bitboss-ui 0.2.39 → 0.2.41

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 (322) hide show
  1. package/dist/index10.js +1 -4
  2. package/dist/index10.js.map +1 -1
  3. package/dist/index100.js +1 -4
  4. package/dist/index100.js.map +1 -1
  5. package/dist/index101.js +3 -3
  6. package/dist/index101.js.map +1 -1
  7. package/dist/index102.js +1 -4
  8. package/dist/index102.js.map +1 -1
  9. package/dist/index103.js +2 -2
  10. package/dist/index103.js.map +1 -1
  11. package/dist/index104.js +1 -4
  12. package/dist/index104.js.map +1 -1
  13. package/dist/index105.js.map +1 -1
  14. package/dist/index106.js +1 -4
  15. package/dist/index106.js.map +1 -1
  16. package/dist/index107.js.map +1 -1
  17. package/dist/index108.js +1 -4
  18. package/dist/index108.js.map +1 -1
  19. package/dist/index109.js +1 -1
  20. package/dist/index109.js.map +1 -1
  21. package/dist/index11.js +2 -2
  22. package/dist/index11.js.map +1 -1
  23. package/dist/index110.js +1 -4
  24. package/dist/index110.js.map +1 -1
  25. package/dist/index111.js +4 -4
  26. package/dist/index111.js.map +1 -1
  27. package/dist/index112.js +1 -4
  28. package/dist/index112.js.map +1 -1
  29. package/dist/index113.js +1 -1
  30. package/dist/index113.js.map +1 -1
  31. package/dist/index114.js +1 -4
  32. package/dist/index114.js.map +1 -1
  33. package/dist/index115.js.map +1 -1
  34. package/dist/index116.js +1 -1
  35. package/dist/index116.js.map +1 -1
  36. package/dist/index117.js +1 -1
  37. package/dist/index117.js.map +1 -1
  38. package/dist/index118.js +1 -1
  39. package/dist/index118.js.map +1 -1
  40. package/dist/index119.js +1 -1
  41. package/dist/index119.js.map +1 -1
  42. package/dist/index12.js +1 -4
  43. package/dist/index12.js.map +1 -1
  44. package/dist/index121.js +1 -1
  45. package/dist/index125.js +1 -1
  46. package/dist/index126.js +1 -1
  47. package/dist/index127.js +1 -1
  48. package/dist/index13.js.map +1 -1
  49. package/dist/index131.js +2 -2
  50. package/dist/index14.js +1 -4
  51. package/dist/index14.js.map +1 -1
  52. package/dist/index15.js +8 -8
  53. package/dist/index15.js.map +1 -1
  54. package/dist/index158.js +1 -4
  55. package/dist/index158.js.map +1 -1
  56. package/dist/index16.js +1 -4
  57. package/dist/index16.js.map +1 -1
  58. package/dist/index160.js +1 -4
  59. package/dist/index160.js.map +1 -1
  60. package/dist/index169.js +1 -4
  61. package/dist/index169.js.map +1 -1
  62. package/dist/index17.js +6 -6
  63. package/dist/index17.js.map +1 -1
  64. package/dist/index18.js +1 -4
  65. package/dist/index18.js.map +1 -1
  66. package/dist/index183.js +1 -4
  67. package/dist/index183.js.map +1 -1
  68. package/dist/index185.js +1 -4
  69. package/dist/index185.js.map +1 -1
  70. package/dist/index19.js +3 -3
  71. package/dist/index19.js.map +1 -1
  72. package/dist/index196.js +10 -2
  73. package/dist/index196.js.map +1 -1
  74. package/dist/index197.js +3 -4
  75. package/dist/index197.js.map +1 -1
  76. package/dist/index198.js +35 -2
  77. package/dist/index198.js.map +1 -1
  78. package/dist/index199.js +6 -3
  79. package/dist/index199.js.map +1 -1
  80. package/dist/index20.js +1 -4
  81. package/dist/index20.js.map +1 -1
  82. package/dist/index200.js +232 -32
  83. package/dist/index200.js.map +1 -1
  84. package/dist/index201.js +2 -6
  85. package/dist/index201.js.map +1 -1
  86. package/dist/index202.js +4 -2
  87. package/dist/index202.js.map +1 -1
  88. package/dist/index203.js +3 -2
  89. package/dist/index203.js.map +1 -1
  90. package/dist/index204.js +3 -5
  91. package/dist/index204.js.map +1 -1
  92. package/dist/index205.js +5 -16
  93. package/dist/index205.js.map +1 -1
  94. package/dist/index206.js +10 -10
  95. package/dist/index206.js.map +1 -1
  96. package/dist/index207.js +15 -18
  97. package/dist/index207.js.map +1 -1
  98. package/dist/index208.js +18 -19
  99. package/dist/index208.js.map +1 -1
  100. package/dist/index209.js +15 -24
  101. package/dist/index209.js.map +1 -1
  102. package/dist/index21.js +2 -2
  103. package/dist/index21.js.map +1 -1
  104. package/dist/index210.js +29 -8
  105. package/dist/index210.js.map +1 -1
  106. package/dist/index211.js +8 -2
  107. package/dist/index211.js.map +1 -1
  108. package/dist/index212.js +2 -235
  109. package/dist/index212.js.map +1 -1
  110. package/dist/index213.js +2 -3
  111. package/dist/index213.js.map +1 -1
  112. package/dist/index214.js +368 -3
  113. package/dist/index214.js.map +1 -1
  114. package/dist/index215.js +131 -375
  115. package/dist/index215.js.map +1 -1
  116. package/dist/index216.js +2 -134
  117. package/dist/index216.js.map +1 -1
  118. package/dist/index219.js +1 -1
  119. package/dist/index219.js.map +1 -1
  120. package/dist/index22.js +1 -4
  121. package/dist/index22.js.map +1 -1
  122. package/dist/index220.js +2 -2
  123. package/dist/index220.js.map +1 -1
  124. package/dist/index221.js +2 -10
  125. package/dist/index221.js.map +1 -1
  126. package/dist/index222.js +8 -27
  127. package/dist/index222.js.map +1 -1
  128. package/dist/index223.js +120 -16
  129. package/dist/index223.js.map +1 -1
  130. package/dist/index224.js +6 -9
  131. package/dist/index224.js.map +1 -1
  132. package/dist/index225.js +16 -120
  133. package/dist/index225.js.map +1 -1
  134. package/dist/index226.js +2 -2
  135. package/dist/index226.js.map +1 -1
  136. package/dist/index227.js +2 -4
  137. package/dist/index227.js.map +1 -1
  138. package/dist/index228.js +151 -426
  139. package/dist/index228.js.map +1 -1
  140. package/dist/index229.js +1 -91
  141. package/dist/index229.js.map +1 -1
  142. package/dist/index23.js +1 -1
  143. package/dist/index23.js.map +1 -1
  144. package/dist/index230.js +68 -199
  145. package/dist/index230.js.map +1 -1
  146. package/dist/index231.js +5 -295
  147. package/dist/index231.js.map +1 -1
  148. package/dist/index232.js +14 -5
  149. package/dist/index232.js.map +1 -1
  150. package/dist/index233.js +435 -2
  151. package/dist/index233.js.map +1 -1
  152. package/dist/index234.js +89 -2
  153. package/dist/index234.js.map +1 -1
  154. package/dist/index235.js +4 -2
  155. package/dist/index235.js.map +1 -1
  156. package/dist/index236.js +200 -2
  157. package/dist/index236.js.map +1 -1
  158. package/dist/index237.js +224 -2
  159. package/dist/index237.js.map +1 -1
  160. package/dist/index238.js +258 -2
  161. package/dist/index238.js.map +1 -1
  162. package/dist/index239.js +295 -2
  163. package/dist/index239.js.map +1 -1
  164. package/dist/index24.js +1 -4
  165. package/dist/index24.js.map +1 -1
  166. package/dist/index240.js +6 -160
  167. package/dist/index240.js.map +1 -1
  168. package/dist/index241.js +2 -2
  169. package/dist/index242.js +2 -69
  170. package/dist/index242.js.map +1 -1
  171. package/dist/index243.js +2 -5
  172. package/dist/index243.js.map +1 -1
  173. package/dist/index244.js +2 -224
  174. package/dist/index244.js.map +1 -1
  175. package/dist/index245.js +2 -258
  176. package/dist/index245.js.map +1 -1
  177. package/dist/index246.js +2 -2
  178. package/dist/index247.js +2 -117
  179. package/dist/index247.js.map +1 -1
  180. package/dist/index248.js +2 -106
  181. package/dist/index248.js.map +1 -1
  182. package/dist/index249.js +117 -2
  183. package/dist/index249.js.map +1 -1
  184. package/dist/index25.js +2 -2
  185. package/dist/index25.js.map +1 -1
  186. package/dist/index250.js +105 -37
  187. package/dist/index250.js.map +1 -1
  188. package/dist/index251.js +4 -2
  189. package/dist/index251.js.map +1 -1
  190. package/dist/index252.js +4 -2
  191. package/dist/index252.js.map +1 -1
  192. package/dist/index253.js +60 -14
  193. package/dist/index253.js.map +1 -1
  194. package/dist/index254.js +3 -2
  195. package/dist/index254.js.map +1 -1
  196. package/dist/index255.js +2 -3
  197. package/dist/index255.js.map +1 -1
  198. package/dist/index26.js +1 -4
  199. package/dist/index26.js.map +1 -1
  200. package/dist/index27.js.map +1 -1
  201. package/dist/index28.js +1 -4
  202. package/dist/index28.js.map +1 -1
  203. package/dist/index29.js +3 -3
  204. package/dist/index29.js.map +1 -1
  205. package/dist/index30.js +1 -4
  206. package/dist/index30.js.map +1 -1
  207. package/dist/index31.js +19 -19
  208. package/dist/index31.js.map +1 -1
  209. package/dist/index32.js +1 -4
  210. package/dist/index32.js.map +1 -1
  211. package/dist/index33.js +2 -2
  212. package/dist/index33.js.map +1 -1
  213. package/dist/index34.js +1 -4
  214. package/dist/index34.js.map +1 -1
  215. package/dist/index35.js +2 -2
  216. package/dist/index35.js.map +1 -1
  217. package/dist/index36.js +1 -4
  218. package/dist/index36.js.map +1 -1
  219. package/dist/index37.js.map +1 -1
  220. package/dist/index38.js +1 -4
  221. package/dist/index38.js.map +1 -1
  222. package/dist/index39.js.map +1 -1
  223. package/dist/index40.js +1 -4
  224. package/dist/index40.js.map +1 -1
  225. package/dist/index41.js.map +1 -1
  226. package/dist/index42.js +1 -4
  227. package/dist/index42.js.map +1 -1
  228. package/dist/index43.js.map +1 -1
  229. package/dist/index44.js +1 -4
  230. package/dist/index44.js.map +1 -1
  231. package/dist/index45.js.map +1 -1
  232. package/dist/index46.js +1 -4
  233. package/dist/index46.js.map +1 -1
  234. package/dist/index47.js +1 -1
  235. package/dist/index47.js.map +1 -1
  236. package/dist/index48.js +1 -4
  237. package/dist/index48.js.map +1 -1
  238. package/dist/index49.js +1 -1
  239. package/dist/index49.js.map +1 -1
  240. package/dist/index50.js +1 -4
  241. package/dist/index50.js.map +1 -1
  242. package/dist/index51.js.map +1 -1
  243. package/dist/index52.js +1 -4
  244. package/dist/index52.js.map +1 -1
  245. package/dist/index53.js.map +1 -1
  246. package/dist/index54.js +1 -4
  247. package/dist/index54.js.map +1 -1
  248. package/dist/index55.js.map +1 -1
  249. package/dist/index56.js +1 -4
  250. package/dist/index56.js.map +1 -1
  251. package/dist/index57.js.map +1 -1
  252. package/dist/index58.js +1 -4
  253. package/dist/index58.js.map +1 -1
  254. package/dist/index59.js.map +1 -1
  255. package/dist/index60.js +1 -4
  256. package/dist/index60.js.map +1 -1
  257. package/dist/index61.js.map +1 -1
  258. package/dist/index62.js +1 -4
  259. package/dist/index62.js.map +1 -1
  260. package/dist/index63.js.map +1 -1
  261. package/dist/index64.js +1 -4
  262. package/dist/index64.js.map +1 -1
  263. package/dist/index65.js +3 -3
  264. package/dist/index65.js.map +1 -1
  265. package/dist/index66.js +1 -4
  266. package/dist/index66.js.map +1 -1
  267. package/dist/index67.js.map +1 -1
  268. package/dist/index68.js +1 -4
  269. package/dist/index68.js.map +1 -1
  270. package/dist/index69.js +13 -13
  271. package/dist/index69.js.map +1 -1
  272. package/dist/index70.js +1 -4
  273. package/dist/index70.js.map +1 -1
  274. package/dist/index71.js.map +1 -1
  275. package/dist/index72.js +1 -1
  276. package/dist/index72.js.map +1 -1
  277. package/dist/index73.js.map +1 -1
  278. package/dist/index74.js +1 -4
  279. package/dist/index74.js.map +1 -1
  280. package/dist/index75.js +1 -1
  281. package/dist/index75.js.map +1 -1
  282. package/dist/index76.js +1 -4
  283. package/dist/index76.js.map +1 -1
  284. package/dist/index77.js.map +1 -1
  285. package/dist/index78.js +1 -4
  286. package/dist/index78.js.map +1 -1
  287. package/dist/index79.js +3 -3
  288. package/dist/index79.js.map +1 -1
  289. package/dist/index80.js +1 -4
  290. package/dist/index80.js.map +1 -1
  291. package/dist/index81.js +1 -1
  292. package/dist/index81.js.map +1 -1
  293. package/dist/index82.js +1 -4
  294. package/dist/index82.js.map +1 -1
  295. package/dist/index83.js.map +1 -1
  296. package/dist/index84.js +1 -4
  297. package/dist/index84.js.map +1 -1
  298. package/dist/index85.js.map +1 -1
  299. package/dist/index86.js +1 -4
  300. package/dist/index86.js.map +1 -1
  301. package/dist/index87.js.map +1 -1
  302. package/dist/index88.js +1 -4
  303. package/dist/index88.js.map +1 -1
  304. package/dist/index89.js.map +1 -1
  305. package/dist/index9.js.map +1 -1
  306. package/dist/index90.js +1 -4
  307. package/dist/index90.js.map +1 -1
  308. package/dist/index91.js.map +1 -1
  309. package/dist/index92.js +1 -4
  310. package/dist/index92.js.map +1 -1
  311. package/dist/index93.js.map +1 -1
  312. package/dist/index94.js +1 -4
  313. package/dist/index94.js.map +1 -1
  314. package/dist/index95.js.map +1 -1
  315. package/dist/index96.js +1 -4
  316. package/dist/index96.js.map +1 -1
  317. package/dist/index97.js.map +1 -1
  318. package/dist/index98.js +1 -4
  319. package/dist/index98.js.map +1 -1
  320. package/dist/index99.js.map +1 -1
  321. package/dist/style.css +1 -1
  322. package/package.json +33 -35
@@ -1 +1 @@
1
- {"version":3,"file":"index15.js","sources":["../src/components/BaseDatePicker/BaseDatePicker.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, createTextVNode as _createTextVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, Transition as _Transition, withCtx as _withCtx, createVNode as _createVNode, vShow as _vShow, withDirectives as _withDirectives, createCommentVNode as _createCommentVNode, renderList as _renderList, Fragment as _Fragment, renderSlot as _renderSlot, normalizeClass as _normalizeClass, mergeProps as _mergeProps } from \"vue\"\n\nconst _hoisted_1 = { class: \"bb-base-date-picker__header\" }\nconst _hoisted_2 = [\"disabled\"]\nconst _hoisted_3 = /*#__PURE__*/_createElementVNode(\"span\", null, null, -1)\nconst _hoisted_4 = {\n \"aria-live\": \"polite\",\n class: \"bb-base-date-picker__selected-day-label\"\n}\nconst _hoisted_5 = { class: \"bb-base-date-picker__weekday\" }\nconst _hoisted_6 = { class: \"bb-base-date-picker__monthday\" }\nconst _hoisted_7 = [\"disabled\"]\nconst _hoisted_8 = { class: \"bb-base-date-picker__small-month-selector\" }\nconst _hoisted_9 = [\"disabled\"]\nconst _hoisted_10 = /*#__PURE__*/_createElementVNode(\"svg\", {\n viewBox: \"0 0 24 24\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}, [\n /*#__PURE__*/_createElementVNode(\"path\", {\n d: \"M13.939 4.939 6.879 12l7.06 7.061 2.122-2.122L11.121 12l4.94-4.939z\",\n fill: \"currentColor\"\n })\n], -1)\nconst _hoisted_11 = /*#__PURE__*/_createElementVNode(\"span\", null, \"Vai indietro di un mese\", -1)\nconst _hoisted_12 = [\n _hoisted_10,\n _hoisted_11\n]\nconst _hoisted_13 = [\"disabled\"]\nconst _hoisted_14 = [\"disabled\"]\nconst _hoisted_15 = {\n style: {\"transform\":\"rotate(180deg)\"},\n viewBox: \"0 0 24 24\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\nconst _hoisted_16 = /*#__PURE__*/_createElementVNode(\"path\", {\n d: \"M13.939 4.939 6.879 12l7.06 7.061 2.122-2.122L11.121 12l4.94-4.939z\",\n fill: \"currentColor\"\n}, null, -1)\nconst _hoisted_17 = [\n _hoisted_16\n]\nconst _hoisted_18 = /*#__PURE__*/_createElementVNode(\"span\", null, \"Vai avanti di un mese\", -1)\nconst _hoisted_19 = { class: \"bb-base-date-picker__small-year-selector\" }\nconst _hoisted_20 = [\"disabled\"]\nconst _hoisted_21 = /*#__PURE__*/_createElementVNode(\"svg\", {\n viewBox: \"0 0 24 24\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}, [\n /*#__PURE__*/_createElementVNode(\"path\", {\n d: \"M13.939 4.939 6.879 12l7.06 7.061 2.122-2.122L11.121 12l4.94-4.939z\",\n fill: \"currentColor\"\n })\n], -1)\nconst _hoisted_22 = /*#__PURE__*/_createElementVNode(\"span\", null, \"Vai indietro di un anno\", -1)\nconst _hoisted_23 = [\n _hoisted_21,\n _hoisted_22\n]\nconst _hoisted_24 = [\"disabled\"]\nconst _hoisted_25 = [\"disabled\"]\nconst _hoisted_26 = {\n style: {\"transform\":\"rotate(180deg)\"},\n viewBox: \"0 0 24 24\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\nconst _hoisted_27 = /*#__PURE__*/_createElementVNode(\"path\", {\n d: \"M13.939 4.939 6.879 12l7.06 7.061 2.122-2.122L11.121 12l4.94-4.939z\",\n fill: \"currentColor\"\n}, null, -1)\nconst _hoisted_28 = [\n _hoisted_27\n]\nconst _hoisted_29 = /*#__PURE__*/_createElementVNode(\"span\", null, \"Vai avanti di un anno\", -1)\nconst _hoisted_30 = {\n key: 0,\n style: {\"height\":\"32px\"}\n}\nconst _hoisted_31 = { class: \"bb-base-date-picker-calendar\" }\nconst _hoisted_32 = { class: \"bb-base-date-picker-header-container\" }\nconst _hoisted_33 = [\"id\", \"disabled\"]\nconst _hoisted_34 = {\n key: 0,\n class: \"bb-base-date-picker__month-selector\"\n}\nconst _hoisted_35 = [\"disabled\", \"onClick\"]\nconst _hoisted_36 = [\"disabled\", \"onClick\"]\n\nimport { computed, nextTick, ref, watch } from 'vue';\nimport { default as dayjs } from 'dayjs';\nimport { default as isSameOrAfter } from 'dayjs/plugin/isSameOrAfter';\nimport { default as isSameOrBefore } from 'dayjs/plugin/isSameOrBefore';\nimport { default as it } from 'dayjs/locale/it';\nimport { default as updateLocale } from 'dayjs/plugin/updateLocale';\nimport { default as weekOfYear } from 'dayjs/plugin/weekOfYear';\nimport { groupBy } from '@/utilities/functions/groupBy';\nimport { isNil } from '@/utilities/functions/isNil';\nimport { last } from '@/utilities/functions/last';\nimport type { Dayjs } from 'dayjs';\nimport type { InputHTMLAttributes } from 'vue';\n\nexport type BaseDatePickerProps = {\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 * 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 * Allows the selection of multiple items.\n\t */\n\tmultiple?: boolean;\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 * 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\ntype Header = {\n\tid: string;\n\n\tlabel: string;\n\n\toriginal: Dayjs;\n};\n\ntype Cell = {\n\tbuttonId: string;\n\n\tdisabled: boolean;\n\n\tfirst: boolean;\n\n\thighlighted: boolean;\n\n\tid: string;\n\n\tlabel: string;\n\n\tlast: boolean;\n\n\tmiddle: boolean;\n\n\toriginal: Dayjs;\n\n\tselected: boolean;\n\n\tslotName: string;\n};\n\nexport type BaseDatePickerSlots = {\n\tday?: (props: {\n\t\tfirst: Cell['first'];\n\t\thighlighted: Cell['highlighted'];\n\t\titem: Cell['original'];\n\t\tlabel: Cell['label'];\n\t\tlast: Cell['last'];\n\t\tmiddle: Cell['middle'];\n\t\tselected: Cell['selected'];\n\t}) => any;\n} & {\n\t[key: string]: (props: {\n\t\tfirst: Cell['first'];\n\t\thighlighted: Cell['highlighted'];\n\t\titem: Cell['original'];\n\t\tlabel: Cell['label'];\n\t\tlast: Cell['last'];\n\t\tmiddle: Cell['middle'];\n\t\tselected: Cell['selected'];\n\t}) => any;\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseDatePicker',\n props: {\n disabled: { type: Boolean },\n firstDayOfWeek: { default: 1 },\n max: {},\n min: {},\n modelValue: {},\n multiple: { type: Boolean },\n range: { type: Boolean },\n readonly: {},\n selectable: {},\n width: { default: 290 }\n },\n emits: ['update:modelValue'],\n setup(__props: any, { expose: __expose, emit: __emit }) {\n\ndayjs.extend(weekOfYear);\ndayjs.extend(updateLocale);\ndayjs.extend(isSameOrAfter);\ndayjs.extend(isSameOrBefore);\ndayjs.locale(it);\n\nconst props = __props;\n\nconst emit = __emit;\n\n\n\ndayjs.updateLocale('it', {\n\tweekStart: props.firstDayOfWeek,\n});\n\nif (props.multiple && props.range) {\n\tthrow new Error('Date picker cannot be both multiple and range');\n}\n\nconst calendar = ref<HTMLElement | null>(null);\n\nconst selectionMode = ref('day');\nconst yearSelector = ref<HTMLElement | null>(null);\n\nlet initialDate = ref(dayjs());\n\nif (Array.isArray(props.modelValue)) {\n\tif (props.modelValue.length) {\n\t\tinitialDate.value = dayjs(last(props.modelValue));\n\t}\n} else if (props.modelValue) {\n\tinitialDate.value = dayjs(props.modelValue);\n}\n\nlet currentDate = ref(initialDate.value.clone());\n\nconst mappedHeaders = computed<Header[]>(() => {\n\treturn (\n\t\tnew Array(7)\n\t\t\t.fill('')\n\t\t\t// Sort days based on first day of the week\n\t\t\t.map((_, index) => dayjs().day((index + props.firstDayOfWeek) % 7))\n\t\t\t.map((day) => {\n\t\t\t\tconst selected = modelValueMetadata.value.selected(day);\n\t\t\t\treturn {\n\t\t\t\t\tlabel: day.format('dd').slice(0, 1).toUpperCase(),\n\t\t\t\t\tid: day.toISOString(),\n\t\t\t\t\toriginal: day,\n\t\t\t\t\tselected,\n\t\t\t\t};\n\t\t\t})\n\t);\n});\n\nconst displayedDates = computed<Cell[]>(() => {\n\tlet startOfMonth = currentDate.value.clone().startOf('month');\n\tlet firstValueToDisplay = startOfMonth.clone().startOf('week');\n\tlet endOfMonth = currentDate.value.clone().endOf('month');\n\tlet lastValueToDisplay = endOfMonth.clone().endOf('week');\n\n\tlet datesInPage: Dayjs[] = [];\n\tconst monthValue = startOfMonth.month();\n\tfor (\n\t\tlet index = firstValueToDisplay;\n\t\tindex.isBefore(lastValueToDisplay);\n\t\tindex = index.add(1, 'day')\n\t) {\n\t\tdatesInPage.push(index.clone());\n\t}\n\treturn datesInPage.map((date): Cell => {\n\t\tconst id = date.toISOString();\n\t\tlet selected = !!modelValueMetadata.value.selected(date);\n\t\tif (props.range && props.modelValue?.length === 2) {\n\t\t\tconst asNumber = date.valueOf();\n\t\t\tselected =\n\t\t\t\tmodelValueMetadata.value.min <= asNumber &&\n\t\t\t\tmodelValueMetadata.value.max >= asNumber;\n\t\t}\n\n\t\tconst first = !!(\n\t\t\tmodelValueMetadata.value.isFirstOfRange(date) && props.range\n\t\t);\n\t\tconst last = !!(\n\t\t\tmodelValueMetadata.value.isLastOfRange(date) && props.range\n\t\t);\n\t\tconst middle = !!(selected && !first && !last && props.range);\n\n\t\t/* Highlighted means it's current month */\n\t\tconst highlighted = date.month() === monthValue;\n\n\t\tconst disabled = isDateDisabled(date);\n\n\t\treturn {\n\t\t\tbuttonId: 'date_' + id,\n\t\t\tdisabled,\n\t\t\tfirst,\n\t\t\thighlighted,\n\t\t\tid,\n\t\t\tlabel: date.get('D').toString(),\n\t\t\tlast,\n\t\t\tmiddle,\n\t\t\toriginal: date,\n\t\t\tselected,\n\t\t\tslotName: id,\n\t\t};\n\t});\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\nconst indexedDates = computed(() => {\n\treturn groupBy(displayedDates.value, (date: Cell) => date.id);\n});\n\nconst indexedRows = computed<Record<string, Cell[]>>(() => {\n\tconst indexedByWeek = groupBy(displayedDates.value, (cell: Cell) =>\n\t\tcell.original.week().toString()\n\t);\n\treturn indexedByWeek;\n});\n\nconst modelValueMetadata = computed(() => {\n\tlet min = Infinity;\n\tlet max = -Infinity;\n\tlet selected: { [key: number]: number } = {};\n\n\tif (props.modelValue) {\n\t\tconst arr = ([] as (string | Date)[])\n\t\t\t.concat(props.modelValue)\n\t\t\t.map((value) => dayjs(value).startOf('day'))\n\t\t\t.map((date) => date.valueOf());\n\t\tarr.forEach((item, index) => {\n\t\t\tif (item < min) min = item;\n\t\t\tif (item > max) max = item;\n\t\t\tselected[item] = index;\n\t\t});\n\t}\n\treturn {\n\t\tmin,\n\t\tmax,\n\t\tindex: (date: Dayjs) => selected[date.valueOf()],\n\t\tselected: (date: Dayjs) => !isNil(selected[date.valueOf()]),\n\t\tisFirstOfRange: (date: Dayjs) => date.valueOf() === min,\n\t\tisLastOfRange: (date: Dayjs) => date.valueOf() === max,\n\t};\n});\n\nconst onButtonClick = (event: MouseEvent) => {\n\tif (event.target instanceof HTMLButtonElement) {\n\t\tconst [, id] = event.target.id.split('_');\n\t\tconst date = indexedDates.value[id][0];\n\t\tonDateselected(date);\n\t}\n};\n\nconst onDateselected = (date: Cell) => {\n\tif (props.readonly) return;\n\tif (props.range) {\n\t\tif (props.modelValue && Array.isArray(props.modelValue)) {\n\t\t\tif (props.modelValue.length !== 1) {\n\t\t\t\temit('update:modelValue', [date.original.toISOString()]);\n\t\t\t} else {\n\t\t\t\tif (props.modelValue.length) {\n\t\t\t\t\tlet [from, to] = [dayjs(props.modelValue[0]), date.original].sort(\n\t\t\t\t\t\t(a, b) =>\n\t\t\t\t\t\t\ta.valueOf > b.valueOf ? 1 : a.valueOf() < b.valueOf() ? -1 : 0\n\t\t\t\t\t);\n\n\t\t\t\t\tconst valueToEmit = [from, to].map((el) => el.toISOString());\n\t\t\t\t\temit('update:modelValue', valueToEmit);\n\t\t\t\t} else {\n\t\t\t\t\tconst valueToEmit = [\n\t\t\t\t\t\t...props.modelValue,\n\t\t\t\t\t\tdate.original.toISOString(),\n\t\t\t\t\t];\n\t\t\t\t\temit('update:modelValue', valueToEmit);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new Error(\n\t\t\t\t'Date picker is set to range but modelValue is not an array.'\n\t\t\t);\n\t\t}\n\t} else if (props.multiple) {\n\t\tif (props.modelValue && Array.isArray(props.modelValue)) {\n\t\t\tif (!date.selected) {\n\t\t\t\temit(\n\t\t\t\t\t'update:modelValue',\n\t\t\t\t\t[...props.modelValue, date.original.toISOString()].sort(\n\t\t\t\t\t\t(iso1, iso2) => (iso1 < iso2 ? -1 : iso1 > iso2 ? 1 : 0)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tconst asString = date.original.toISOString();\n\t\t\t\tconst valueToEmit = props.modelValue.filter((el) => el !== asString);\n\t\t\t\temit('update:modelValue', valueToEmit);\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new Error(\n\t\t\t\t'datepicker is set to multiple but modelValue is not an array.'\n\t\t\t);\n\t\t}\n\t} else {\n\t\tif (date.selected) {\n\t\t\temit('update:modelValue', null);\n\t\t} else {\n\t\t\temit('update:modelValue', date.original.toISOString());\n\t\t}\n\t}\n};\n\nconst monthOptions = computed(() => {\n\tconst currentMonth = currentDate.value.month();\n\treturn new Array(12)\n\t\t.fill(currentDate.value.clone().startOf('year'))\n\t\t.map((date: Dayjs, index) => date.add(index, 'month'))\n\t\t.map((date) => ({\n\t\t\ttext: date.format('MMMM'),\n\t\t\tkey: date.unix(),\n\t\t\tselected: date.month() === currentMonth,\n\t\t\thandler: () => setDateToMonth(date),\n\t\t}));\n});\n\nconst decreaseMonth = () => {\n\tcurrentDate.value = currentDate.value.subtract(1, 'month');\n};\nconst increaseMonth = () => {\n\tcurrentDate.value = currentDate.value.add(1, 'month');\n};\n\nconst setDateToMonth = (date: Dayjs) => {\n\tconst month = date.get('month');\n\tconst toEmit = currentDate.value.set('month', month);\n\tif (props.modelValue && !Array.isArray(props.modelValue)) {\n\t\tif (isDateDisabled(toEmit)) {\n\t\t\tcurrentDate.value = toEmit;\n\t\t} else {\n\t\t\temit('update:modelValue', toEmit.toISOString());\n\t\t}\n\t} else {\n\t\tcurrentDate.value = toEmit;\n\t}\n\tselectionMode.value = 'day';\n};\n\nconst setSelectionModeToYear = async () => {\n\tselectionMode.value = 'year';\n\tawait nextTick();\n\tconst selectedYear = yearSelector.value?.querySelector(\n\t\t'.bb-base-date-picker__year-selector-year--selected'\n\t);\n\tif (selectedYear) {\n\t\tselectedYear.scrollIntoView({ block: 'center', inline: 'center' });\n\t}\n};\n\nconst setSelectionModeToDay = () => (selectionMode.value = 'day');\n\nconst yearOptions = computed(() => {\n\tconst currentYear = currentDate.value.year();\n\tconst pastYears = new Array(100)\n\t\t.fill(currentDate.value.clone())\n\t\t.map((date: Dayjs, index, arr) =>\n\t\t\tdate.year(currentYear - arr.length + index)\n\t\t);\n\tconst futureYears = new Array(100)\n\t\t.fill(currentDate.value.clone())\n\t\t.map((date: Dayjs, index) => date.year(currentYear + index + 1));\n\treturn pastYears\n\t\t.concat(currentDate.value.clone())\n\t\t.concat(futureYears)\n\t\t.map((date) => ({\n\t\t\ttext: date.format('YYYY'),\n\t\t\tkey: date.unix(),\n\t\t\tselected: date.year() === currentYear,\n\t\t\thandler: () => setDateToYear(date),\n\t\t}));\n});\n\nconst decreaseYear = () => {\n\tconst toEmit = currentDate.value.subtract(1, 'year');\n\tif (props.modelValue && !Array.isArray(props.modelValue)) {\n\t\tif (isDateDisabled(toEmit)) {\n\t\t\tcurrentDate.value = toEmit;\n\t\t} else {\n\t\t\temit('update:modelValue', toEmit.toISOString());\n\t\t}\n\t} else {\n\t\tcurrentDate.value = toEmit;\n\t}\n};\nconst increaseYear = () => {\n\tconst toEmit = currentDate.value.add(1, 'year');\n\tif (props.modelValue && !Array.isArray(props.modelValue)) {\n\t\tif (isDateDisabled(toEmit)) {\n\t\t\tcurrentDate.value = toEmit;\n\t\t} else {\n\t\t\temit('update:modelValue', toEmit.toISOString());\n\t\t}\n\t} else {\n\t\tcurrentDate.value = toEmit;\n\t}\n};\n\nconst setDateToYear = (date: Dayjs) => {\n\tconst year = date.get('year');\n\tconst toEmit = currentDate.value.set('year', year);\n\tif (props.modelValue && !Array.isArray(props.modelValue)) {\n\t\tif (isDateDisabled(toEmit)) {\n\t\t\tcurrentDate.value = toEmit;\n\t\t} else {\n\t\t\temit('update:modelValue', toEmit.toISOString());\n\t\t}\n\t} else {\n\t\tcurrentDate.value = toEmit;\n\t}\n\tselectionMode.value = 'month';\n};\n\nwatch(\n\t() => props.modelValue,\n\t() => {\n\t\tif (props.modelValue) {\n\t\t\tif (Array.isArray(props.modelValue)) {\n\t\t\t\tif (props.modelValue.length) {\n\t\t\t\t\tcurrentDate.value = dayjs(last(props.modelValue));\n\t\t\t\t} else {\n\t\t\t\t\tcurrentDate.value = dayjs();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcurrentDate.value = dayjs(props.modelValue);\n\t\t\t}\n\t\t} else currentDate.value = dayjs();\n\t}\n);\n\nconst containerAttributes = computed(() => {\n\tconst classes = {\n\t\t'bb-base-date-picker': true,\n\t\t'bb-base-date-picker--readonly': props.readonly,\n\t\t'bb-base-date-picker--disabled': props.disabled,\n\t};\n\tlet width: string;\n\t// If the width is a css unit string use it, if it is a number or number string add px\n\tif (typeof props.width === 'string' && Number.isNaN(Number(props.width))) {\n\t\twidth = props.width;\n\t} else {\n\t\twidth = `${props.width}px`;\n\t}\n\tconst style = {\n\t\twidth: width,\n\t};\n\n\treturn {\n\t\tclass: classes,\n\t\tstyle,\n\t};\n});\n\n__expose({ calendar, setSelectionModeToDay, isDateDisabled });\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _mergeProps(containerAttributes.value, {\n ref_key: \"calendar\",\n ref: calendar\n }), [\n _createElementVNode(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", null, [\n _createElementVNode(\"button\", {\n \"aria-live\": \"polite\",\n class: \"bb-base-date-picker__year-button\",\n disabled: _ctx.disabled,\n type: \"button\",\n onClick: setSelectionModeToYear\n }, [\n _createTextVNode(_toDisplayString(_unref(currentDate).format('YYYY')) + \" \", 1),\n _hoisted_3\n ], 8, _hoisted_2)\n ]),\n _createElementVNode(\"div\", _hoisted_4, [\n _createElementVNode(\"span\", _hoisted_5, _toDisplayString(_unref(currentDate).format('ddd')) + \", \", 1),\n _createElementVNode(\"span\", _hoisted_6, _toDisplayString(_unref(currentDate).format('DD')), 1),\n _createElementVNode(\"button\", {\n class: \"bb-base-date-picker__month-button\",\n disabled: _ctx.disabled,\n type: \"button\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (selectionMode.value = 'month'))\n }, _toDisplayString(_unref(currentDate).format('MMMM')), 9, _hoisted_7)\n ])\n ]),\n _withDirectives(_createElementVNode(\"div\", _hoisted_8, [\n _createElementVNode(\"button\", {\n class: \"bb-base-date-picker__previous-month-button\",\n disabled: _ctx.disabled,\n type: \"button\",\n onClick: decreaseMonth\n }, _hoisted_12, 8, _hoisted_9),\n _createVNode(_Transition, {\n mode: \"out-in\",\n name: \"fade\"\n }, {\n default: _withCtx(() => [\n (_openBlock(), _createElementBlock(\"button\", {\n key: _unref(currentDate).month(),\n \"aria-live\": \"polite\",\n class: \"bb-base-date-picker__current-month-button\",\n disabled: _ctx.disabled,\n type: \"button\",\n onClick: _cache[1] || (_cache[1] = ($event: any) => (selectionMode.value = 'month'))\n }, _toDisplayString(_unref(currentDate).format('MMMM')), 9, _hoisted_13))\n ]),\n _: 1\n }),\n _createElementVNode(\"button\", {\n class: \"bb-base-date-picker__next-month-button\",\n disabled: _ctx.disabled,\n type: \"button\",\n onClick: increaseMonth\n }, [\n (_openBlock(), _createElementBlock(\"svg\", _hoisted_15, _hoisted_17)),\n _hoisted_18\n ], 8, _hoisted_14)\n ], 512), [\n [_vShow, selectionMode.value === 'day']\n ]),\n _withDirectives(_createElementVNode(\"div\", _hoisted_19, [\n _createElementVNode(\"button\", {\n class: \"bb-base-date-picker__previous-year-button\",\n disabled: _ctx.disabled,\n type: \"button\",\n onClick: decreaseYear\n }, _hoisted_23, 8, _hoisted_20),\n _createVNode(_Transition, {\n mode: \"out-in\",\n name: \"fade\"\n }, {\n default: _withCtx(() => [\n (_openBlock(), _createElementBlock(\"button\", {\n key: _unref(currentDate).year(),\n \"aria-live\": \"polite\",\n class: \"bb-base-date-picker__current-year-button\",\n disabled: _ctx.disabled,\n type: \"button\",\n onClick: setSelectionModeToYear\n }, _toDisplayString(_unref(currentDate).format('YYYY')), 9, _hoisted_24))\n ]),\n _: 1\n }),\n _createElementVNode(\"button\", {\n class: \"bb-base-date-picker__next-year-button\",\n disabled: _ctx.disabled,\n type: \"button\",\n onClick: increaseYear\n }, [\n (_openBlock(), _createElementBlock(\"svg\", _hoisted_26, _hoisted_28)),\n _hoisted_29\n ], 8, _hoisted_25)\n ], 512), [\n [_vShow, selectionMode.value === 'month']\n ]),\n (selectionMode.value === 'year')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_30))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", _hoisted_31, [\n _createVNode(_Transition, {\n mode: \"out-in\",\n name: \"fade\"\n }, {\n default: _withCtx(() => [\n (_openBlock(), _createElementBlock(\"div\", {\n key: _unref(currentDate).month(),\n class: _normalizeClass([\"bb-base-date-picker-month\", { invisible: selectionMode.value !== 'day' }])\n }, [\n _createElementVNode(\"div\", _hoisted_32, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(mappedHeaders.value, (header) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n key: header.id,\n class: \"bb-base-date-picker-header\"\n }, _toDisplayString(header.label), 1))\n }), 128))\n ]),\n _createElementVNode(\"div\", null, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(indexedRows.value, (cells, id) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n key: id,\n class: \"bb-base-date-picker-week\"\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(cells, (cell) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n key: cell.id,\n class: _normalizeClass({\n\t\t\t\t\t\t\t\t\t'bb-base-date-picker-date--disabled':\n\t\t\t\t\t\t\t\t\t\t_ctx.disabled || cell.disabled,\n\t\t\t\t\t\t\t\t\t'bb-base-date-picker-date--first': cell.first,\n\t\t\t\t\t\t\t\t\t'bb-base-date-picker-date--highlighted': cell.highlighted,\n\t\t\t\t\t\t\t\t\t'bb-base-date-picker-date--last': cell.last,\n\t\t\t\t\t\t\t\t\t'bb-base-date-picker-date--middle': cell.middle,\n\t\t\t\t\t\t\t\t\t'bb-base-date-picker-date--selected': cell.selected,\n\t\t\t\t\t\t\t\t\t'bb-base-date-picker-date': true,\n\t\t\t\t\t\t\t\t})\n }, [\n _createElementVNode(\"button\", {\n id: cell.buttonId,\n class: \"bb-base-date-picker-date__button\",\n disabled: _ctx.disabled || cell.disabled,\n type: \"button\",\n onClick: onButtonClick\n }, _toDisplayString(cell.label), 9, _hoisted_33),\n _renderSlot(_ctx.$slots, 'day', {\n first: cell.first,\n highlighted: cell.highlighted,\n item: cell.original,\n label: cell.label,\n last: cell.last,\n middle: cell.middle,\n selected: cell.selected\n }),\n _renderSlot(_ctx.$slots, cell.slotName, {\n first: cell.first,\n highlighted: cell.highlighted,\n item: cell.original,\n label: cell.label,\n last: cell.last,\n middle: cell.middle,\n selected: cell.selected\n })\n ], 2))\n }), 128))\n ]))\n }), 128))\n ])\n ], 2))\n ]),\n _: 3\n }),\n _createVNode(_Transition, { name: \"fade\" }, {\n default: _withCtx(() => [\n (selectionMode.value === 'month')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_34, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(monthOptions.value, (option) => {\n return (_openBlock(), _createElementBlock(\"button\", {\n key: option.key,\n class: _normalizeClass({\n\t\t\t\t\t\t\t'bb-base-date-picker__month-selector-month': true,\n\t\t\t\t\t\t\t'bb-base-date-picker__month-selector-month--selected':\n\t\t\t\t\t\t\t\toption.selected,\n\t\t\t\t\t\t}),\n disabled: _ctx.disabled,\n type: \"button\",\n onClick: option.handler\n }, _toDisplayString(option.text), 11, _hoisted_35))\n }), 128))\n ]))\n : _createCommentVNode(\"\", true)\n ]),\n _: 1\n }),\n _createVNode(_Transition, { name: \"fade\" }, {\n default: _withCtx(() => [\n (selectionMode.value === 'year')\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n ref_key: \"yearSelector\",\n ref: yearSelector,\n class: \"bb-base-date-picker__year-selector\"\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(yearOptions.value, (option) => {\n return (_openBlock(), _createElementBlock(\"button\", {\n key: option.key,\n class: _normalizeClass({\n\t\t\t\t\t\t\t'bb-base-date-picker__year-selector-year': true,\n\t\t\t\t\t\t\t'bb-base-date-picker__year-selector-year--selected':\n\t\t\t\t\t\t\t\toption.selected,\n\t\t\t\t\t\t}),\n disabled: _ctx.disabled,\n onClick: option.handler\n }, _toDisplayString(option.text), 11, _hoisted_36))\n }), 128))\n ], 512))\n : _createCommentVNode(\"\", true)\n ]),\n _: 1\n })\n ])\n ], 16))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_createElementVNode","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_19","_hoisted_20","_hoisted_21","_hoisted_22","_hoisted_23","_hoisted_24","_hoisted_25","_hoisted_26","_hoisted_27","_hoisted_28","_hoisted_29","_hoisted_30","_hoisted_31","_hoisted_32","_hoisted_33","_hoisted_34","_hoisted_35","_hoisted_36","_sfc_main","_defineComponent","__props","__expose","__emit","dayjs","weekOfYear","updateLocale","isSameOrAfter","isSameOrBefore","it","props","emit","calendar","ref","selectionMode","yearSelector","initialDate","last","currentDate","mappedHeaders","computed","_","index","day","selected","modelValueMetadata","displayedDates","startOfMonth","firstValueToDisplay","lastValueToDisplay","datesInPage","monthValue","date","id","_a","asNumber","first","middle","highlighted","disabled","isDateDisabled","passing","indexedDates","groupBy","indexedRows","cell","min","max","value","item","isNil","onButtonClick","event","onDateselected","from","to","a","b","valueToEmit","el","iso1","iso2","asString","monthOptions","currentMonth","setDateToMonth","decreaseMonth","increaseMonth","month","toEmit","setSelectionModeToYear","nextTick","selectedYear","setSelectionModeToDay","yearOptions","currentYear","pastYears","arr","futureYears","setDateToYear","decreaseYear","increaseYear","year","watch","containerAttributes","classes","width","_ctx","_cache","_openBlock","_createElementBlock","_mergeProps","_createTextVNode","_toDisplayString","_unref","$event","_withDirectives","_createVNode","_Transition","_withCtx","_vShow","_createCommentVNode","_normalizeClass","_Fragment","_renderList","header","cells","_renderSlot","option"],"mappings":";;;;;;;;;;AAGA,MAAMA,KAAa,EAAE,OAAO,iCACtBC,KAAa,CAAC,UAAU,GACxBC,KAA0BC,gBAAAA,EAAoB,QAAQ,MAAM,MAAM,EAAE,GACpEC,KAAa;AAAA,EACjB,aAAa;AAAA,EACb,OAAO;AACT,GACMC,KAAa,EAAE,OAAO,kCACtBC,KAAa,EAAE,OAAO,mCACtBC,KAAa,CAAC,UAAU,GACxBC,KAAa,EAAE,OAAO,+CACtBC,KAAa,CAAC,UAAU,GACxBC,uBAA+C,OAAO;AAAA,EAC1D,SAAS;AAAA,EACT,OAAO;AACT,GAAG;AAAA,oBACgC,QAAQ;AAAA,IACvC,GAAG;AAAA,IACH,MAAM;AAAA,EAAA,CACP;AACH,GAAG,EAAE,GACCC,KAA2BR,gBAAAA,EAAoB,QAAQ,MAAM,2BAA2B,EAAE,GAC1FS,KAAc;AAAA,EAClBF;AAAA,EACAC;AACF,GACME,KAAc,CAAC,UAAU,GACzBC,KAAc,CAAC,UAAU,GACzBC,KAAc;AAAA,EAClB,OAAO,EAAC,WAAY,iBAAgB;AAAA,EACpC,SAAS;AAAA,EACT,OAAO;AACT,GACMC,uBAA+C,QAAQ;AAAA,EAC3D,GAAG;AAAA,EACH,MAAM;AACR,GAAG,MAAM,EAAE,GACLC,KAAc;AAAA,EAClBD;AACF,GACME,KAA2Bf,gBAAAA,EAAoB,QAAQ,MAAM,yBAAyB,EAAE,GACxFgB,KAAc,EAAE,OAAO,8CACvBC,KAAc,CAAC,UAAU,GACzBC,uBAA+C,OAAO;AAAA,EAC1D,SAAS;AAAA,EACT,OAAO;AACT,GAAG;AAAA,oBACgC,QAAQ;AAAA,IACvC,GAAG;AAAA,IACH,MAAM;AAAA,EAAA,CACP;AACH,GAAG,EAAE,GACCC,KAA2BnB,gBAAAA,EAAoB,QAAQ,MAAM,2BAA2B,EAAE,GAC1FoB,KAAc;AAAA,EAClBF;A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pC,2CAA2C;AAAA,kBAC3C,qDACCM,EAAO;AAAA,gBAAA,CACR;AAAA,gBACa,UAAUrB,EAAK;AAAA,gBACf,SAASqB,EAAO;AAAA,cAAA,GACff,EAAiBe,EAAO,IAAI,GAAG,IAAI9G,EAAW,EAClD,GAAG,GAAG;AAAA,YACN,GAAA,GAAG,KACNuG,EAAoB,IAAI,EAAI;AAAA,UAAA,CACjC;AAAA,UACD,GAAG;AAAA,QAAA,CACJ;AAAA,MAAA,CACF;AAAA,OACA,EAAE;AAAA,EAEP;AAEA,CAAC;"}
1
+ {"version":3,"file":"index15.js","sources":["../src/components/BaseDatePicker/BaseDatePicker.vue"],"sourcesContent":["<template>\n\t<div v-bind=\"containerAttributes\" ref=\"calendar\">\n\t\t<div class=\"bb-base-date-picker__header\">\n\t\t\t<div>\n\t\t\t\t<button\n\t\t\t\t\taria-live=\"polite\"\n\t\t\t\t\tclass=\"bb-base-date-picker__year-button\"\n\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t@click=\"setSelectionModeToYear\"\n\t\t\t\t>\n\t\t\t\t\t{{ currentDate.format('YYYY') }} <span></span>\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t\t<div aria-live=\"polite\" class=\"bb-base-date-picker__selected-day-label\">\n\t\t\t\t<span class=\"bb-base-date-picker__weekday\"\n\t\t\t\t\t>{{ currentDate.format('ddd') }},\n\t\t\t\t</span>\n\t\t\t\t<span class=\"bb-base-date-picker__monthday\">{{\n\t\t\t\t\tcurrentDate.format('DD')\n\t\t\t\t}}</span>\n\t\t\t\t<button\n\t\t\t\t\tclass=\"bb-base-date-picker__month-button\"\n\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t@click=\"selectionMode = 'month'\"\n\t\t\t\t>\n\t\t\t\t\t{{ currentDate.format('MMMM') }}\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t</div>\n\t\t<div\n\t\t\tv-show=\"selectionMode === 'day'\"\n\t\t\tclass=\"bb-base-date-picker__small-month-selector\"\n\t\t>\n\t\t\t<button\n\t\t\t\tclass=\"bb-base-date-picker__previous-month-button\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\ttype=\"button\"\n\t\t\t\t@click=\"decreaseMonth\"\n\t\t\t>\n\t\t\t\t<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M13.939 4.939 6.879 12l7.06 7.061 2.122-2.122L11.121 12l4.94-4.939z\"\n\t\t\t\t\t\tfill=\"currentColor\"\n\t\t\t\t\t/>\n\t\t\t\t</svg>\n\t\t\t\t<span>Vai indietro di un mese</span>\n\t\t\t</button>\n\n\t\t\t<Transition mode=\"out-in\" name=\"fade\">\n\t\t\t\t<button\n\t\t\t\t\t:key=\"currentDate.month()\"\n\t\t\t\t\taria-live=\"polite\"\n\t\t\t\t\tclass=\"bb-base-date-picker__current-month-button\"\n\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t@click=\"selectionMode = 'month'\"\n\t\t\t\t>\n\t\t\t\t\t{{ currentDate.format('MMMM') }}\n\t\t\t\t</button>\n\t\t\t</Transition>\n\n\t\t\t<button\n\t\t\t\tclass=\"bb-base-date-picker__next-month-button\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\ttype=\"button\"\n\t\t\t\t@click=\"increaseMonth\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\tstyle=\"transform: rotate(180deg)\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M13.939 4.939 6.879 12l7.06 7.061 2.122-2.122L11.121 12l4.94-4.939z\"\n\t\t\t\t\t\tfill=\"currentColor\"\n\t\t\t\t\t/>\n\t\t\t\t</svg>\n\t\t\t\t<span>Vai avanti di un mese</span>\n\t\t\t</button>\n\t\t</div>\n\t\t<div\n\t\t\tv-show=\"selectionMode === 'month'\"\n\t\t\tclass=\"bb-base-date-picker__small-year-selector\"\n\t\t>\n\t\t\t<button\n\t\t\t\tclass=\"bb-base-date-picker__previous-year-button\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\ttype=\"button\"\n\t\t\t\t@click=\"decreaseYear\"\n\t\t\t>\n\t\t\t\t<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M13.939 4.939 6.879 12l7.06 7.061 2.122-2.122L11.121 12l4.94-4.939z\"\n\t\t\t\t\t\tfill=\"currentColor\"\n\t\t\t\t\t/>\n\t\t\t\t</svg>\n\t\t\t\t<span>Vai indietro di un anno</span>\n\t\t\t</button>\n\t\t\t<Transition mode=\"out-in\" name=\"fade\">\n\t\t\t\t<button\n\t\t\t\t\t:key=\"currentDate.year()\"\n\t\t\t\t\taria-live=\"polite\"\n\t\t\t\t\tclass=\"bb-base-date-picker__current-year-button\"\n\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t@click=\"setSelectionModeToYear\"\n\t\t\t\t>\n\t\t\t\t\t{{ currentDate.format('YYYY') }}\n\t\t\t\t</button>\n\t\t\t</Transition>\n\t\t\t<button\n\t\t\t\tclass=\"bb-base-date-picker__next-year-button\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\ttype=\"button\"\n\t\t\t\t@click=\"increaseYear\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\tstyle=\"transform: rotate(180deg)\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M13.939 4.939 6.879 12l7.06 7.061 2.122-2.122L11.121 12l4.94-4.939z\"\n\t\t\t\t\t\tfill=\"currentColor\"\n\t\t\t\t\t/>\n\t\t\t\t</svg>\n\t\t\t\t<span>Vai avanti di un anno</span>\n\t\t\t</button>\n\t\t</div>\n\t\t<div v-if=\"selectionMode === 'year'\" style=\"height: 32px\"></div>\n\t\t<div class=\"bb-base-date-picker-calendar\">\n\t\t\t<Transition mode=\"out-in\" name=\"fade\">\n\t\t\t\t<div\n\t\t\t\t\t:key=\"currentDate.month()\"\n\t\t\t\t\tclass=\"bb-base-date-picker-month\"\n\t\t\t\t\t:class=\"{ invisible: selectionMode !== 'day' }\"\n\t\t\t\t>\n\t\t\t\t\t<div class=\"bb-base-date-picker-header-container\">\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tv-for=\"header in mappedHeaders\"\n\t\t\t\t\t\t\t:key=\"header.id\"\n\t\t\t\t\t\t\tclass=\"bb-base-date-picker-header\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{{ header.label }}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tv-for=\"(cells, id) in indexedRows\"\n\t\t\t\t\t\t\t:key=\"id\"\n\t\t\t\t\t\t\tclass=\"bb-base-date-picker-week\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tv-for=\"cell in cells\"\n\t\t\t\t\t\t\t\t:key=\"cell.id\"\n\t\t\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t\t\t'bb-base-date-picker-date--disabled':\n\t\t\t\t\t\t\t\t\t\tdisabled || cell.disabled,\n\t\t\t\t\t\t\t\t\t'bb-base-date-picker-date--first': cell.first,\n\t\t\t\t\t\t\t\t\t'bb-base-date-picker-date--highlighted': cell.highlighted,\n\t\t\t\t\t\t\t\t\t'bb-base-date-picker-date--last': cell.last,\n\t\t\t\t\t\t\t\t\t'bb-base-date-picker-date--middle': cell.middle,\n\t\t\t\t\t\t\t\t\t'bb-base-date-picker-date--selected': cell.selected,\n\t\t\t\t\t\t\t\t\t'bb-base-date-picker-date': true,\n\t\t\t\t\t\t\t\t}\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t:id=\"cell.buttonId\"\n\t\t\t\t\t\t\t\t\tclass=\"bb-base-date-picker-date__button\"\n\t\t\t\t\t\t\t\t\t:disabled=\"disabled || cell.disabled\"\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t@click=\"onButtonClick\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{{ cell.label }}\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t\t:first=\"cell.first\"\n\t\t\t\t\t\t\t\t\t:highlighted=\"cell.highlighted\"\n\t\t\t\t\t\t\t\t\t:item=\"cell.original\"\n\t\t\t\t\t\t\t\t\t:label=\"cell.label\"\n\t\t\t\t\t\t\t\t\t:last=\"cell.last\"\n\t\t\t\t\t\t\t\t\t:middle=\"cell.middle\"\n\t\t\t\t\t\t\t\t\t:name=\"'day'\"\n\t\t\t\t\t\t\t\t\t:selected=\"cell.selected\"\n\t\t\t\t\t\t\t\t></slot>\n\t\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t\t:first=\"cell.first\"\n\t\t\t\t\t\t\t\t\t:highlighted=\"cell.highlighted\"\n\t\t\t\t\t\t\t\t\t:item=\"cell.original\"\n\t\t\t\t\t\t\t\t\t:label=\"cell.label\"\n\t\t\t\t\t\t\t\t\t:last=\"cell.last\"\n\t\t\t\t\t\t\t\t\t:middle=\"cell.middle\"\n\t\t\t\t\t\t\t\t\t:name=\"cell.slotName\"\n\t\t\t\t\t\t\t\t\t:selected=\"cell.selected\"\n\t\t\t\t\t\t\t\t></slot>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</Transition>\n\n\t\t\t<Transition name=\"fade\">\n\t\t\t\t<div\n\t\t\t\t\tv-if=\"selectionMode === 'month'\"\n\t\t\t\t\tclass=\"bb-base-date-picker__month-selector\"\n\t\t\t\t>\n\t\t\t\t\t<button\n\t\t\t\t\t\tv-for=\"option in monthOptions\"\n\t\t\t\t\t\t:key=\"option.key\"\n\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t'bb-base-date-picker__month-selector-month': true,\n\t\t\t\t\t\t\t'bb-base-date-picker__month-selector-month--selected':\n\t\t\t\t\t\t\t\toption.selected,\n\t\t\t\t\t\t}\"\n\t\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t@click=\"option.handler\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{{ option.text }}\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</Transition>\n\n\t\t\t<Transition name=\"fade\">\n\t\t\t\t<div\n\t\t\t\t\tv-if=\"selectionMode === 'year'\"\n\t\t\t\t\tref=\"yearSelector\"\n\t\t\t\t\tclass=\"bb-base-date-picker__year-selector\"\n\t\t\t\t>\n\t\t\t\t\t<button\n\t\t\t\t\t\tv-for=\"option in yearOptions\"\n\t\t\t\t\t\t:key=\"option.key\"\n\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t'bb-base-date-picker__year-selector-year': true,\n\t\t\t\t\t\t\t'bb-base-date-picker__year-selector-year--selected':\n\t\t\t\t\t\t\t\toption.selected,\n\t\t\t\t\t\t}\"\n\t\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\t\t@click=\"option.handler\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{{ option.text }}\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</Transition>\n\t\t</div>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, nextTick, ref, watch } from 'vue';\nimport { default as dayjs } from 'dayjs';\nimport { default as isSameOrAfter } from 'dayjs/plugin/isSameOrAfter';\nimport { default as isSameOrBefore } from 'dayjs/plugin/isSameOrBefore';\nimport { default as it } from 'dayjs/locale/it';\nimport { default as updateLocale } from 'dayjs/plugin/updateLocale';\nimport { default as weekOfYear } from 'dayjs/plugin/weekOfYear';\nimport { groupBy } from '@/utilities/functions/groupBy';\nimport { isNil } from '@/utilities/functions/isNil';\nimport { last } from '@/utilities/functions/last';\nimport type { Dayjs } from 'dayjs';\nimport type { InputHTMLAttributes } from 'vue';\n\ndayjs.extend(weekOfYear);\ndayjs.extend(updateLocale);\ndayjs.extend(isSameOrAfter);\ndayjs.extend(isSameOrBefore);\ndayjs.locale(it);\n\nexport type BaseDatePickerProps = {\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 * 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 * Allows the selection of multiple items.\n\t */\n\tmultiple?: boolean;\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 * 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\ntype Header = {\n\tid: string;\n\n\tlabel: string;\n\n\toriginal: Dayjs;\n};\n\ntype Cell = {\n\tbuttonId: string;\n\n\tdisabled: boolean;\n\n\tfirst: boolean;\n\n\thighlighted: boolean;\n\n\tid: string;\n\n\tlabel: string;\n\n\tlast: boolean;\n\n\tmiddle: boolean;\n\n\toriginal: Dayjs;\n\n\tselected: boolean;\n\n\tslotName: string;\n};\n\nconst props = withDefaults(defineProps<BaseDatePickerProps>(), {\n\twidth: 290,\n\tfirstDayOfWeek: 1,\n});\n\nconst emit = defineEmits(['update:modelValue']);\n\nexport type BaseDatePickerSlots = {\n\tday?: (props: {\n\t\tfirst: Cell['first'];\n\t\thighlighted: Cell['highlighted'];\n\t\titem: Cell['original'];\n\t\tlabel: Cell['label'];\n\t\tlast: Cell['last'];\n\t\tmiddle: Cell['middle'];\n\t\tselected: Cell['selected'];\n\t}) => any;\n} & {\n\t[key: string]: (props: {\n\t\tfirst: Cell['first'];\n\t\thighlighted: Cell['highlighted'];\n\t\titem: Cell['original'];\n\t\tlabel: Cell['label'];\n\t\tlast: Cell['last'];\n\t\tmiddle: Cell['middle'];\n\t\tselected: Cell['selected'];\n\t}) => any;\n};\n\ndefineSlots<BaseDatePickerSlots>();\n\ndayjs.updateLocale('it', {\n\tweekStart: props.firstDayOfWeek,\n});\n\nif (props.multiple && props.range) {\n\tthrow new Error('Date picker cannot be both multiple and range');\n}\n\nconst calendar = ref<HTMLElement | null>(null);\n\nconst selectionMode = ref('day');\nconst yearSelector = ref<HTMLElement | null>(null);\n\nlet initialDate = ref(dayjs());\n\nif (Array.isArray(props.modelValue)) {\n\tif (props.modelValue.length) {\n\t\tinitialDate.value = dayjs(last(props.modelValue));\n\t}\n} else if (props.modelValue) {\n\tinitialDate.value = dayjs(props.modelValue);\n}\n\nlet currentDate = ref(initialDate.value.clone());\n\nconst mappedHeaders = computed<Header[]>(() => {\n\treturn (\n\t\tnew Array(7)\n\t\t\t.fill('')\n\t\t\t// Sort days based on first day of the week\n\t\t\t.map((_, index) => dayjs().day((index + props.firstDayOfWeek) % 7))\n\t\t\t.map((day) => {\n\t\t\t\tconst selected = modelValueMetadata.value.selected(day);\n\t\t\t\treturn {\n\t\t\t\t\tlabel: day.format('dd').slice(0, 1).toUpperCase(),\n\t\t\t\t\tid: day.toISOString(),\n\t\t\t\t\toriginal: day,\n\t\t\t\t\tselected,\n\t\t\t\t};\n\t\t\t})\n\t);\n});\n\nconst displayedDates = computed<Cell[]>(() => {\n\tlet startOfMonth = currentDate.value.clone().startOf('month');\n\tlet firstValueToDisplay = startOfMonth.clone().startOf('week');\n\tlet endOfMonth = currentDate.value.clone().endOf('month');\n\tlet lastValueToDisplay = endOfMonth.clone().endOf('week');\n\n\tlet datesInPage: Dayjs[] = [];\n\tconst monthValue = startOfMonth.month();\n\tfor (\n\t\tlet index = firstValueToDisplay;\n\t\tindex.isBefore(lastValueToDisplay);\n\t\tindex = index.add(1, 'day')\n\t) {\n\t\tdatesInPage.push(index.clone());\n\t}\n\treturn datesInPage.map((date): Cell => {\n\t\tconst id = date.toISOString();\n\t\tlet selected = !!modelValueMetadata.value.selected(date);\n\t\tif (props.range && props.modelValue?.length === 2) {\n\t\t\tconst asNumber = date.valueOf();\n\t\t\tselected =\n\t\t\t\tmodelValueMetadata.value.min <= asNumber &&\n\t\t\t\tmodelValueMetadata.value.max >= asNumber;\n\t\t}\n\n\t\tconst first = !!(\n\t\t\tmodelValueMetadata.value.isFirstOfRange(date) && props.range\n\t\t);\n\t\tconst last = !!(\n\t\t\tmodelValueMetadata.value.isLastOfRange(date) && props.range\n\t\t);\n\t\tconst middle = !!(selected && !first && !last && props.range);\n\n\t\t/* Highlighted means it's current month */\n\t\tconst highlighted = date.month() === monthValue;\n\n\t\tconst disabled = isDateDisabled(date);\n\n\t\treturn {\n\t\t\tbuttonId: 'date_' + id,\n\t\t\tdisabled,\n\t\t\tfirst,\n\t\t\thighlighted,\n\t\t\tid,\n\t\t\tlabel: date.get('D').toString(),\n\t\t\tlast,\n\t\t\tmiddle,\n\t\t\toriginal: date,\n\t\t\tselected,\n\t\t\tslotName: id,\n\t\t};\n\t});\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\nconst indexedDates = computed(() => {\n\treturn groupBy(displayedDates.value, (date: Cell) => date.id);\n});\n\nconst indexedRows = computed<Record<string, Cell[]>>(() => {\n\tconst indexedByWeek = groupBy(displayedDates.value, (cell: Cell) =>\n\t\tcell.original.week().toString()\n\t);\n\treturn indexedByWeek;\n});\n\nconst modelValueMetadata = computed(() => {\n\tlet min = Infinity;\n\tlet max = -Infinity;\n\tlet selected: { [key: number]: number } = {};\n\n\tif (props.modelValue) {\n\t\tconst arr = ([] as (string | Date)[])\n\t\t\t.concat(props.modelValue)\n\t\t\t.map((value) => dayjs(value).startOf('day'))\n\t\t\t.map((date) => date.valueOf());\n\t\tarr.forEach((item, index) => {\n\t\t\tif (item < min) min = item;\n\t\t\tif (item > max) max = item;\n\t\t\tselected[item] = index;\n\t\t});\n\t}\n\treturn {\n\t\tmin,\n\t\tmax,\n\t\tindex: (date: Dayjs) => selected[date.valueOf()],\n\t\tselected: (date: Dayjs) => !isNil(selected[date.valueOf()]),\n\t\tisFirstOfRange: (date: Dayjs) => date.valueOf() === min,\n\t\tisLastOfRange: (date: Dayjs) => date.valueOf() === max,\n\t};\n});\n\nconst onButtonClick = (event: MouseEvent) => {\n\tif (event.target instanceof HTMLButtonElement) {\n\t\tconst [, id] = event.target.id.split('_');\n\t\tconst date = indexedDates.value[id][0];\n\t\tonDateselected(date);\n\t}\n};\n\nconst onDateselected = (date: Cell) => {\n\tif (props.readonly) return;\n\tif (props.range) {\n\t\tif (props.modelValue && Array.isArray(props.modelValue)) {\n\t\t\tif (props.modelValue.length !== 1) {\n\t\t\t\temit('update:modelValue', [date.original.toISOString()]);\n\t\t\t} else {\n\t\t\t\tif (props.modelValue.length) {\n\t\t\t\t\tlet [from, to] = [dayjs(props.modelValue[0]), date.original].sort(\n\t\t\t\t\t\t(a, b) =>\n\t\t\t\t\t\t\ta.valueOf > b.valueOf ? 1 : a.valueOf() < b.valueOf() ? -1 : 0\n\t\t\t\t\t);\n\n\t\t\t\t\tconst valueToEmit = [from, to].map((el) => el.toISOString());\n\t\t\t\t\temit('update:modelValue', valueToEmit);\n\t\t\t\t} else {\n\t\t\t\t\tconst valueToEmit = [\n\t\t\t\t\t\t...props.modelValue,\n\t\t\t\t\t\tdate.original.toISOString(),\n\t\t\t\t\t];\n\t\t\t\t\temit('update:modelValue', valueToEmit);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new Error(\n\t\t\t\t'Date picker is set to range but modelValue is not an array.'\n\t\t\t);\n\t\t}\n\t} else if (props.multiple) {\n\t\tif (props.modelValue && Array.isArray(props.modelValue)) {\n\t\t\tif (!date.selected) {\n\t\t\t\temit(\n\t\t\t\t\t'update:modelValue',\n\t\t\t\t\t[...props.modelValue, date.original.toISOString()].sort(\n\t\t\t\t\t\t(iso1, iso2) => (iso1 < iso2 ? -1 : iso1 > iso2 ? 1 : 0)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tconst asString = date.original.toISOString();\n\t\t\t\tconst valueToEmit = props.modelValue.filter((el) => el !== asString);\n\t\t\t\temit('update:modelValue', valueToEmit);\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new Error(\n\t\t\t\t'datepicker is set to multiple but modelValue is not an array.'\n\t\t\t);\n\t\t}\n\t} else {\n\t\tif (date.selected) {\n\t\t\temit('update:modelValue', null);\n\t\t} else {\n\t\t\temit('update:modelValue', date.original.toISOString());\n\t\t}\n\t}\n};\n\nconst monthOptions = computed(() => {\n\tconst currentMonth = currentDate.value.month();\n\treturn new Array(12)\n\t\t.fill(currentDate.value.clone().startOf('year'))\n\t\t.map((date: Dayjs, index) => date.add(index, 'month'))\n\t\t.map((date) => ({\n\t\t\ttext: date.format('MMMM'),\n\t\t\tkey: date.unix(),\n\t\t\tselected: date.month() === currentMonth,\n\t\t\thandler: () => setDateToMonth(date),\n\t\t}));\n});\n\nconst decreaseMonth = () => {\n\tcurrentDate.value = currentDate.value.subtract(1, 'month');\n};\nconst increaseMonth = () => {\n\tcurrentDate.value = currentDate.value.add(1, 'month');\n};\n\nconst setDateToMonth = (date: Dayjs) => {\n\tconst month = date.get('month');\n\tconst toEmit = currentDate.value.set('month', month);\n\tif (props.modelValue && !Array.isArray(props.modelValue)) {\n\t\tif (isDateDisabled(toEmit)) {\n\t\t\tcurrentDate.value = toEmit;\n\t\t} else {\n\t\t\temit('update:modelValue', toEmit.toISOString());\n\t\t}\n\t} else {\n\t\tcurrentDate.value = toEmit;\n\t}\n\tselectionMode.value = 'day';\n};\n\nconst setSelectionModeToYear = async () => {\n\tselectionMode.value = 'year';\n\tawait nextTick();\n\tconst selectedYear = yearSelector.value?.querySelector(\n\t\t'.bb-base-date-picker__year-selector-year--selected'\n\t);\n\tif (selectedYear) {\n\t\tselectedYear.scrollIntoView({ block: 'center', inline: 'center' });\n\t}\n};\n\nconst setSelectionModeToDay = () => (selectionMode.value = 'day');\n\nconst yearOptions = computed(() => {\n\tconst currentYear = currentDate.value.year();\n\tconst pastYears = new Array(100)\n\t\t.fill(currentDate.value.clone())\n\t\t.map((date: Dayjs, index, arr) =>\n\t\t\tdate.year(currentYear - arr.length + index)\n\t\t);\n\tconst futureYears = new Array(100)\n\t\t.fill(currentDate.value.clone())\n\t\t.map((date: Dayjs, index) => date.year(currentYear + index + 1));\n\treturn pastYears\n\t\t.concat(currentDate.value.clone())\n\t\t.concat(futureYears)\n\t\t.map((date) => ({\n\t\t\ttext: date.format('YYYY'),\n\t\t\tkey: date.unix(),\n\t\t\tselected: date.year() === currentYear,\n\t\t\thandler: () => setDateToYear(date),\n\t\t}));\n});\n\nconst decreaseYear = () => {\n\tconst toEmit = currentDate.value.subtract(1, 'year');\n\tif (props.modelValue && !Array.isArray(props.modelValue)) {\n\t\tif (isDateDisabled(toEmit)) {\n\t\t\tcurrentDate.value = toEmit;\n\t\t} else {\n\t\t\temit('update:modelValue', toEmit.toISOString());\n\t\t}\n\t} else {\n\t\tcurrentDate.value = toEmit;\n\t}\n};\nconst increaseYear = () => {\n\tconst toEmit = currentDate.value.add(1, 'year');\n\tif (props.modelValue && !Array.isArray(props.modelValue)) {\n\t\tif (isDateDisabled(toEmit)) {\n\t\t\tcurrentDate.value = toEmit;\n\t\t} else {\n\t\t\temit('update:modelValue', toEmit.toISOString());\n\t\t}\n\t} else {\n\t\tcurrentDate.value = toEmit;\n\t}\n};\n\nconst setDateToYear = (date: Dayjs) => {\n\tconst year = date.get('year');\n\tconst toEmit = currentDate.value.set('year', year);\n\tif (props.modelValue && !Array.isArray(props.modelValue)) {\n\t\tif (isDateDisabled(toEmit)) {\n\t\t\tcurrentDate.value = toEmit;\n\t\t} else {\n\t\t\temit('update:modelValue', toEmit.toISOString());\n\t\t}\n\t} else {\n\t\tcurrentDate.value = toEmit;\n\t}\n\tselectionMode.value = 'month';\n};\n\nwatch(\n\t() => props.modelValue,\n\t() => {\n\t\tif (props.modelValue) {\n\t\t\tif (Array.isArray(props.modelValue)) {\n\t\t\t\tif (props.modelValue.length) {\n\t\t\t\t\tcurrentDate.value = dayjs(last(props.modelValue));\n\t\t\t\t} else {\n\t\t\t\t\tcurrentDate.value = dayjs();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcurrentDate.value = dayjs(props.modelValue);\n\t\t\t}\n\t\t} else currentDate.value = dayjs();\n\t}\n);\n\nconst containerAttributes = computed(() => {\n\tconst classes = {\n\t\t'bb-base-date-picker': true,\n\t\t'bb-base-date-picker--readonly': props.readonly,\n\t\t'bb-base-date-picker--disabled': props.disabled,\n\t};\n\tlet width: string;\n\t// If the width is a css unit string use it, if it is a number or number string add px\n\tif (typeof props.width === 'string' && Number.isNaN(Number(props.width))) {\n\t\twidth = props.width;\n\t} else {\n\t\twidth = `${props.width}px`;\n\t}\n\tconst style = {\n\t\twidth: width,\n\t};\n\n\treturn {\n\t\tclass: classes,\n\t\tstyle,\n\t};\n});\n\ndefineExpose({ calendar, setSelectionModeToDay, isDateDisabled });\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BaseDatePicker';\n</style>\n"],"names":["dayjs","weekOfYear","updateLocale","isSameOrAfter","isSameOrBefore","it","props","__props","emit","__emit","calendar","ref","selectionMode","yearSelector","initialDate","last","currentDate","mappedHeaders","computed","_","index","day","selected","modelValueMetadata","displayedDates","startOfMonth","firstValueToDisplay","lastValueToDisplay","datesInPage","monthValue","date","id","_a","asNumber","first","middle","highlighted","disabled","isDateDisabled","passing","indexedDates","groupBy","indexedRows","cell","min","max","value","item","isNil","onButtonClick","event","onDateselected","from","to","a","b","valueToEmit","el","iso1","iso2","asString","monthOptions","currentMonth","setDateToMonth","decreaseMonth","increaseMonth","month","toEmit","setSelectionModeToYear","nextTick","selectedYear","setSelectionModeToDay","yearOptions","currentYear","pastYears","arr","futureYears","setDateToYear","decreaseYear","increaseYear","year","watch","containerAttributes","classes","width","__expose"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwQA,IAAAA,EAAM,OAAOC,EAAU,GACvBD,EAAM,OAAOE,EAAY,GACzBF,EAAM,OAAOG,EAAa,GAC1BH,EAAM,OAAOI,EAAc,GAC3BJ,EAAM,OAAOK,EAAE;AAuFf,UAAMC,IAAQC,GAKRC,IAAOC;AA8BT,QAJJT,EAAM,aAAa,MAAM;AAAA,MACxB,WAAWM,EAAM;AAAA,IAAA,CACjB,GAEGA,EAAM,YAAYA,EAAM;AACrB,YAAA,IAAI,MAAM,+CAA+C;AAG1D,UAAAI,IAAWC,EAAwB,IAAI,GAEvCC,IAAgBD,EAAI,KAAK,GACzBE,IAAeF,EAAwB,IAAI;AAE7C,QAAAG,IAAcH,EAAIX,EAAA,CAAO;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
+
5
2
  //# sourceMappingURL=index158.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index158.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"index158.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/index16.js CHANGED
@@ -1,5 +1,2 @@
1
- const e = "";
2
- export {
3
- e as default
4
- };
1
+
5
2
  //# sourceMappingURL=index16.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index16.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"index16.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/index160.js CHANGED
@@ -1,5 +1,2 @@
1
- const e = "";
2
- export {
3
- e as default
4
- };
1
+
5
2
  //# sourceMappingURL=index160.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index160.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"index160.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/index169.js CHANGED
@@ -1,5 +1,2 @@
1
- const e = "";
2
- export {
3
- e as default
4
- };
1
+
5
2
  //# sourceMappingURL=index169.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index169.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"index169.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/index17.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { defineComponent as R, ref as l, computed as Y, watch as J, onMounted as Q, onBeforeUnmount as X, openBlock as B, createElementBlock as Z, normalizeClass as C, renderSlot as d, createElementVNode as h, withDirectives as x, mergeProps as T, unref as u, toDisplayString as ee, createBlock as ae, Teleport as te, createVNode as ne, createSlots as oe, renderList as le, withCtx as ie, normalizeProps as re, guardReactiveProps as se } from "vue";
2
- import { autoUpdate as de, computePosition as ue, flip as ce, shift as fe } from "./index215.js";
3
- import pe from "./index216.js";
4
- import c from "./index204.js";
5
- import me from "./index207.js";
6
- import { identity as be } from "./index203.js";
7
- import { last as ve } from "./index211.js";
2
+ import { autoUpdate as de, computePosition as ue, flip as ce, shift as fe } from "./index214.js";
3
+ import pe from "./index215.js";
4
+ import c from "./index205.js";
5
+ import me from "./index208.js";
6
+ import { identity as be } from "./index216.js";
7
+ import { last as ve } from "./index212.js";
8
8
  import { useId as ye } from "./index7.js";
9
9
  import { vMaska as he } from "./index217.js";
10
10
  import { wait as I } from "./index122.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index17.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, unref as _unref, mergeProps as _mergeProps, 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 = [\"id\", \"aria-describedby\", \"autocomplete\", \"autofocus\", \"data-maska\", \"disabled\", \"name\", \"placeholder\", \"readonly\", \"value\"]\nconst _hoisted_2 = [\"id\"]\n\nimport {\n\tautoUpdate,\n\tcomputePosition,\n\tflip,\n\toffset,\n\tshift,\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 { useId } from '@/composables/useId';\nimport { vMaska } from 'maska';\nimport { wait } from '@/utilities/functions/wait';\nimport BaseDatePicker from '../BaseDatePicker/BaseDatePicker.vue';\nimport focusableSelectors from 'focusable-selectors';\nimport selectors from 'focusable-selectors';\nimport type { BaseDatePickerSlots } from '../BaseDatePicker/BaseDatePicker.vue';\nimport type { HTMLAttributes, InputHTMLAttributes } from 'vue';\n\nexport type BaseDatePickerInputProps = {\n\t/**\n\t * Allows typing into the input.\n\t */\n\tallowWriting?: boolean;\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 * 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 * 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 * 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\nexport type BaseDatePickerInputEvents = {\n\t(e: 'update:modelValue', value: BaseDatePickerInputProps['modelValue']): void;\n\n\t(e: 'inactive'): void;\n\n\t(e: 'error', message: string): void;\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseDatePickerInput',\n props: {\n allowWriting: { type: Boolean, default: true },\n autocomplete: { default: 'off' },\n autofocus: {},\n disabled: { type: Boolean },\n firstDayOfWeek: {},\n hasErrors: { type: Boolean },\n id: {},\n max: {},\n min: {},\n modelValue: {},\n name: {},\n placeholder: {},\n range: { type: Boolean },\n readonly: {},\n selectable: {},\n width: { default: 290 }\n },\n emits: [\"update:modelValue\", \"inactive\", \"error\"],\n setup(__props: any, { emit: __emit }) {\n\ndayjs.extend(customParseFormat);\ndayjs.locale(it);\n\nconst props = __props;\n\nconst emit = __emit;\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();\nconst id = props.id || `bdpi_${useId().id.value}`;\n\nconst classes = computed(() => ({\n\t'bb-base-date-picker-input': true,\n\t'bb-base-date-picker-input--errors': props.hasErrors,\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 (!basedatepicker.value.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 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\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\tif (innerContainer.value && calendar.value) {\n\t\tcomputePosition(innerContainer.value, calendar.value, {\n\t\t\tplacement: 'bottom-start',\n\t\t\tmiddleware: [offset(6), flip(), shift()],\n\t\t}).then((data) => {\n\t\t\tif (calendar.value) {\n\t\t\t\tcalendar.value.style.left = `${data.x}px`;\n\t\t\t\tcalendar.value.style.top = `${data.y}px`;\n\t\t\t\tif (typeof props.width === 'string') {\n\t\t\t\t\tif (Number(props.width)) {\n\t\t\t\t\t\tcalendar.value.style.width = `${Math.max(\n\t\t\t\t\t\t\tinnerContainer.value?.offsetWidth ?? 0,\n\t\t\t\t\t\t\t+props.width\n\t\t\t\t\t\t)}px`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcalendar.value.style.width = props.width;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n};\n\nlet cleanUpPositioning: () => void;\n\nonMounted(async () => {\n\tif (innerContainer.value && calendar.value) {\n\t\tcleanUpPositioning = autoUpdate(\n\t\t\tinnerContainer.value,\n\t\t\tcalendar.value,\n\t\t\tdisplayOptions\n\t\t);\n\t}\n});\nonBeforeUnmount(() => {\n\tcleanUpPositioning();\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(500);\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(500);\n\thiding.value = false;\n\tshown.value = false;\n\thidden.value = true;\n\tbasedatepicker.value?.setSelectionModeToDay();\n};\n\nconst onKeydown = (event: KeyboardEvent) => {\n\tif (event.key === 'Tab') {\n\t\tif (!event.shiftKey) {\n\t\t\tevent.preventDefault();\n\t\t\tif (calendar.value) {\n\t\t\t\tconst focusableElements = calendar.value.querySelectorAll(\n\t\t\t\t\tselectors.join()\n\t\t\t\t);\n\t\t\t\tconst firstFocusableElement = focusableElements[0];\n\t\t\t\tif (firstFocusableElement instanceof HTMLElement) {\n\t\t\t\t\tfirstFocusableElement.focus();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\nconst onCalendarKeydown = (event: KeyboardEvent) => {\n\tif (event.key === 'Tab') {\n\t\tif (calendar.value) {\n\t\t\tconst focusableSelectorsString = focusableSelectors.join(', ');\n\t\t\tconst focusableElements = calendar.value.querySelectorAll(\n\t\t\t\tfocusableSelectorsString\n\t\t\t);\n\t\t\t/* When the user tabs on the last tabbable elem */\n\t\t\tif (event.target === focusableElements[focusableElements.length - 1]) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst focusableElements = Array.from(\n\t\t\t\t\tdocument.body.querySelectorAll(focusableSelectorsString)\n\t\t\t\t);\n\t\t\t\tconst indexOfInput = focusableElements.findIndex(\n\t\t\t\t\t(el) => el.id === props.id\n\t\t\t\t);\n\t\t\t\tif (indexOfInput > -1) {\n\t\t\t\t\tconst nextElement = focusableElements[indexOfInput + 1];\n\t\t\t\t\tif (nextElement instanceof HTMLElement) {\n\t\t\t\t\t\tnextElement.focus();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (event.target === focusableElements[0]) {\n\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tinput.value?.focus();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\nconst onFocus = () => {\n\topen();\n\tdocument.addEventListener('focusin', onDocumentFocus);\n\tdocument.addEventListener('click', onDocumentClick);\n};\n\nconst onDocumentFocus = (event: FocusEvent) => {\n\tif (event.target instanceof HTMLElement) {\n\t\tif (\n\t\t\t!(\n\t\t\t\touterContainer.value?.contains(event.target) ||\n\t\t\t\tcalendar.value?.contains(event.target)\n\t\t\t)\n\t\t) {\n\t\t\tclose();\n\t\t\tactive.value = false;\n\t\t\tdocument.removeEventListener('click', onDocumentClick);\n\t\t\tdocument.removeEventListener('focusin', onDocumentFocus);\n\t\t\temit('inactive');\n\t\t}\n\t}\n};\n\nconst onDocumentClick = (event: MouseEvent) => {\n\tif (event.target instanceof HTMLElement) {\n\t\tif (\n\t\t\t!(\n\t\t\t\touterContainer.value?.contains(event.target) ||\n\t\t\t\tcalendar.value?.contains(event.target)\n\t\t\t)\n\t\t) {\n\t\t\tclose();\n\t\t\tactive.value = false;\n\t\t\tdocument.removeEventListener('click', onDocumentClick);\n\t\t\tdocument.removeEventListener('focusin', onDocumentFocus);\n\t\t\temit('inactive');\n\t\t}\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};\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"span\", {\n ref_key: \"outerContainer\",\n ref: outerContainer,\n class: _normalizeClass([\"bb-base-date-picker-input__container\", classes.value])\n }, [\n _renderSlot(_ctx.$slots, \"prepend-outer\"),\n _createElementVNode(\"span\", {\n ref_key: \"innerContainer\",\n ref: innerContainer,\n class: \"bb-base-date-picker-input__inner-container\"\n }, [\n _renderSlot(_ctx.$slots, \"prepend\"),\n _withDirectives(_createElementVNode(\"input\", _mergeProps({\n id: _unref(id),\n ref_key: \"input\",\n ref: input,\n \"aria-describedby\": `bdpi_description_${_unref(id)}`,\n autocomplete: _ctx.autocomplete,\n autofocus: _ctx.autofocus,\n \"data-maska\": props.range ? '##/##/#### - ##/##/####' : '##/##/####',\n disabled: _ctx.disabled,\n name: _ctx.name,\n placeholder: _ctx.placeholder,\n readonly: _ctx.readonly || _ctx.range || !_ctx.allowWriting,\n type: 'text',\n value: displayValue.value\n }, eventListeners, {\n onFocus: onFocus,\n onKeydown: onKeydown\n }), null, 16, _hoisted_1), [\n [_unref(vMaska)]\n ]),\n _renderSlot(_ctx.$slots, \"append\"),\n _createElementVNode(\"span\", {\n id: `bdpi_description_${_unref(id)}`,\n class: \"bb-base-date-picker-input__accessible-description\"\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 ref_key: \"calendar\",\n ref: calendar,\n class: _normalizeClass([\"bb-base-date-picker-input__calendar\", {\n\t\t\t\t\t'bb-base-date-picker-input__calendar--active': active.value,\n\t\t\t\t\t'bb-base-date-picker-input__calendar--shown': shown.value,\n\t\t\t\t\t'bb-base-date-picker-input__calendar--showing': showing.value,\n\t\t\t\t\t'bb-base-date-picker-input__calendar--hiding': hiding.value,\n\t\t\t\t\t'bb-base-date-picker-input__calendar--hidden': hidden.value,\n\t\t\t\t}]),\n onKeydown: onCalendarKeydown\n }, [\n _createVNode(BaseDatePicker, _mergeProps({ id: _unref(id) }, calendarEventListeners, {\n ref_key: \"basedatepicker\",\n ref: basedatepicker,\n disabled: _ctx.disabled,\n \"first-day-of-week\": _ctx.firstDayOfWeek,\n max: _ctx.max,\n min: _ctx.min,\n \"model-value\": _ctx.modelValue,\n range: _ctx.range,\n readonly: _ctx.readonly,\n selectable: _ctx.selectable,\n width: _ctx.width\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, [\"id\", \"disabled\", \"first-day-of-week\", \"max\", \"min\", \"model-value\", \"range\", \"readonly\", \"selectable\", \"width\"])\n ], 34)\n ]))\n ], 2))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_sfc_main","_defineComponent","__props","__emit","dayjs","customParseFormat","it","props","emit","calendar","ref","outerContainer","innerContainer","input","inputValue","basedatepicker","id","useId","classes","computed","eventListeners","event","date","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,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AYjB,EAAK,QAAQ,CAACkB,GAAGC,OACpB;AAAA,cACL,MAAAA;AAAA,cACA,IAAIC,GAAS,CAAC/C,MAAS;AAAA,gBACrBgC,EAAYL,EAAK,QAAQmB,GAAME,GAAgBC,GAAoBjD,CAAI,CAAC,CAAC;AAAA,cAAA,CAC1E;AAAA,YAAA,EAEJ;AAAA,UACF,CAAA,GAAG,MAAM,CAAC,MAAM,YAAY,qBAAqB,OAAO,OAAO,eAAe,SAAS,YAAY,cAAc,OAAO,CAAC;AAAA,WACzH,EAAE;AAAA,MAAA,CACN;AAAA,OACA,CAAC;AAAA,EAEN;AAEA,CAAC;"}
1
+ {"version":3,"file":"index17.js","sources":["../src/components/BaseDatePickerInput/BaseDatePickerInput.vue"],"sourcesContent":["<template>\n\t<span\n\t\tref=\"outerContainer\"\n\t\tclass=\"bb-base-date-picker-input__container\"\n\t\t:class=\"classes\"\n\t>\n\t\t<slot name=\"prepend-outer\"></slot>\n\t\t<span\n\t\t\tref=\"innerContainer\"\n\t\t\tclass=\"bb-base-date-picker-input__inner-container\"\n\t\t>\n\t\t\t<slot name=\"prepend\"></slot>\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:name=\"name\"\n\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t:readonly=\"readonly || range || !allowWriting\"\n\t\t\t\t:type=\"'text'\"\n\t\t\t\t:value=\"displayValue\"\n\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t\t@focus=\"onFocus\"\n\t\t\t\t@keydown=\"onKeydown\"\n\t\t\t/>\n\n\t\t\t<slot name=\"append\"></slot>\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</span>\n\t\t<slot name=\"append-outer\"></slot>\n\t\t<teleport 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@keydown=\"onCalendarKeydown\"\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\t:width=\"width\"\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</span>\n</template>\n\n<script setup lang=\"ts\">\nimport {\n\tautoUpdate,\n\tcomputePosition,\n\tflip,\n\toffset,\n\tshift,\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 { useId } from '@/composables/useId';\nimport { vMaska } from 'maska';\nimport { wait } from '@/utilities/functions/wait';\nimport BaseDatePicker from '../BaseDatePicker/BaseDatePicker.vue';\nimport focusableSelectors from 'focusable-selectors';\nimport selectors from 'focusable-selectors';\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;\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 * 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 * 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 * 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: 'update:modelValue', value: BaseDatePickerInputProps['modelValue']): void;\n\n\t(e: 'inactive'): void;\n\n\t(e: 'error', message: string): 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\tappend?: (props: object) => any;\n\t\t'append-outer'?: (props: object) => any;\n\t} & BaseDatePickerSlots\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();\nconst id = props.id || `bdpi_${useId().id.value}`;\n\nconst classes = computed(() => ({\n\t'bb-base-date-picker-input': true,\n\t'bb-base-date-picker-input--errors': props.hasErrors,\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 (!basedatepicker.value.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 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\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\tif (innerContainer.value && calendar.value) {\n\t\tcomputePosition(innerContainer.value, calendar.value, {\n\t\t\tplacement: 'bottom-start',\n\t\t\tmiddleware: [offset(6), flip(), shift()],\n\t\t}).then((data) => {\n\t\t\tif (calendar.value) {\n\t\t\t\tcalendar.value.style.left = `${data.x}px`;\n\t\t\t\tcalendar.value.style.top = `${data.y}px`;\n\t\t\t\tif (typeof props.width === 'string') {\n\t\t\t\t\tif (Number(props.width)) {\n\t\t\t\t\t\tcalendar.value.style.width = `${Math.max(\n\t\t\t\t\t\t\tinnerContainer.value?.offsetWidth ?? 0,\n\t\t\t\t\t\t\t+props.width\n\t\t\t\t\t\t)}px`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcalendar.value.style.width = props.width;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n};\n\nlet cleanUpPositioning: () => void;\n\nonMounted(async () => {\n\tif (innerContainer.value && calendar.value) {\n\t\tcleanUpPositioning = autoUpdate(\n\t\t\tinnerContainer.value,\n\t\t\tcalendar.value,\n\t\t\tdisplayOptions\n\t\t);\n\t}\n});\nonBeforeUnmount(() => {\n\tcleanUpPositioning();\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(500);\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(500);\n\thiding.value = false;\n\tshown.value = false;\n\thidden.value = true;\n\tbasedatepicker.value?.setSelectionModeToDay();\n};\n\nconst onKeydown = (event: KeyboardEvent) => {\n\tif (event.key === 'Tab') {\n\t\tif (!event.shiftKey) {\n\t\t\tevent.preventDefault();\n\t\t\tif (calendar.value) {\n\t\t\t\tconst focusableElements = calendar.value.querySelectorAll(\n\t\t\t\t\tselectors.join()\n\t\t\t\t);\n\t\t\t\tconst firstFocusableElement = focusableElements[0];\n\t\t\t\tif (firstFocusableElement instanceof HTMLElement) {\n\t\t\t\t\tfirstFocusableElement.focus();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\nconst onCalendarKeydown = (event: KeyboardEvent) => {\n\tif (event.key === 'Tab') {\n\t\tif (calendar.value) {\n\t\t\tconst focusableSelectorsString = focusableSelectors.join(', ');\n\t\t\tconst focusableElements = calendar.value.querySelectorAll(\n\t\t\t\tfocusableSelectorsString\n\t\t\t);\n\t\t\t/* When the user tabs on the last tabbable elem */\n\t\t\tif (event.target === focusableElements[focusableElements.length - 1]) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tconst focusableElements = Array.from(\n\t\t\t\t\tdocument.body.querySelectorAll(focusableSelectorsString)\n\t\t\t\t);\n\t\t\t\tconst indexOfInput = focusableElements.findIndex(\n\t\t\t\t\t(el) => el.id === props.id\n\t\t\t\t);\n\t\t\t\tif (indexOfInput > -1) {\n\t\t\t\t\tconst nextElement = focusableElements[indexOfInput + 1];\n\t\t\t\t\tif (nextElement instanceof HTMLElement) {\n\t\t\t\t\t\tnextElement.focus();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (event.target === focusableElements[0]) {\n\t\t\t\tif (event.shiftKey) {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tinput.value?.focus();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\nconst onFocus = () => {\n\topen();\n\tdocument.addEventListener('focusin', onDocumentFocus);\n\tdocument.addEventListener('click', onDocumentClick);\n};\n\nconst onDocumentFocus = (event: FocusEvent) => {\n\tif (event.target instanceof HTMLElement) {\n\t\tif (\n\t\t\t!(\n\t\t\t\touterContainer.value?.contains(event.target) ||\n\t\t\t\tcalendar.value?.contains(event.target)\n\t\t\t)\n\t\t) {\n\t\t\tclose();\n\t\t\tactive.value = false;\n\t\t\tdocument.removeEventListener('click', onDocumentClick);\n\t\t\tdocument.removeEventListener('focusin', onDocumentFocus);\n\t\t\temit('inactive');\n\t\t}\n\t}\n};\n\nconst onDocumentClick = (event: MouseEvent) => {\n\tif (event.target instanceof HTMLElement) {\n\t\tif (\n\t\t\t!(\n\t\t\t\touterContainer.value?.contains(event.target) ||\n\t\t\t\tcalendar.value?.contains(event.target)\n\t\t\t)\n\t\t) {\n\t\t\tclose();\n\t\t\tactive.value = false;\n\t\t\tdocument.removeEventListener('click', onDocumentClick);\n\t\t\tdocument.removeEventListener('focusin', onDocumentFocus);\n\t\t\temit('inactive');\n\t\t}\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};\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","classes","computed","eventListeners","event","date","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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmGA,IAAAA,EAAM,OAAOC,EAAiB,GAC9BD,EAAM,OAAOE,EAAE;AAsFf,UAAMC,IAAQC,GAcRC,IAAOC,GAWPC,IAAWC,EAAwB,IAAI,GACvCC,IAAiBD,EAAwB,IAAI,GAC7CE,IAAiBF,EAAwB,IAAI,GAC7CG,IAAQH,EAAwB,IAAI,GACpCI,IAAaJ,EAAmB,IAAI,GACpCK,IAAiBL,KACjBM,IAAKX,EAAM,MAAM,QAAQY,KAAQ,GAAG,KAAK,IAEzCC,IAAUC,EAAS,OAAO;AAAA,MAC/B,6BAA6B;AAAA,MAC7B,qCAAqCd,EAAM;AAAA,MAC3C,uCAAuCA,EAAM;AAAA,MAC7C,uCAAuCA,EAAM;AAAA,IAC5C,EAAA,GAKIe,IAAi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BAAoB,SAASuC,CAAe,GAC5C,SAAA,oBAAoB,WAAWD,CAAe,GACvDtD,EAAK,UAAU;AAAA,IAEjB,GAGKuD,IAAkB,CAACzC,MAAsB;;AAC1C,MAAAA,EAAM,kBAAkB,iBAGzBkB,IAAA5B,EAAe,UAAf,QAAA4B,EAAsB,SAASlB,EAAM,YACrC0C,IAAAtD,EAAS,UAAT,QAAAsD,EAAgB,SAAS1C,EAAM,YAG1B6B,KACN3B,EAAO,QAAQ,IACN,SAAA,oBAAoB,SAASuC,CAAe,GAC5C,SAAA,oBAAoB,WAAWD,CAAe,GACvDtD,EAAK,UAAU;AAAA,IAEjB,GAMKyD,IAAyB;AAAA,MAC9B,uBAAuB,CAACvC,MACvBlB,EAAK,qBAAqBkB,CAAK;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index18.js CHANGED
@@ -1,5 +1,2 @@
1
- const e = "";
2
- export {
3
- e as default
4
- };
1
+
5
2
  //# sourceMappingURL=index18.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index18.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"index18.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/index183.js CHANGED
@@ -1,5 +1,2 @@
1
- const e = "";
2
- export {
3
- e as default
4
- };
1
+
5
2
  //# sourceMappingURL=index183.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index183.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"index183.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/index185.js CHANGED
@@ -1,5 +1,2 @@
1
- const e = "";
2
- export {
3
- e as default
4
- };
1
+
5
2
  //# sourceMappingURL=index185.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index185.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"index185.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/index19.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { defineComponent as J, ref as o, useAttrs as Q, computed as h, onMounted as X, onBeforeUnmount as E, watchPostEffect as Y, openBlock as _, createBlock as Z, Teleport as ee, createElementVNode as l, mergeProps as N, createElementBlock as B, renderSlot as i, createTextVNode as te, toDisplayString as V, createCommentVNode as D, nextTick as T } from "vue";
2
- import { throttle as oe } from "./index199.js";
3
- import { useFocusTrap as le } from "./index200.js";
2
+ import { throttle as oe } from "./index197.js";
3
+ import { useFocusTrap as le } from "./index198.js";
4
4
  import { useId as A } from "./index7.js";
5
5
  import { wait as L } from "./index122.js";
6
- import { waitFor as ae } from "./index201.js";
6
+ import { waitFor as ae } from "./index199.js";
7
7
  const se = { class: "bb-base-dialog-close" }, ne = { class: "bb-base-dialog-close__content" }, ie = { class: "bb-base-dialog-close__label" }, re = /* @__PURE__ */ l("span", { class: "bb-base-dialog-close__icon" }, [
8
8
  /* @__PURE__ */ l("svg", {
9
9
  "aria-hidden": "true",
@@ -1 +1 @@
1
- {"version":3,"file":"index19.js","sources":["../src/components/BaseDialog/BaseDialog.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, mergeProps as _mergeProps, Teleport as _Teleport, createBlock as _createBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"bb-base-dialog-close\" }\nconst _hoisted_2 = { class: \"bb-base-dialog-close__content\" }\nconst _hoisted_3 = { class: \"bb-base-dialog-close__label\" }\nconst _hoisted_4 = /*#__PURE__*/_createElementVNode(\"span\", { class: \"bb-base-dialog-close__icon\" }, [\n /*#__PURE__*/_createElementVNode(\"svg\", {\n \"aria-hidden\": \"true\",\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n xmlns: \"http://www.w3.org/2000/svg\"\n }, [\n /*#__PURE__*/_createElementVNode(\"path\", {\n d: \"M23 23L1 1M23 1L1 23\",\n stroke: \"currentColor\",\n \"stroke-linecap\": \"round\",\n \"stroke-width\": \"2\"\n })\n ])\n], -1)\nconst _hoisted_5 = /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"10000 10000 0%\"} }, null, -1)\n\nimport {\n\tcomputed,\n\tonBeforeUnmount,\n\tonMounted,\n\tref,\n\tuseAttrs,\n\twatch,\n\tnextTick,\n\twatchPostEffect,\n} from 'vue';\nimport { throttle } from '@/utilities/functions/throttle';\nimport { useFocusTrap } from '@vueuse/integrations/useFocusTrap';\nimport { useId } from '@/composables/useId';\nimport { wait } from '@/utilities/functions/wait';\nimport { waitFor } from '@/utilities/functions/waitFor';\nimport type { CommonProps, Size } from '@/types/CommonProps';\n\nexport type Sizes = {\n\tsm: number;\n\tmd: number;\n\tlg: number;\n};\n\nexport type BaseDialogProps = Pick<\n\tCommonProps,\n\t| 'closeLabel'\n\t| 'compact'\n\t| 'disabled'\n\t| 'eager'\n\t| 'panelClasses'\n\t| 'overlayClasses'\n\t| 'persistent'\n\t| 'showClose'\n\t| 'title'\n\t| 'transition'\n\t| 'transitionDuration'\n> &\n\tSize<Sizes> & {\n\t\t/**\n\t\t * Description of the content of the modal. Extremely useful for accessibility reasons.\n\t\t */\n\t\tdescription?: string;\n\t\t/**\n\t\t * Displays the modala as fulscreen with no margin to the page\n\t\t */\n\t\tfullscreen?: boolean;\n\t\t/**\n\t\t * Defines the state open / closed of the modal.\n\t\t */\n\t\tmodelValue?: boolean | null;\n\t};\n\nexport type BaseDialogSlots = {\n\theader?: (props: {\n\t\ttitleId: typeof titleId;\n\t\tclose: typeof onCloseClick;\n\t\ttitle: BaseDialogProps['title'];\n\t}) => any;\n\ttitle?: (props: { text: BaseDialogProps['title'] }) => any;\n\tclose?: (props: { text: BaseDialogProps['closeLabel'] }) => any;\n\tdescription?: (props: {\n\t\tdescriptionId: typeof descriptionId;\n\t\ttext: BaseDialogProps['description'];\n\t}) => any;\n\tdefault?: (props: {}) => any;\n\tfooter?: (props: {}) => any;\n};\n\nexport type BaseDialogEvents = {\n\t(e: 'shown'): void;\n\t(e: 'hidden'): void;\n\t(e: 'update:modelValue', value: boolean): void;\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseDialog',\n props: {\n closeLabel: { default: 'Chiudi modale' },\n compact: { type: Boolean },\n disabled: { type: Boolean },\n eager: { type: Boolean },\n panelClasses: { default: () => [] },\n overlayClasses: { default: () => [] },\n persistent: { type: Boolean },\n showClose: { type: Boolean, default: true },\n title: {},\n transition: { default: 'fade' },\n transitionDuration: { default: 350 },\n size: { default: 'sm' },\n description: {},\n fullscreen: { type: Boolean },\n modelValue: { type: [Boolean, null] }\n },\n emits: [\"shown\", \"hidden\", \"update:modelValue\"],\n setup(__props: any, { emit: __emit }) {\n\nconst props = __props;\n\n\n\nconst emit = __emit;\n\nconst titleId = `title_${useId().id.value}`;\nconst descriptionId = `description_${useId().id.value}`;\n\nconst observer = ref<MutationObserver | null>(null);\nconst overlay = ref<HTMLElement | null>(null);\nconst panel = ref<HTMLElement | null>(null);\nconst content = ref<HTMLElement | null>(null);\nconst header = ref<HTMLElement | null>(null);\nconst body = ref<HTMLElement | null>(null);\nconst footer = ref<HTMLElement | null>(null);\nconst height = ref<number | null>(null);\n\nconst { activate, deactivate } = useFocusTrap(panel, {\n\tclickOutsideDeactivates: true,\n\t/* On esc deactivate the trap, return focus and then close the modal */\n\tescapeDeactivates: () => {\n\t\tnextTick(() => {\n\t\t\temit('update:modelValue', false);\n\t\t});\n\t\treturn true;\n\t},\n});\n\nconst attrs = useAttrs();\n\nconst closeLabel = computed(() => props.closeLabel);\n\nonMounted(async () => {\n\tif (body.value) {\n\t\tobserver.value = new MutationObserver(onContentGrow);\n\t\tobserver.value.observe(body.value, { childList: true, subtree: true });\n\t}\n\twindow.addEventListener('resize', onContentGrow);\n});\nonBeforeUnmount(() => {\n\twindow.removeEventListener('resize', onContentGrow);\n});\n\nconst open = ref(false);\nconst opening = ref(false);\nconst closed = ref(true);\nconst closing = ref(false);\nconst hasRenderedAtLeastOnce = ref(props.eager || props.modelValue);\n\nconst busy = computed(() => opening.value || closing.value);\n\nonBeforeUnmount(() => {\n\tif (props.modelValue) {\n\t\tlet currentlyOpenModals = Number(\n\t\t\tdocument.body.dataset['openModals'] ?? '0'\n\t\t);\n\t\t// This prevents overscroll chaining (additional scrolling to the body when the modal has been completely scrolled)\n\t\tcurrentlyOpenModals--;\n\t\tdocument.body.dataset['openModals'] = currentlyOpenModals.toString();\n\t\tif (!currentlyOpenModals) {\n\t\t\tdocument.body.style.overflow = 'auto';\n\t\t\tdocument.body.style.paddingRight = '0px';\n\t\t}\n\t}\n});\n\n/**\n * When modelValue becomes true if the component wasn't rendered render it\n * and wait for it to be on the page (or transitions would not work).\n * Stash the latest focused element so we can return it later when it closes.\n * Focus on the panel upon opening.\n * ---\n * Notice all interactions update modelValue and then this function aligns the display to it\n */\nconst alignToModelValue = async () => {\n\tif (props.modelValue) {\n\t\tif (!hasRenderedAtLeastOnce.value) {\n\t\t\thasRenderedAtLeastOnce.value = true;\n\t\t\tawait waitFor(() => !!body.value);\n\t\t\tawait nextTick();\n\t\t\tif (body.value) {\n\t\t\t\tobserver.value = new MutationObserver(onContentGrow);\n\t\t\t\tobserver.value.observe(body.value, { childList: true, subtree: true });\n\t\t\t}\n\t\t}\n\n\t\tclosed.value = false;\n\t\tclosing.value = false;\n\t\topening.value = true;\n\n\t\t// This prevents overscroll chaining (additional scrolling to the body when the modal has been completely scrolled)\n\n\t\tlet currentlyOpenModals = Number(\n\t\t\tdocument.body.dataset['openModals'] ?? '0'\n\t\t);\n\t\tcurrentlyOpenModals++;\n\t\tdocument.body.dataset['openModals'] = currentlyOpenModals.toString();\n\t\tconst scrollBarWidth =\n\t\t\twindow.innerWidth - document.documentElement.clientWidth;\n\t\tdocument.body.style.overflow = 'hidden';\n\t\tdocument.body.style.paddingRight = `${scrollBarWidth}px`;\n\n\t\tawait wait(props.transitionDuration);\n\t\topening.value = false;\n\t\topen.value = true;\n\t\temit('shown');\n\t\tactivate();\n\t} else {\n\t\tdeactivate();\n\t\topening.value = false;\n\t\topen.value = false;\n\t\tclosing.value = true;\n\n\t\tawait wait(props.transitionDuration);\n\n\t\tlet currentlyOpenModals = Number(\n\t\t\tdocument.body.dataset['openModals'] ?? '0'\n\t\t);\n\t\t// This prevents overscroll chaining (additional scrolling to the body when the modal has been completely scrolled)\n\t\tcurrentlyOpenModals--;\n\t\tdocument.body.dataset['openModals'] = currentlyOpenModals.toString();\n\t\tif (!currentlyOpenModals) {\n\t\t\tdocument.body.style.overflow = 'auto';\n\t\t\tdocument.body.style.paddingRight = '0px';\n\t\t}\n\t\tclosing.value = false;\n\t\tclosed.value = true;\n\t\temit('hidden');\n\t}\n};\n\n/**\n * Every time modelValue changes align the display to it\n */\nwatchPostEffect(() => {\n\tif (!props.modelValue && !hasRenderedAtLeastOnce.value) return;\n\talignToModelValue();\n});\n\n/**\n * Disable scrolling\n */\nconst onOverlayScroll = (event: UIEvent) => {\n\tif (event.target === overlay.value) {\n\t\tevent.preventDefault();\n\t}\n};\n\n/**\n * Close the modal on overlay click if not persistent\n */\nconst onOverlayClick = (event: MouseEvent) => {\n\tif (props.disabled || busy.value) return;\n\tif (overlay.value) {\n\t\tif (event.target === overlay.value) {\n\t\t\tif (!props.persistent) {\n\t\t\t\temit('update:modelValue', false);\n\t\t\t}\n\t\t}\n\t}\n};\n\n/**\n * On click on the X button\n */\nconst onCloseClick = () => {\n\tif (props.disabled || busy.value) return;\n\tdeactivate();\n\temit('update:modelValue', false);\n};\n\nconst overlayAttributes = computed(() => {\n\tconst classes = [\n\t\t{\n\t\t\t'bb-base-dialog bb-base-dialog__overlay': true,\n\t\t\t'bb-base-dialog--fullscreen': props.fullscreen,\n\t\t\t'bb-base-dialog--open': open.value,\n\t\t\t'bb-base-dialog--opening': opening.value,\n\t\t\t'bb-base-dialog--closed': closed.value,\n\t\t\t'bb-base-dialog--closing': closing.value,\n\t\t\t[`bb-base-dialog--transition-${props.transition}`]: true,\n\t\t},\n\t\tprops.overlayClasses,\n\t].flat();\n\tconst eventListeners = {\n\t\tonClick: onOverlayClick,\n\t\tonScroll: onOverlayScroll,\n\t\tonTouchmove: onOverlayScroll,\n\t\tonWheel: onOverlayScroll,\n\t\tonKeydown: onOverlayScroll,\n\t};\n\n\tconst style = {\n\t\ttransitionDuration: props.transitionDuration / 1000 + 's',\n\t};\n\treturn {\n\t\tclass: classes,\n\t\tstyle,\n\t\t...eventListeners,\n\t\t...attrs,\n\t};\n});\n\nconst panelAttributes = computed(() => {\n\tconst classes = [\n\t\t{\n\t\t\t'bb-base-dialog__panel': true,\n\t\t\t'bb-base-dialog__panel--compact': props.compact,\n\t\t},\n\t\tprops.panelClasses,\n\t].flat();\n\n\tconst accessibilityAttrs: {\n\t\t[key: string]: string | boolean;\n\t} = {\n\t\trole: 'dialog',\n\t\t'aria-modal': true,\n\t};\n\n\tif (hasRenderedAtLeastOnce.value) {\n\t\taccessibilityAttrs['aria-labelledby'] = titleId;\n\n\t\tif (props.description)\n\t\t\taccessibilityAttrs['aria-describedby'] = descriptionId;\n\t}\n\n\tlet maxWidth;\n\tconst sizes: Sizes = {\n\t\tsm: 384,\n\t\tmd: 652,\n\t\tlg: 896,\n\t};\n\tif (props.fullscreen) maxWidth = '100%';\n\telse if (typeof props.size === 'number') maxWidth = props.size + 'px';\n\telse if (props.size in sizes)\n\t\tmaxWidth = sizes[props.size as keyof Sizes] + 'px';\n\telse maxWidth = props.size + 'px';\n\n\tconst style = {\n\t\tmaxWidth,\n\t\ttransitionDuration: props.transitionDuration / 1000 + 's',\n\t};\n\n\treturn {\n\t\tclass: classes,\n\t\tstyle,\n\t\t...accessibilityAttrs,\n\t};\n});\n\n/**\n * This is called when content inside body changes.\n * Gets the total height the panel needs to be\n * It could be called numerous times so throttle every 300ms\n */\nconst onContentGrow = throttle(async () => {\n\tif (props.fullscreen) {\n\t\theight.value = window.innerHeight;\n\t\treturn;\n\t}\n\tif (header.value && body.value && footer.value) {\n\t\tconst contentHeight =\n\t\t\theader.value.scrollHeight +\n\t\t\tbody.value.scrollHeight +\n\t\t\tfooter.value.scrollHeight +\n\t\t\t2;\n\t\t/* Add two so renderless elements at the bottom are not cut off */\n\t\tif (content.value) {\n\t\t\tcontent.value.style.height = '0px';\n\t\t\tcontent.value.style.height = `${contentHeight + 10}px`;\n\t\t\t/**\n\t\t\t * Run until all transitions inside have completed\n\t\t\t */\n\t\t\tawait wait(30);\n\t\t\tif (header.value && body.value && footer.value) {\n\t\t\t\tconst contentHeight2 =\n\t\t\t\t\theader.value.scrollHeight +\n\t\t\t\t\tbody.value.scrollHeight +\n\t\t\t\t\tfooter.value.scrollHeight +\n\t\t\t\t\t20;\n\t\t\t\tif (contentHeight !== contentHeight2) onContentGrow();\n\t\t\t}\n\t\t}\n\t}\n}, 200);\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createBlock(_Teleport, { to: \"body\" }, [\n _createElementVNode(\"div\", _mergeProps(overlayAttributes.value, {\n ref_key: \"overlay\",\n ref: overlay\n }), [\n _createElementVNode(\"div\", _mergeProps(panelAttributes.value, {\n ref_key: \"panel\",\n ref: panel\n }), [\n (hasRenderedAtLeastOnce.value)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n ref_key: \"content\",\n ref: content,\n class: \"bb-base-dialog__content\"\n }, [\n _createElementVNode(\"div\", {\n ref_key: \"header\",\n ref: header,\n class: \"bb-base-dialog__header\"\n }, [\n _renderSlot(_ctx.$slots, \"header\", {\n close: onCloseClick,\n title: _ctx.title,\n titleId: titleId\n }, () => [\n _createElementVNode(\"span\", {\n id: titleId,\n class: \"bb-base-dialog__title\"\n }, [\n _renderSlot(_ctx.$slots, \"title\", { text: _ctx.title }, () => [\n _createTextVNode(_toDisplayString(_ctx.title), 1)\n ])\n ]),\n _createElementVNode(\"span\", _hoisted_1, [\n (_ctx.showClose)\n ? (_openBlock(), _createElementBlock(\"button\", {\n key: 0,\n type: \"button\",\n onClick: onCloseClick\n }, [\n _renderSlot(_ctx.$slots, \"close\", { text: closeLabel.value }, () => [\n _createElementVNode(\"span\", _hoisted_2, [\n _createElementVNode(\"span\", _hoisted_3, _toDisplayString(closeLabel.value), 1),\n _hoisted_4\n ])\n ])\n ]))\n : _createCommentVNode(\"\", true)\n ])\n ])\n ], 512),\n _createElementVNode(\"div\", {\n ref_key: \"body\",\n ref: body,\n class: \"bb-base-dialog__body\"\n }, [\n _renderSlot(_ctx.$slots, \"description\", {\n descriptionId: descriptionId,\n text: _ctx.description\n }, () => [\n (_ctx.description)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n id: descriptionId,\n class: \"bb-base-dialog__description\"\n }, _toDisplayString(_ctx.description), 1))\n : _createCommentVNode(\"\", true)\n ]),\n _renderSlot(_ctx.$slots, \"default\")\n ], 512),\n _hoisted_5,\n _createElementVNode(\"div\", {\n ref_key: \"footer\",\n ref: footer,\n class: \"bb-base-dialog__footer\"\n }, [\n _renderSlot(_ctx.$slots, \"footer\")\n ], 512)\n ], 512))\n : _createCommentVNode(\"\", true)\n ], 16)\n ], 16)\n ]))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_createElementVNode","_hoisted_5","_sfc_main","_defineComponent","__props","__emit","props","emit","titleId","useId","descriptionId","observer","ref","overlay","panel","content","header","body","footer","height","activate","deactivate","useFocusTrap","nextTick","attrs","useAttrs","closeLabel","computed","onMounted","onContentGrow","onBeforeUnmount","open","opening","closed","closing","hasRenderedAtLeastOnce","busy","currentlyOpenModals","alignToModelValue","waitFor","scrollBarWidth","wait","watchPostEffect","onOverlayScroll","event","onOverlayClick","onCloseClick","overlayAttributes","classes","eventListeners","style","panelAttributes","accessibilityAttrs","maxWidth","sizes","throttle","contentHeight","contentHeight2","_ctx","_cache","_openBlock","_createBlock","_Teleport","_mergeProps","_createElementBlock","_renderSlot","_createTextVNode","_toDisplayString","_createCommentVNode"],"mappings":";;;;;;AAGA,MAAMA,KAAa,EAAE,OAAO,0BACtBC,KAAa,EAAE,OAAO,mCACtBC,KAAa,EAAE,OAAO,iCACtBC,KAA8CC,gBAAAA,EAAA,QAAQ,EAAE,OAAO,gCAAgC;AAAA,oBAClE,OAAO;AAAA,IACtC,eAAe;AAAA,IACf,MAAM;AAAA,IACN,SAAS;AAAA,IACT,OAAO;AAAA,EAAA,GACN;AAAA,sBACgC,QAAQ;AAAA,MACvC,GAAG;AAAA,MACH,QAAQ;AAAA,MACR,kBAAkB;AAAA,MAClB,gBAAgB;AAAA,IAAA,CACjB;AAAA,EAAA,CACF;AACH,GAAG,EAAE,GACCC,KAA8CD,gBAAAA,EAAA,OAAO,EAAE,OAAO,EAAC,MAAO,mBAAqB,GAAA,MAAM,EAAE,GA6E7EE,KAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,YAAY,EAAE,SAAS,gBAAgB;AAAA,IACvC,SAAS,EAAE,MAAM,QAAQ;AAAA,IACzB,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC1B,OAAO,EAAE,MAAM,QAAQ;AAAA,IACvB,cAAc,EAAE,SAAS,MAAM,GAAG;AAAA,IAClC,gBAAgB,EAAE,SAAS,MAAM,GAAG;AAAA,IACpC,YAAY,EAAE,MAAM,QAAQ;AAAA,IAC5B,WAAW,EAAE,MAAM,SAAS,SAAS,GAAK;AAAA,IAC1C,OAAO,CAAC;AAAA,IACR,YAAY,EAAE,SAAS,OAAO;AAAA,IAC9B,oBAAoB,EAAE,SAAS,IAAI;AAAA,IACnC,MAAM,EAAE,SAAS,KAAK;AAAA,IACtB,aAAa,CAAC;AAAA,IACd,YAAY,EAAE,MAAM,QAAQ;AAAA,IAC5B,YAAY,EAAE,MAAM,CAAC,SAAS,IAAI,EAAE;AAAA,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AE,MAAMhC,EAAW,MAAM,GAAG,MAAM;AAAA,sBAClE1B,EAAoB,QAAQH,IAAY;AAAA,wBACtCG,EAAoB,QAAQF,IAAYqE,EAAiBzC,EAAW,KAAK,GAAG,CAAC;AAAA,wBAC7E3B;AAAA,sBAAA,CACD;AAAA,oBAAA,CACF;AAAA,kBAAA,CACF,KACDqE,EAAoB,IAAI,EAAI;AAAA,gBAAA,CACjC;AAAA,cAAA,CACF;AAAA,eACA,GAAG;AAAA,YACNpE,EAAoB,OAAO;AAAA,cACzB,SAAS;AAAA,cACT,KAAKiB;AAAA,cACL,OAAO;AAAA,YAAA,GACN;AAAA,cACDgD,EAAYP,EAAK,QAAQ,eAAe;AAAA,gBACtC,eAAAhD;AAAA,gBACA,MAAMgD,EAAK;AAAA,cAAA,GACV,MAAM;AAAA,gBACNA,EAAK,eACDE,KAAcI,EAAoB,OAAO;AAAA,kBACxC,KAAK;AAAA,kBACL,IAAItD;AAAA,kBACJ,OAAO;AAAA,gBAAA,GACNyD,EAAiBT,EAAK,WAAW,GAAG,CAAC,KACxCU,EAAoB,IAAI,EAAI;AAAA,cAAA,CACjC;AAAA,cACDH,EAAYP,EAAK,QAAQ,SAAS;AAAA,eACjC,GAAG;AAAA,YACNzD;AAAA,YACAD,EAAoB,OAAO;AAAA,cACzB,SAAS;AAAA,cACT,KAAKkB;AAAA,cACL,OAAO;AAAA,YAAA,GACN;AAAA,cACD+C,EAAYP,EAAK,QAAQ,QAAQ;AAAA,eAChC,GAAG;AAAA,UACL,GAAA,GAAG,KACNU,EAAoB,IAAI,EAAI;AAAA,WAC/B,EAAE;AAAA,SACJ,EAAE;AAAA,IAAA,CACN;AAAA,EAEH;AAEA,CAAC;"}
1
+ {"version":3,"file":"index19.js","sources":["../src/components/BaseDialog/BaseDialog.vue"],"sourcesContent":["<template>\n\t<teleport to=\"body\">\n\t\t<div v-bind=\"overlayAttributes\" ref=\"overlay\">\n\t\t\t<div v-bind=\"panelAttributes\" ref=\"panel\">\n\t\t\t\t<div\n\t\t\t\t\tv-if=\"hasRenderedAtLeastOnce\"\n\t\t\t\t\tref=\"content\"\n\t\t\t\t\tclass=\"bb-base-dialog__content\"\n\t\t\t\t>\n\t\t\t\t\t<div ref=\"header\" class=\"bb-base-dialog__header\">\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t:close=\"onCloseClick\"\n\t\t\t\t\t\t\tname=\"header\"\n\t\t\t\t\t\t\t:title=\"title\"\n\t\t\t\t\t\t\t:title-id=\"titleId\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span :id=\"titleId\" class=\"bb-base-dialog__title\">\n\t\t\t\t\t\t\t\t<slot name=\"title\" :text=\"title\">{{ title }}</slot>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span class=\"bb-base-dialog-close\">\n\t\t\t\t\t\t\t\t<button v-if=\"showClose\" type=\"button\" @click=\"onCloseClick\">\n\t\t\t\t\t\t\t\t\t<slot name=\"close\" :text=\"closeLabel\">\n\t\t\t\t\t\t\t\t\t\t<span class=\"bb-base-dialog-close__content\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"bb-base-dialog-close__label\">{{\n\t\t\t\t\t\t\t\t\t\t\t\tcloseLabel\n\t\t\t\t\t\t\t\t\t\t\t}}</span>\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"bb-base-dialog-close__icon\"\n\t\t\t\t\t\t\t\t\t\t\t\t><svg\n\t\t\t\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\t\td=\"M23 23L1 1M23 1L1 23\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</slot>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div ref=\"body\" class=\"bb-base-dialog__body\">\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t:description-id=\"descriptionId\"\n\t\t\t\t\t\t\tname=\"description\"\n\t\t\t\t\t\t\t:text=\"description\"\n\t\t\t\t\t\t\t><div\n\t\t\t\t\t\t\t\tv-if=\"description\"\n\t\t\t\t\t\t\t\t:id=\"descriptionId\"\n\t\t\t\t\t\t\t\tclass=\"bb-base-dialog__description\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{{ description }}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div style=\"flex: 10000 10000 0%\"></div>\n\t\t\t\t\t<div ref=\"footer\" class=\"bb-base-dialog__footer\">\n\t\t\t\t\t\t<slot name=\"footer\"></slot>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</teleport>\n</template>\n\n<script setup lang=\"ts\">\nimport {\n\tcomputed,\n\tonBeforeUnmount,\n\tonMounted,\n\tref,\n\tuseAttrs,\n\twatch,\n\tnextTick,\n\twatchPostEffect,\n} from 'vue';\nimport { throttle } from '@/utilities/functions/throttle';\nimport { useFocusTrap } from '@vueuse/integrations/useFocusTrap';\nimport { useId } from '@/composables/useId';\nimport { wait } from '@/utilities/functions/wait';\nimport { waitFor } from '@/utilities/functions/waitFor';\nimport type { CommonProps, Size } from '@/types/CommonProps';\n\nexport type Sizes = {\n\tsm: number;\n\tmd: number;\n\tlg: number;\n};\n\nexport type BaseDialogProps = Pick<\n\tCommonProps,\n\t| 'closeLabel'\n\t| 'compact'\n\t| 'disabled'\n\t| 'eager'\n\t| 'panelClasses'\n\t| 'overlayClasses'\n\t| 'persistent'\n\t| 'showClose'\n\t| 'title'\n\t| 'transition'\n\t| 'transitionDuration'\n> &\n\tSize<Sizes> & {\n\t\t/**\n\t\t * Description of the content of the modal. Extremely useful for accessibility reasons.\n\t\t */\n\t\tdescription?: string;\n\t\t/**\n\t\t * Displays the modala as fulscreen with no margin to the page\n\t\t */\n\t\tfullscreen?: boolean;\n\t\t/**\n\t\t * Defines the state open / closed of the modal.\n\t\t */\n\t\tmodelValue?: boolean | null;\n\t};\n\nconst props = withDefaults(defineProps<BaseDialogProps>(), {\n\tcloseLabel: 'Chiudi modale',\n\tshowClose: true,\n\tsize: 'sm',\n\ttransition: 'fade',\n\ttransitionDuration: 350,\n\tpanelClasses: () => [],\n\toverlayClasses: () => [],\n});\n\nexport type BaseDialogSlots = {\n\theader?: (props: {\n\t\ttitleId: typeof titleId;\n\t\tclose: typeof onCloseClick;\n\t\ttitle: BaseDialogProps['title'];\n\t}) => any;\n\ttitle?: (props: { text: BaseDialogProps['title'] }) => any;\n\tclose?: (props: { text: BaseDialogProps['closeLabel'] }) => any;\n\tdescription?: (props: {\n\t\tdescriptionId: typeof descriptionId;\n\t\ttext: BaseDialogProps['description'];\n\t}) => any;\n\tdefault?: (props: {}) => any;\n\tfooter?: (props: {}) => any;\n};\n\ndefineSlots<BaseDialogSlots>();\n\nexport type BaseDialogEvents = {\n\t(e: 'shown'): void;\n\t(e: 'hidden'): void;\n\t(e: 'update:modelValue', value: boolean): void;\n};\n\nconst emit = defineEmits<BaseDialogEvents>();\n\nconst titleId = `title_${useId().id.value}`;\nconst descriptionId = `description_${useId().id.value}`;\n\nconst observer = ref<MutationObserver | null>(null);\nconst overlay = ref<HTMLElement | null>(null);\nconst panel = ref<HTMLElement | null>(null);\nconst content = ref<HTMLElement | null>(null);\nconst header = ref<HTMLElement | null>(null);\nconst body = ref<HTMLElement | null>(null);\nconst footer = ref<HTMLElement | null>(null);\nconst height = ref<number | null>(null);\n\nconst { activate, deactivate } = useFocusTrap(panel, {\n\tclickOutsideDeactivates: true,\n\t/* On esc deactivate the trap, return focus and then close the modal */\n\tescapeDeactivates: () => {\n\t\tnextTick(() => {\n\t\t\temit('update:modelValue', false);\n\t\t});\n\t\treturn true;\n\t},\n});\n\nconst attrs = useAttrs();\n\nconst closeLabel = computed(() => props.closeLabel);\n\nonMounted(async () => {\n\tif (body.value) {\n\t\tobserver.value = new MutationObserver(onContentGrow);\n\t\tobserver.value.observe(body.value, { childList: true, subtree: true });\n\t}\n\twindow.addEventListener('resize', onContentGrow);\n});\nonBeforeUnmount(() => {\n\twindow.removeEventListener('resize', onContentGrow);\n});\n\nconst open = ref(false);\nconst opening = ref(false);\nconst closed = ref(true);\nconst closing = ref(false);\nconst hasRenderedAtLeastOnce = ref(props.eager || props.modelValue);\n\nconst busy = computed(() => opening.value || closing.value);\n\nonBeforeUnmount(() => {\n\tif (props.modelValue) {\n\t\tlet currentlyOpenModals = Number(\n\t\t\tdocument.body.dataset['openModals'] ?? '0'\n\t\t);\n\t\t// This prevents overscroll chaining (additional scrolling to the body when the modal has been completely scrolled)\n\t\tcurrentlyOpenModals--;\n\t\tdocument.body.dataset['openModals'] = currentlyOpenModals.toString();\n\t\tif (!currentlyOpenModals) {\n\t\t\tdocument.body.style.overflow = 'auto';\n\t\t\tdocument.body.style.paddingRight = '0px';\n\t\t}\n\t}\n});\n\n/**\n * When modelValue becomes true if the component wasn't rendered render it\n * and wait for it to be on the page (or transitions would not work).\n * Stash the latest focused element so we can return it later when it closes.\n * Focus on the panel upon opening.\n * ---\n * Notice all interactions update modelValue and then this function aligns the display to it\n */\nconst alignToModelValue = async () => {\n\tif (props.modelValue) {\n\t\tif (!hasRenderedAtLeastOnce.value) {\n\t\t\thasRenderedAtLeastOnce.value = true;\n\t\t\tawait waitFor(() => !!body.value);\n\t\t\tawait nextTick();\n\t\t\tif (body.value) {\n\t\t\t\tobserver.value = new MutationObserver(onContentGrow);\n\t\t\t\tobserver.value.observe(body.value, { childList: true, subtree: true });\n\t\t\t}\n\t\t}\n\n\t\tclosed.value = false;\n\t\tclosing.value = false;\n\t\topening.value = true;\n\n\t\t// This prevents overscroll chaining (additional scrolling to the body when the modal has been completely scrolled)\n\n\t\tlet currentlyOpenModals = Number(\n\t\t\tdocument.body.dataset['openModals'] ?? '0'\n\t\t);\n\t\tcurrentlyOpenModals++;\n\t\tdocument.body.dataset['openModals'] = currentlyOpenModals.toString();\n\t\tconst scrollBarWidth =\n\t\t\twindow.innerWidth - document.documentElement.clientWidth;\n\t\tdocument.body.style.overflow = 'hidden';\n\t\tdocument.body.style.paddingRight = `${scrollBarWidth}px`;\n\n\t\tawait wait(props.transitionDuration);\n\t\topening.value = false;\n\t\topen.value = true;\n\t\temit('shown');\n\t\tactivate();\n\t} else {\n\t\tdeactivate();\n\t\topening.value = false;\n\t\topen.value = false;\n\t\tclosing.value = true;\n\n\t\tawait wait(props.transitionDuration);\n\n\t\tlet currentlyOpenModals = Number(\n\t\t\tdocument.body.dataset['openModals'] ?? '0'\n\t\t);\n\t\t// This prevents overscroll chaining (additional scrolling to the body when the modal has been completely scrolled)\n\t\tcurrentlyOpenModals--;\n\t\tdocument.body.dataset['openModals'] = currentlyOpenModals.toString();\n\t\tif (!currentlyOpenModals) {\n\t\t\tdocument.body.style.overflow = 'auto';\n\t\t\tdocument.body.style.paddingRight = '0px';\n\t\t}\n\t\tclosing.value = false;\n\t\tclosed.value = true;\n\t\temit('hidden');\n\t}\n};\n\n/**\n * Every time modelValue changes align the display to it\n */\nwatchPostEffect(() => {\n\tif (!props.modelValue && !hasRenderedAtLeastOnce.value) return;\n\talignToModelValue();\n});\n\n/**\n * Disable scrolling\n */\nconst onOverlayScroll = (event: UIEvent) => {\n\tif (event.target === overlay.value) {\n\t\tevent.preventDefault();\n\t}\n};\n\n/**\n * Close the modal on overlay click if not persistent\n */\nconst onOverlayClick = (event: MouseEvent) => {\n\tif (props.disabled || busy.value) return;\n\tif (overlay.value) {\n\t\tif (event.target === overlay.value) {\n\t\t\tif (!props.persistent) {\n\t\t\t\temit('update:modelValue', false);\n\t\t\t}\n\t\t}\n\t}\n};\n\n/**\n * On click on the X button\n */\nconst onCloseClick = () => {\n\tif (props.disabled || busy.value) return;\n\tdeactivate();\n\temit('update:modelValue', false);\n};\n\nconst overlayAttributes = computed(() => {\n\tconst classes = [\n\t\t{\n\t\t\t'bb-base-dialog bb-base-dialog__overlay': true,\n\t\t\t'bb-base-dialog--fullscreen': props.fullscreen,\n\t\t\t'bb-base-dialog--open': open.value,\n\t\t\t'bb-base-dialog--opening': opening.value,\n\t\t\t'bb-base-dialog--closed': closed.value,\n\t\t\t'bb-base-dialog--closing': closing.value,\n\t\t\t[`bb-base-dialog--transition-${props.transition}`]: true,\n\t\t},\n\t\tprops.overlayClasses,\n\t].flat();\n\tconst eventListeners = {\n\t\tonClick: onOverlayClick,\n\t\tonScroll: onOverlayScroll,\n\t\tonTouchmove: onOverlayScroll,\n\t\tonWheel: onOverlayScroll,\n\t\tonKeydown: onOverlayScroll,\n\t};\n\n\tconst style = {\n\t\ttransitionDuration: props.transitionDuration / 1000 + 's',\n\t};\n\treturn {\n\t\tclass: classes,\n\t\tstyle,\n\t\t...eventListeners,\n\t\t...attrs,\n\t};\n});\n\nconst panelAttributes = computed(() => {\n\tconst classes = [\n\t\t{\n\t\t\t'bb-base-dialog__panel': true,\n\t\t\t'bb-base-dialog__panel--compact': props.compact,\n\t\t},\n\t\tprops.panelClasses,\n\t].flat();\n\n\tconst accessibilityAttrs: {\n\t\t[key: string]: string | boolean;\n\t} = {\n\t\trole: 'dialog',\n\t\t'aria-modal': true,\n\t};\n\n\tif (hasRenderedAtLeastOnce.value) {\n\t\taccessibilityAttrs['aria-labelledby'] = titleId;\n\n\t\tif (props.description)\n\t\t\taccessibilityAttrs['aria-describedby'] = descriptionId;\n\t}\n\n\tlet maxWidth;\n\tconst sizes: Sizes = {\n\t\tsm: 384,\n\t\tmd: 652,\n\t\tlg: 896,\n\t};\n\tif (props.fullscreen) maxWidth = '100%';\n\telse if (typeof props.size === 'number') maxWidth = props.size + 'px';\n\telse if (props.size in sizes)\n\t\tmaxWidth = sizes[props.size as keyof Sizes] + 'px';\n\telse maxWidth = props.size + 'px';\n\n\tconst style = {\n\t\tmaxWidth,\n\t\ttransitionDuration: props.transitionDuration / 1000 + 's',\n\t};\n\n\treturn {\n\t\tclass: classes,\n\t\tstyle,\n\t\t...accessibilityAttrs,\n\t};\n});\n\n/**\n * This is called when content inside body changes.\n * Gets the total height the panel needs to be\n * It could be called numerous times so throttle every 300ms\n */\nconst onContentGrow = throttle(async () => {\n\tif (props.fullscreen) {\n\t\theight.value = window.innerHeight;\n\t\treturn;\n\t}\n\tif (header.value && body.value && footer.value) {\n\t\tconst contentHeight =\n\t\t\theader.value.scrollHeight +\n\t\t\tbody.value.scrollHeight +\n\t\t\tfooter.value.scrollHeight +\n\t\t\t2;\n\t\t/* Add two so renderless elements at the bottom are not cut off */\n\t\tif (content.value) {\n\t\t\tcontent.value.style.height = '0px';\n\t\t\tcontent.value.style.height = `${contentHeight + 10}px`;\n\t\t\t/**\n\t\t\t * Run until all transitions inside have completed\n\t\t\t */\n\t\t\tawait wait(30);\n\t\t\tif (header.value && body.value && footer.value) {\n\t\t\t\tconst contentHeight2 =\n\t\t\t\t\theader.value.scrollHeight +\n\t\t\t\t\tbody.value.scrollHeight +\n\t\t\t\t\tfooter.value.scrollHeight +\n\t\t\t\t\t20;\n\t\t\t\tif (contentHeight !== contentHeight2) onContentGrow();\n\t\t\t}\n\t\t}\n\t}\n}, 200);\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BaseDialog';\n</style>\n"],"names":["props","__props","emit","__emit","titleId","useId","descriptionId","observer","ref","overlay","panel","content","header","body","footer","height","activate","deactivate","useFocusTrap","nextTick","attrs","useAttrs","closeLabel","computed","onMounted","onContentGrow","onBeforeUnmount","open","opening","closed","closing","hasRenderedAtLeastOnce","busy","currentlyOpenModals","alignToModelValue","waitFor","scrollBarWidth","wait","watchPostEffect","onOverlayScroll","event","onOverlayClick","onCloseClick","overlayAttributes","classes","eventListeners","style","panelAttributes","accessibilityAttrs","maxWidth","sizes","throttle","contentHeight","contentHeight2"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6HA,UAAMA,IAAQC,GAkCRC,IAAOC,GAEPC,IAAU,SAASC,EAAM,EAAE,GAAG,KAAK,IACnCC,IAAgB,eAAeD,EAAM,EAAE,GAAG,KAAK,IAE/CE,IAAWC,EAA6B,IAAI,GAC5CC,IAAUD,EAAwB,IAAI,GACtCE,IAAQF,EAAwB,IAAI,GACpCG,IAAUH,EAAwB,IAAI,GACtCI,IAASJ,EAAwB,IAAI,GACrCK,IAAOL,EAAwB,IAAI,GACnCM,IAASN,EAAwB,IAAI,GACrCO,IAASP,EAAmB,IAAI,GAEhC,EAAE,UAAAQ,GAAU,YAAAC,MAAeC,GAAaR,GAAO;AAAA,MACpD,yBAAyB;AAAA;AAAA,MAEzB,mBAAmB,OAClBS,EAAS,MAAM;AACd,QAAAjB,EAAK,qBAAqB,EAAK;AAAA,MAAA,CAC/B,GACM;AAAA,IACR,CACA,GAEKkB,IAAQC,KAERC,IAAaC,EAAS,MAAMvB,EAAM,UAAU;AAElD,IAAAwB,EAAU,YAAY;AACrB,MAAIX,EAAK,UACCN,EAAA,QAAQ,IAAI,iBAAiBkB,CAAa,GAC1ClB,EAAA,MAAM,QAAQM,EAAK,OAAO,EAAE,WAAW,IAAM,SAAS,GAAA,CAAM,IAE/D,OAAA,iBAAiB,UAAUY,CAAa;AAAA,IA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,UAAIH,EAAO,SAASC,EAAK,SAASC,EAAO,OAAO;AACzC,cAAAsC,IACLxC,EAAO,MAAM,eACbC,EAAK,MAAM,eACXC,EAAO,MAAM,eACb;AAED,YAAIH,EAAQ,UACHA,EAAA,MAAM,MAAM,SAAS,OAC7BA,EAAQ,MAAM,MAAM,SAAS,GAAGyC,IAAgB,EAAE,MAIlD,MAAMf,EAAK,EAAE,GACTzB,EAAO,SAASC,EAAK,SAASC,EAAO,QAAO;AACzC,gBAAAuC,IACLzC,EAAO,MAAM,eACbC,EAAK,MAAM,eACXC,EAAO,MAAM,eACb;AACD,UAAIsC,MAAkBC,KAA8B5B;QACrD;AAAA,MAEF;AAAA,OACE,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index196.js CHANGED
@@ -1,5 +1,13 @@
1
- const s = (r) => !!r && !!r.match(/^(#|var\(--|(rgb|hsl)a?\()/);
1
+ import { getCurrentScope as o, onScopeDispose as n, unref as r } from "vue";
2
+ function f(e) {
3
+ return o() ? (n(e), !0) : !1;
4
+ }
5
+ function p(e) {
6
+ return typeof e == "function" ? e() : r(e);
7
+ }
8
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
2
9
  export {
3
- s as isCssColor
10
+ p as toValue,
11
+ f as tryOnScopeDispose
4
12
  };
5
13
  //# sourceMappingURL=index196.js.map