bitboss-ui 2.0.4 → 2.0.7

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 (442) hide show
  1. package/dist/components/BaseDialog/BaseDialog.vue.d.ts +1 -3
  2. package/dist/composables/useOptions.d.ts +1 -1
  3. package/dist/index.js +138 -137
  4. package/dist/index.js.map +1 -1
  5. package/dist/index10.js +74 -35
  6. package/dist/index10.js.map +1 -1
  7. package/dist/{index99.js → index100.js} +3 -3
  8. package/dist/index100.js.map +1 -0
  9. package/dist/{index101.js → index102.js} +3 -3
  10. package/dist/{index101.js.map → index102.js.map} +1 -1
  11. package/dist/{index103.js → index104.js} +8 -8
  12. package/dist/{index103.js.map → index104.js.map} +1 -1
  13. package/dist/{index105.js → index106.js} +10 -10
  14. package/dist/{index105.js.map → index106.js.map} +1 -1
  15. package/dist/{index107.js → index108.js} +3 -3
  16. package/dist/{index107.js.map → index108.js.map} +1 -1
  17. package/dist/index11.js +36 -189
  18. package/dist/index11.js.map +1 -1
  19. package/dist/{index109.js → index110.js} +3 -3
  20. package/dist/{index109.js.map → index110.js.map} +1 -1
  21. package/dist/{index111.js → index112.js} +3 -3
  22. package/dist/{index111.js.map → index112.js.map} +1 -1
  23. package/dist/{index113.js → index114.js} +3 -3
  24. package/dist/{index113.js.map → index114.js.map} +1 -1
  25. package/dist/{index115.js → index116.js} +8 -8
  26. package/dist/{index115.js.map → index116.js.map} +1 -1
  27. package/dist/{index117.js → index118.js} +2 -2
  28. package/dist/{index117.js.map → index118.js.map} +1 -1
  29. package/dist/index12.js +189 -78
  30. package/dist/index12.js.map +1 -1
  31. package/dist/index120.js +34 -38
  32. package/dist/index120.js.map +1 -1
  33. package/dist/index121.js +38 -38
  34. package/dist/index121.js.map +1 -1
  35. package/dist/index122.js +39 -42
  36. package/dist/index122.js.map +1 -1
  37. package/dist/index123.js +43 -31
  38. package/dist/index123.js.map +1 -1
  39. package/dist/index124.js +35 -2
  40. package/dist/index124.js.map +1 -1
  41. package/dist/index125.js +2 -21
  42. package/dist/index125.js.map +1 -1
  43. package/dist/index126.js +21 -2
  44. package/dist/index126.js.map +1 -1
  45. package/dist/index127.js +2 -312
  46. package/dist/index127.js.map +1 -1
  47. package/dist/index128.js +309 -21
  48. package/dist/index128.js.map +1 -1
  49. package/dist/index129.js +24 -2
  50. package/dist/index129.js.map +1 -1
  51. package/dist/index13.js +85 -0
  52. package/dist/index13.js.map +1 -0
  53. package/dist/index130.js +2 -5
  54. package/dist/index130.js.map +1 -1
  55. package/dist/index131.js +5 -9
  56. package/dist/index131.js.map +1 -1
  57. package/dist/index132.js +8 -5
  58. package/dist/index132.js.map +1 -1
  59. package/dist/index133.js +6 -3
  60. package/dist/index133.js.map +1 -1
  61. package/dist/index134.js +1 -1
  62. package/dist/index135.js +1 -1
  63. package/dist/index136.js +1 -1
  64. package/dist/index137.js +1 -1
  65. package/dist/index138.js +1 -1
  66. package/dist/index139.js +1 -1
  67. package/dist/index140.js +1 -1
  68. package/dist/index141.js +1 -1
  69. package/dist/index142.js +1 -1
  70. package/dist/index143.js +1 -1
  71. package/dist/index144.js +1 -1
  72. package/dist/index145.js +1 -1
  73. package/dist/index146.js +1 -1
  74. package/dist/index147.js +1 -1
  75. package/dist/index148.js +1 -1
  76. package/dist/index149.js +1 -1
  77. package/dist/{index14.js → index15.js} +4 -4
  78. package/dist/{index14.js.map → index15.js.map} +1 -1
  79. package/dist/index150.js +1 -1
  80. package/dist/index151.js +1 -1
  81. package/dist/index152.js +1 -1
  82. package/dist/index153.js +1 -1
  83. package/dist/index154.js +1 -1
  84. package/dist/index155.js +1 -1
  85. package/dist/index156.js +1 -1
  86. package/dist/index157.js +1 -1
  87. package/dist/index158.js +1 -1
  88. package/dist/index159.js +2 -2
  89. package/dist/{index161.js → index160.js} +1 -1
  90. package/dist/index160.js.map +1 -0
  91. package/dist/index162.js +6 -0
  92. package/dist/index162.js.map +1 -0
  93. package/dist/index164.js +1 -1
  94. package/dist/index165.js +1 -1
  95. package/dist/index166.js +1 -1
  96. package/dist/index167.js +1 -1
  97. package/dist/index168.js +1 -1
  98. package/dist/index169.js +2 -2
  99. package/dist/{index16.js → index17.js} +4 -4
  100. package/dist/{index16.js.map → index17.js.map} +1 -1
  101. package/dist/index170.js +6 -0
  102. package/dist/index170.js.map +1 -0
  103. package/dist/index172.js +2 -3
  104. package/dist/index172.js.map +1 -1
  105. package/dist/index173.js +1 -1
  106. package/dist/index174.js +1 -1
  107. package/dist/index175.js +1 -1
  108. package/dist/index176.js +1 -1
  109. package/dist/index177.js +1 -1
  110. package/dist/index178.js +1 -1
  111. package/dist/index179.js +1 -1
  112. package/dist/index180.js +1 -1
  113. package/dist/index181.js +1 -1
  114. package/dist/index182.js +1 -1
  115. package/dist/index183.js +2 -2
  116. package/dist/{index185.js → index184.js} +1 -1
  117. package/dist/index184.js.map +1 -0
  118. package/dist/index186.js +6 -0
  119. package/dist/index186.js.map +1 -0
  120. package/dist/index188.js +1 -1
  121. package/dist/index189.js +1 -1
  122. package/dist/{index18.js → index19.js} +76 -74
  123. package/dist/index19.js.map +1 -0
  124. package/dist/index190.js +1 -1
  125. package/dist/index191.js +1 -1
  126. package/dist/index192.js +1 -1
  127. package/dist/index193.js +1 -1
  128. package/dist/index194.js +1 -1
  129. package/dist/index195.js +1 -1
  130. package/dist/index196.js +1 -1
  131. package/dist/index197.js +3 -2
  132. package/dist/index197.js.map +1 -1
  133. package/dist/index198.js +77 -154
  134. package/dist/index198.js.map +1 -1
  135. package/dist/index199.js +2 -84
  136. package/dist/index199.js.map +1 -1
  137. package/dist/index200.js +5 -0
  138. package/dist/index200.js.map +1 -0
  139. package/dist/index201.js +4 -2
  140. package/dist/index201.js.map +1 -1
  141. package/dist/index202.js +2 -4
  142. package/dist/index202.js.map +1 -1
  143. package/dist/index203.js +8 -2
  144. package/dist/index203.js.map +1 -1
  145. package/dist/index204.js +117 -72
  146. package/dist/index204.js.map +1 -1
  147. package/dist/index205.js +5 -126
  148. package/dist/index205.js.map +1 -1
  149. package/dist/index206.js +123 -5
  150. package/dist/index206.js.map +1 -1
  151. package/dist/index207.js +17 -121
  152. package/dist/index207.js.map +1 -1
  153. package/dist/index208.js +15 -18
  154. package/dist/index208.js.map +1 -1
  155. package/dist/index209.js +10 -10
  156. package/dist/index209.js.map +1 -1
  157. package/dist/{index20.js → index21.js} +26 -27
  158. package/dist/index21.js.map +1 -0
  159. package/dist/index210.js +2 -16
  160. package/dist/index210.js.map +1 -1
  161. package/dist/index211.js +2 -2
  162. package/dist/index211.js.map +1 -1
  163. package/dist/index212.js +35 -2
  164. package/dist/index212.js.map +1 -1
  165. package/dist/index213.js +172 -33
  166. package/dist/index213.js.map +1 -1
  167. package/dist/index214.js +6 -174
  168. package/dist/index214.js.map +1 -1
  169. package/dist/index215.js +42 -5
  170. package/dist/index215.js.map +1 -1
  171. package/dist/index217.js +16 -0
  172. package/dist/index217.js.map +1 -0
  173. package/dist/index218.js +4 -12
  174. package/dist/index218.js.map +1 -1
  175. package/dist/index219.js +369 -5
  176. package/dist/index219.js.map +1 -1
  177. package/dist/index220.js +17 -367
  178. package/dist/index220.js.map +1 -1
  179. package/dist/index221.js +27 -8
  180. package/dist/index221.js.map +1 -1
  181. package/dist/index222.js +3 -3
  182. package/dist/index222.js.map +1 -1
  183. package/dist/index223.js +249 -7
  184. package/dist/index223.js.map +1 -1
  185. package/dist/index224.js +51 -18
  186. package/dist/index224.js.map +1 -1
  187. package/dist/index225.js +44 -27
  188. package/dist/index225.js.map +1 -1
  189. package/dist/index226.js +5 -3
  190. package/dist/index226.js.map +1 -1
  191. package/dist/index227.js +43 -243
  192. package/dist/index227.js.map +1 -1
  193. package/dist/index228.js +6 -0
  194. package/dist/{index233.js.map → index228.js.map} +1 -1
  195. package/dist/index229.js +3 -52
  196. package/dist/index229.js.map +1 -1
  197. package/dist/{index22.js → index23.js} +74 -76
  198. package/dist/index23.js.map +1 -0
  199. package/dist/index230.js +7 -37
  200. package/dist/index230.js.map +1 -1
  201. package/dist/index231.js +158 -5
  202. package/dist/index231.js.map +1 -1
  203. package/dist/index232.js +77 -34
  204. package/dist/index232.js.map +1 -1
  205. package/dist/index234.js +2 -2
  206. package/dist/index234.js.map +1 -1
  207. package/dist/index235.js +18 -3
  208. package/dist/index235.js.map +1 -1
  209. package/dist/index236.js +105 -17
  210. package/dist/index236.js.map +1 -1
  211. package/dist/{index239.js → index238.js} +3 -3
  212. package/dist/{index239.js.map → index238.js.map} +1 -1
  213. package/dist/index240.js +5 -0
  214. package/dist/index240.js.map +1 -0
  215. package/dist/index244.js +3 -3
  216. package/dist/index248.js +9 -3
  217. package/dist/index248.js.map +1 -1
  218. package/dist/index249.js +281 -12
  219. package/dist/index249.js.map +1 -1
  220. package/dist/{index24.js → index25.js} +6 -6
  221. package/dist/{index24.js.map → index25.js.map} +1 -1
  222. package/dist/index250.js +5 -8
  223. package/dist/index250.js.map +1 -1
  224. package/dist/index251.js +2 -9
  225. package/dist/index251.js.map +1 -1
  226. package/dist/index252.js +2 -17
  227. package/dist/index252.js.map +1 -1
  228. package/dist/index253.js +2 -281
  229. package/dist/index253.js.map +1 -1
  230. package/dist/index254.js +2 -6
  231. package/dist/index254.js.map +1 -1
  232. package/dist/index255.js +2 -2
  233. package/dist/index256.js +126 -2
  234. package/dist/index256.js.map +1 -1
  235. package/dist/index257.js +431 -2
  236. package/dist/index257.js.map +1 -1
  237. package/dist/index258.js +3 -2
  238. package/dist/index258.js.map +1 -1
  239. package/dist/index260.js +7 -126
  240. package/dist/index260.js.map +1 -1
  241. package/dist/index261.js +20 -429
  242. package/dist/index261.js.map +1 -1
  243. package/dist/{index259.js → index263.js} +1 -1
  244. package/dist/index263.js.map +1 -0
  245. package/dist/index264.js +2 -7
  246. package/dist/index264.js.map +1 -1
  247. package/dist/index265.js +1 -21
  248. package/dist/index265.js.map +1 -1
  249. package/dist/index266.js +5 -0
  250. package/dist/index266.js.map +1 -0
  251. package/dist/index267.js +2 -9
  252. package/dist/index267.js.map +1 -1
  253. package/dist/index268.js +2 -200
  254. package/dist/index268.js.map +1 -1
  255. package/dist/index269.js +23 -431
  256. package/dist/index269.js.map +1 -1
  257. package/dist/{index26.js → index27.js} +4 -4
  258. package/dist/{index26.js.map → index27.js.map} +1 -1
  259. package/dist/index270.js +21 -126
  260. package/dist/index270.js.map +1 -1
  261. package/dist/index272.js +224 -2
  262. package/dist/index272.js.map +1 -1
  263. package/dist/index273.js +89 -2
  264. package/dist/index273.js.map +1 -1
  265. package/dist/index274.js +200 -3
  266. package/dist/index274.js.map +1 -1
  267. package/dist/index275.js +436 -2
  268. package/dist/index275.js.map +1 -1
  269. package/dist/index276.js +127 -2
  270. package/dist/index276.js.map +1 -1
  271. package/dist/index277.js +5 -2
  272. package/dist/index277.js.map +1 -1
  273. package/dist/index278.js +2 -28
  274. package/dist/index278.js.map +1 -1
  275. package/dist/index279.js +7 -20
  276. package/dist/index279.js.map +1 -1
  277. package/dist/index280.js +72 -0
  278. package/dist/index280.js.map +1 -0
  279. package/dist/index281.js +3 -2
  280. package/dist/index281.js.map +1 -1
  281. package/dist/index282.js +12 -5
  282. package/dist/index282.js.map +1 -1
  283. package/dist/index283.js +8 -68
  284. package/dist/index283.js.map +1 -1
  285. package/dist/index284.js +17 -224
  286. package/dist/index284.js.map +1 -1
  287. package/dist/index285.js +1 -1
  288. package/dist/index286.js +1 -1
  289. package/dist/index287.js +12 -12
  290. package/dist/index287.js.map +1 -1
  291. package/dist/index288.js +18 -0
  292. package/dist/index288.js.map +1 -0
  293. package/dist/index289.js +4 -15
  294. package/dist/index289.js.map +1 -1
  295. package/dist/{index28.js → index29.js} +19 -19
  296. package/dist/index29.js.map +1 -0
  297. package/dist/index290.js +4 -4
  298. package/dist/index290.js.map +1 -1
  299. package/dist/index291.js +59 -4
  300. package/dist/index291.js.map +1 -1
  301. package/dist/index292.js +34 -58
  302. package/dist/index292.js.map +1 -1
  303. package/dist/index293.js +6 -10
  304. package/dist/index293.js.map +1 -1
  305. package/dist/index294.js +18 -34
  306. package/dist/index294.js.map +1 -1
  307. package/dist/index295.js +6 -6
  308. package/dist/index295.js.map +1 -1
  309. package/dist/index296.js +2 -19
  310. package/dist/index296.js.map +1 -1
  311. package/dist/index297.js +10 -6
  312. package/dist/index297.js.map +1 -1
  313. package/dist/index298.js +47 -2
  314. package/dist/index298.js.map +1 -1
  315. package/dist/index300.js +424 -0
  316. package/dist/index300.js.map +1 -0
  317. package/dist/index301.js +42 -416
  318. package/dist/index301.js.map +1 -1
  319. package/dist/{index30.js → index31.js} +4 -4
  320. package/dist/{index30.js.map → index31.js.map} +1 -1
  321. package/dist/{index32.js → index33.js} +41 -40
  322. package/dist/index33.js.map +1 -0
  323. package/dist/{index34.js → index35.js} +23 -22
  324. package/dist/{index34.js.map → index35.js.map} +1 -1
  325. package/dist/{index36.js → index37.js} +9 -8
  326. package/dist/index37.js.map +1 -0
  327. package/dist/{index38.js → index39.js} +4 -3
  328. package/dist/index39.js.map +1 -0
  329. package/dist/index4.js +14 -40
  330. package/dist/index4.js.map +1 -1
  331. package/dist/{index40.js → index41.js} +4 -4
  332. package/dist/{index40.js.map → index41.js.map} +1 -1
  333. package/dist/{index42.js → index43.js} +34 -33
  334. package/dist/{index42.js.map → index43.js.map} +1 -1
  335. package/dist/{index44.js → index45.js} +9 -9
  336. package/dist/index45.js.map +1 -0
  337. package/dist/{index46.js → index47.js} +3 -3
  338. package/dist/{index46.js.map → index47.js.map} +1 -1
  339. package/dist/{index48.js → index49.js} +4 -4
  340. package/dist/{index48.js.map → index49.js.map} +1 -1
  341. package/dist/index5.js +38 -76
  342. package/dist/index5.js.map +1 -1
  343. package/dist/index51.js +95 -0
  344. package/dist/index51.js.map +1 -0
  345. package/dist/{index52.js → index53.js} +3 -3
  346. package/dist/{index52.js.map → index53.js.map} +1 -1
  347. package/dist/{index54.js → index55.js} +3 -3
  348. package/dist/{index54.js.map → index55.js.map} +1 -1
  349. package/dist/{index56.js → index57.js} +2 -2
  350. package/dist/{index56.js.map → index57.js.map} +1 -1
  351. package/dist/{index58.js → index59.js} +7 -6
  352. package/dist/{index58.js.map → index59.js.map} +1 -1
  353. package/dist/index6.js +78 -62
  354. package/dist/index6.js.map +1 -1
  355. package/dist/{index60.js → index61.js} +3 -3
  356. package/dist/{index60.js.map → index61.js.map} +1 -1
  357. package/dist/{index62.js → index63.js} +3 -3
  358. package/dist/{index62.js.map → index63.js.map} +1 -1
  359. package/dist/{index64.js → index65.js} +5 -5
  360. package/dist/{index64.js.map → index65.js.map} +1 -1
  361. package/dist/{index66.js → index67.js} +3 -3
  362. package/dist/{index66.js.map → index67.js.map} +1 -1
  363. package/dist/{index68.js → index69.js} +2 -2
  364. package/dist/{index68.js.map → index69.js.map} +1 -1
  365. package/dist/index7.js +60 -18
  366. package/dist/index7.js.map +1 -1
  367. package/dist/{index70.js → index71.js} +7 -7
  368. package/dist/{index70.js.map → index71.js.map} +1 -1
  369. package/dist/{index72.js → index73.js} +3 -3
  370. package/dist/{index72.js.map → index73.js.map} +1 -1
  371. package/dist/{index74.js → index75.js} +3 -3
  372. package/dist/{index74.js.map → index75.js.map} +1 -1
  373. package/dist/index77.js +37 -120
  374. package/dist/index77.js.map +1 -1
  375. package/dist/index78.js +130 -0
  376. package/dist/index78.js.map +1 -0
  377. package/dist/index8.js +19 -7
  378. package/dist/index8.js.map +1 -1
  379. package/dist/{index79.js → index80.js} +5 -5
  380. package/dist/{index79.js.map → index80.js.map} +1 -1
  381. package/dist/{index81.js → index82.js} +7 -6
  382. package/dist/{index81.js.map → index82.js.map} +1 -1
  383. package/dist/{index83.js → index84.js} +7 -7
  384. package/dist/{index83.js.map → index84.js.map} +1 -1
  385. package/dist/{index85.js → index86.js} +3 -3
  386. package/dist/{index85.js.map → index86.js.map} +1 -1
  387. package/dist/{index87.js → index88.js} +3 -3
  388. package/dist/{index87.js.map → index88.js.map} +1 -1
  389. package/dist/index9.js +7 -78
  390. package/dist/index9.js.map +1 -1
  391. package/dist/{index89.js → index90.js} +3 -3
  392. package/dist/{index89.js.map → index90.js.map} +1 -1
  393. package/dist/{index91.js → index92.js} +3 -3
  394. package/dist/{index91.js.map → index92.js.map} +1 -1
  395. package/dist/{index93.js → index94.js} +1 -1
  396. package/dist/index94.js.map +1 -0
  397. package/dist/{index95.js → index96.js} +3 -3
  398. package/dist/{index95.js.map → index96.js.map} +1 -1
  399. package/dist/{index97.js → index98.js} +3 -3
  400. package/dist/{index97.js.map → index98.js.map} +1 -1
  401. package/dist/style.css +1 -1
  402. package/package.json +1 -1
  403. package/dist/index119.js +0 -47
  404. package/dist/index119.js.map +0 -1
  405. package/dist/index161.js.map +0 -1
  406. package/dist/index163.js +0 -6
  407. package/dist/index163.js.map +0 -1
  408. package/dist/index171.js +0 -5
  409. package/dist/index171.js.map +0 -1
  410. package/dist/index18.js.map +0 -1
  411. package/dist/index185.js.map +0 -1
  412. package/dist/index187.js +0 -6
  413. package/dist/index187.js.map +0 -1
  414. package/dist/index20.js.map +0 -1
  415. package/dist/index216.js +0 -45
  416. package/dist/index216.js.map +0 -1
  417. package/dist/index22.js.map +0 -1
  418. package/dist/index233.js +0 -6
  419. package/dist/index237.js +0 -109
  420. package/dist/index237.js.map +0 -1
  421. package/dist/index259.js.map +0 -1
  422. package/dist/index262.js +0 -6
  423. package/dist/index262.js.map +0 -1
  424. package/dist/index271.js +0 -92
  425. package/dist/index271.js.map +0 -1
  426. package/dist/index28.js.map +0 -1
  427. package/dist/index299.js +0 -50
  428. package/dist/index299.js.map +0 -1
  429. package/dist/index3.js +0 -17
  430. package/dist/index3.js.map +0 -1
  431. package/dist/index302.js +0 -50
  432. package/dist/index302.js.map +0 -1
  433. package/dist/index32.js.map +0 -1
  434. package/dist/index36.js.map +0 -1
  435. package/dist/index38.js.map +0 -1
  436. package/dist/index44.js.map +0 -1
  437. package/dist/index50.js +0 -97
  438. package/dist/index50.js.map +0 -1
  439. package/dist/index76.js +0 -47
  440. package/dist/index76.js.map +0 -1
  441. package/dist/index93.js.map +0 -1
  442. package/dist/index99.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index6.js","sources":["../src/composables/useCountdown.ts"],"sourcesContent":["import { getAsPercentage } from '@/utilities/functions/percentage';\nimport { wait } from '@/utilities/functions/wait';\nimport { computed, onBeforeUnmount, ref } from 'vue';\n\ntype CounterParams = {\n\t/** Longevity of the countdown in milliseconds */\n\tduration: number;\n\t/** Function called every time the countdown starts or restarts */\n\tonStart?: (...args: any[]) => any;\n\t/** Function called anytime the timer stops or pauses */\n\tonStop?: (...args: any[]) => any;\n\t/** Function called on completion */\n\tonFinish?: (...args: any[]) => any;\n};\nexport const useCountdown = ({\n\tduration,\n\tonStart,\n\tonFinish,\n\tonStop,\n}: CounterParams) => {\n\tif (!duration) {\n\t\tthrow new Error('You must define a duration for the coundown');\n\t}\n\tconst remaining = ref(duration);\n\tconst elapsed = ref(0);\n\tconst progress = computed(() => getAsPercentage(elapsed.value, duration));\n\tconst tick = 100;\n\tconst running = ref(false);\n\tconst paused = ref(false);\n\n\tlet timeoutID: ReturnType<typeof setInterval>;\n\n\tconst start = () => {\n\t\tif (elapsed.value === duration || (running.value && !paused.value)) return;\n\t\tif (onStart) onStart();\n\t\tpaused.value = false;\n\t\trunning.value = true;\n\n\t\ttimeoutID = setInterval(() => {\n\t\t\tremaining.value = Math.max(remaining.value - tick, 0);\n\t\t\telapsed.value = Math.min(elapsed.value + tick, duration);\n\n\t\t\tif (remaining.value === 0) {\n\t\t\t\twait(0).then(() => {\n\t\t\t\t\tclearInterval(timeoutID);\n\t\t\t\t\trunning.value = false;\n\t\t\t\t\tif (onStop) onStop();\n\t\t\t\t\tif (onFinish) onFinish();\n\t\t\t\t});\n\t\t\t}\n\t\t}, tick);\n\t};\n\n\tconst restart = () => {\n\t\treset();\n\t\tstart();\n\t};\n\n\tconst reset = () => {\n\t\tif (timeoutID) clearInterval(timeoutID);\n\t\tif (!paused.value) {\n\t\t\tif (onStop) onStop();\n\t\t}\n\t\tremaining.value = duration;\n\t\telapsed.value = 0;\n\t\trunning.value = false;\n\t\tpaused.value = false;\n\t};\n\n\tconst pause = () => {\n\t\tif (timeoutID) clearInterval(timeoutID);\n\t\tif (!paused.value) {\n\t\t\tif (onStop) onStop();\n\t\t}\n\t\tpaused.value = true;\n\t};\n\n\tconst remainingFormatted = computed(() => {\n\t\tconst msInADay = 1000 * 60 * 60 * 24;\n\t\tconst msInAnHour = 1000 * 60 * 60;\n\t\tconst msInAMinute = 1000 * 60;\n\t\tconst msInASecond = 1000;\n\n\t\tconst days = Math.trunc(remaining.value / msInADay);\n\t\tconst hours = Math.trunc((remaining.value - days * msInADay) / msInAnHour);\n\t\tconst minutes = Math.trunc(\n\t\t\t(remaining.value - hours * msInAnHour - days * msInADay) / msInAMinute\n\t\t);\n\t\tconst seconds = Math.trunc(\n\t\t\t(remaining.value -\n\t\t\t\tminutes * msInAMinute -\n\t\t\t\thours * msInAnHour -\n\t\t\t\tdays * msInADay) /\n\t\t\t\tmsInASecond\n\t\t);\n\t\treturn {\n\t\t\tdays,\n\t\t\thours,\n\t\t\tminutes,\n\t\t\tseconds,\n\t\t};\n\t});\n\n\tonBeforeUnmount(() => clearInterval(timeoutID));\n\n\treturn {\n\t\t/** Elapsed milliseconds since starting the timer */\n\t\telapsed: computed(() => elapsed.value),\n\t\t/** Remaining milliseconds */\n\t\tremaining: computed(() => remaining.value),\n\t\t/** Remaining as a formatted object for display */\n\t\tremainingFormatted,\n\t\t/** Percentage of elapsed time against duration */\n\t\tprogress,\n\t\t/** Starts the timer */\n\t\tstart,\n\t\t/** Reset the timer to intiial state and starts again */\n\t\trestart,\n\t\t/** Pauses the timer */\n\t\tpause,\n\t\t/** Reset the timer to initial state, if the timer is running it is stopped */\n\t\treset,\n\t\t/** Boolean, is the timer running (paused doesn't change running state) */\n\t\trunning,\n\t\t/** Boolean is the timer paused */\n\t\tpaused,\n\t};\n};\n"],"names":["useCountdown","duration","onStart","onFinish","onStop","remaining","ref","elapsed","progress","computed","getAsPercentage","tick","running","paused","timeo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GAGVO,IAAqBX,EAAS,MAAM;AAMzC,UAAMY,IAAO,KAAK,MAAMhB,EAAU,QAAQ,KAAQ,GAC5CiB,IAAQ,KAAK,OAAOjB,EAAU,QAAQgB,IAAO,SAAY,IAAU,GACnEE,IAAU,KAAK;AAAA,OACnBlB,EAAU,QAAQiB,IAAQ,OAAaD,IAAO,SAAY;AAAA,IAAA,GAEtDG,IAAU,KAAK;AAAA,OACnBnB,EAAU,QACVkB,IAAU,MACVD,IAAQ,OACRD,IAAO,SACP;AAAA,IAAA;AAEK,WAAA;AAAA,MACN,MAAAA;AAAA,MACA,OAAAC;AAAA,MACA,SAAAC;AAAA,MACA,SAAAC;AAAA,IAAA;AAAA,EACD,CACA;AAEe,SAAAC,EAAA,MAAM,cAAcX,CAAS,CAAC,GAEvC;AAAA;AAAA,IAEN,SAASL,EAAS,MAAMF,EAAQ,KAAK;AAAA;AAAA,IAErC,WAAWE,EAAS,MAAMJ,EAAU,KAAK;AAAA;AAAA,IAEzC,oBAAAe;AAAA;AAAA,IAEA,UAAAZ;AAAA;AAAA,IAEA,OAAAO;AAAA;AAAA,IAEA,SAAAE;AAAA;AAAA,IAEA,OAAAE;AAAA;AAAA,IAEA,OAAAD;AAAA;AAAA,IAEA,SAAAN;AAAA;AAAA,IAEA,QAAAC;AAAA,EAAA;AAEF;"}
1
+ {"version":3,"file":"index6.js","sources":["../src/composables/useConfirm.ts"],"sourcesContent":["import { computed, reactive, ref, watch } from 'vue';\nimport { isNil } from '@/utilities/functions/isNil';\nimport type { Sizes } from '@/components/BaseDialog/BaseDialog.vue';\n\ntype State = {\n\tdescription: string;\n\ttheme: string;\n\tloading: boolean;\n\tnoText: string;\n\topen: boolean;\n\ttext: string;\n\ttitle: string;\n\tyesText: string;\n\tyes: boolean;\n\tno: boolean;\n\tactions: boolean;\n\tsize: keyof Sizes;\n};\n\ntype UserOptions = {\n\t/**\n\t * Boolean that sets whether to display or hide the buttons.\n\t * Confirms without actions can only be dismissed by clicking on the overlay or the close button.\n\t */\n\tactions?: State['actions'];\n\t/**\n\t * Description of the content of the modal for accessibility purposes.\n\t */\n\tdescription?: State['description'];\n\t/**\n\t * Boolean that defines whether to display or hide the \"No\" action.\n\t */\n\tno?: State['no'];\n\t/**\n\t * Text content of the \"No\" action.\n\t */\n\tnoText?: State['noText'];\n\t/**\n\t * Text content of the modal.\n\t */\n\ttext: State['text'];\n\t/**\n\t * The name of the theme it applies a css class to BbConfirm for styling.\n\t */\n\ttheme?: State['theme'];\n\t/**\n\t * Tittle of the modal\n\t */\n\ttitle: State['title'];\n\t/**\n\t * Boolean that defines whether to display or hide the \"Yes\" action.\n\t */\n\tyes?: State['yes'];\n\t/**\n\t * Text content of the \"Yes\" action.\n\t */\n\tyesText?: State['yesText'];\n\t/**\n\t * Size of the confirm modal. Use any sizes valid for `BbModal`.\n\t */\n\tsize?: State['size'];\n};\n\n// Stash all instances of current dialogs\nlet subscribers: ((...args: any[]) => any)[] = [];\n\nconst value = ref<boolean | null>(null);\n\nwatch(\n\t() => value.value,\n\t() => {\n\t\tif (typeof value.value === 'boolean') {\n\t\t\t// Every time a dialog is resolved resolve all dialogs\n\t\t\tsubscribers.forEach((fn) => fn());\n\t\t\tsubscribers = [];\n\t\t}\n\t}\n);\n\nconst defaultState: State = {\n\tactions: true,\n\tdescription: '',\n\tloading: false,\n\tno: true,\n\tnoText: '',\n\topen: false,\n\tsize: 'sm',\n\ttext: '',\n\ttheme: 'default',\n\ttitle: '',\n\tyes: true,\n\tyesText: '',\n};\nconst defaultOption: UserOptions = {\n\tactions: true,\n\tdescription: '',\n\tno: true,\n\tnoText: 'Annulla',\n\ttext: '',\n\ttheme: 'default',\n\ttitle: '',\n\tyes: true,\n\tyesText: 'OK',\n};\n\nexport const state = reactive<State>({\n\t...defaultState,\n});\n\nexport const actions = computed(() => [\n\t{\n\t\ttext: state.noText,\n\t\thandler: () => {\n\t\t\tvalue.value = false;\n\t\t},\n\t},\n\t{\n\t\ttext: state.yesText,\n\t\thandler: () => {\n\t\t\tvalue.value = true;\n\t\t},\n\t},\n]);\n\nexport const useConfirm = () => {\n\treturn {\n\t\t/**\n\t\t * The confirm function. It accepts a set of options defining\n\t\t * the behavior of the modal and returns `Promise<boolean>`\n\t\t * when the user accepts, declines, or ignores the modal.\n\t\t */\n\t\tconfirm: (options: UserOptions) => {\n\t\t\tvalue.value = null;\n\t\t\tconst newOptions = { ...defaultOption, ...options };\n\t\t\tconst newState = { ...defaultState };\n\t\t\tnewState.title = newOptions.title;\n\t\t\tnewState.text = newOptions.text;\n\t\t\tif (newOptions.description) newState.description = newOptions.description;\n\t\t\tif (newOptions.noText) newState.noText = newOptions.noText;\n\t\t\tif (newOptions.yesText) newState.yesText = newOptions.yesText;\n\t\t\tif (newOptions.size) newState.size = newOptions.size;\n\t\t\tif (newOptions.theme) newState.theme = newOptions.theme;\n\t\t\tif (!isNil(newOptions.yes)) newState.yes = !!newOptions.yes;\n\t\t\tif (!isNil(newOptions.no)) newState.no = !!newOptions.no;\n\t\t\tif (!isNil(newOptions.actions)) newState.actions = !!newOptions.actions;\n\n\t\t\tstate.actions = newState.actions;\n\t\t\tstate.description = newState.description;\n\t\t\tstate.no = newState.no;\n\t\t\tstate.noText = newState.noText;\n\t\t\tstate.open = true;\n\t\t\tstate.size = newState.size;\n\t\t\tstate.text = newState.text;\n\t\t\tstate.theme = newState.theme;\n\t\t\tstate.title = newState.title;\n\t\t\tstate.yes = newState.yes;\n\t\t\tstate.yesText = newState.yesText;\n\n\t\t\treturn new Promise<boolean>((resolve) => {\n\t\t\t\tsubscribers.push(() => resolve(value.value as boolean));\n\t\t\t});\n\t\t},\n\t\t/**\n\t\t * Sets the state of the confirm to loading and displays a spinner.\n\t\t */\n\t\tsetLoading: (value: boolean = true) => {\n\t\t\tstate.loading = value;\n\t\t},\n\t\t/**\n\t\t * Closes the confirmation modal. It is a manual operation\n\t\t * so you can update the state while the modal is still open.\n\t\t */\n\t\tclose: () => {\n\t\t\tstate.description = defaultState.description;\n\t\t\tstate.loading = defaultState.loading;\n\t\t\tstate.noText = defaultState.noText;\n\t\t\tstate.open = defaultState.open;\n\t\t\tstate.text = defaultState.text;\n\t\t\tstate.theme = defaultState.theme;\n\t\t\tstate.title = defaultState.title;\n\t\t\tstate.yesText = defaultState.yesText;\n\t\t\tvalue.value = false;\n\t\t\treturn Promise.resolve().then(() => {\n\t\t\t\tvalue.value = null;\n\t\t\t});\n\t\t},\n\t};\n};\n"],"names":["subscribers","value","ref","watch","fn","defaultState","defaultOption","state","reactive","actions","computed","useConfirm","options","newOptions","newState","isNil","resolve"],"mappings":";;AAgEA,IAAIA,IAA2C,CAAA;AAE/C,MAAMC,IAAQC,EAAoB,IAAI;AAEtCC;AAAA,EACC,MAAMF,EAAM;AAAA,EACZ,MAAM;AACD,IAAA,OAAOA,EAAM,SAAU,cAE1BD,EAAY,QAAQ,CAACI,MAAOA,EAAI,CAAA,GAChCJ,IAAc,CAAA;AAAA,EAEhB;AACD;AAEA,MAAMK,IAAsB;AAAA,EAC3B,SAAS;AAAA,EACT,aAAa;AAAA,EACb,SAAS;AAAA,EACT,IAAI;AAAA,EACJ,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,KAAK;AAAA,EACL,SAAS;AACV,GACMC,IAA6B;AAAA,EAClC,SAAS;AAAA,EACT,aAAa;AAAA,EACb,IAAI;AAAA,EACJ,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,OAAO;AAAA,EACP,OAAO;AAAA,EACP,KAAK;AAAA,EACL,SAAS;AACV,GAEaC,IAAQC,EAAgB;AAAA,EACpC,GAAGH;AACJ,CAAC,GAEYI,IAAUC,EAAS,MAAM;AAAA,EACrC;AAAA,IACC,MAAMH,EAAM;AAAA,IACZ,SAAS,MAAM;AACd,MAAAN,EAAM,QAAQ;AAAA,IACf;AAAA,EACD;AAAA,EACA;AAAA,IACC,MAAMM,EAAM;AAAA,IACZ,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;AAAA;AAAA,EAKA,OAAO,OACNM,EAAM,cAAcF,EAAa,aACjCE,EAAM,UAAUF,EAAa,SAC7BE,EAAM,SAASF,EAAa,QAC5BE,EAAM,OAAOF,EAAa,MAC1BE,EAAM,OAAOF,EAAa,MAC1BE,EAAM,QAAQF,EAAa,OAC3BE,EAAM,QAAQF,EAAa,OAC3BE,EAAM,UAAUF,EAAa,SAC7BJ,EAAM,QAAQ,IACP,QAAQ,UAAU,KAAK,MAAM;AACnC,IAAAA,EAAM,QAAQ;AAAA,EAAA,CACd;AACF;"}
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as f, ref as v, computed as y, openBlock as k, createBlock as w, withCtx as r, renderSlot as n, normalizeProps as B, guardReactiveProps as V, createVNode as g, mergeProps as i } from "vue";
2
- import P from "./index14.js";
2
+ import P from "./index15.js";
3
3
  /* empty css */
4
- import C from "./index24.js";
4
+ import C from "./index25.js";
5
5
  /* empty css */
6
6
  const M = /* @__PURE__ */ f({
7
7
  __name: "BbCheckbox",
@@ -98,4 +98,4 @@ const M = /* @__PURE__ */ f({
98
98
  export {
99
99
  M as default
100
100
  };
101
- //# sourceMappingURL=index60.js.map
101
+ //# sourceMappingURL=index61.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index60.js","sources":["../src/components/BbCheckbox/BbCheckbox.vue"],"sourcesContent":["<template>\n\t<BaseInputContainer\n\t\t:id=\"id\"\n\t\tclass=\"bb-checkbox\"\n\t\t:direction=\"direction\"\n\t\t:errors=\"errors\"\n\t\t:has-errors=\"hasErrors\"\n\t\t:hide-label=\"hideLabel\"\n\t\t:hint=\"hint\"\n\t\t:input-position=\"inputPosition\"\n\t\t:label=\"label\"\n\t\t:label-position=\"labelPosition\"\n\t\t:label-tag=\"'span'\"\n\t\t:name=\"name\"\n\t\t:reverse=\"reverse\"\n\t\t:show-hint=\"showHint\"\n\t\t:tag=\"'label'\"\n\t>\n\t\t<template #label=\"data\"><slot name=\"label\" v-bind=\"data\"></slot></template>\n\t\t<template #input=\"{ id, name, hasErrors, ariaDescribedby }\">\n\t\t\t<BaseCheckbox\n\t\t\t\t:id=\"id\"\n\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t:autofocus=\"autofocus\"\n\t\t\t\t:checked=\"checked\"\n\t\t\t\t:color=\"color\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:false-value=\"falseValue\"\n\t\t\t\t:has-errors=\"hasErrors\"\n\t\t\t\t:indeterminate=\"indeterminate\"\n\t\t\t\t:model-value=\"modelValue\"\n\t\t\t\t:name=\"name\"\n\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t:required=\"required\"\n\t\t\t\t:submit-when-false=\"submitWhenFalse\"\n\t\t\t\t:true-value=\"trueValue\"\n\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t\t><template #icon=\"data\"\n\t\t\t\t\t><slot name=\"icon\" v-bind=\"data\" :text=\"label\" /></template\n\t\t\t></BaseCheckbox>\n\t\t</template>\n\t</BaseInputContainer>\n</template>\n\n<script setup lang=\"ts\">\nimport BaseCheckbox from '../BaseCheckbox/BaseCheckbox.vue';\nimport BaseInputContainer from '../BaseInputContainer/BaseInputContainer.vue';\nimport type {\n\tBaseCheckboxEvents,\n\tSlotAttributes,\n} from '../BaseCheckbox/BaseCheckbox.vue';\nimport {\n\tref,\n\ttype HTMLAttributes,\n\ttype InputHTMLAttributes,\n\tcomputed,\n} from 'vue';\n\nexport type BbCheckboxProps = {\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Defines the input as checked\n\t */\n\tchecked?: boolean | 'true' | 'false';\n\n\t/**\n\t * Define a color for the component.\n\t *\n\t * Either a custom color or a coded color in common HEX, RGB, etc... format.\n\t */\n\tcolor?: string;\n\n\t/**\n\t * Direction of the layout of the component. Can either be a predefined value or a pattern separated by a space like `xx xxxxx`.\n\t */\n\tdirection?: 'horizontal' | 'vertical' | 'auto' | string;\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Can be a string or an array of string containing the messages to display.\n\t */\n\terrors?: string | string[];\n\n\t/**\n\t * Value of the input when unchecked. It handles any kind of serializable object.\n\t */\n\tfalseValue?: any;\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 * Visually hides the label of the input while maintaining accessibility.\n\t */\n\thideLabel?: boolean;\n\n\t/**\n\t * Text box to be displayed near the input, usually to indicate instructions.\n\t */\n\thint?: string;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Sets the input in an indeterminate state.\n\t */\n\tindeterminate?: InputHTMLAttributes['indeterminate'];\n\n\t/**\n\t * Sets the slignment of the input. Since inputs are inline block they can be aligned just as text can.\n\t */\n\tinputPosition?: 'left' | 'center' | 'right';\n\n\t/**\n\t * Text content of the label of the element.\n\t */\n\tlabel: string;\n\n\t/**\n\t * Sets the text alignment of the label.\n\t */\n\tlabelPosition?: 'left' | 'center' | 'right';\n\n\t/**\n\t * Used by v-model. Can be any serializable type.\n\t */\n\tmodelValue?: any;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * Keeps the hint displayed.\n\t */\n\tpersistentHint?: boolean;\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: InputHTMLAttributes['readonly'];\n\n\t/**\n\t * Sets the input as required.\n\t */\n\trequired?: boolean;\n\n\t/**\n\t * Reverses the layout. Applicable in every direction the order of the label and the input is swapped.\n\t */\n\treverse?: boolean;\n\n\t/**\n\t * Will submit \"falseValue\" if the input is not checked. Otherwise \"trueValue\" will be submitted.\n\t */\n\tsubmitWhenFalse?: boolean;\n\n\t/**\n\t * Value of the input when checked. It handles any kind of serializable object.\n\t */\n\ttrueValue?: any;\n};\n\nexport type BbCheckboxEvents = BaseCheckboxEvents;\n\nconst props = withDefaults(defineProps<BbCheckboxProps>(), {\n\tdirection: 'auto',\n\treverse: true,\n\tinputPosition: 'left',\n});\n\nconst emit = defineEmits<BbCheckboxEvents>();\n\ndefineSlots<{\n\tlabel?: (props: { text: string; hasErrors: boolean }) => any;\n\ticon?: (props: SlotAttributes & { text: string }) => any;\n}>();\n\nconst active = ref(false);\nconst showHint = computed(() => props.persistentHint || active.value);\n\nconst eventListeners = {\n\tonBlur: (event: FocusEvent) => {\n\t\tactive.value = false;\n\t\temit('blur', event);\n\t},\n\tonChange: (event: Event) => emit('change', event),\n\tonClick: (event: MouseEvent) => emit('click', event),\n\tonFocus: (event: FocusEvent) => {\n\t\tactive.value = true;\n\t\temit('focus', event);\n\t},\n\tonInput: (event: Event) => emit('input', event),\n\tonKeydown: (event: KeyboardEvent) => emit('keydown', event),\n\tonMousedown: (event: MouseEvent) => emit('mousedown', event),\n\tonMouseup: (event: MouseEvent) => emit('mouseup', event),\n\t'onUpdate:modelValue': (value: any) => emit('update:modelValue', value),\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbCheckbox';\n</style>\n"],"names":["props","__props","emit","__emit","active","ref","showHint","computed","eventListeners","event","value"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoLA,UAAMA,IAAQC,GAMRC,IAAOC,GAOPC,IAASC,EAAI,EAAK,GAClBC,IAAWC,EAAS,MAAMP,EAAM,kBAAkBI,EAAO,KAAK,GAE9DI,IAAiB;AAAA,MACtB,QAAQ,CAACC,MAAsB;AAC9B,QAAAL,EAAO,QAAQ,IACfF,EAAK,QAAQO,CAAK;AAAA,MACnB;AAAA,MACA,UAAU,CAACA,MAAiBP,EAAK,UAAUO,CAAK;AAAA,MAChD,SAAS,CAACA,MAAsBP,EAAK,SAASO,CAAK;AAAA,MACnD,SAAS,CAACA,MAAsB;AAC/B,QAAAL,EAAO,QAAQ,IACfF,EAAK,SAASO,CAAK;AAAA,MACpB;AAAA,MACA,SAAS,CAACA,MAAiBP,EAAK,SAASO,CAAK;AAAA,MAC9C,WAAW,CAACA,MAAyBP,EAAK,WAAWO,CAAK;AAAA,MAC1D,aAAa,CAACA,MAAsBP,EAAK,aAAaO,CAAK;AAAA,MAC3D,WAAW,CAACA,MAAsBP,EAAK,WAAWO,CAAK;AAAA,MACvD,uBAAuB,CAACC,MAAeR,EAAK,qBAAqBQ,CAAK;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index61.js","sources":["../src/components/BbCheckbox/BbCheckbox.vue"],"sourcesContent":["<template>\n\t<BaseInputContainer\n\t\t:id=\"id\"\n\t\tclass=\"bb-checkbox\"\n\t\t:direction=\"direction\"\n\t\t:errors=\"errors\"\n\t\t:has-errors=\"hasErrors\"\n\t\t:hide-label=\"hideLabel\"\n\t\t:hint=\"hint\"\n\t\t:input-position=\"inputPosition\"\n\t\t:label=\"label\"\n\t\t:label-position=\"labelPosition\"\n\t\t:label-tag=\"'span'\"\n\t\t:name=\"name\"\n\t\t:reverse=\"reverse\"\n\t\t:show-hint=\"showHint\"\n\t\t:tag=\"'label'\"\n\t>\n\t\t<template #label=\"data\"><slot name=\"label\" v-bind=\"data\"></slot></template>\n\t\t<template #input=\"{ id, name, hasErrors, ariaDescribedby }\">\n\t\t\t<BaseCheckbox\n\t\t\t\t:id=\"id\"\n\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t:autofocus=\"autofocus\"\n\t\t\t\t:checked=\"checked\"\n\t\t\t\t:color=\"color\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:false-value=\"falseValue\"\n\t\t\t\t:has-errors=\"hasErrors\"\n\t\t\t\t:indeterminate=\"indeterminate\"\n\t\t\t\t:model-value=\"modelValue\"\n\t\t\t\t:name=\"name\"\n\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t:required=\"required\"\n\t\t\t\t:submit-when-false=\"submitWhenFalse\"\n\t\t\t\t:true-value=\"trueValue\"\n\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t\t><template #icon=\"data\"\n\t\t\t\t\t><slot name=\"icon\" v-bind=\"data\" :text=\"label\" /></template\n\t\t\t></BaseCheckbox>\n\t\t</template>\n\t</BaseInputContainer>\n</template>\n\n<script setup lang=\"ts\">\nimport BaseCheckbox from '../BaseCheckbox/BaseCheckbox.vue';\nimport BaseInputContainer from '../BaseInputContainer/BaseInputContainer.vue';\nimport type {\n\tBaseCheckboxEvents,\n\tSlotAttributes,\n} from '../BaseCheckbox/BaseCheckbox.vue';\nimport {\n\tref,\n\ttype HTMLAttributes,\n\ttype InputHTMLAttributes,\n\tcomputed,\n} from 'vue';\n\nexport type BbCheckboxProps = {\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Defines the input as checked\n\t */\n\tchecked?: boolean | 'true' | 'false';\n\n\t/**\n\t * Define a color for the component.\n\t *\n\t * Either a custom color or a coded color in common HEX, RGB, etc... format.\n\t */\n\tcolor?: string;\n\n\t/**\n\t * Direction of the layout of the component. Can either be a predefined value or a pattern separated by a space like `xx xxxxx`.\n\t */\n\tdirection?: 'horizontal' | 'vertical' | 'auto' | string;\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Can be a string or an array of string containing the messages to display.\n\t */\n\terrors?: string | string[];\n\n\t/**\n\t * Value of the input when unchecked. It handles any kind of serializable object.\n\t */\n\tfalseValue?: any;\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 * Visually hides the label of the input while maintaining accessibility.\n\t */\n\thideLabel?: boolean;\n\n\t/**\n\t * Text box to be displayed near the input, usually to indicate instructions.\n\t */\n\thint?: string;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Sets the input in an indeterminate state.\n\t */\n\tindeterminate?: InputHTMLAttributes['indeterminate'];\n\n\t/**\n\t * Sets the slignment of the input. Since inputs are inline block they can be aligned just as text can.\n\t */\n\tinputPosition?: 'left' | 'center' | 'right';\n\n\t/**\n\t * Text content of the label of the element.\n\t */\n\tlabel: string;\n\n\t/**\n\t * Sets the text alignment of the label.\n\t */\n\tlabelPosition?: 'left' | 'center' | 'right';\n\n\t/**\n\t * Used by v-model. Can be any serializable type.\n\t */\n\tmodelValue?: any;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * Keeps the hint displayed.\n\t */\n\tpersistentHint?: boolean;\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: InputHTMLAttributes['readonly'];\n\n\t/**\n\t * Sets the input as required.\n\t */\n\trequired?: boolean;\n\n\t/**\n\t * Reverses the layout. Applicable in every direction the order of the label and the input is swapped.\n\t */\n\treverse?: boolean;\n\n\t/**\n\t * Will submit \"falseValue\" if the input is not checked. Otherwise \"trueValue\" will be submitted.\n\t */\n\tsubmitWhenFalse?: boolean;\n\n\t/**\n\t * Value of the input when checked. It handles any kind of serializable object.\n\t */\n\ttrueValue?: any;\n};\n\nexport type BbCheckboxEvents = BaseCheckboxEvents;\n\nconst props = withDefaults(defineProps<BbCheckboxProps>(), {\n\tdirection: 'auto',\n\treverse: true,\n\tinputPosition: 'left',\n});\n\nconst emit = defineEmits<BbCheckboxEvents>();\n\ndefineSlots<{\n\tlabel?: (props: { text: string; hasErrors: boolean }) => any;\n\ticon?: (props: SlotAttributes & { text: string }) => any;\n}>();\n\nconst active = ref(false);\nconst showHint = computed(() => props.persistentHint || active.value);\n\nconst eventListeners = {\n\tonBlur: (event: FocusEvent) => {\n\t\tactive.value = false;\n\t\temit('blur', event);\n\t},\n\tonChange: (event: Event) => emit('change', event),\n\tonClick: (event: MouseEvent) => emit('click', event),\n\tonFocus: (event: FocusEvent) => {\n\t\tactive.value = true;\n\t\temit('focus', event);\n\t},\n\tonInput: (event: Event) => emit('input', event),\n\tonKeydown: (event: KeyboardEvent) => emit('keydown', event),\n\tonMousedown: (event: MouseEvent) => emit('mousedown', event),\n\tonMouseup: (event: MouseEvent) => emit('mouseup', event),\n\t'onUpdate:modelValue': (value: any) => emit('update:modelValue', value),\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbCheckbox';\n</style>\n"],"names":["props","__props","emit","__emit","active","ref","showHint","computed","eventListeners","event","value"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoLA,UAAMA,IAAQC,GAMRC,IAAOC,GAOPC,IAASC,EAAI,EAAK,GAClBC,IAAWC,EAAS,MAAMP,EAAM,kBAAkBI,EAAO,KAAK,GAE9DI,IAAiB;AAAA,MACtB,QAAQ,CAACC,MAAsB;AAC9B,QAAAL,EAAO,QAAQ,IACfF,EAAK,QAAQO,CAAK;AAAA,MACnB;AAAA,MACA,UAAU,CAACA,MAAiBP,EAAK,UAAUO,CAAK;AAAA,MAChD,SAAS,CAACA,MAAsBP,EAAK,SAASO,CAAK;AAAA,MACnD,SAAS,CAACA,MAAsB;AAC/B,QAAAL,EAAO,QAAQ,IACfF,EAAK,SAASO,CAAK;AAAA,MACpB;AAAA,MACA,SAAS,CAACA,MAAiBP,EAAK,SAASO,CAAK;AAAA,MAC9C,WAAW,CAACA,MAAyBP,EAAK,WAAWO,CAAK;AAAA,MAC1D,aAAa,CAACA,MAAsBP,EAAK,aAAaO,CAAK;AAAA,MAC3D,WAAW,CAACA,MAAsBP,EAAK,WAAWO,CAAK;AAAA,MACvD,uBAAuB,CAACC,MAAeR,EAAK,qBAAqBQ,CAAK;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as v, ref as g, computed as y, openBlock as B, createBlock as $, withCtx as a, renderSlot as i, normalizeProps as l, guardReactiveProps as r, createVNode as w, mergeProps as T } from "vue";
2
- import V from "./index16.js";
2
+ import V from "./index17.js";
3
3
  /* empty css */
4
- import k from "./index24.js";
4
+ import k from "./index25.js";
5
5
  /* empty css */
6
6
  const I = /* @__PURE__ */ v({
7
7
  __name: "BbCheckboxGroup",
@@ -125,4 +125,4 @@ const I = /* @__PURE__ */ v({
125
125
  export {
126
126
  I as default
127
127
  };
128
- //# sourceMappingURL=index62.js.map
128
+ //# sourceMappingURL=index63.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index62.js","sources":["../src/components/BbCheckboxGroup/BbCheckboxGroup.vue"],"sourcesContent":["<template>\n\t<BaseInputContainer\n\t\t:id=\"id\"\n\t\tclass=\"bb-checkbox-group\"\n\t\t:direction=\"'vertical'\"\n\t\t:errors=\"errors\"\n\t\t:has-errors=\"hasErrors\"\n\t\t:hide-label=\"hideLegend\"\n\t\t:hint=\"hint\"\n\t\t:label=\"legend\"\n\t\t:label-tag=\"'legend'\"\n\t\t:name=\"name\"\n\t\t:reverse=\"reverse\"\n\t\t:show-hint=\"showHint\"\n\t\t:tag=\"'fieldset'\"\n\t>\n\t\t<template #label=\"data\"><slot name=\"legend\" v-bind=\"data\"></slot></template>\n\t\t<template #input=\"{ id, name, hasErrors, ariaDescribedby }\">\n\t\t\t<BaseCheckboxGroup\n\t\t\t\t:id=\"id\"\n\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t:autofocus=\"autofocus\"\n\t\t\t\t:color=\"color\"\n\t\t\t\t:dependencies=\"dependencies\"\n\t\t\t\t:deps-debounce-time=\"depsDebounceTime\"\n\t\t\t\t:direction=\"inputDirection\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:enforce-coherence=\"enforceCoherence\"\n\t\t\t\t:has-errors=\"hasErrors\"\n\t\t\t\t:hide-label=\"hideLabel\"\n\t\t\t\t:item-text=\"<any>itemText\"\n\t\t\t\t:item-value=\"<any>itemValue\"\n\t\t\t\t:items=\"items\"\n\t\t\t\t:loading-text=\"loadingText\"\n\t\t\t\t:model-value=\"modelValue\"\n\t\t\t\t:model-value-debounce-time=\"modelValueDebounceTime\"\n\t\t\t\t:name=\"name\"\n\t\t\t\t:no-data-text=\"noDataText\"\n\t\t\t\t:readonly=\"readonly\"\n\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t>\n\t\t\t\t<template #prepend=\"data\"\n\t\t\t\t\t><slot name=\"prepend\" v-bind=\"data\"></slot></template\n\t\t\t\t><template #loading=\"data\"\n\t\t\t\t\t><slot name=\"loading\" v-bind=\"data\"></slot></template\n\t\t\t\t><template #no-data=\"data\"\n\t\t\t\t\t><slot name=\"no-data\" v-bind=\"data\"></slot></template\n\t\t\t\t><template #option:prepend=\"data\"\n\t\t\t\t\t><slot name=\"option:prepend\" v-bind=\"data\"></slot></template\n\t\t\t\t><template #icon=\"data\"\n\t\t\t\t\t><slot name=\"icon\" v-bind=\"data\"></slot></template\n\t\t\t\t><template #label=\"data\"\n\t\t\t\t\t><slot name=\"label\" v-bind=\"data\"></slot></template\n\t\t\t\t><template #option:append=\"data\"\n\t\t\t\t\t><slot name=\"option:append\" v-bind=\"data\"></slot></template\n\t\t\t\t><template #append=\"data\"\n\t\t\t\t\t><slot name=\"append\" v-bind=\"data\"></slot\n\t\t\t\t></template>\n\t\t\t</BaseCheckboxGroup>\n\t\t</template>\n\t</BaseInputContainer>\n</template>\n\n<script setup lang=\"ts\" generic=\"T = any\">\nimport BaseCheckboxGroup from '../BaseCheckboxGroup/BaseCheckboxGroup.vue';\nimport BaseInputContainer from '../BaseInputContainer/BaseInputContainer.vue';\nimport type { BaseCheckboxGroupEvents } from '../BaseCheckboxGroup/BaseCheckboxGroup.vue';\nimport {\n\tref,\n\ttype HTMLAttributes,\n\ttype InputHTMLAttributes,\n\tcomputed,\n} from 'vue';\nimport type { NestedKeyOf } from '@/types/NestedKeyOf';\nimport type { SlotAttributes } from '../BaseCheckbox/BaseCheckbox.vue';\n\nexport type BbCheckboxGroupProps<T> = {\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Define a color for the component.\n\t *\n\t * Either a custom color or a coded color in common HEX, RGB, etc... format.\n\t */\n\tcolor?: string;\n\n\t/**\n\t * Defines an array of dependencies that will trigger actions in the component upon change.\n\t */\n\tdependencies?: any[];\n\n\t/**\n\t * Timeout used to debounce response to changes to dependencies.\n\t */\n\tdepsDebounceTime?: number;\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * If coherence is enforce the input cannot have a modelValue the is incoherent with its current items.\n\t *\n\t * e.g. You cannot set v-model to a user that is not present in the items passed.\n\t *\n\t * modelValue will be reset upon incoherence.\n\t */\n\tenforceCoherence?: boolean;\n\n\t/**\n\t * Can be a string or an array of string containing the messages to display.\n\t */\n\terrors?: string | string[];\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 * Visually hides the label of the input while maintaining accessibility.\n\t */\n\thideLabel?: boolean;\n\n\t/**\n\t * Visually hides the legend of the fieldset while maintaining accessibility.\n\t */\n\thideLegend?: boolean;\n\n\t/**\n\t * Text box to be displayed near the input, usually to indicate instructions.\n\t */\n\thint?: string;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Defines the direction of the inputs in the fieldset\n\t */\n\tinputDirection?: 'horizontal' | 'vertical';\n\n\t/**\n\t * Used to retrieve items can be an array or a function.\n\t */\n\titems:\n\t\t| T[]\n\t\t| ((prefill: boolean, modelValue?: any[]) => Promise<T[]>)\n\t\t| ((prefill: boolean, modelValue?: any[]) => T[]);\n\n\t/**\n\t * Defines a path that returns a property of the object to use as text or a function that returns a string\n\t */\n\titemText?: T extends object\n\t\t? NestedKeyOf<T> | ((item: T) => string)\n\t\t: ((item: T) => string) | undefined;\n\n\t/**\n\t * Defines a path that returns a property of the object to use as value or a function that returns any value\n\t */\n\titemValue?: T extends object\n\t\t? NestedKeyOf<T> | ((item: T) => string)\n\t\t: ((item: T) => any) | undefined;\n\n\t/**\n\t * Text content of the legend.\n\t */\n\tlegend: string;\n\n\t/**\n\t * String displayed while items are being loaded.\n\t */\n\tloadingText?: string;\n\n\t/**\n\t * Used by v-model. Can be an array of any serializable type.\n\t */\n\tmodelValue: any[];\n\n\t/**\n\t * Timeout used to debounce response to changes to modelValue.\n\t */\n\tmodelValueDebounceTime?: number;\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 are no items to display.\n\t */\n\tnoDataText?: string;\n\n\t/**\n\t * Keeps the hint displayed.\n\t */\n\tpersistentHint?: boolean;\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: InputHTMLAttributes['readonly'];\n\n\t/**\n\t * Reverses the layout. Applicable in every direction the order of the label and the input is swapped.\n\t */\n\treverse?: boolean;\n};\n\nexport type BbCheckboxGroupEvents = BaseCheckboxGroupEvents;\n\nconst props = withDefaults(defineProps<BbCheckboxGroupProps<T>>(), {});\n\nconst emit = defineEmits<BbCheckboxGroupEvents>();\n\ndefineSlots<{\n\tprepend?: (props: object) => any;\n\tloading?: (props: object) => any;\n\t'no-data'?: (props: object) => any;\n\t'option:prepend'?: (props: {\n\t\tchecked: boolean;\n\t\tdisabled: boolean;\n\t\tid?: string;\n\t\titem: T;\n\t\ttext: string;\n\t}) => any;\n\ticon?: (\n\t\tprops: SlotAttributes & {\n\t\t\titem: T;\n\t\t\ttext: string;\n\t\t}\n\t) => any;\n\tlabel?: (props: { item: T; text: string; checked: boolean }) => any;\n\t'option:append'?: (props: {\n\t\tchecked: boolean;\n\t\tdisabled: boolean;\n\t\tid?: string;\n\t\titem: T;\n\t\ttext: string;\n\t}) => any;\n\tappend?: (props: object) => any;\n\tlegend?: (props: { text: string; hasErrors: boolean }) => any;\n}>();\n\nconst active = ref(false);\nconst showHint = computed(() => props.persistentHint || active.value);\n\nconst eventListeners = {\n\tonBlur: (event: FocusEvent) => emit('blur', event),\n\tonChange: (event: Event) => emit('change', event),\n\tonClick: (event: MouseEvent) => emit('click', event),\n\tonFocus: (event: FocusEvent) => {\n\t\tactive.value = true;\n\t\temit('focus', event);\n\t},\n\tonInactive: () => {\n\t\tactive.value = false;\n\t\temit('inactive');\n\t},\n\tonInput: (event: Event) => emit('input', event),\n\tonKeydown: (event: KeyboardEvent) => emit('keydown', event),\n\tonMousedown: (event: MouseEvent) => emit('mousedown', event),\n\tonMouseup: (event: MouseEvent) => emit('mouseup', event),\n\t'onUpdate:modelValue': (event: any) => emit('update:modelValue', event),\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbCheckboxGroup';\n</style>\n"],"names":["props","__props","emit","__emit","active","ref","showHint","computed","eventListeners","event"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2NA,UAAMA,IAAQC,GAERC,IAAOC,GA+BPC,IAASC,EAAI,EAAK,GAClBC,IAAWC,EAAS,MAAMP,EAAM,kBAAkBI,EAAO,KAAK,GAE9DI,IAAiB;AAAA,MACtB,QAAQ,CAACC,MAAsBP,EAAK,QAAQO,CAAK;AAAA,MACjD,UAAU,CAACA,MAAiBP,EAAK,UAAUO,CAAK;AAAA,MAChD,SAAS,CAACA,MAAsBP,EAAK,SAASO,CAAK;AAAA,MACnD,SAAS,CAACA,MAAsB;AAC/B,QAAAL,EAAO,QAAQ,IACfF,EAAK,SAASO,CAAK;AAAA,MACpB;AAAA,MACA,YAAY,MAAM;AACjB,QAAAL,EAAO,QAAQ,IACfF,EAAK,UAAU;AAAA,MAChB;AAAA,MACA,SAAS,CAACO,MAAiBP,EAAK,SAASO,CAAK;AAAA,MAC9C,WAAW,CAACA,MAAyBP,EAAK,WAAWO,CAAK;AAAA,MAC1D,aAAa,CAACA,MAAsBP,EAAK,aAAaO,CAAK;AAAA,MAC3D,WAAW,CAACA,MAAsBP,EAAK,WAAWO,CAAK;AAAA,MACvD,uBAAuB,CAACA,MAAeP,EAAK,qBAAqBO,CAAK;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index63.js","sources":["../src/components/BbCheckboxGroup/BbCheckboxGroup.vue"],"sourcesContent":["<template>\n\t<BaseInputContainer\n\t\t:id=\"id\"\n\t\tclass=\"bb-checkbox-group\"\n\t\t:direction=\"'vertical'\"\n\t\t:errors=\"errors\"\n\t\t:has-errors=\"hasErrors\"\n\t\t:hide-label=\"hideLegend\"\n\t\t:hint=\"hint\"\n\t\t:label=\"legend\"\n\t\t:label-tag=\"'legend'\"\n\t\t:name=\"name\"\n\t\t:reverse=\"reverse\"\n\t\t:show-hint=\"showHint\"\n\t\t:tag=\"'fieldset'\"\n\t>\n\t\t<template #label=\"data\"><slot name=\"legend\" v-bind=\"data\"></slot></template>\n\t\t<template #input=\"{ id, name, hasErrors, ariaDescribedby }\">\n\t\t\t<BaseCheckboxGroup\n\t\t\t\t:id=\"id\"\n\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t:autofocus=\"autofocus\"\n\t\t\t\t:color=\"color\"\n\t\t\t\t:dependencies=\"dependencies\"\n\t\t\t\t:deps-debounce-time=\"depsDebounceTime\"\n\t\t\t\t:direction=\"inputDirection\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:enforce-coherence=\"enforceCoherence\"\n\t\t\t\t:has-errors=\"hasErrors\"\n\t\t\t\t:hide-label=\"hideLabel\"\n\t\t\t\t:item-text=\"<any>itemText\"\n\t\t\t\t:item-value=\"<any>itemValue\"\n\t\t\t\t:items=\"items\"\n\t\t\t\t:loading-text=\"loadingText\"\n\t\t\t\t:model-value=\"modelValue\"\n\t\t\t\t:model-value-debounce-time=\"modelValueDebounceTime\"\n\t\t\t\t:name=\"name\"\n\t\t\t\t:no-data-text=\"noDataText\"\n\t\t\t\t:readonly=\"readonly\"\n\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t>\n\t\t\t\t<template #prepend=\"data\"\n\t\t\t\t\t><slot name=\"prepend\" v-bind=\"data\"></slot></template\n\t\t\t\t><template #loading=\"data\"\n\t\t\t\t\t><slot name=\"loading\" v-bind=\"data\"></slot></template\n\t\t\t\t><template #no-data=\"data\"\n\t\t\t\t\t><slot name=\"no-data\" v-bind=\"data\"></slot></template\n\t\t\t\t><template #option:prepend=\"data\"\n\t\t\t\t\t><slot name=\"option:prepend\" v-bind=\"data\"></slot></template\n\t\t\t\t><template #icon=\"data\"\n\t\t\t\t\t><slot name=\"icon\" v-bind=\"data\"></slot></template\n\t\t\t\t><template #label=\"data\"\n\t\t\t\t\t><slot name=\"label\" v-bind=\"data\"></slot></template\n\t\t\t\t><template #option:append=\"data\"\n\t\t\t\t\t><slot name=\"option:append\" v-bind=\"data\"></slot></template\n\t\t\t\t><template #append=\"data\"\n\t\t\t\t\t><slot name=\"append\" v-bind=\"data\"></slot\n\t\t\t\t></template>\n\t\t\t</BaseCheckboxGroup>\n\t\t</template>\n\t</BaseInputContainer>\n</template>\n\n<script setup lang=\"ts\" generic=\"T = any\">\nimport BaseCheckboxGroup from '../BaseCheckboxGroup/BaseCheckboxGroup.vue';\nimport BaseInputContainer from '../BaseInputContainer/BaseInputContainer.vue';\nimport type { BaseCheckboxGroupEvents } from '../BaseCheckboxGroup/BaseCheckboxGroup.vue';\nimport {\n\tref,\n\ttype HTMLAttributes,\n\ttype InputHTMLAttributes,\n\tcomputed,\n} from 'vue';\nimport type { NestedKeyOf } from '@/types/NestedKeyOf';\nimport type { SlotAttributes } from '../BaseCheckbox/BaseCheckbox.vue';\n\nexport type BbCheckboxGroupProps<T> = {\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Define a color for the component.\n\t *\n\t * Either a custom color or a coded color in common HEX, RGB, etc... format.\n\t */\n\tcolor?: string;\n\n\t/**\n\t * Defines an array of dependencies that will trigger actions in the component upon change.\n\t */\n\tdependencies?: any[];\n\n\t/**\n\t * Timeout used to debounce response to changes to dependencies.\n\t */\n\tdepsDebounceTime?: number;\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * If coherence is enforce the input cannot have a modelValue the is incoherent with its current items.\n\t *\n\t * e.g. You cannot set v-model to a user that is not present in the items passed.\n\t *\n\t * modelValue will be reset upon incoherence.\n\t */\n\tenforceCoherence?: boolean;\n\n\t/**\n\t * Can be a string or an array of string containing the messages to display.\n\t */\n\terrors?: string | string[];\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 * Visually hides the label of the input while maintaining accessibility.\n\t */\n\thideLabel?: boolean;\n\n\t/**\n\t * Visually hides the legend of the fieldset while maintaining accessibility.\n\t */\n\thideLegend?: boolean;\n\n\t/**\n\t * Text box to be displayed near the input, usually to indicate instructions.\n\t */\n\thint?: string;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Defines the direction of the inputs in the fieldset\n\t */\n\tinputDirection?: 'horizontal' | 'vertical';\n\n\t/**\n\t * Used to retrieve items can be an array or a function.\n\t */\n\titems:\n\t\t| T[]\n\t\t| ((prefill: boolean, modelValue?: any[]) => Promise<T[]>)\n\t\t| ((prefill: boolean, modelValue?: any[]) => T[]);\n\n\t/**\n\t * Defines a path that returns a property of the object to use as text or a function that returns a string\n\t */\n\titemText?: T extends object\n\t\t? NestedKeyOf<T> | ((item: T) => string)\n\t\t: ((item: T) => string) | undefined;\n\n\t/**\n\t * Defines a path that returns a property of the object to use as value or a function that returns any value\n\t */\n\titemValue?: T extends object\n\t\t? NestedKeyOf<T> | ((item: T) => string)\n\t\t: ((item: T) => any) | undefined;\n\n\t/**\n\t * Text content of the legend.\n\t */\n\tlegend: string;\n\n\t/**\n\t * String displayed while items are being loaded.\n\t */\n\tloadingText?: string;\n\n\t/**\n\t * Used by v-model. Can be an array of any serializable type.\n\t */\n\tmodelValue: any[];\n\n\t/**\n\t * Timeout used to debounce response to changes to modelValue.\n\t */\n\tmodelValueDebounceTime?: number;\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 are no items to display.\n\t */\n\tnoDataText?: string;\n\n\t/**\n\t * Keeps the hint displayed.\n\t */\n\tpersistentHint?: boolean;\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: InputHTMLAttributes['readonly'];\n\n\t/**\n\t * Reverses the layout. Applicable in every direction the order of the label and the input is swapped.\n\t */\n\treverse?: boolean;\n};\n\nexport type BbCheckboxGroupEvents = BaseCheckboxGroupEvents;\n\nconst props = withDefaults(defineProps<BbCheckboxGroupProps<T>>(), {});\n\nconst emit = defineEmits<BbCheckboxGroupEvents>();\n\ndefineSlots<{\n\tprepend?: (props: object) => any;\n\tloading?: (props: object) => any;\n\t'no-data'?: (props: object) => any;\n\t'option:prepend'?: (props: {\n\t\tchecked: boolean;\n\t\tdisabled: boolean;\n\t\tid?: string;\n\t\titem: T;\n\t\ttext: string;\n\t}) => any;\n\ticon?: (\n\t\tprops: SlotAttributes & {\n\t\t\titem: T;\n\t\t\ttext: string;\n\t\t}\n\t) => any;\n\tlabel?: (props: { item: T; text: string; checked: boolean }) => any;\n\t'option:append'?: (props: {\n\t\tchecked: boolean;\n\t\tdisabled: boolean;\n\t\tid?: string;\n\t\titem: T;\n\t\ttext: string;\n\t}) => any;\n\tappend?: (props: object) => any;\n\tlegend?: (props: { text: string; hasErrors: boolean }) => any;\n}>();\n\nconst active = ref(false);\nconst showHint = computed(() => props.persistentHint || active.value);\n\nconst eventListeners = {\n\tonBlur: (event: FocusEvent) => emit('blur', event),\n\tonChange: (event: Event) => emit('change', event),\n\tonClick: (event: MouseEvent) => emit('click', event),\n\tonFocus: (event: FocusEvent) => {\n\t\tactive.value = true;\n\t\temit('focus', event);\n\t},\n\tonInactive: () => {\n\t\tactive.value = false;\n\t\temit('inactive');\n\t},\n\tonInput: (event: Event) => emit('input', event),\n\tonKeydown: (event: KeyboardEvent) => emit('keydown', event),\n\tonMousedown: (event: MouseEvent) => emit('mousedown', event),\n\tonMouseup: (event: MouseEvent) => emit('mouseup', event),\n\t'onUpdate:modelValue': (event: any) => emit('update:modelValue', event),\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbCheckboxGroup';\n</style>\n"],"names":["props","__props","emit","__emit","active","ref","showHint","computed","eventListeners","event"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2NA,UAAMA,IAAQC,GAERC,IAAOC,GA+BPC,IAASC,EAAI,EAAK,GAClBC,IAAWC,EAAS,MAAMP,EAAM,kBAAkBI,EAAO,KAAK,GAE9DI,IAAiB;AAAA,MACtB,QAAQ,CAACC,MAAsBP,EAAK,QAAQO,CAAK;AAAA,MACjD,UAAU,CAACA,MAAiBP,EAAK,UAAUO,CAAK;AAAA,MAChD,SAAS,CAACA,MAAsBP,EAAK,SAASO,CAAK;AAAA,MACnD,SAAS,CAACA,MAAsB;AAC/B,QAAAL,EAAO,QAAQ,IACfF,EAAK,SAASO,CAAK;AAAA,MACpB;AAAA,MACA,YAAY,MAAM;AACjB,QAAAL,EAAO,QAAQ,IACfF,EAAK,UAAU;AAAA,MAChB;AAAA,MACA,SAAS,CAACO,MAAiBP,EAAK,SAASO,CAAK;AAAA,MAC9C,WAAW,CAACA,MAAyBP,EAAK,WAAWO,CAAK;AAAA,MAC1D,aAAa,CAACA,MAAsBP,EAAK,aAAaO,CAAK;AAAA,MAC3D,WAAW,CAACA,MAAsBP,EAAK,WAAWO,CAAK;AAAA,MACvD,uBAAuB,CAACA,MAAeP,EAAK,qBAAqBO,CAAK;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,10 +1,10 @@
1
1
  import { defineComponent as k, computed as _, openBlock as n, createBlock as l, unref as e, createSlots as h, withCtx as s, createElementBlock as f, toDisplayString as c, createCommentVNode as m, renderSlot as d, createElementVNode as g, createVNode as C, renderList as $, normalizeProps as x, guardReactiveProps as V, mergeProps as z, createTextVNode as u } from "vue";
2
- import { actions as p, state as o } from "./index5.js";
3
- import v from "./index12.js";
2
+ import { actions as p, state as o } from "./index6.js";
3
+ import v from "./index13.js";
4
4
  /* empty css */
5
- import A from "./index22.js";
5
+ import A from "./index23.js";
6
6
  /* empty css */
7
- import B from "./index123.js";
7
+ import B from "./index124.js";
8
8
  /* empty css */
9
9
  const N = {
10
10
  key: 0,
@@ -83,4 +83,4 @@ const N = {
83
83
  export {
84
84
  F as default
85
85
  };
86
- //# sourceMappingURL=index64.js.map
86
+ //# sourceMappingURL=index65.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index64.js","sources":["../src/components/BbConfirm/BbConfirm.vue"],"sourcesContent":["<template>\n\t<BaseDialog\n\t\t:model-value=\"state.open || state.loading\"\n\t\t:overlay-classes=\"['bb-confirm', `bb-confirm--${state.theme}`]\"\n\t\t:size=\"state.size\"\n\t\t:title=\"state.title\"\n\t\t@update:model-value=\"onModelValueUpdate\"\n\t>\n\t\t<!-- Transparently pass all slots that are not customized -->\n\t\t<template\n\t\t\tv-for=\"name in ['header', 'title', 'close', 'description']\"\n\t\t\t#[name]=\"data\"\n\t\t>\n\t\t\t<slot :name=\"name\" v-bind=\"data\"> </slot>\n\t\t</template>\n\t\t<div v-if=\"!state.loading\" class=\"bb-confirm__content\">\n\t\t\t<div v-if=\"state.text\" class=\"bb-confirm__text\">{{ state.text }}</div>\n\t\t</div>\n\t\t<slot v-else name=\"spinner\">\n\t\t\t<div class=\"bb-confirm__spinner\">\n\t\t\t\t<BbSpinner size=\"36\" />\n\t\t\t</div>\n\t\t</slot>\n\t\t<template v-if=\"!state.loading && state.actions\" #footer=\"data\">\n\t\t\t<slot\n\t\t\t\t:actions=\"state.actions\"\n\t\t\t\t:loading=\"state.loading\"\n\t\t\t\tname=\"footer\"\n\t\t\t\t:no=\"state.no\"\n\t\t\t\t:no-action=\"noAction\"\n\t\t\t\t:yes=\"state.yes\"\n\t\t\t\t:yes-action=\"yesAction\"\n\t\t\t\tv-bind=\"data\"\n\t\t\t>\n\t\t\t\t<BaseButton\n\t\t\t\t\tv-if=\"state.no\"\n\t\t\t\t\tclass=\"bb-confirm__no\"\n\t\t\t\t\t@click=\"noAction.handler\"\n\t\t\t\t>\n\t\t\t\t\t{{ noAction.text }}\n\t\t\t\t</BaseButton>\n\n\t\t\t\t<BaseButton\n\t\t\t\t\tv-if=\"state.yes\"\n\t\t\t\t\tclass=\"bb-confirm__yes\"\n\t\t\t\t\t@click=\"yesAction.handler\"\n\t\t\t\t>\n\t\t\t\t\t{{ yesAction.text }}\n\t\t\t\t</BaseButton>\n\t\t\t</slot>\n\t\t</template>\n\t</BaseDialog>\n</template>\n\n<script setup lang=\"ts\">\nimport { actions, state } from '@/composables/useConfirm';\nimport { computed } from 'vue';\nimport BaseButton from '../BaseButton/BaseButton.vue';\nimport BaseDialog from '../BaseDialog/BaseDialog.vue';\nimport BbSpinner from '../BbSpinner/BbSpinner.vue';\n\nconst noAction = computed(() => actions.value[0]);\nconst yesAction = computed(() => actions.value[1]);\nconst onModelValueUpdate = (value: boolean) => {\n\tif (value) yesAction.value.handler();\n\telse noAction.value.handler();\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbConfirm';\n</style>\n"],"names":["noAction","computed","actions","yesAction","onModelValueUpdate","value"],"mappings":";;;;;;;;;;;;;;;;;AA6DA,UAAMA,IAAWC,EAAS,MAAMC,EAAQ,MAAM,CAAC,CAAC,GAC1CC,IAAYF,EAAS,MAAMC,EAAQ,MAAM,CAAC,CAAC,GAC3CE,IAAqB,CAACC,MAAmB;AAC1C,MAAAA,IAAiBF,EAAA,MAAM,QAAQ,IAC9BH,EAAS,MAAM;IAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index65.js","sources":["../src/components/BbConfirm/BbConfirm.vue"],"sourcesContent":["<template>\n\t<BaseDialog\n\t\t:model-value=\"state.open || state.loading\"\n\t\t:overlay-classes=\"['bb-confirm', `bb-confirm--${state.theme}`]\"\n\t\t:size=\"state.size\"\n\t\t:title=\"state.title\"\n\t\t@update:model-value=\"onModelValueUpdate\"\n\t>\n\t\t<!-- Transparently pass all slots that are not customized -->\n\t\t<template\n\t\t\tv-for=\"name in ['header', 'title', 'close', 'description']\"\n\t\t\t#[name]=\"data\"\n\t\t>\n\t\t\t<slot :name=\"name\" v-bind=\"data\"> </slot>\n\t\t</template>\n\t\t<div v-if=\"!state.loading\" class=\"bb-confirm__content\">\n\t\t\t<div v-if=\"state.text\" class=\"bb-confirm__text\">{{ state.text }}</div>\n\t\t</div>\n\t\t<slot v-else name=\"spinner\">\n\t\t\t<div class=\"bb-confirm__spinner\">\n\t\t\t\t<BbSpinner size=\"36\" />\n\t\t\t</div>\n\t\t</slot>\n\t\t<template v-if=\"!state.loading && state.actions\" #footer=\"data\">\n\t\t\t<slot\n\t\t\t\t:actions=\"state.actions\"\n\t\t\t\t:loading=\"state.loading\"\n\t\t\t\tname=\"footer\"\n\t\t\t\t:no=\"state.no\"\n\t\t\t\t:no-action=\"noAction\"\n\t\t\t\t:yes=\"state.yes\"\n\t\t\t\t:yes-action=\"yesAction\"\n\t\t\t\tv-bind=\"data\"\n\t\t\t>\n\t\t\t\t<BaseButton\n\t\t\t\t\tv-if=\"state.no\"\n\t\t\t\t\tclass=\"bb-confirm__no\"\n\t\t\t\t\t@click=\"noAction.handler\"\n\t\t\t\t>\n\t\t\t\t\t{{ noAction.text }}\n\t\t\t\t</BaseButton>\n\n\t\t\t\t<BaseButton\n\t\t\t\t\tv-if=\"state.yes\"\n\t\t\t\t\tclass=\"bb-confirm__yes\"\n\t\t\t\t\t@click=\"yesAction.handler\"\n\t\t\t\t>\n\t\t\t\t\t{{ yesAction.text }}\n\t\t\t\t</BaseButton>\n\t\t\t</slot>\n\t\t</template>\n\t</BaseDialog>\n</template>\n\n<script setup lang=\"ts\">\nimport { actions, state } from '@/composables/useConfirm';\nimport { computed } from 'vue';\nimport BaseButton from '../BaseButton/BaseButton.vue';\nimport BaseDialog from '../BaseDialog/BaseDialog.vue';\nimport BbSpinner from '../BbSpinner/BbSpinner.vue';\n\nconst noAction = computed(() => actions.value[0]);\nconst yesAction = computed(() => actions.value[1]);\nconst onModelValueUpdate = (value: boolean) => {\n\tif (value) yesAction.value.handler();\n\telse noAction.value.handler();\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbConfirm';\n</style>\n"],"names":["noAction","computed","actions","yesAction","onModelValueUpdate","value"],"mappings":";;;;;;;;;;;;;;;;;AA6DA,UAAMA,IAAWC,EAAS,MAAMC,EAAQ,MAAM,CAAC,CAAC,GAC1CC,IAAYF,EAAS,MAAMC,EAAQ,MAAM,CAAC,CAAC,GAC3CE,IAAqB,CAACC,MAAmB;AAC1C,MAAAA,IAAiBF,EAAA,MAAM,QAAQ,IAC9BH,EAAS,MAAM;IAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as m, ref as c, computed as h, openBlock as f, createBlock as b, withCtx as l, renderSlot as v, normalizeProps as y, guardReactiveProps as w, createVNode as g, mergeProps as B } from "vue";
2
- import k from "./index20.js";
2
+ import k from "./index21.js";
3
3
  /* empty css */
4
- import V from "./index24.js";
4
+ import V from "./index25.js";
5
5
  /* empty css */
6
6
  const H = /* @__PURE__ */ m({
7
7
  __name: "BbDatePickerInput",
@@ -97,4 +97,4 @@ const H = /* @__PURE__ */ m({
97
97
  export {
98
98
  H as default
99
99
  };
100
- //# sourceMappingURL=index66.js.map
100
+ //# sourceMappingURL=index67.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index66.js","sources":["../src/components/BbDatePickerInput/BbDatePickerInput.vue"],"sourcesContent":["<template>\n\t<BaseInputContainer\n\t\t:id=\"id\"\n\t\tclass=\"bb-date-picker-input\"\n\t\t:direction=\"direction\"\n\t\t:errors=\"errors\"\n\t\t:has-errors=\"hasErrors\"\n\t\t:hide-label=\"hideLabel\"\n\t\t:hint=\"hint\"\n\t\t:label=\"label\"\n\t\t:label-position=\"labelPosition\"\n\t\t:model-value=\"modelValue\"\n\t\t:name=\"name\"\n\t\t:reverse=\"reverse\"\n\t\t:show-hint=\"showHint\"\n\t>\n\t\t<template #label=\"data\"><slot name=\"label\" v-bind=\"data\"></slot></template>\n\t\t<template #input=\"{ id, name, hasErrors }\">\n\t\t\t<BaseDatePickerInput\n\t\t\t\t:id=\"id\"\n\t\t\t\t:allow-writing=\"allowWriting\"\n\t\t\t\t:append:icon=\"$props['append:icon']\"\n\t\t\t\t:autocomplete=\"autocomplete\"\n\t\t\t\t:autofocus=\"autofocus\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:first-day-of-week=\"firstDayOfWeek\"\n\t\t\t\t:has-errors=\"hasErrors\"\n\t\t\t\t:loading=\"loading\"\n\t\t\t\t:max=\"max\"\n\t\t\t\t:min=\"min\"\n\t\t\t\t:model-value=\"modelValue\"\n\t\t\t\t:name=\"name\"\n\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t:prepend:icon=\"$props['prepend:icon']\"\n\t\t\t\t:range=\"range\"\n\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t:required=\"required\"\n\t\t\t\t:selectable=\"selectable\"\n\t\t\t\t:width=\"width\"\n\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t>\n\t\t\t</BaseDatePickerInput>\n\t\t</template>\n\t</BaseInputContainer>\n</template>\n\n<script setup lang=\"ts\">\nimport BaseDatePickerInput from '../BaseDatePickerInput/BaseDatePickerInput.vue';\nimport BaseInputContainer from '../BaseInputContainer/BaseInputContainer.vue';\nimport type { BaseDatePickerInputEvents } from '../BaseDatePickerInput/BaseDatePickerInput.vue';\nimport {\n\tref,\n\ttype HTMLAttributes,\n\ttype InputHTMLAttributes,\n\tcomputed,\n} from 'vue';\nimport type { Locale } from 'dayjs/locale/it';\n\nexport type BbDatePickerInputProps = {\n\t/**\n\t * Allows typing into the input.\n\t */\n\tallowWriting?: boolean | 'not-mobile';\n\n\t/**\n\t * Name of the icon to be added at the end of the input.\n\t */\n\t// eslint-disable-next-line vue/prop-name-casing\n\t'append:icon'?: string;\n\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tautocomplete?: InputHTMLAttributes['autocomplete'];\n\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Direction of the layout of the component. Can either be a predefined value or a pattern separated by a space like `xx xxxxx`.\n\t */\n\tdirection?: 'horizontal' | 'vertical' | 'auto' | string;\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Can be a string or an array of string containing the messages to display.\n\t */\n\terrors?: string | string[];\n\n\t/**\n\t * Defines the first day of the week with `0` meaning Sunday and `6` meaning Saturday\n\t */\n\tfirstDayOfWeek?: Locale['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 * Visually hides the label of the input while maintaining accessibility.\n\t */\n\thideLabel?: boolean;\n\n\t/**\n\t * Text box to be displayed near the input, usually to indicate instructions.\n\t */\n\thint?: string;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Text content of the label of the element.\n\t */\n\tlabel: string;\n\n\t/**\n\t * Sets the text alignment of the label.\n\t */\n\tlabelPosition?: 'left' | 'center' | 'right';\n\n\t/**\n\t * Sets the component in a loading state, usually triggering some visual styles.\n\t */\n\tloading?: boolean;\n\n\t/**\n\t * Maximum selectable date\n\t */\n\tmax?: Date | string | number;\n\n\t/**\n\t * Minimum selectable date\n\t */\n\tmin?: Date | string | number;\n\n\t/**\n\t * Used by v-model. Can be null, a single string, or an array of strings based on whether a range or single date is needed\n\t */\n\tmodelValue: string | string[] | null;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * Keeps the hint displayed.\n\t */\n\tpersistentHint?: boolean;\n\n\t/**\n\t * String displayed when there's no data.\n\t */\n\tplaceholder?: InputHTMLAttributes['placeholder'];\n\n\t/**\n\t * Name of the icon to be added at the start of the input.\n\t */\n\t// eslint-disable-next-line vue/prop-name-casing\n\t'prepend:icon'?: string;\n\n\t/**\n\t * Selects a range of dates between two dates. It selects all of the days between start and end\n\t */\n\trange?: boolean;\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: boolean;\n\n\t/**\n\t * Sets the input as required.\n\t */\n\trequired?: boolean;\n\n\t/**\n\t * Reverses the layout. Applicable in every direction the order of the label and the input is swapped.\n\t */\n\treverse?: boolean;\n\n\t/**\n\t * Function that accepts a `Date` object and returns a boolean. `false` meaning the date cannot be selected\n\t * @param date\n\t */\n\tselectable?: (date: Date) => boolean;\n\n\t/**\n\t * Width of the calendar\n\t */\n\twidth?: number | string;\n};\n\nconst props = withDefaults(defineProps<BbDatePickerInputProps>(), {\n\tallowWriting: true,\n});\n\nexport type BbDatePickerInputEvents = BaseDatePickerInputEvents;\n\nconst emit = defineEmits<BbDatePickerInputEvents>();\n\ndefineSlots<{\n\t'prepend-outer'?: (props: object) => any;\n\tprepend?: (props: object) => any;\n\tappend?: (props: object) => any;\n\t'append-outer'?: (props: object) => any;\n\tlabel?: (props: { text: string; hasErrors: boolean }) => any;\n}>();\n\nconst active = ref(false);\nconst showHint = computed(() => props.persistentHint || active.value);\n\n/**\n * These events are just propagated\n */\nconst eventListeners = {\n\tonError: (message: string) => emit('error', message),\n\tonFocus: (event: FocusEvent) => emit('focus', event),\n\tonActive: () => {\n\t\tactive.value = true;\n\t\temit('active');\n\t},\n\tonInactive: () => {\n\t\tactive.value = false;\n\t\temit('inactive');\n\t},\n\t'onUpdate:modelValue': (value: BbDatePickerInputProps['modelValue']) =>\n\t\temit('update:modelValue', value),\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbDatePickerInput';\n</style>\n"],"names":["props","__props","emit","__emit","active","ref","showHint","computed","eventListeners","message","event","value"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4MA,UAAMA,IAAQC,GAMRC,IAAOC,GAUPC,IAASC,EAAI,EAAK,GAClBC,IAAWC,EAAS,MAAMP,EAAM,kBAAkBI,EAAO,KAAK,GAK9DI,IAAiB;AAAA,MACtB,SAAS,CAACC,MAAoBP,EAAK,SAASO,CAAO;AAAA,MACnD,SAAS,CAACC,MAAsBR,EAAK,SAASQ,CAAK;AAAA,MACnD,UAAU,MAAM;AACf,QAAAN,EAAO,QAAQ,IACfF,EAAK,QAAQ;AAAA,MACd;AAAA,MACA,YAAY,MAAM;AACjB,QAAAE,EAAO,QAAQ,IACfF,EAAK,UAAU;AAAA,MAChB;AAAA,MACA,uBAAuB,CAACS,MACvBT,EAAK,qBAAqBS,CAAK;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index67.js","sources":["../src/components/BbDatePickerInput/BbDatePickerInput.vue"],"sourcesContent":["<template>\n\t<BaseInputContainer\n\t\t:id=\"id\"\n\t\tclass=\"bb-date-picker-input\"\n\t\t:direction=\"direction\"\n\t\t:errors=\"errors\"\n\t\t:has-errors=\"hasErrors\"\n\t\t:hide-label=\"hideLabel\"\n\t\t:hint=\"hint\"\n\t\t:label=\"label\"\n\t\t:label-position=\"labelPosition\"\n\t\t:model-value=\"modelValue\"\n\t\t:name=\"name\"\n\t\t:reverse=\"reverse\"\n\t\t:show-hint=\"showHint\"\n\t>\n\t\t<template #label=\"data\"><slot name=\"label\" v-bind=\"data\"></slot></template>\n\t\t<template #input=\"{ id, name, hasErrors }\">\n\t\t\t<BaseDatePickerInput\n\t\t\t\t:id=\"id\"\n\t\t\t\t:allow-writing=\"allowWriting\"\n\t\t\t\t:append:icon=\"$props['append:icon']\"\n\t\t\t\t:autocomplete=\"autocomplete\"\n\t\t\t\t:autofocus=\"autofocus\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:first-day-of-week=\"firstDayOfWeek\"\n\t\t\t\t:has-errors=\"hasErrors\"\n\t\t\t\t:loading=\"loading\"\n\t\t\t\t:max=\"max\"\n\t\t\t\t:min=\"min\"\n\t\t\t\t:model-value=\"modelValue\"\n\t\t\t\t:name=\"name\"\n\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t:prepend:icon=\"$props['prepend:icon']\"\n\t\t\t\t:range=\"range\"\n\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t:required=\"required\"\n\t\t\t\t:selectable=\"selectable\"\n\t\t\t\t:width=\"width\"\n\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t>\n\t\t\t</BaseDatePickerInput>\n\t\t</template>\n\t</BaseInputContainer>\n</template>\n\n<script setup lang=\"ts\">\nimport BaseDatePickerInput from '../BaseDatePickerInput/BaseDatePickerInput.vue';\nimport BaseInputContainer from '../BaseInputContainer/BaseInputContainer.vue';\nimport type { BaseDatePickerInputEvents } from '../BaseDatePickerInput/BaseDatePickerInput.vue';\nimport {\n\tref,\n\ttype HTMLAttributes,\n\ttype InputHTMLAttributes,\n\tcomputed,\n} from 'vue';\nimport type { Locale } from 'dayjs/locale/it';\n\nexport type BbDatePickerInputProps = {\n\t/**\n\t * Allows typing into the input.\n\t */\n\tallowWriting?: boolean | 'not-mobile';\n\n\t/**\n\t * Name of the icon to be added at the end of the input.\n\t */\n\t// eslint-disable-next-line vue/prop-name-casing\n\t'append:icon'?: string;\n\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tautocomplete?: InputHTMLAttributes['autocomplete'];\n\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Direction of the layout of the component. Can either be a predefined value or a pattern separated by a space like `xx xxxxx`.\n\t */\n\tdirection?: 'horizontal' | 'vertical' | 'auto' | string;\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Can be a string or an array of string containing the messages to display.\n\t */\n\terrors?: string | string[];\n\n\t/**\n\t * Defines the first day of the week with `0` meaning Sunday and `6` meaning Saturday\n\t */\n\tfirstDayOfWeek?: Locale['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 * Visually hides the label of the input while maintaining accessibility.\n\t */\n\thideLabel?: boolean;\n\n\t/**\n\t * Text box to be displayed near the input, usually to indicate instructions.\n\t */\n\thint?: string;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Text content of the label of the element.\n\t */\n\tlabel: string;\n\n\t/**\n\t * Sets the text alignment of the label.\n\t */\n\tlabelPosition?: 'left' | 'center' | 'right';\n\n\t/**\n\t * Sets the component in a loading state, usually triggering some visual styles.\n\t */\n\tloading?: boolean;\n\n\t/**\n\t * Maximum selectable date\n\t */\n\tmax?: Date | string | number;\n\n\t/**\n\t * Minimum selectable date\n\t */\n\tmin?: Date | string | number;\n\n\t/**\n\t * Used by v-model. Can be null, a single string, or an array of strings based on whether a range or single date is needed\n\t */\n\tmodelValue: string | string[] | null;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * Keeps the hint displayed.\n\t */\n\tpersistentHint?: boolean;\n\n\t/**\n\t * String displayed when there's no data.\n\t */\n\tplaceholder?: InputHTMLAttributes['placeholder'];\n\n\t/**\n\t * Name of the icon to be added at the start of the input.\n\t */\n\t// eslint-disable-next-line vue/prop-name-casing\n\t'prepend:icon'?: string;\n\n\t/**\n\t * Selects a range of dates between two dates. It selects all of the days between start and end\n\t */\n\trange?: boolean;\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: boolean;\n\n\t/**\n\t * Sets the input as required.\n\t */\n\trequired?: boolean;\n\n\t/**\n\t * Reverses the layout. Applicable in every direction the order of the label and the input is swapped.\n\t */\n\treverse?: boolean;\n\n\t/**\n\t * Function that accepts a `Date` object and returns a boolean. `false` meaning the date cannot be selected\n\t * @param date\n\t */\n\tselectable?: (date: Date) => boolean;\n\n\t/**\n\t * Width of the calendar\n\t */\n\twidth?: number | string;\n};\n\nconst props = withDefaults(defineProps<BbDatePickerInputProps>(), {\n\tallowWriting: true,\n});\n\nexport type BbDatePickerInputEvents = BaseDatePickerInputEvents;\n\nconst emit = defineEmits<BbDatePickerInputEvents>();\n\ndefineSlots<{\n\t'prepend-outer'?: (props: object) => any;\n\tprepend?: (props: object) => any;\n\tappend?: (props: object) => any;\n\t'append-outer'?: (props: object) => any;\n\tlabel?: (props: { text: string; hasErrors: boolean }) => any;\n}>();\n\nconst active = ref(false);\nconst showHint = computed(() => props.persistentHint || active.value);\n\n/**\n * These events are just propagated\n */\nconst eventListeners = {\n\tonError: (message: string) => emit('error', message),\n\tonFocus: (event: FocusEvent) => emit('focus', event),\n\tonActive: () => {\n\t\tactive.value = true;\n\t\temit('active');\n\t},\n\tonInactive: () => {\n\t\tactive.value = false;\n\t\temit('inactive');\n\t},\n\t'onUpdate:modelValue': (value: BbDatePickerInputProps['modelValue']) =>\n\t\temit('update:modelValue', value),\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbDatePickerInput';\n</style>\n"],"names":["props","__props","emit","__emit","active","ref","showHint","computed","eventListeners","message","event","value"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4MA,UAAMA,IAAQC,GAMRC,IAAOC,GAUPC,IAASC,EAAI,EAAK,GAClBC,IAAWC,EAAS,MAAMP,EAAM,kBAAkBI,EAAO,KAAK,GAK9DI,IAAiB;AAAA,MACtB,SAAS,CAACC,MAAoBP,EAAK,SAASO,CAAO;AAAA,MACnD,SAAS,CAACC,MAAsBR,EAAK,SAASQ,CAAK;AAAA,MACnD,UAAU,MAAM;AACf,QAAAN,EAAO,QAAQ,IACfF,EAAK,QAAQ;AAAA,MACd;AAAA,MACA,YAAY,MAAM;AACjB,QAAAE,EAAO,QAAQ,IACfF,EAAK,UAAU;AAAA,MAChB;AAAA,MACA,uBAAuB,CAACS,MACvBT,EAAK,qBAAqBS,CAAK;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as d, computed as u, openBlock as m, createBlock as f, mergeProps as y, withCtx as l, renderSlot as t, normalizeProps as a, guardReactiveProps as r } from "vue";
2
- import $ from "./index22.js";
2
+ import $ from "./index23.js";
3
3
  /* empty css */
4
4
  const b = /* @__PURE__ */ d({
5
5
  __name: "BbDialog",
@@ -58,4 +58,4 @@ const b = /* @__PURE__ */ d({
58
58
  export {
59
59
  b as default
60
60
  };
61
- //# sourceMappingURL=index68.js.map
61
+ //# sourceMappingURL=index69.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index68.js","sources":["../src/components/BbDialog/BbDialog.vue"],"sourcesContent":["<template>\n\t<!-- Events need to be propagated manually -->\n\t<BaseDialog\n\t\tv-bind=\"$props\"\n\t\t:overlay-classes=\"overlayClasses\"\n\t\t@hidden=\"() => $emit('hidden')\"\n\t\t@shown=\"() => $emit('shown')\"\n\t\t@update:model-value=\"(value: boolean) => $emit('update:modelValue', value)\"\n\t\t><template #close=\"data\"><slot name=\"close\" v-bind=\"data\" /></template\n\t\t><template #default=\"data\"><slot name=\"default\" v-bind=\"data\" /></template\n\t\t><template #description=\"data\"\n\t\t\t><slot name=\"description\" v-bind=\"data\" /></template\n\t\t><template #footer=\"data\"><slot name=\"footer\" v-bind=\"data\" /></template\n\t\t><template #header=\"data\"><slot name=\"header\" v-bind=\"data\" /></template\n\t\t><template #title=\"data\"><slot name=\"title\" v-bind=\"data\" /></template>\n\t</BaseDialog>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport BaseDialog from '../BaseDialog/BaseDialog.vue';\nimport type { Classes } from '@/types/Classes';\nimport type {\n\tBaseDialogProps,\n\tBaseDialogEvents,\n\tBaseDialogSlots,\n} from '../BaseDialog/BaseDialog.vue';\nexport type {\n\tBaseDialogProps as BbDialogProps,\n\tBaseDialogEvents as BbDialogEvents,\n\tSizes,\n} from '../BaseDialog/BaseDialog.vue';\n\nconst props = withDefaults(defineProps<BaseDialogProps>(), {\n\tshowClose: true,\n});\n\ndefineEmits<BaseDialogEvents>();\n\ndefineSlots<BaseDialogSlots>();\n\nconst overlayClasses = computed<Classes>(() => {\n\tlet base: Classes = ['bb-dialog'];\n\tif (props.overlayClasses) {\n\t\tbase = base.concat(props.overlayClasses);\n\t}\n\treturn base;\n});\n</script>\n<style lang=\"postcss\">\n@import '@/assets/css/BbDialog';\n</style>\n"],"names":["props","__props","overlayClasses","computed","base"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,UAAMA,IAAQC,GAQRC,IAAiBC,EAAkB,MAAM;AAC1C,UAAAC,IAAgB,CAAC,WAAW;AAChC,aAAIJ,EAAM,mBACFI,IAAAA,EAAK,OAAOJ,EAAM,cAAc,IAEjCI;AAAA,IAAA,CACP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index69.js","sources":["../src/components/BbDialog/BbDialog.vue"],"sourcesContent":["<template>\n\t<!-- Events need to be propagated manually -->\n\t<BaseDialog\n\t\tv-bind=\"$props\"\n\t\t:overlay-classes=\"overlayClasses\"\n\t\t@hidden=\"() => $emit('hidden')\"\n\t\t@shown=\"() => $emit('shown')\"\n\t\t@update:model-value=\"(value: boolean) => $emit('update:modelValue', value)\"\n\t\t><template #close=\"data\"><slot name=\"close\" v-bind=\"data\" /></template\n\t\t><template #default=\"data\"><slot name=\"default\" v-bind=\"data\" /></template\n\t\t><template #description=\"data\"\n\t\t\t><slot name=\"description\" v-bind=\"data\" /></template\n\t\t><template #footer=\"data\"><slot name=\"footer\" v-bind=\"data\" /></template\n\t\t><template #header=\"data\"><slot name=\"header\" v-bind=\"data\" /></template\n\t\t><template #title=\"data\"><slot name=\"title\" v-bind=\"data\" /></template>\n\t</BaseDialog>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport BaseDialog from '../BaseDialog/BaseDialog.vue';\nimport type { Classes } from '@/types/Classes';\nimport type {\n\tBaseDialogProps,\n\tBaseDialogEvents,\n\tBaseDialogSlots,\n} from '../BaseDialog/BaseDialog.vue';\nexport type {\n\tBaseDialogProps as BbDialogProps,\n\tBaseDialogEvents as BbDialogEvents,\n\tSizes,\n} from '../BaseDialog/BaseDialog.vue';\n\nconst props = withDefaults(defineProps<BaseDialogProps>(), {\n\tshowClose: true,\n});\n\ndefineEmits<BaseDialogEvents>();\n\ndefineSlots<BaseDialogSlots>();\n\nconst overlayClasses = computed<Classes>(() => {\n\tlet base: Classes = ['bb-dialog'];\n\tif (props.overlayClasses) {\n\t\tbase = base.concat(props.overlayClasses);\n\t}\n\treturn base;\n});\n</script>\n<style lang=\"postcss\">\n@import '@/assets/css/BbDialog';\n</style>\n"],"names":["props","__props","overlayClasses","computed","base"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,UAAMA,IAAQC,GAQRC,IAAiBC,EAAkB,MAAM;AAC1C,UAAAC,IAAgB,CAAC,WAAW;AAChC,aAAIJ,EAAM,mBACFI,IAAAA,EAAK,OAAOJ,EAAM,cAAc,IAEjCI;AAAA,IAAA,CACP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index7.js CHANGED
@@ -1,23 +1,65 @@
1
- import { ref as n } from "vue";
2
- const c = (t) => {
3
- const r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", h = e.length;
4
- let o = r.charAt(
5
- Math.floor(Math.random() * r.length)
6
- ), a = 1;
7
- for (; a < t; )
8
- o += e.charAt(Math.floor(Math.random() * h)), a += 1;
9
- return o;
10
- }, l = () => {
11
- const t = n(c(12));
12
- return {
13
- /**
14
- * The generated id
15
- */
16
- id: t,
17
- refresh: () => t.value = c(12)
1
+ import { getAsPercentage as p } from "./index126.js";
2
+ import { wait as w } from "./index127.js";
3
+ import { ref as c, computed as o, onBeforeUnmount as H } from "vue";
4
+ const Y = ({
5
+ duration: t,
6
+ onStart: f,
7
+ onFinish: i,
8
+ onStop: s
9
+ }) => {
10
+ if (!t)
11
+ throw new Error("You must define a duration for the coundown");
12
+ const e = c(t), u = c(0), M = o(() => p(u.value, t)), m = 100, r = c(!1), n = c(!1);
13
+ let a;
14
+ const I = () => {
15
+ u.value === t || r.value && !n.value || (f && f(), n.value = !1, r.value = !0, a = setInterval(() => {
16
+ e.value = Math.max(e.value - m, 0), u.value = Math.min(u.value + m, t), e.value === 0 && w(0).then(() => {
17
+ clearInterval(a), r.value = !1, s && s(), i && i();
18
+ });
19
+ }, m));
20
+ }, d = () => {
21
+ A(), I();
22
+ }, A = () => {
23
+ a && clearInterval(a), n.value || s && s(), e.value = t, u.value = 0, r.value = !1, n.value = !1;
24
+ }, g = () => {
25
+ a && clearInterval(a), n.value || s && s(), n.value = !0;
26
+ }, y = o(() => {
27
+ const l = Math.trunc(e.value / 864e5), v = Math.trunc((e.value - l * 864e5) / 36e5), h = Math.trunc(
28
+ (e.value - v * 36e5 - l * 864e5) / 6e4
29
+ ), D = Math.trunc(
30
+ (e.value - h * 6e4 - v * 36e5 - l * 864e5) / 1e3
31
+ );
32
+ return {
33
+ days: l,
34
+ hours: v,
35
+ minutes: h,
36
+ seconds: D
37
+ };
38
+ });
39
+ return H(() => clearInterval(a)), {
40
+ /** Elapsed milliseconds since starting the timer */
41
+ elapsed: o(() => u.value),
42
+ /** Remaining milliseconds */
43
+ remaining: o(() => e.value),
44
+ /** Remaining as a formatted object for display */
45
+ remainingFormatted: y,
46
+ /** Percentage of elapsed time against duration */
47
+ progress: M,
48
+ /** Starts the timer */
49
+ start: I,
50
+ /** Reset the timer to intiial state and starts again */
51
+ restart: d,
52
+ /** Pauses the timer */
53
+ pause: g,
54
+ /** Reset the timer to initial state, if the timer is running it is stopped */
55
+ reset: A,
56
+ /** Boolean, is the timer running (paused doesn't change running state) */
57
+ running: r,
58
+ /** Boolean is the timer paused */
59
+ paused: n
18
60
  };
19
61
  };
20
62
  export {
21
- l as useId
63
+ Y as useCountdown
22
64
  };
23
65
  //# sourceMappingURL=index7.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index7.js","sources":["../src/composables/useId.ts"],"sourcesContent":["import { ref } from 'vue';\n\nconst makeid = (length: number) => {\n\tconst allowedFirstCharacter =\n\t\t'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';\n\tconst characters =\n\t\t'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\tconst charactersLength = characters.length;\n\tlet result = allowedFirstCharacter.charAt(\n\t\tMath.floor(Math.random() * allowedFirstCharacter.length)\n\t);\n\tlet counter = 1;\n\twhile (counter < length) {\n\t\tresult += characters.charAt(Math.floor(Math.random() * charactersLength));\n\t\tcounter += 1;\n\t}\n\treturn result;\n};\n\n/**\n * Return a reactive ref to an ID with a collision probability of one in 4 trillion.\n * The characters used are [a-zA-Z0-9] so they are fully compatible with HTML5 ID attr.\n * Also returns a function to refresh the id.\n */\nexport const useId = () => {\n\tconst id = ref(makeid(12));\n\tconst refresh = () => (id.value = makeid(12));\n\treturn {\n\t\t/**\n\t\t * The generated id\n\t\t */\n\t\tid,\n\t\trefresh,\n\t};\n};\n"],"names":["makeid","length","allowedFirstCharacter","characters","charactersLength","result","counter","useId","id","ref"],"mappings":";AAEA,MAAMA,IAAS,CAACC,MAAmB;AAClC,QAAMC,IACL,wDACKC,IACL,kEACKC,IAAmBD,EAAW;AACpC,MAAIE,IAASH,EAAsB;AAAA,IAClC,KAAK,MAAM,KAAK,OAAO,IAAIA,EAAsB,MAAM;AAAA,EAAA,GAEpDI,IAAU;AACd,SAAOA,IAAUL;AACN,IAAAI,KAAAF,EAAW,OAAO,KAAK,MAAM,KAAK,OAAO,IAAIC,CAAgB,CAAC,GAC7DE,KAAA;AAEL,SAAAD;AACR,GAOaE,IAAQ,MAAM;AAC1B,QAAMC,IAAKC,EAAIT,EAAO,EAAE,CAAC;AAElB,SAAA;AAAA;AAAA;AAAA;AAAA,IAIN,IAAAQ;AAAA,IACA,SANe,MAAOA,EAAG,QAAQR,EAAO,EAAE;AAAA,EAM1C;AAEF;"}
1
+ {"version":3,"file":"index7.js","sources":["../src/composables/useCountdown.ts"],"sourcesContent":["import { getAsPercentage } from '@/utilities/functions/percentage';\nimport { wait } from '@/utilities/functions/wait';\nimport { computed, onBeforeUnmount, ref } from 'vue';\n\ntype CounterParams = {\n\t/** Longevity of the countdown in milliseconds */\n\tduration: number;\n\t/** Function called every time the countdown starts or restarts */\n\tonStart?: (...args: any[]) => any;\n\t/** Function called anytime the timer stops or pauses */\n\tonStop?: (...args: any[]) => any;\n\t/** Function called on completion */\n\tonFinish?: (...args: any[]) => any;\n};\nexport const useCountdown = ({\n\tduration,\n\tonStart,\n\tonFinish,\n\tonStop,\n}: CounterParams) => {\n\tif (!duration) {\n\t\tthrow new Error('You must define a duration for the coundown');\n\t}\n\tconst remaining = ref(duration);\n\tconst elapsed = ref(0);\n\tconst progress = computed(() => getAsPercentage(elapsed.value, duration));\n\tconst tick = 100;\n\tconst running = ref(false);\n\tconst paused = ref(false);\n\n\tlet timeoutID: ReturnType<typeof setInterval>;\n\n\tconst start = () => {\n\t\tif (elapsed.value === duration || (running.value && !paused.value)) return;\n\t\tif (onStart) onStart();\n\t\tpaused.value = false;\n\t\trunning.value = true;\n\n\t\ttimeoutID = setInterval(() => {\n\t\t\tremaining.value = Math.max(remaining.value - tick, 0);\n\t\t\telapsed.value = Math.min(elapsed.value + tick, duration);\n\n\t\t\tif (remaining.value === 0) {\n\t\t\t\twait(0).then(() => {\n\t\t\t\t\tclearInterval(timeoutID);\n\t\t\t\t\trunning.value = false;\n\t\t\t\t\tif (onStop) onStop();\n\t\t\t\t\tif (onFinish) onFinish();\n\t\t\t\t});\n\t\t\t}\n\t\t}, tick);\n\t};\n\n\tconst restart = () => {\n\t\treset();\n\t\tstart();\n\t};\n\n\tconst reset = () => {\n\t\tif (timeoutID) clearInterval(timeoutID);\n\t\tif (!paused.value) {\n\t\t\tif (onStop) onStop();\n\t\t}\n\t\tremaining.value = duration;\n\t\telapsed.value = 0;\n\t\trunning.value = false;\n\t\tpaused.value = false;\n\t};\n\n\tconst pause = () => {\n\t\tif (timeoutID) clearInterval(timeoutID);\n\t\tif (!paused.value) {\n\t\t\tif (onStop) onStop();\n\t\t}\n\t\tpaused.value = true;\n\t};\n\n\tconst remainingFormatted = computed(() => {\n\t\tconst msInADay = 1000 * 60 * 60 * 24;\n\t\tconst msInAnHour = 1000 * 60 * 60;\n\t\tconst msInAMinute = 1000 * 60;\n\t\tconst msInASecond = 1000;\n\n\t\tconst days = Math.trunc(remaining.value / msInADay);\n\t\tconst hours = Math.trunc((remaining.value - days * msInADay) / msInAnHour);\n\t\tconst minutes = Math.trunc(\n\t\t\t(remaining.value - hours * msInAnHour - days * msInADay) / msInAMinute\n\t\t);\n\t\tconst seconds = Math.trunc(\n\t\t\t(remaining.value -\n\t\t\t\tminutes * msInAMinute -\n\t\t\t\thours * msInAnHour -\n\t\t\t\tdays * msInADay) /\n\t\t\t\tmsInASecond\n\t\t);\n\t\treturn {\n\t\t\tdays,\n\t\t\thours,\n\t\t\tminutes,\n\t\t\tseconds,\n\t\t};\n\t});\n\n\tonBeforeUnmount(() => clearInterval(timeoutID));\n\n\treturn {\n\t\t/** Elapsed milliseconds since starting the timer */\n\t\telapsed: computed(() => elapsed.value),\n\t\t/** Remaining milliseconds */\n\t\tremaining: computed(() => remaining.value),\n\t\t/** Remaining as a formatted object for display */\n\t\tremainingFormatted,\n\t\t/** Percentage of elapsed time against duration */\n\t\tprogress,\n\t\t/** Starts the timer */\n\t\tstart,\n\t\t/** Reset the timer to intiial state and starts again */\n\t\trestart,\n\t\t/** Pauses the timer */\n\t\tpause,\n\t\t/** Reset the timer to initial state, if the timer is running it is stopped */\n\t\treset,\n\t\t/** Boolean, is the timer running (paused doesn't change running state) */\n\t\trunning,\n\t\t/** Boolean is the timer paused */\n\t\tpaused,\n\t};\n};\n"],"names":["useCountdown","duration","onStart","onFinish","onStop","remaining","ref","elapsed","progress","computed","getAsPercentage","tick","running","paused","timeoutID","start","wait","restart","reset","pause","remainingFormatted","days","hours","minutes","seconds","onBeforeUnmount"],"mappings":";;;AAcO,MAAMA,IAAe,CAAC;AAAA,EAC5B,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AACD,MAAqB;AACpB,MAAI,CAACH;AACE,UAAA,IAAI,MAAM,6CAA6C;AAExD,QAAAI,IAAYC,EAAIL,CAAQ,GACxBM,IAAUD,EAAI,CAAC,GACfE,IAAWC,EAAS,MAAMC,EAAgBH,EAAQ,OAAON,CAAQ,CAAC,GAClEU,IAAO,KACPC,IAAUN,EAAI,EAAK,GACnBO,IAASP,EAAI,EAAK;AAEpB,MAAAQ;AAEJ,QAAMC,IAAQ,MAAM;AACnB,IAAIR,EAAQ,UAAUN,KAAaW,EAAQ,SAAS,CAACC,EAAO,UACxDX,KAAiBA,KACrBW,EAAO,QAAQ,IACfD,EAAQ,QAAQ,IAEhBE,IAA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,KAAK;AAAA;AAAA,IAEzC,oBAAAe;AAAA;AAAA,IAEA,UAAAZ;AAAA;AAAA,IAEA,OAAAO;AAAA;AAAA,IAEA,SAAAE;AAAA;AAAA,IAEA,OAAAE;AAAA;AAAA,IAEA,OAAAD;AAAA;AAAA,IAEA,SAAAN;AAAA;AAAA,IAEA,QAAAC;AAAA,EAAA;AAEF;"}
@@ -1,13 +1,13 @@
1
1
  import { defineComponent as Y, computed as M, ref as v, openBlock as D, createElementBlock as H, mergeProps as I, createElementVNode as $, renderSlot as _, normalizeProps as Z, guardReactiveProps as ee, unref as c, createBlock as te, Teleport as oe, normalizeClass as ne, normalizeStyle as z, Fragment as N, renderList as ae, createVNode as le, withCtx as se, createCommentVNode as ie } from "vue";
2
2
  import { findRightIndex as S } from "./index246.js";
3
- import { useFloating as re, arrow as ue } from "./index205.js";
4
- import { useId as de } from "./index7.js";
5
- import { wait as U } from "./index126.js";
6
- import { useIntersectionObserver as ce } from "./index127.js";
7
- import fe from "./index12.js";
3
+ import { useFloating as re, arrow as ue } from "./index204.js";
4
+ import { useId as de } from "./index8.js";
5
+ import { wait as U } from "./index127.js";
6
+ import { useIntersectionObserver as ce } from "./index128.js";
7
+ import fe from "./index13.js";
8
8
  /* empty css */
9
9
  import V from "./index247.js";
10
- import { autoUpdate as pe, flip as be, offset as me, shift as ve } from "./index220.js";
10
+ import { autoUpdate as pe, flip as be, offset as me, shift as ve } from "./index219.js";
11
11
  const we = ["id", "aria-labelledby"], ye = { class: "bb-dropdown__items-container" }, He = /* @__PURE__ */ Y({
12
12
  __name: "BbDropdown",
13
13
  props: {
@@ -311,4 +311,4 @@ const we = ["id", "aria-labelledby"], ye = { class: "bb-dropdown__items-containe
311
311
  export {
312
312
  He as default
313
313
  };
314
- //# sourceMappingURL=index70.js.map
314
+ //# sourceMappingURL=index71.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index70.js","sources":["../src/components/BbDropdown/BbDropdown.vue"],"sourcesContent":["<template>\n\t<span class=\"bb-dropdown\" v-bind=\"attributes\">\n\t\t<span ref=\"wrapper\" class=\"bb-dropdown__wrapper\">\n\t\t\t<slot\n\t\t\t\tname=\"activator\"\n\t\t\t\tv-bind=\"{\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t'aria-expanded': open,\n\t\t\t\t\t\t'aria-controls': `menu_${id}`,\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tonClick,\n\t\t\t\t\t\tonKeydown,\n\t\t\t\t\t\tdisabled,\n\t\t\t\t\t},\n\t\t\t\t\tclosed: closed,\n\t\t\t\t\tclosing: closing,\n\t\t\t\t\tdisabled: disabled,\n\t\t\t\t\topen: open,\n\t\t\t\t\topening: opening,\n\t\t\t\t\tplacement: placement,\n\t\t\t\t}\"\n\t\t\t></slot>\n\t\t</span>\n\t\t<teleport v-if=\"hasOpenedOnce || eager\" to=\"body\">\n\t\t\t<span\n\t\t\t\t:id=\"`menu_${id}`\"\n\t\t\t\tref=\"content\"\n\t\t\t\t:aria-labelledby=\"id\"\n\t\t\t\taria-role=\"menu\"\n\t\t\t\tclass=\"bb-dropdown__bubble-container\"\n\t\t\t\t:class=\"{\n\t\t\t\t\t[`bb-dropdown__bubble-container--${placement}`]: true,\n\t\t\t\t\t[`bb-dropdown__bubble-container--${theme}`]: theme,\n\t\t\t\t\t'bb-dropdown__bubble-container--hidden': closed,\n\t\t\t\t\t'bb-dropdown__bubble-container--closing': closing,\n\t\t\t\t\t'bb-dropdown__bubble-container--opening': opening,\n\t\t\t\t\t'bb-dropdown__bubble-container--open': open,\n\t\t\t\t}\"\n\t\t\t\t:style=\"{\n\t\t\t\t\t...floatingStyles,\n\t\t\t\t\ttransitionDuration: `${props.transitionDuration}ms`,\n\t\t\t\t}\"\n\t\t\t>\n\t\t\t\t<span\n\t\t\t\t\tref=\"bubblearrow\"\n\t\t\t\t\tclass=\"bb-dropdown__arrow\"\n\t\t\t\t\tv-bind=\"arrowAttributes\"\n\t\t\t\t></span>\n\t\t\t\t<span class=\"bb-dropdown__bubble\" :style=\"{ width: `${width}px` }\">\n\t\t\t\t\t<slot\n\t\t\t\t\t\t:closed=\"closed\"\n\t\t\t\t\t\t:closing=\"closing\"\n\t\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\t\tname=\"prepend\"\n\t\t\t\t\t\t:open=\"open\"\n\t\t\t\t\t\t:opening=\"opening\"\n\t\t\t\t\t\t:placement=\"placement\"\n\t\t\t\t\t></slot>\n\t\t\t\t\t<span class=\"bb-dropdown__items-container\">\n\t\t\t\t\t\t<template v-for=\"(item, index) in mappedItems\" :key=\"item.key\">\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:closed=\"closed\"\n\t\t\t\t\t\t\t\t:closing=\"closing\"\n\t\t\t\t\t\t\t\t:disabled=\"item.disabled\"\n\t\t\t\t\t\t\t\t:index=\"index\"\n\t\t\t\t\t\t\t\t:item=\"items[index]\"\n\t\t\t\t\t\t\t\t:name=\"`item:prepend`\"\n\t\t\t\t\t\t\t\t:open=\"open\"\n\t\t\t\t\t\t\t\t:opening=\"opening\"\n\t\t\t\t\t\t\t\t:placement=\"placement\"\n\t\t\t\t\t\t\t\t:text=\"item.text\"\n\t\t\t\t\t\t\t></slot>\n\t\t\t\t\t\t\t<BaseButton\n\t\t\t\t\t\t\t\t:aria-role=\"'menuitem'\"\n\t\t\t\t\t\t\t\tclass=\"bb-dropdown__item\"\n\t\t\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t\t\t'bb-dropdown__item--first': index === 0,\n\t\t\t\t\t\t\t\t\t'bb-dropdown__item--last': index === items.length - 1,\n\t\t\t\t\t\t\t\t}\"\n\t\t\t\t\t\t\t\t:data-dropdown-item=\"true\"\n\t\t\t\t\t\t\t\tv-bind=\"item\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t\t:closed=\"closed\"\n\t\t\t\t\t\t\t\t\t:closing=\"closing\"\n\t\t\t\t\t\t\t\t\t:disabled=\"item.disabled\"\n\t\t\t\t\t\t\t\t\t:index=\"index\"\n\t\t\t\t\t\t\t\t\t:item=\"item\"\n\t\t\t\t\t\t\t\t\t:name=\"item.key\"\n\t\t\t\t\t\t\t\t\t:open=\"open\"\n\t\t\t\t\t\t\t\t\t:opening=\"opening\"\n\t\t\t\t\t\t\t\t\t:placement=\"placement\"\n\t\t\t\t\t\t\t\t\t:text=\"item.text\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t\t\t:closed=\"closed\"\n\t\t\t\t\t\t\t\t\t\t:closing=\"closing\"\n\t\t\t\t\t\t\t\t\t\t:disabled=\"item.disabled\"\n\t\t\t\t\t\t\t\t\t\t:index=\"index\"\n\t\t\t\t\t\t\t\t\t\t:item=\"item\"\n\t\t\t\t\t\t\t\t\t\tname=\"item\"\n\t\t\t\t\t\t\t\t\t\t:open=\"open\"\n\t\t\t\t\t\t\t\t\t\t:opening=\"opening\"\n\t\t\t\t\t\t\t\t\t\t:placement=\"placement\"\n\t\t\t\t\t\t\t\t\t\t:text=\"item.text\"\n\t\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</BaseButton>\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:closed=\"closed\"\n\t\t\t\t\t\t\t\t:closing=\"closing\"\n\t\t\t\t\t\t\t\t:disabled=\"item.disabled\"\n\t\t\t\t\t\t\t\t:index=\"index\"\n\t\t\t\t\t\t\t\t:item=\"items[index]\"\n\t\t\t\t\t\t\t\t:name=\"`item:append`\"\n\t\t\t\t\t\t\t\t:open=\"open\"\n\t\t\t\t\t\t\t\t:opening=\"opening\"\n\t\t\t\t\t\t\t\t:placement=\"placement\"\n\t\t\t\t\t\t\t\t:text=\"item.text\"\n\t\t\t\t\t\t\t></slot>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</span>\n\t\t\t\t\t<slot\n\t\t\t\t\t\t:closed=\"closed\"\n\t\t\t\t\t\t:closing=\"closing\"\n\t\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\t\tname=\"append\"\n\t\t\t\t\t\t:open=\"open\"\n\t\t\t\t\t\t:opening=\"opening\"\n\t\t\t\t\t\t:placement=\"placement\"\n\t\t\t\t\t></slot>\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t</teleport>\n\t</span>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref } from 'vue';\nimport { findRightIndex } from '@/utilities/functions/findRightIndex';\nimport {\n\tuseFloating,\n\tautoUpdate,\n\tflip,\n\tshift,\n\tarrow,\n\toffset,\n} from '@floating-ui/vue';\nimport { useId } from '@/composables/useId';\nimport { wait } from '@/utilities/functions/wait';\nimport { useIntersectionObserver } from '@vueuse/core';\nimport BaseButton from '../BaseButton/BaseButton.vue';\nimport selectors from 'focusable-selectors';\nimport type { BaseButtonProps } from '../BaseButton/BaseButton.vue';\nimport type { CommonProps } from '@/types/CommonProps';\n\nexport type BbDropdownProps = Pick<\n\tCommonProps,\n\t| 'arrowPadding'\n\t| 'block'\n\t| 'disabled'\n\t| 'eager'\n\t| 'id'\n\t| 'offset'\n\t| 'padding'\n\t| 'placement'\n\t| 'theme'\n\t| 'transitionDuration'\n> & {\n\t/**\n\t * Array used to render each dropdown button.\n\t * They can act as `button`, as `a`, or as `router-link`\n\t * as they are based on the functionality provided by\n\t * `BaseButton`\n\t */\n\titems: Item[];\n\t/**\n\t * Width of the dropdown in pixels.\n\t */\n\twidth?: number;\n};\n\ndefineSlots<\n\t{\n\t\tactivator?: (props: {\n\t\t\tprops: {\n\t\t\t\t'aria-expanded': boolean;\n\t\t\t\t'aria-controls': string;\n\t\t\t\tid: string;\n\t\t\t\tonClick: MappedItem['onClick'];\n\t\t\t\tonKeydown: MappedItem['onKeydown'];\n\t\t\t\tdisabled?: BbDropdownProps['disabled'];\n\t\t\t};\n\t\t\tclosed: boolean;\n\t\t\tclosing: boolean;\n\t\t\tdisabled?: boolean;\n\t\t\topen: boolean;\n\t\t\topening: boolean;\n\t\t\tplacement: BbDropdownProps['placement'];\n\t\t}) => any;\n\t\tprepend?: (props: {\n\t\t\tclosed: boolean;\n\t\t\tclosing: boolean;\n\t\t\tdisabled?: boolean;\n\t\t\topen: boolean;\n\t\t\topening: boolean;\n\t\t\tplacement: BbDropdownProps['placement'];\n\t\t}) => any;\n\t\t'item:prepend'?: (props: {\n\t\t\tclosed: boolean;\n\t\t\tclosing: boolean;\n\t\t\tdisabled?: MappedItem['disabled'];\n\t\t\tindex: number;\n\t\t\titem: BbDropdownProps['items'][number];\n\t\t\topen: boolean;\n\t\t\topening: boolean;\n\t\t\tplacement: BbDropdownProps['placement'];\n\t\t\ttext: MappedItem['text'];\n\t\t}) => any;\n\t\titem?: (props: {\n\t\t\tclosed: boolean;\n\t\t\tclosing: boolean;\n\t\t\tdisabled?: MappedItem['disabled'];\n\t\t\tindex: number;\n\t\t\titem: BbDropdownProps['items'][number];\n\t\t\topen: boolean;\n\t\t\topening: boolean;\n\t\t\tplacement: BbDropdownProps['placement'];\n\t\t\ttext: MappedItem['text'];\n\t\t}) => any;\n\t\t'item:append'?: (props: {\n\t\t\tclosed: boolean;\n\t\t\tclosing: boolean;\n\t\t\tdisabled?: MappedItem['disabled'];\n\t\t\tindex: number;\n\t\t\titem: BbDropdownProps['items'][number];\n\t\t\topen: boolean;\n\t\t\topening: boolean;\n\t\t\tplacement: BbDropdownProps['placement'];\n\t\t\ttext: MappedItem['text'];\n\t\t}) => any;\n\t\tappend?: (props: {\n\t\t\tclosed: boolean;\n\t\t\tclosing: boolean;\n\t\t\tdisabled?: boolean;\n\t\t\topen: boolean;\n\t\t\topening: boolean;\n\t\t\tplacement: BbDropdownProps['placement'];\n\t\t}) => any;\n\t} & {\n\t\t[key: string]: (props: {\n\t\t\tclosed: boolean;\n\t\t\tclosing: boolean;\n\t\t\tdisabled?: MappedItem['disabled'];\n\t\t\tindex: number;\n\t\t\titem: BbDropdownProps['items'][number];\n\t\t\topen: boolean;\n\t\t\topening: boolean;\n\t\t\tplacement: BbDropdownProps['placement'];\n\t\t\ttext: MappedItem['text'];\n\t\t}) => any;\n\t}\n>();\n\nexport type Item = Omit<BaseButtonProps, 'block' | 'tag' | 'type'> & {\n\t/**\n\t * Click handler of the item.\n\t */\n\tonClick?: (...args: any[]) => any;\n\t/**\n\t * Key used to identify the element.\n\t */\n\tkey: string;\n};\n\nexport type MappedItem = Item & {\n\t/**\n\t * Identifier of the element among it's siblings.\n\t */\n\tid: string;\n\t/**\n\t * Keydown event used to handle accessibility.\n\t */\n\tonKeydown: (event: KeyboardEvent) => void;\n};\n\nconst props = withDefaults(defineProps<BbDropdownProps>(), {\n\tarrowPadding: 10,\n\tplacement: 'bottom',\n\ttheme: 'default',\n\ttransitionDuration: 150,\n\twidth: 200,\n\tpadding: 6,\n\toffset: 3,\n});\n\nconst id = props.id ?? `bb_${useId().id.value}`;\n\nconst mappedItems = computed<MappedItem[]>(() => {\n\tlet firstFocusableIndex: number = props.items.findIndex((el) => !el.disabled);\n\tlet lastFocusableIndex: number = findRightIndex(\n\t\tprops.items,\n\t\t(item) => !item.disabled\n\t);\n\n\treturn props.items.map((item, index) => {\n\t\tconst itemid = `${id}-item-${item.key}`;\n\t\tconst { onClick: handler, ...rest } = item;\n\n\t\t/* Id a click handler has been passed close the dropdown\n\t\t * return focus and run the handler\n\t\t */\n\t\tconst onClick = async () => {\n\t\t\tawait closeDropdown();\n\t\t\tconst nextElement = document.querySelector(`#${id}`);\n\t\t\tif (!nextElement) return;\n\t\t\telse if (nextElement instanceof HTMLElement) {\n\t\t\t\tnextElement.focus();\n\t\t\t}\n\t\t\tif (handler) handler();\n\t\t};\n\n\t\t/**\n\t\t * On keydown\n\t\t * arrow down move to the next focusable element if it's not the last\n\t\t * arrow up move to the previous focusable element if it's not the first\n\t\t * on tab search the next focusable element after the button that opens the dropdown\n\t\t * if an element is found focus on that\n\t\t * (the menu is attached to body so it's not in order)\n\t\t */\n\t\tconst onKeydown = (event: KeyboardEvent) => {\n\t\t\tif (\n\t\t\t\tevent.target instanceof HTMLElement &&\n\t\t\t\tevent.target.dataset['dropdownItem']\n\t\t\t) {\n\t\t\t\tif (!content.value) return;\n\t\t\t\tif (event.key === 'ArrowDown') {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tif (content.value && index !== lastFocusableIndex) {\n\t\t\t\t\t\tconst option = content.value.querySelector(\n\t\t\t\t\t\t\tselectors.map((selector) => `#${itemid} ~ ${selector}`).join(',')\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (option && option instanceof HTMLElement) {\n\t\t\t\t\t\t\toption.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (event.key === 'ArrowUp') {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tif (content.value && index !== firstFocusableIndex) {\n\t\t\t\t\t\tconst indexOfPrevious = findRightIndex(props.items, (item, i) => {\n\t\t\t\t\t\t\treturn i < index && !item.disabled;\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tconst options = Array.from(\n\t\t\t\t\t\t\tcontent.value.querySelectorAll(`.bb-dropdown__item`)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tconst option = options[indexOfPrevious];\n\n\t\t\t\t\t\tif (option && option instanceof HTMLElement) {\n\t\t\t\t\t\t\toption.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (event.key === 'Tab') {\n\t\t\t\t\tif (index === lastFocusableIndex && !event.shiftKey) {\n\t\t\t\t\t\tconst selector = selectors.join(',');\n\t\t\t\t\t\tconst focusableElements = Array.from(\n\t\t\t\t\t\t\tdocument.querySelectorAll(selector)\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst indexOfButton = focusableElements.findIndex(\n\t\t\t\t\t\t\t(el) => el.id === id\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst nextElement = focusableElements[indexOfButton + 1];\n\t\t\t\t\t\tif (!nextElement) return;\n\t\t\t\t\t\telse if (nextElement instanceof HTMLElement) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tcloseDropdown();\n\t\t\t\t\t\t\tnextElement.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (index === firstFocusableIndex && event.shiftKey) {\n\t\t\t\t\t\tconst nextElement = document.querySelector(`#${id}`);\n\t\t\t\t\t\tif (!nextElement) return;\n\t\t\t\t\t\telse if (nextElement instanceof HTMLElement) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tnextElement.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\treturn {\n\t\t\t...rest,\n\t\t\tdisabled: rest.disabled || props.disabled,\n\t\t\tid: itemid,\n\t\t\tonClick,\n\t\t\tonKeydown,\n\t\t};\n\t});\n});\n\nconst wrapper = ref<HTMLElement>();\nconst content = ref<HTMLElement>();\nconst bubblearrow = ref<HTMLElement>();\n\nconst { floatingStyles, placement, middlewareData } = useFloating(\n\twrapper,\n\tcontent,\n\t{\n\t\tplacement: props.placement,\n\t\twhileElementsMounted: autoUpdate,\n\t\tmiddleware: [\n\t\t\tflip(),\n\t\t\toffset(props.offset),\n\t\t\tshift({ padding: props.padding }),\n\t\t\tarrow({\n\t\t\t\telement: bubblearrow,\n\t\t\t\tpadding: props.arrowPadding,\n\t\t\t}),\n\t\t],\n\t}\n);\n\nuseIntersectionObserver(\n\twrapper,\n\t([{ intersectionRatio }]) => {\n\t\tif (intersectionRatio !== 1 && open.value) closeDropdown();\n\t},\n\t{ threshold: [0, 1] }\n);\n\nconst opening = ref(false);\nconst open = ref(false);\nconst closing = ref(false);\nconst closed = ref(true);\n\nconst arrowAttributes = computed(() => {\n\tif (middlewareData.value.arrow) {\n\t\tconst { x, y } = middlewareData.value.arrow;\n\t\treturn {\n\t\t\tstyle: {\n\t\t\t\tleft: `${x}px`,\n\t\t\t\ttop: `${y}px`,\n\t\t\t},\n\t\t};\n\t}\n\treturn undefined;\n});\n\n/* On click of the trigger attach elements */\nconst onClick = () => {\n\tif (opening.value || closing.value) return;\n\tif (open.value) {\n\t\tcloseDropdown();\n\t} else {\n\t\topenDropdown();\n\t}\n};\n\nconst onKeydown = async (event: KeyboardEvent) => {\n\tlet firstFocusableIndex: number = props.items.findIndex((el) => !el.disabled);\n\tlet lastFocusableIndex: number = findRightIndex(\n\t\tprops.items,\n\t\t(item) => !item.disabled\n\t);\n\tif (event.key === 'ArrowDown') {\n\t\tevent.preventDefault();\n\t\tif (closing.value || opening.value) return;\n\t\tif (closed.value) {\n\t\t\tawait openDropdown();\n\t\t}\n\t\tif (\n\t\t\tcontent.value &&\n\t\t\tmappedItems.value.length &&\n\t\t\tfirstFocusableIndex !== -1\n\t\t) {\n\t\t\tconst idToFocus = mappedItems.value[firstFocusableIndex].id;\n\t\t\tconst option = content.value.querySelector(`#${idToFocus}`);\n\t\t\tif (option && option instanceof HTMLElement) {\n\t\t\t\toption.focus();\n\t\t\t}\n\t\t}\n\t} else if (event.key === 'ArrowUp') {\n\t\tevent.preventDefault();\n\t\tif (closing.value || opening.value) return;\n\t\tif (closed.value) {\n\t\t\tawait openDropdown();\n\t\t}\n\t\tif (\n\t\t\tcontent.value &&\n\t\t\tmappedItems.value.length &&\n\t\t\tlastFocusableIndex !== -1\n\t\t) {\n\t\t\tconst idToFocus = mappedItems.value[lastFocusableIndex].id;\n\t\t\tconst option = content.value.querySelector(`#${idToFocus}`);\n\t\t\tif (option && option instanceof HTMLElement) {\n\t\t\t\toption.focus();\n\t\t\t}\n\t\t}\n\t} else if (event.key === 'Tab') {\n\t\tif (open.value && !event.shiftKey) {\n\t\t\tevent.preventDefault();\n\t\t\tif (\n\t\t\t\tcontent.value &&\n\t\t\t\tmappedItems.value.length &&\n\t\t\t\tfirstFocusableIndex !== -1\n\t\t\t) {\n\t\t\t\tconst idToFocus = mappedItems.value[firstFocusableIndex].id;\n\t\t\t\tconst option = content.value.querySelector(`#${idToFocus}`);\n\t\t\t\tif (option && option instanceof HTMLElement) {\n\t\t\t\t\toption.focus();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\nconst onClickDocument = (event: Event) => {\n\tconst target = event.target;\n\tif (!target) return;\n\tif (target instanceof HTMLElement) {\n\t\tlet isOutside = true;\n\n\t\tif (wrapper.value) {\n\t\t\tif (wrapper.value.contains(target)) {\n\t\t\t\tisOutside = false;\n\t\t\t}\n\t\t}\n\t\tif (content.value) {\n\t\t\tif (content.value.contains(target)) {\n\t\t\t\tisOutside = false;\n\t\t\t}\n\t\t}\n\n\t\tif (isOutside) {\n\t\t\tcloseDropdown();\n\t\t}\n\t}\n};\n\nconst onDocumentFocus = (event: FocusEvent) => {\n\tconst target = event.target;\n\tif (!target) return;\n\tif (target instanceof HTMLElement) {\n\t\tlet isOutside = true;\n\n\t\tif (wrapper.value) {\n\t\t\tif (wrapper.value.contains(target)) {\n\t\t\t\tisOutside = false;\n\t\t\t}\n\t\t}\n\t\tif (content.value) {\n\t\t\tif (content.value.contains(target)) {\n\t\t\t\tisOutside = false;\n\t\t\t}\n\t\t}\n\n\t\tif (isOutside) {\n\t\t\tcloseDropdown();\n\t\t}\n\t}\n};\n\nconst onEsc = (event: KeyboardEvent) => {\n\tif (open.value) {\n\t\tif (event.key === 'Escape') {\n\t\t\tif (document.activeElement?.id !== id) {\n\t\t\t\tconst button = document.querySelector(`#${id}`);\n\t\t\t\tif (button instanceof HTMLElement) {\n\t\t\t\t\tbutton.focus();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcloseDropdown();\n\t\t}\n\t}\n};\nconst hasOpenedOnce = ref(false);\nconst openDropdown = async () => {\n\thasOpenedOnce.value = true;\n\tclosed.value = false;\n\tclosing.value = false;\n\topening.value = true;\n\tawait wait(50);\n\topen.value = true;\n\topening.value = false;\n\t/* Attach listeners to document so we don't have to track them one by one */\n\tdocument.addEventListener('click', onClickDocument, { passive: true });\n\tdocument.addEventListener('focusin', onDocumentFocus, { passive: true });\n\tdocument.addEventListener('keydown', onEsc, { passive: true });\n};\n\nconst closeDropdown = async () => {\n\topen.value = false;\n\topening.value = false;\n\tclosing.value = true;\n\tawait wait(props.transitionDuration);\n\tclosing.value = false;\n\tclosed.value = true;\n\tdocument.removeEventListener('click', onClickDocument);\n\tdocument.removeEventListener('focusin', onDocumentFocus);\n\tdocument.removeEventListener('keydown', onEsc);\n};\n\nconst attributes = computed(() => {\n\tconst classes = {\n\t\t'bb-dropdown--block': props.block,\n\t\t[`bb-dropdown--theme-${props.theme}`]: props.theme,\n\t};\n\treturn {\n\t\tclass: classes,\n\t};\n});\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbDropdown';\n</style>\n"],"names":["props","__props","id","useId","mappedItems","computed","firstFocusableIndex","el","lastFocusableIndex","findRightIndex","item","index","itemid","handler","rest","onClick","closeDropdown","nextElement","onKeydown","event","content","option","selectors","selector","indexOfPrevious","i","focusableElements","indexOfButton","wrapper","ref","bubblearrow","floatingStyles","placement","middlewareData","useFloating","autoUpdate","flip","offset","shift","arrow","useIntersectionObserver","intersectionRatio","open","opening","closing","closed","arrowAttributes","x","y","openDropdown","idToFocus","onClickDocument","target","isOutside","onDocumentFocus","onEsc","_a","button","hasOpenedOnce","wait","attributes"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA8RA,UAAMA,IAAQC,GAURC,IAAKF,EAAM,MAAM,MAAMG,KAAQ,GAAG,KAAK,IAEvCC,IAAcC,EAAuB,MAAM;AAC5C,UAAAC,IAA8BN,EAAM,MAAM,UAAU,CAACO,MAAO,CAACA,EAAG,QAAQ,GACxEC,IAA6BC;AAAA,QAChCT,EAAM;AAAA,QACN,CAACU,MAAS,CAACA,EAAK;AAAA,MAAA;AAGjB,aAAOV,EAAM,MAAM,IAAI,CAACU,GAAMC,MAAU;AACvC,cAAMC,IAAS,GAAGV,CAAE,SAASQ,EAAK,GAAG,IAC/B,EAAE,SAASG,GAAS,GAAGC,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c,QAAQ,IACtBb,EAAO,QAAQ,IACfD,EAAQ,QAAQ,IAChBD,EAAQ,QAAQ,IAChB,MAAMgB,EAAK,EAAE,GACbjB,EAAK,QAAQ,IACbC,EAAQ,QAAQ,IAEhB,SAAS,iBAAiB,SAASQ,GAAiB,EAAE,SAAS,IAAM,GACrE,SAAS,iBAAiB,WAAWG,GAAiB,EAAE,SAAS,IAAM,GACvE,SAAS,iBAAiB,WAAWC,GAAO,EAAE,SAAS,IAAM;AAAA,IAAA,GAGxDvC,IAAgB,YAAY;AACjC,MAAA0B,EAAK,QAAQ,IACbC,EAAQ,QAAQ,IAChBC,EAAQ,QAAQ,IACV,MAAAe,EAAK3D,EAAM,kBAAkB,GACnC4C,EAAQ,QAAQ,IAChBC,EAAO,QAAQ,IACN,SAAA,oBAAoB,SAASM,CAAe,GAC5C,SAAA,oBAAoB,WAAWG,CAAe,GAC9C,SAAA,oBAAoB,WAAWC,CAAK;AAAA,IAAA,GAGxCK,IAAavD,EAAS,OAKpB;AAAA,MACN,OALe;AAAA,QACf,sBAAsBL,EAAM;AAAA,QAC5B,CAAC,sBAAsBA,EAAM,KAAK,EAAE,GAAGA,EAAM;AAAA,MAAA;AAAA,IAGtC,EAER;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index71.js","sources":["../src/components/BbDropdown/BbDropdown.vue"],"sourcesContent":["<template>\n\t<span class=\"bb-dropdown\" v-bind=\"attributes\">\n\t\t<span ref=\"wrapper\" class=\"bb-dropdown__wrapper\">\n\t\t\t<slot\n\t\t\t\tname=\"activator\"\n\t\t\t\tv-bind=\"{\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t'aria-expanded': open,\n\t\t\t\t\t\t'aria-controls': `menu_${id}`,\n\t\t\t\t\t\tid,\n\t\t\t\t\t\tonClick,\n\t\t\t\t\t\tonKeydown,\n\t\t\t\t\t\tdisabled,\n\t\t\t\t\t},\n\t\t\t\t\tclosed: closed,\n\t\t\t\t\tclosing: closing,\n\t\t\t\t\tdisabled: disabled,\n\t\t\t\t\topen: open,\n\t\t\t\t\topening: opening,\n\t\t\t\t\tplacement: placement,\n\t\t\t\t}\"\n\t\t\t></slot>\n\t\t</span>\n\t\t<teleport v-if=\"hasOpenedOnce || eager\" to=\"body\">\n\t\t\t<span\n\t\t\t\t:id=\"`menu_${id}`\"\n\t\t\t\tref=\"content\"\n\t\t\t\t:aria-labelledby=\"id\"\n\t\t\t\taria-role=\"menu\"\n\t\t\t\tclass=\"bb-dropdown__bubble-container\"\n\t\t\t\t:class=\"{\n\t\t\t\t\t[`bb-dropdown__bubble-container--${placement}`]: true,\n\t\t\t\t\t[`bb-dropdown__bubble-container--${theme}`]: theme,\n\t\t\t\t\t'bb-dropdown__bubble-container--hidden': closed,\n\t\t\t\t\t'bb-dropdown__bubble-container--closing': closing,\n\t\t\t\t\t'bb-dropdown__bubble-container--opening': opening,\n\t\t\t\t\t'bb-dropdown__bubble-container--open': open,\n\t\t\t\t}\"\n\t\t\t\t:style=\"{\n\t\t\t\t\t...floatingStyles,\n\t\t\t\t\ttransitionDuration: `${props.transitionDuration}ms`,\n\t\t\t\t}\"\n\t\t\t>\n\t\t\t\t<span\n\t\t\t\t\tref=\"bubblearrow\"\n\t\t\t\t\tclass=\"bb-dropdown__arrow\"\n\t\t\t\t\tv-bind=\"arrowAttributes\"\n\t\t\t\t></span>\n\t\t\t\t<span class=\"bb-dropdown__bubble\" :style=\"{ width: `${width}px` }\">\n\t\t\t\t\t<slot\n\t\t\t\t\t\t:closed=\"closed\"\n\t\t\t\t\t\t:closing=\"closing\"\n\t\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\t\tname=\"prepend\"\n\t\t\t\t\t\t:open=\"open\"\n\t\t\t\t\t\t:opening=\"opening\"\n\t\t\t\t\t\t:placement=\"placement\"\n\t\t\t\t\t></slot>\n\t\t\t\t\t<span class=\"bb-dropdown__items-container\">\n\t\t\t\t\t\t<template v-for=\"(item, index) in mappedItems\" :key=\"item.key\">\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:closed=\"closed\"\n\t\t\t\t\t\t\t\t:closing=\"closing\"\n\t\t\t\t\t\t\t\t:disabled=\"item.disabled\"\n\t\t\t\t\t\t\t\t:index=\"index\"\n\t\t\t\t\t\t\t\t:item=\"items[index]\"\n\t\t\t\t\t\t\t\t:name=\"`item:prepend`\"\n\t\t\t\t\t\t\t\t:open=\"open\"\n\t\t\t\t\t\t\t\t:opening=\"opening\"\n\t\t\t\t\t\t\t\t:placement=\"placement\"\n\t\t\t\t\t\t\t\t:text=\"item.text\"\n\t\t\t\t\t\t\t></slot>\n\t\t\t\t\t\t\t<BaseButton\n\t\t\t\t\t\t\t\t:aria-role=\"'menuitem'\"\n\t\t\t\t\t\t\t\tclass=\"bb-dropdown__item\"\n\t\t\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t\t\t'bb-dropdown__item--first': index === 0,\n\t\t\t\t\t\t\t\t\t'bb-dropdown__item--last': index === items.length - 1,\n\t\t\t\t\t\t\t\t}\"\n\t\t\t\t\t\t\t\t:data-dropdown-item=\"true\"\n\t\t\t\t\t\t\t\tv-bind=\"item\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t\t:closed=\"closed\"\n\t\t\t\t\t\t\t\t\t:closing=\"closing\"\n\t\t\t\t\t\t\t\t\t:disabled=\"item.disabled\"\n\t\t\t\t\t\t\t\t\t:index=\"index\"\n\t\t\t\t\t\t\t\t\t:item=\"item\"\n\t\t\t\t\t\t\t\t\t:name=\"item.key\"\n\t\t\t\t\t\t\t\t\t:open=\"open\"\n\t\t\t\t\t\t\t\t\t:opening=\"opening\"\n\t\t\t\t\t\t\t\t\t:placement=\"placement\"\n\t\t\t\t\t\t\t\t\t:text=\"item.text\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t\t\t:closed=\"closed\"\n\t\t\t\t\t\t\t\t\t\t:closing=\"closing\"\n\t\t\t\t\t\t\t\t\t\t:disabled=\"item.disabled\"\n\t\t\t\t\t\t\t\t\t\t:index=\"index\"\n\t\t\t\t\t\t\t\t\t\t:item=\"item\"\n\t\t\t\t\t\t\t\t\t\tname=\"item\"\n\t\t\t\t\t\t\t\t\t\t:open=\"open\"\n\t\t\t\t\t\t\t\t\t\t:opening=\"opening\"\n\t\t\t\t\t\t\t\t\t\t:placement=\"placement\"\n\t\t\t\t\t\t\t\t\t\t:text=\"item.text\"\n\t\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</BaseButton>\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:closed=\"closed\"\n\t\t\t\t\t\t\t\t:closing=\"closing\"\n\t\t\t\t\t\t\t\t:disabled=\"item.disabled\"\n\t\t\t\t\t\t\t\t:index=\"index\"\n\t\t\t\t\t\t\t\t:item=\"items[index]\"\n\t\t\t\t\t\t\t\t:name=\"`item:append`\"\n\t\t\t\t\t\t\t\t:open=\"open\"\n\t\t\t\t\t\t\t\t:opening=\"opening\"\n\t\t\t\t\t\t\t\t:placement=\"placement\"\n\t\t\t\t\t\t\t\t:text=\"item.text\"\n\t\t\t\t\t\t\t></slot>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</span>\n\t\t\t\t\t<slot\n\t\t\t\t\t\t:closed=\"closed\"\n\t\t\t\t\t\t:closing=\"closing\"\n\t\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\t\tname=\"append\"\n\t\t\t\t\t\t:open=\"open\"\n\t\t\t\t\t\t:opening=\"opening\"\n\t\t\t\t\t\t:placement=\"placement\"\n\t\t\t\t\t></slot>\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t</teleport>\n\t</span>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref } from 'vue';\nimport { findRightIndex } from '@/utilities/functions/findRightIndex';\nimport {\n\tuseFloating,\n\tautoUpdate,\n\tflip,\n\tshift,\n\tarrow,\n\toffset,\n} from '@floating-ui/vue';\nimport { useId } from '@/composables/useId';\nimport { wait } from '@/utilities/functions/wait';\nimport { useIntersectionObserver } from '@vueuse/core';\nimport BaseButton from '../BaseButton/BaseButton.vue';\nimport selectors from 'focusable-selectors';\nimport type { BaseButtonProps } from '../BaseButton/BaseButton.vue';\nimport type { CommonProps } from '@/types/CommonProps';\n\nexport type BbDropdownProps = Pick<\n\tCommonProps,\n\t| 'arrowPadding'\n\t| 'block'\n\t| 'disabled'\n\t| 'eager'\n\t| 'id'\n\t| 'offset'\n\t| 'padding'\n\t| 'placement'\n\t| 'theme'\n\t| 'transitionDuration'\n> & {\n\t/**\n\t * Array used to render each dropdown button.\n\t * They can act as `button`, as `a`, or as `router-link`\n\t * as they are based on the functionality provided by\n\t * `BaseButton`\n\t */\n\titems: Item[];\n\t/**\n\t * Width of the dropdown in pixels.\n\t */\n\twidth?: number;\n};\n\ndefineSlots<\n\t{\n\t\tactivator?: (props: {\n\t\t\tprops: {\n\t\t\t\t'aria-expanded': boolean;\n\t\t\t\t'aria-controls': string;\n\t\t\t\tid: string;\n\t\t\t\tonClick: MappedItem['onClick'];\n\t\t\t\tonKeydown: MappedItem['onKeydown'];\n\t\t\t\tdisabled?: BbDropdownProps['disabled'];\n\t\t\t};\n\t\t\tclosed: boolean;\n\t\t\tclosing: boolean;\n\t\t\tdisabled?: boolean;\n\t\t\topen: boolean;\n\t\t\topening: boolean;\n\t\t\tplacement: BbDropdownProps['placement'];\n\t\t}) => any;\n\t\tprepend?: (props: {\n\t\t\tclosed: boolean;\n\t\t\tclosing: boolean;\n\t\t\tdisabled?: boolean;\n\t\t\topen: boolean;\n\t\t\topening: boolean;\n\t\t\tplacement: BbDropdownProps['placement'];\n\t\t}) => any;\n\t\t'item:prepend'?: (props: {\n\t\t\tclosed: boolean;\n\t\t\tclosing: boolean;\n\t\t\tdisabled?: MappedItem['disabled'];\n\t\t\tindex: number;\n\t\t\titem: BbDropdownProps['items'][number];\n\t\t\topen: boolean;\n\t\t\topening: boolean;\n\t\t\tplacement: BbDropdownProps['placement'];\n\t\t\ttext: MappedItem['text'];\n\t\t}) => any;\n\t\titem?: (props: {\n\t\t\tclosed: boolean;\n\t\t\tclosing: boolean;\n\t\t\tdisabled?: MappedItem['disabled'];\n\t\t\tindex: number;\n\t\t\titem: BbDropdownProps['items'][number];\n\t\t\topen: boolean;\n\t\t\topening: boolean;\n\t\t\tplacement: BbDropdownProps['placement'];\n\t\t\ttext: MappedItem['text'];\n\t\t}) => any;\n\t\t'item:append'?: (props: {\n\t\t\tclosed: boolean;\n\t\t\tclosing: boolean;\n\t\t\tdisabled?: MappedItem['disabled'];\n\t\t\tindex: number;\n\t\t\titem: BbDropdownProps['items'][number];\n\t\t\topen: boolean;\n\t\t\topening: boolean;\n\t\t\tplacement: BbDropdownProps['placement'];\n\t\t\ttext: MappedItem['text'];\n\t\t}) => any;\n\t\tappend?: (props: {\n\t\t\tclosed: boolean;\n\t\t\tclosing: boolean;\n\t\t\tdisabled?: boolean;\n\t\t\topen: boolean;\n\t\t\topening: boolean;\n\t\t\tplacement: BbDropdownProps['placement'];\n\t\t}) => any;\n\t} & {\n\t\t[key: string]: (props: {\n\t\t\tclosed: boolean;\n\t\t\tclosing: boolean;\n\t\t\tdisabled?: MappedItem['disabled'];\n\t\t\tindex: number;\n\t\t\titem: BbDropdownProps['items'][number];\n\t\t\topen: boolean;\n\t\t\topening: boolean;\n\t\t\tplacement: BbDropdownProps['placement'];\n\t\t\ttext: MappedItem['text'];\n\t\t}) => any;\n\t}\n>();\n\nexport type Item = Omit<BaseButtonProps, 'block' | 'tag' | 'type'> & {\n\t/**\n\t * Click handler of the item.\n\t */\n\tonClick?: (...args: any[]) => any;\n\t/**\n\t * Key used to identify the element.\n\t */\n\tkey: string;\n};\n\nexport type MappedItem = Item & {\n\t/**\n\t * Identifier of the element among it's siblings.\n\t */\n\tid: string;\n\t/**\n\t * Keydown event used to handle accessibility.\n\t */\n\tonKeydown: (event: KeyboardEvent) => void;\n};\n\nconst props = withDefaults(defineProps<BbDropdownProps>(), {\n\tarrowPadding: 10,\n\tplacement: 'bottom',\n\ttheme: 'default',\n\ttransitionDuration: 150,\n\twidth: 200,\n\tpadding: 6,\n\toffset: 3,\n});\n\nconst id = props.id ?? `bb_${useId().id.value}`;\n\nconst mappedItems = computed<MappedItem[]>(() => {\n\tlet firstFocusableIndex: number = props.items.findIndex((el) => !el.disabled);\n\tlet lastFocusableIndex: number = findRightIndex(\n\t\tprops.items,\n\t\t(item) => !item.disabled\n\t);\n\n\treturn props.items.map((item, index) => {\n\t\tconst itemid = `${id}-item-${item.key}`;\n\t\tconst { onClick: handler, ...rest } = item;\n\n\t\t/* Id a click handler has been passed close the dropdown\n\t\t * return focus and run the handler\n\t\t */\n\t\tconst onClick = async () => {\n\t\t\tawait closeDropdown();\n\t\t\tconst nextElement = document.querySelector(`#${id}`);\n\t\t\tif (!nextElement) return;\n\t\t\telse if (nextElement instanceof HTMLElement) {\n\t\t\t\tnextElement.focus();\n\t\t\t}\n\t\t\tif (handler) handler();\n\t\t};\n\n\t\t/**\n\t\t * On keydown\n\t\t * arrow down move to the next focusable element if it's not the last\n\t\t * arrow up move to the previous focusable element if it's not the first\n\t\t * on tab search the next focusable element after the button that opens the dropdown\n\t\t * if an element is found focus on that\n\t\t * (the menu is attached to body so it's not in order)\n\t\t */\n\t\tconst onKeydown = (event: KeyboardEvent) => {\n\t\t\tif (\n\t\t\t\tevent.target instanceof HTMLElement &&\n\t\t\t\tevent.target.dataset['dropdownItem']\n\t\t\t) {\n\t\t\t\tif (!content.value) return;\n\t\t\t\tif (event.key === 'ArrowDown') {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tif (content.value && index !== lastFocusableIndex) {\n\t\t\t\t\t\tconst option = content.value.querySelector(\n\t\t\t\t\t\t\tselectors.map((selector) => `#${itemid} ~ ${selector}`).join(',')\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif (option && option instanceof HTMLElement) {\n\t\t\t\t\t\t\toption.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (event.key === 'ArrowUp') {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tif (content.value && index !== firstFocusableIndex) {\n\t\t\t\t\t\tconst indexOfPrevious = findRightIndex(props.items, (item, i) => {\n\t\t\t\t\t\t\treturn i < index && !item.disabled;\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tconst options = Array.from(\n\t\t\t\t\t\t\tcontent.value.querySelectorAll(`.bb-dropdown__item`)\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tconst option = options[indexOfPrevious];\n\n\t\t\t\t\t\tif (option && option instanceof HTMLElement) {\n\t\t\t\t\t\t\toption.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (event.key === 'Tab') {\n\t\t\t\t\tif (index === lastFocusableIndex && !event.shiftKey) {\n\t\t\t\t\t\tconst selector = selectors.join(',');\n\t\t\t\t\t\tconst focusableElements = Array.from(\n\t\t\t\t\t\t\tdocument.querySelectorAll(selector)\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst indexOfButton = focusableElements.findIndex(\n\t\t\t\t\t\t\t(el) => el.id === id\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst nextElement = focusableElements[indexOfButton + 1];\n\t\t\t\t\t\tif (!nextElement) return;\n\t\t\t\t\t\telse if (nextElement instanceof HTMLElement) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tcloseDropdown();\n\t\t\t\t\t\t\tnextElement.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (index === firstFocusableIndex && event.shiftKey) {\n\t\t\t\t\t\tconst nextElement = document.querySelector(`#${id}`);\n\t\t\t\t\t\tif (!nextElement) return;\n\t\t\t\t\t\telse if (nextElement instanceof HTMLElement) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tnextElement.focus();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\treturn {\n\t\t\t...rest,\n\t\t\tdisabled: rest.disabled || props.disabled,\n\t\t\tid: itemid,\n\t\t\tonClick,\n\t\t\tonKeydown,\n\t\t};\n\t});\n});\n\nconst wrapper = ref<HTMLElement>();\nconst content = ref<HTMLElement>();\nconst bubblearrow = ref<HTMLElement>();\n\nconst { floatingStyles, placement, middlewareData } = useFloating(\n\twrapper,\n\tcontent,\n\t{\n\t\tplacement: props.placement,\n\t\twhileElementsMounted: autoUpdate,\n\t\tmiddleware: [\n\t\t\tflip(),\n\t\t\toffset(props.offset),\n\t\t\tshift({ padding: props.padding }),\n\t\t\tarrow({\n\t\t\t\telement: bubblearrow,\n\t\t\t\tpadding: props.arrowPadding,\n\t\t\t}),\n\t\t],\n\t}\n);\n\nuseIntersectionObserver(\n\twrapper,\n\t([{ intersectionRatio }]) => {\n\t\tif (intersectionRatio !== 1 && open.value) closeDropdown();\n\t},\n\t{ threshold: [0, 1] }\n);\n\nconst opening = ref(false);\nconst open = ref(false);\nconst closing = ref(false);\nconst closed = ref(true);\n\nconst arrowAttributes = computed(() => {\n\tif (middlewareData.value.arrow) {\n\t\tconst { x, y } = middlewareData.value.arrow;\n\t\treturn {\n\t\t\tstyle: {\n\t\t\t\tleft: `${x}px`,\n\t\t\t\ttop: `${y}px`,\n\t\t\t},\n\t\t};\n\t}\n\treturn undefined;\n});\n\n/* On click of the trigger attach elements */\nconst onClick = () => {\n\tif (opening.value || closing.value) return;\n\tif (open.value) {\n\t\tcloseDropdown();\n\t} else {\n\t\topenDropdown();\n\t}\n};\n\nconst onKeydown = async (event: KeyboardEvent) => {\n\tlet firstFocusableIndex: number = props.items.findIndex((el) => !el.disabled);\n\tlet lastFocusableIndex: number = findRightIndex(\n\t\tprops.items,\n\t\t(item) => !item.disabled\n\t);\n\tif (event.key === 'ArrowDown') {\n\t\tevent.preventDefault();\n\t\tif (closing.value || opening.value) return;\n\t\tif (closed.value) {\n\t\t\tawait openDropdown();\n\t\t}\n\t\tif (\n\t\t\tcontent.value &&\n\t\t\tmappedItems.value.length &&\n\t\t\tfirstFocusableIndex !== -1\n\t\t) {\n\t\t\tconst idToFocus = mappedItems.value[firstFocusableIndex].id;\n\t\t\tconst option = content.value.querySelector(`#${idToFocus}`);\n\t\t\tif (option && option instanceof HTMLElement) {\n\t\t\t\toption.focus();\n\t\t\t}\n\t\t}\n\t} else if (event.key === 'ArrowUp') {\n\t\tevent.preventDefault();\n\t\tif (closing.value || opening.value) return;\n\t\tif (closed.value) {\n\t\t\tawait openDropdown();\n\t\t}\n\t\tif (\n\t\t\tcontent.value &&\n\t\t\tmappedItems.value.length &&\n\t\t\tlastFocusableIndex !== -1\n\t\t) {\n\t\t\tconst idToFocus = mappedItems.value[lastFocusableIndex].id;\n\t\t\tconst option = content.value.querySelector(`#${idToFocus}`);\n\t\t\tif (option && option instanceof HTMLElement) {\n\t\t\t\toption.focus();\n\t\t\t}\n\t\t}\n\t} else if (event.key === 'Tab') {\n\t\tif (open.value && !event.shiftKey) {\n\t\t\tevent.preventDefault();\n\t\t\tif (\n\t\t\t\tcontent.value &&\n\t\t\t\tmappedItems.value.length &&\n\t\t\t\tfirstFocusableIndex !== -1\n\t\t\t) {\n\t\t\t\tconst idToFocus = mappedItems.value[firstFocusableIndex].id;\n\t\t\t\tconst option = content.value.querySelector(`#${idToFocus}`);\n\t\t\t\tif (option && option instanceof HTMLElement) {\n\t\t\t\t\toption.focus();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\n\nconst onClickDocument = (event: Event) => {\n\tconst target = event.target;\n\tif (!target) return;\n\tif (target instanceof HTMLElement) {\n\t\tlet isOutside = true;\n\n\t\tif (wrapper.value) {\n\t\t\tif (wrapper.value.contains(target)) {\n\t\t\t\tisOutside = false;\n\t\t\t}\n\t\t}\n\t\tif (content.value) {\n\t\t\tif (content.value.contains(target)) {\n\t\t\t\tisOutside = false;\n\t\t\t}\n\t\t}\n\n\t\tif (isOutside) {\n\t\t\tcloseDropdown();\n\t\t}\n\t}\n};\n\nconst onDocumentFocus = (event: FocusEvent) => {\n\tconst target = event.target;\n\tif (!target) return;\n\tif (target instanceof HTMLElement) {\n\t\tlet isOutside = true;\n\n\t\tif (wrapper.value) {\n\t\t\tif (wrapper.value.contains(target)) {\n\t\t\t\tisOutside = false;\n\t\t\t}\n\t\t}\n\t\tif (content.value) {\n\t\t\tif (content.value.contains(target)) {\n\t\t\t\tisOutside = false;\n\t\t\t}\n\t\t}\n\n\t\tif (isOutside) {\n\t\t\tcloseDropdown();\n\t\t}\n\t}\n};\n\nconst onEsc = (event: KeyboardEvent) => {\n\tif (open.value) {\n\t\tif (event.key === 'Escape') {\n\t\t\tif (document.activeElement?.id !== id) {\n\t\t\t\tconst button = document.querySelector(`#${id}`);\n\t\t\t\tif (button instanceof HTMLElement) {\n\t\t\t\t\tbutton.focus();\n\t\t\t\t}\n\t\t\t}\n\t\t\tcloseDropdown();\n\t\t}\n\t}\n};\nconst hasOpenedOnce = ref(false);\nconst openDropdown = async () => {\n\thasOpenedOnce.value = true;\n\tclosed.value = false;\n\tclosing.value = false;\n\topening.value = true;\n\tawait wait(50);\n\topen.value = true;\n\topening.value = false;\n\t/* Attach listeners to document so we don't have to track them one by one */\n\tdocument.addEventListener('click', onClickDocument, { passive: true });\n\tdocument.addEventListener('focusin', onDocumentFocus, { passive: true });\n\tdocument.addEventListener('keydown', onEsc, { passive: true });\n};\n\nconst closeDropdown = async () => {\n\topen.value = false;\n\topening.value = false;\n\tclosing.value = true;\n\tawait wait(props.transitionDuration);\n\tclosing.value = false;\n\tclosed.value = true;\n\tdocument.removeEventListener('click', onClickDocument);\n\tdocument.removeEventListener('focusin', onDocumentFocus);\n\tdocument.removeEventListener('keydown', onEsc);\n};\n\nconst attributes = computed(() => {\n\tconst classes = {\n\t\t'bb-dropdown--block': props.block,\n\t\t[`bb-dropdown--theme-${props.theme}`]: props.theme,\n\t};\n\treturn {\n\t\tclass: classes,\n\t};\n});\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbDropdown';\n</style>\n"],"names":["props","__props","id","useId","mappedItems","computed","firstFocusableIndex","el","lastFocusableIndex","findRightIndex","item","index","itemid","handler","rest","onClick","closeDropdown","nextElement","onKeydown","event","content","option","selectors","selector","indexOfPrevious","i","focusableElements","indexOfButton","wrapper","ref","bubblearrow","floatingStyles","placement","middlewareData","useFloating","autoUpdate","flip","offset","shift","arrow","useIntersectionObserver","intersectionRatio","open","opening","closing","closed","arrowAttributes","x","y","openDropdown","idToFocus","onClickDocument","target","isOutside","onDocumentFocus","onEsc","_a","button","hasOpenedOnce","wait","attributes"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA8RA,UAAMA,IAAQC,GAURC,IAAKF,EAAM,MAAM,MAAMG,KAAQ,GAAG,KAAK,IAEvCC,IAAcC,EAAuB,MAAM;AAC5C,UAAAC,IAA8BN,EAAM,MAAM,UAAU,CAACO,MAAO,CAACA,EAAG,QAAQ,GACxEC,IAA6BC;AAAA,QAChCT,EAAM;AAAA,QACN,CAACU,MAAS,CAACA,EAAK;AAAA,MAAA;AAGjB,aAAOV,EAAM,MAAM,IAAI,CAACU,GAAMC,MAAU;AACvC,cAAMC,IAAS,GAAGV,CAAE,SAASQ,EAAK,GAAG,IAC/B,EAAE,SAASG,GAAS,GAAGC,MAASJ,GAKhCK,IAAU,YAAY;AAC3B,gBAAMC,EAAc;AACpB,gBAAMC,IAAc,SAAS,cAAc,IAAIf,CAAE,EAAE;AACnD,cAAKe,EAAa,CACTA,aAAuB,eAC/BA,EAAY,MAAM;AAAA,cAFD;AAIlB,UAAIJ,KAAiBA;QAAA,GAWhBK,IAAY,CAACC,MAAyB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