bitboss-ui 2.0.7 → 2.0.9

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 (413) hide show
  1. package/dist/index.js +139 -138
  2. package/dist/index.js.map +1 -1
  3. package/dist/index10.js +7 -78
  4. package/dist/index10.js.map +1 -1
  5. package/dist/{index100.js → index101.js} +3 -3
  6. package/dist/{index100.js.map → index101.js.map} +1 -1
  7. package/dist/{index102.js → index103.js} +3 -3
  8. package/dist/{index102.js.map → index103.js.map} +1 -1
  9. package/dist/{index104.js → index105.js} +8 -8
  10. package/dist/{index104.js.map → index105.js.map} +1 -1
  11. package/dist/{index106.js → index107.js} +9 -9
  12. package/dist/{index106.js.map → index107.js.map} +1 -1
  13. package/dist/{index108.js → index109.js} +3 -3
  14. package/dist/{index108.js.map → index109.js.map} +1 -1
  15. package/dist/index11.js +74 -35
  16. package/dist/index11.js.map +1 -1
  17. package/dist/{index110.js → index111.js} +3 -3
  18. package/dist/{index110.js.map → index111.js.map} +1 -1
  19. package/dist/{index112.js → index113.js} +3 -3
  20. package/dist/{index112.js.map → index113.js.map} +1 -1
  21. package/dist/{index114.js → index115.js} +3 -3
  22. package/dist/{index114.js.map → index115.js.map} +1 -1
  23. package/dist/{index116.js → index117.js} +8 -8
  24. package/dist/{index116.js.map → index117.js.map} +1 -1
  25. package/dist/{index118.js → index119.js} +2 -2
  26. package/dist/{index118.js.map → index119.js.map} +1 -1
  27. package/dist/index12.js +36 -189
  28. package/dist/index12.js.map +1 -1
  29. package/dist/index121.js +34 -38
  30. package/dist/index121.js.map +1 -1
  31. package/dist/index122.js +38 -38
  32. package/dist/index122.js.map +1 -1
  33. package/dist/index123.js +39 -42
  34. package/dist/index123.js.map +1 -1
  35. package/dist/index124.js +43 -31
  36. package/dist/index124.js.map +1 -1
  37. package/dist/index125.js +35 -2
  38. package/dist/index125.js.map +1 -1
  39. package/dist/index126.js +2 -21
  40. package/dist/index126.js.map +1 -1
  41. package/dist/index127.js +21 -2
  42. package/dist/index127.js.map +1 -1
  43. package/dist/index128.js +2 -312
  44. package/dist/index128.js.map +1 -1
  45. package/dist/index129.js +309 -21
  46. package/dist/index129.js.map +1 -1
  47. package/dist/index13.js +189 -78
  48. package/dist/index13.js.map +1 -1
  49. package/dist/index130.js +24 -2
  50. package/dist/index130.js.map +1 -1
  51. package/dist/index131.js +2 -5
  52. package/dist/index131.js.map +1 -1
  53. package/dist/index132.js +5 -9
  54. package/dist/index132.js.map +1 -1
  55. package/dist/index133.js +8 -5
  56. package/dist/index133.js.map +1 -1
  57. package/dist/index134.js +6 -3
  58. package/dist/index134.js.map +1 -1
  59. package/dist/index135.js +1 -1
  60. package/dist/index136.js +1 -1
  61. package/dist/index137.js +1 -1
  62. package/dist/index138.js +1 -1
  63. package/dist/index139.js +1 -1
  64. package/dist/index14.js +85 -0
  65. package/dist/index14.js.map +1 -0
  66. package/dist/index140.js +1 -1
  67. package/dist/index141.js +1 -1
  68. package/dist/index142.js +1 -1
  69. package/dist/index143.js +1 -1
  70. package/dist/index144.js +1 -1
  71. package/dist/index145.js +1 -1
  72. package/dist/index146.js +1 -1
  73. package/dist/index147.js +1 -1
  74. package/dist/index148.js +1 -1
  75. package/dist/index149.js +1 -1
  76. package/dist/index150.js +1 -1
  77. package/dist/index151.js +1 -1
  78. package/dist/index152.js +1 -1
  79. package/dist/index153.js +1 -1
  80. package/dist/index154.js +1 -1
  81. package/dist/index155.js +1 -1
  82. package/dist/index156.js +1 -1
  83. package/dist/index157.js +1 -1
  84. package/dist/index158.js +1 -1
  85. package/dist/index159.js +1 -1
  86. package/dist/{index15.js → index16.js} +4 -4
  87. package/dist/{index15.js.map → index16.js.map} +1 -1
  88. package/dist/index160.js +2 -2
  89. package/dist/{index162.js → index161.js} +1 -1
  90. package/dist/index161.js.map +1 -0
  91. package/dist/index163.js +6 -0
  92. package/dist/index163.js.map +1 -0
  93. package/dist/index165.js +1 -1
  94. package/dist/index166.js +1 -1
  95. package/dist/index167.js +1 -1
  96. package/dist/index168.js +1 -1
  97. package/dist/index169.js +1 -1
  98. package/dist/index170.js +2 -2
  99. package/dist/index171.js +6 -0
  100. package/dist/index171.js.map +1 -0
  101. package/dist/index173.js +2 -3
  102. package/dist/index173.js.map +1 -1
  103. package/dist/index174.js +1 -1
  104. package/dist/index175.js +1 -1
  105. package/dist/index176.js +1 -1
  106. package/dist/index177.js +1 -1
  107. package/dist/index178.js +1 -1
  108. package/dist/index179.js +1 -1
  109. package/dist/{index17.js → index18.js} +4 -4
  110. package/dist/{index17.js.map → index18.js.map} +1 -1
  111. package/dist/index180.js +1 -1
  112. package/dist/index181.js +1 -1
  113. package/dist/index182.js +1 -1
  114. package/dist/index183.js +1 -1
  115. package/dist/index184.js +1 -1
  116. package/dist/{index186.js → index185.js} +1 -1
  117. package/dist/index185.js.map +1 -0
  118. package/dist/index187.js +6 -0
  119. package/dist/index187.js.map +1 -0
  120. package/dist/index189.js +1 -1
  121. package/dist/index190.js +1 -1
  122. package/dist/index191.js +1 -1
  123. package/dist/index192.js +1 -1
  124. package/dist/index193.js +1 -1
  125. package/dist/index194.js +1 -1
  126. package/dist/index195.js +1 -1
  127. package/dist/index196.js +1 -1
  128. package/dist/index197.js +1 -1
  129. package/dist/index198.js +3 -81
  130. package/dist/index198.js.map +1 -1
  131. package/dist/{index19.js → index20.js} +19 -18
  132. package/dist/{index19.js.map → index20.js.map} +1 -1
  133. package/dist/index200.js +126 -2
  134. package/dist/index200.js.map +1 -1
  135. package/dist/index201.js +5 -4
  136. package/dist/index201.js.map +1 -1
  137. package/dist/index202.js +123 -2
  138. package/dist/index202.js.map +1 -1
  139. package/dist/index203.js +19 -8
  140. package/dist/index203.js.map +1 -1
  141. package/dist/index204.js +14 -124
  142. package/dist/index204.js.map +1 -1
  143. package/dist/index205.js +16 -5
  144. package/dist/index205.js.map +1 -1
  145. package/dist/index206.js +2 -123
  146. package/dist/index206.js.map +1 -1
  147. package/dist/index207.js +2 -19
  148. package/dist/index207.js.map +1 -1
  149. package/dist/index208.js +35 -16
  150. package/dist/index208.js.map +1 -1
  151. package/dist/index209.js +172 -14
  152. package/dist/index209.js.map +1 -1
  153. package/dist/index210.js +6 -2
  154. package/dist/index210.js.map +1 -1
  155. package/dist/index211.js +44 -2
  156. package/dist/index211.js.map +1 -1
  157. package/dist/index213.js +12 -173
  158. package/dist/index213.js.map +1 -1
  159. package/dist/index214.js +5 -6
  160. package/dist/index214.js.map +1 -1
  161. package/dist/index215.js +369 -43
  162. package/dist/index215.js.map +1 -1
  163. package/dist/index216.js +161 -0
  164. package/dist/index216.js.map +1 -0
  165. package/dist/index217.js +84 -13
  166. package/dist/index217.js.map +1 -1
  167. package/dist/index219.js +67 -355
  168. package/dist/index219.js.map +1 -1
  169. package/dist/{index21.js → index22.js} +21 -21
  170. package/dist/{index21.js.map → index22.js.map} +1 -1
  171. package/dist/index220.js +8 -19
  172. package/dist/index220.js.map +1 -1
  173. package/dist/index221.js +3 -27
  174. package/dist/index221.js.map +1 -1
  175. package/dist/index222.js +2 -3
  176. package/dist/index222.js.map +1 -1
  177. package/dist/index223.js +4 -249
  178. package/dist/index223.js.map +1 -1
  179. package/dist/index224.js +2 -52
  180. package/dist/index224.js.map +1 -1
  181. package/dist/index225.js +3 -44
  182. package/dist/index225.js.map +1 -1
  183. package/dist/index226.js +7 -5
  184. package/dist/index226.js.map +1 -1
  185. package/dist/index227.js +19 -49
  186. package/dist/index227.js.map +1 -1
  187. package/dist/index228.js +27 -3
  188. package/dist/index228.js.map +1 -1
  189. package/dist/index229.js +3 -3
  190. package/dist/index229.js.map +1 -1
  191. package/dist/index230.js +249 -7
  192. package/dist/index230.js.map +1 -1
  193. package/dist/index231.js +50 -156
  194. package/dist/index231.js.map +1 -1
  195. package/dist/index232.js +38 -78
  196. package/dist/index232.js.map +1 -1
  197. package/dist/index233.js +8 -0
  198. package/dist/index233.js.map +1 -0
  199. package/dist/index234.js +49 -2
  200. package/dist/index234.js.map +1 -1
  201. package/dist/index235.js +2 -18
  202. package/dist/index235.js.map +1 -1
  203. package/dist/index236.js +2 -106
  204. package/dist/index236.js.map +1 -1
  205. package/dist/index237.js +21 -0
  206. package/dist/index237.js.map +1 -0
  207. package/dist/index238.js +53 -47
  208. package/dist/index238.js.map +1 -1
  209. package/dist/{index23.js → index24.js} +8 -8
  210. package/dist/{index23.js.map → index24.js.map} +1 -1
  211. package/dist/index240.js +100 -2
  212. package/dist/index240.js.map +1 -1
  213. package/dist/index242.js +9 -2
  214. package/dist/index242.js.map +1 -1
  215. package/dist/index243.js +2 -3
  216. package/dist/index243.js.map +1 -1
  217. package/dist/index244.js +3 -6
  218. package/dist/index244.js.map +1 -1
  219. package/dist/index245.js +12 -16
  220. package/dist/index245.js.map +1 -1
  221. package/dist/index246.js +8 -8
  222. package/dist/index246.js.map +1 -1
  223. package/dist/index247.js +9 -23
  224. package/dist/index247.js.map +1 -1
  225. package/dist/index248.js +17 -9
  226. package/dist/index248.js.map +1 -1
  227. package/dist/index257.js +1 -1
  228. package/dist/index258.js +1 -1
  229. package/dist/{index25.js → index26.js} +6 -6
  230. package/dist/{index25.js.map → index26.js.map} +1 -1
  231. package/dist/index263.js +224 -2
  232. package/dist/index263.js.map +1 -1
  233. package/dist/index264.js +4 -2
  234. package/dist/index264.js.map +1 -1
  235. package/dist/index265.js +9 -2
  236. package/dist/index265.js.map +1 -1
  237. package/dist/index266.js +5 -1
  238. package/dist/index266.js.map +1 -1
  239. package/dist/index267.js +16 -2
  240. package/dist/index267.js.map +1 -1
  241. package/dist/index268.js +9 -2
  242. package/dist/index268.js.map +1 -1
  243. package/dist/index269.js +23 -28
  244. package/dist/index269.js.map +1 -1
  245. package/dist/index270.js +199 -21
  246. package/dist/index270.js.map +1 -1
  247. package/dist/index271.js +439 -0
  248. package/dist/index271.js.map +1 -0
  249. package/dist/index272.js +121 -218
  250. package/dist/index272.js.map +1 -1
  251. package/dist/index274.js +5 -200
  252. package/dist/index274.js.map +1 -1
  253. package/dist/index275.js +2 -436
  254. package/dist/index275.js.map +1 -1
  255. package/dist/index276.js +2 -127
  256. package/dist/index276.js.map +1 -1
  257. package/dist/index277.js +2 -5
  258. package/dist/index277.js.map +1 -1
  259. package/dist/index278.js +2 -2
  260. package/dist/index278.js.map +1 -1
  261. package/dist/index279.js +2 -9
  262. package/dist/index279.js.map +1 -1
  263. package/dist/{index27.js → index28.js} +3 -3
  264. package/dist/{index27.js.map → index28.js.map} +1 -1
  265. package/dist/index280.js +2 -69
  266. package/dist/index280.js.map +1 -1
  267. package/dist/index281.js +28 -3
  268. package/dist/index281.js.map +1 -1
  269. package/dist/index282.js +22 -12
  270. package/dist/index282.js.map +1 -1
  271. package/dist/index284.js +2 -17
  272. package/dist/index284.js.map +1 -1
  273. package/dist/index285.js +68 -2
  274. package/dist/index285.js.map +1 -1
  275. package/dist/index287.js +3 -211
  276. package/dist/index287.js.map +1 -1
  277. package/dist/index288.js +211 -15
  278. package/dist/index288.js.map +1 -1
  279. package/dist/index289.js +15 -4
  280. package/dist/index289.js.map +1 -1
  281. package/dist/index290.js +11 -4
  282. package/dist/index290.js.map +1 -1
  283. package/dist/index291.js +34 -58
  284. package/dist/index291.js.map +1 -1
  285. package/dist/index292.js +4 -35
  286. package/dist/index292.js.map +1 -1
  287. package/dist/index293.js +4 -7
  288. package/dist/index293.js.map +1 -1
  289. package/dist/index294.js +57 -17
  290. package/dist/index294.js.map +1 -1
  291. package/dist/index295.js +2 -7
  292. package/dist/index295.js.map +1 -1
  293. package/dist/index296.js +7 -2
  294. package/dist/index296.js.map +1 -1
  295. package/dist/index297.js +6 -10
  296. package/dist/index297.js.map +1 -1
  297. package/dist/index298.js +17 -45
  298. package/dist/index298.js.map +1 -1
  299. package/dist/index299.js +50 -0
  300. package/dist/index299.js.map +1 -0
  301. package/dist/{index29.js → index30.js} +3 -3
  302. package/dist/{index29.js.map → index30.js.map} +1 -1
  303. package/dist/index301.js +416 -42
  304. package/dist/index301.js.map +1 -1
  305. package/dist/index302.js +50 -0
  306. package/dist/index302.js.map +1 -0
  307. package/dist/{index31.js → index32.js} +4 -4
  308. package/dist/{index31.js.map → index32.js.map} +1 -1
  309. package/dist/{index33.js → index34.js} +5 -5
  310. package/dist/{index33.js.map → index34.js.map} +1 -1
  311. package/dist/{index35.js → index36.js} +23 -22
  312. package/dist/{index35.js.map → index36.js.map} +1 -1
  313. package/dist/{index37.js → index38.js} +7 -7
  314. package/dist/{index37.js.map → index38.js.map} +1 -1
  315. package/dist/{index39.js → index40.js} +3 -3
  316. package/dist/{index39.js.map → index40.js.map} +1 -1
  317. package/dist/{index41.js → index42.js} +4 -4
  318. package/dist/{index41.js.map → index42.js.map} +1 -1
  319. package/dist/{index43.js → index44.js} +12 -11
  320. package/dist/{index43.js.map → index44.js.map} +1 -1
  321. package/dist/{index45.js → index46.js} +4 -4
  322. package/dist/{index45.js.map → index46.js.map} +1 -1
  323. package/dist/{index47.js → index48.js} +3 -3
  324. package/dist/{index47.js.map → index48.js.map} +1 -1
  325. package/dist/index5.js +14 -40
  326. package/dist/index5.js.map +1 -1
  327. package/dist/{index49.js → index50.js} +4 -4
  328. package/dist/{index49.js.map → index50.js.map} +1 -1
  329. package/dist/{index51.js → index52.js} +3 -3
  330. package/dist/{index51.js.map → index52.js.map} +1 -1
  331. package/dist/{index53.js → index54.js} +3 -3
  332. package/dist/{index53.js.map → index54.js.map} +1 -1
  333. package/dist/{index55.js → index56.js} +3 -3
  334. package/dist/{index55.js.map → index56.js.map} +1 -1
  335. package/dist/{index57.js → index58.js} +2 -2
  336. package/dist/{index57.js.map → index58.js.map} +1 -1
  337. package/dist/index6.js +38 -76
  338. package/dist/index6.js.map +1 -1
  339. package/dist/{index59.js → index60.js} +14 -13
  340. package/dist/{index59.js.map → index60.js.map} +1 -1
  341. package/dist/{index61.js → index62.js} +3 -3
  342. package/dist/{index61.js.map → index62.js.map} +1 -1
  343. package/dist/{index63.js → index64.js} +3 -3
  344. package/dist/{index63.js.map → index64.js.map} +1 -1
  345. package/dist/{index65.js → index66.js} +5 -5
  346. package/dist/{index65.js.map → index66.js.map} +1 -1
  347. package/dist/{index67.js → index68.js} +3 -3
  348. package/dist/{index67.js.map → index68.js.map} +1 -1
  349. package/dist/index7.js +78 -62
  350. package/dist/index7.js.map +1 -1
  351. package/dist/{index69.js → index70.js} +2 -2
  352. package/dist/{index69.js.map → index70.js.map} +1 -1
  353. package/dist/{index71.js → index72.js} +9 -9
  354. package/dist/{index71.js.map → index72.js.map} +1 -1
  355. package/dist/{index73.js → index74.js} +3 -3
  356. package/dist/{index73.js.map → index74.js.map} +1 -1
  357. package/dist/{index75.js → index76.js} +5 -5
  358. package/dist/{index75.js.map → index76.js.map} +1 -1
  359. package/dist/index78.js +37 -120
  360. package/dist/index78.js.map +1 -1
  361. package/dist/index79.js +130 -0
  362. package/dist/index79.js.map +1 -0
  363. package/dist/index8.js +60 -18
  364. package/dist/index8.js.map +1 -1
  365. package/dist/{index80.js → index81.js} +5 -5
  366. package/dist/{index80.js.map → index81.js.map} +1 -1
  367. package/dist/{index82.js → index83.js} +25 -24
  368. package/dist/{index82.js.map → index83.js.map} +1 -1
  369. package/dist/{index84.js → index85.js} +7 -7
  370. package/dist/{index84.js.map → index85.js.map} +1 -1
  371. package/dist/{index86.js → index87.js} +2 -2
  372. package/dist/{index86.js.map → index87.js.map} +1 -1
  373. package/dist/{index88.js → index89.js} +3 -3
  374. package/dist/{index88.js.map → index89.js.map} +1 -1
  375. package/dist/index9.js +19 -7
  376. package/dist/index9.js.map +1 -1
  377. package/dist/{index90.js → index91.js} +3 -3
  378. package/dist/{index90.js.map → index91.js.map} +1 -1
  379. package/dist/{index92.js → index93.js} +3 -3
  380. package/dist/{index92.js.map → index93.js.map} +1 -1
  381. package/dist/{index94.js → index95.js} +1 -1
  382. package/dist/index95.js.map +1 -0
  383. package/dist/{index96.js → index97.js} +3 -3
  384. package/dist/{index96.js.map → index97.js.map} +1 -1
  385. package/dist/{index98.js → index99.js} +3 -3
  386. package/dist/{index98.js.map → index99.js.map} +1 -1
  387. package/dist/style.css +1 -1
  388. package/package.json +1 -1
  389. package/dist/index120.js +0 -43
  390. package/dist/index120.js.map +0 -1
  391. package/dist/index162.js.map +0 -1
  392. package/dist/index164.js +0 -6
  393. package/dist/index164.js.map +0 -1
  394. package/dist/index172.js +0 -5
  395. package/dist/index172.js.map +0 -1
  396. package/dist/index186.js.map +0 -1
  397. package/dist/index188.js +0 -6
  398. package/dist/index188.js.map +0 -1
  399. package/dist/index212.js +0 -38
  400. package/dist/index212.js.map +0 -1
  401. package/dist/index218.js +0 -8
  402. package/dist/index218.js.map +0 -1
  403. package/dist/index241.js +0 -13
  404. package/dist/index241.js.map +0 -1
  405. package/dist/index283.js +0 -12
  406. package/dist/index283.js.map +0 -1
  407. package/dist/index300.js +0 -424
  408. package/dist/index300.js.map +0 -1
  409. package/dist/index4.js +0 -17
  410. package/dist/index4.js.map +0 -1
  411. package/dist/index77.js +0 -47
  412. package/dist/index77.js.map +0 -1
  413. package/dist/index94.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index39.js","sources":["../src/components/BaseSwitch/BaseSwitch.vue"],"sourcesContent":["<template>\n\t<span v-bind=\"containerAttributes\">\n\t\t<input v-if=\"!checked && submitWhenFalse\" v-bind=\"hiddenInputAttributes\" />\n\t\t<input v-bind=\"inputAttributes\" ref=\"checkboxInput\" />\n\t\t<span class=\"bb-base-switch-container\">\n\t\t\t<slot name=\"icon\" v-bind=\"slotAttributes\">\n\t\t\t\t<span v-bind=\"iconAttributes\">\n\t\t\t\t\t<span class=\"bb-base-switch-container__icon-thumb\"></span>\n\t\t\t\t</span>\n\t\t\t</slot>\n\t\t</span>\n\t</span>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, watch } from 'vue';\nimport { isCssColor } from '@/utilities/functions/isCssColor';\nimport { when } from '@/utilities/functions/when';\nimport type {\n\tBaseCheckboxEvents,\n\tBaseCheckboxProps,\n\tSlotAttributes,\n} from '../BaseCheckbox/BaseCheckbox.vue';\n\nexport type BaseSwitchProps = BaseCheckboxProps;\n\nexport type BaseSwitchEvents = BaseCheckboxEvents;\n\nconst props = withDefaults(defineProps<BaseSwitchProps>(), {\n\ttrueValue: true,\n\tfalseValue: false,\n});\n\nconst emit = defineEmits<BaseSwitchEvents>();\n\nexport type BaseSwitchSlots = {\n\ticon?: (props: SlotAttributes) => any;\n};\n\ndefineSlots<BaseSwitchSlots>();\n\nconst checkboxInput = ref<HTMLInputElement | null>(null);\n\nconst checked = computed(() => {\n\tif (props.checked) return true;\n\treturn JSON.stringify(props.trueValue) === JSON.stringify(props.modelValue);\n});\nconst hasFocus = ref(false);\n\nconst containerAttributes = computed(() => {\n\tconst attributes: Record<string, any> = {\n\t\tclass: {\n\t\t\t'bb-base-switch': true,\n\t\t\t'bb-base-switch--disabled': props.disabled,\n\t\t\t'bb-base-switch--errors': props.hasErrors,\n\t\t\t'bb-base-switch--indeterminate': props.indeterminate,\n\t\t\t'bb-base-switch--readonly': props.readonly,\n\t\t\t[`bb-base-switch--${props.color}`]:\n\t\t\t\tprops.color && !isCssColor(props.color),\n\t\t},\n\t};\n\tif (props.color && isCssColor(props.color)) {\n\t\tattributes['style'] = `--color: ${props.color}`;\n\t}\n\treturn attributes;\n});\n\n/**\n * This is used to keep the value compatible to common html expected values.\n * Convert to string everything that's not but do not double encode strings\n */\nconst makeInputValue = when(\n\t(item: unknown) => typeof item !== 'string',\n\tJSON.stringify\n);\n\nconst hiddenInputAttributes = computed(() => {\n\tconst value = makeInputValue(props.falseValue);\n\treturn {\n\t\tdisabled: props.disabled,\n\t\tname: props.name,\n\t\ttype: 'hidden',\n\t\tvalue: value,\n\t};\n});\n\nconst inputAttributes = computed(() => {\n\tconst value = makeInputValue(props.trueValue);\n\n\tconst onBlur = (event: FocusEvent): void => {\n\t\thasFocus.value = false;\n\t\temit('blur', event);\n\t};\n\n\tconst onChange = (event: Event): void => {\n\t\tif (event.target instanceof HTMLInputElement) {\n\t\t\tlet value = event.target.checked ? props.trueValue : props.falseValue;\n\n\t\t\temit('change', event);\n\t\t\temit('update:modelValue', value);\n\t\t}\n\t};\n\n\tconst onFocus = (event: FocusEvent): void => {\n\t\thasFocus.value = true;\n\t\temit('focus', event);\n\t};\n\n\tconst eventListeners = {\n\t\tonBlur,\n\t\tonChange,\n\t\tonClick: (event: MouseEvent) => emit('click', event),\n\t\tonFocus,\n\t\tonInput: (event: Event) => emit('input', event),\n\t\tonKeydown: (event: KeyboardEvent) => emit('keydown', event),\n\t\tonMousedown: (event: MouseEvent) => emit('mousedown', event),\n\t\tonMouseup: (event: MouseEvent) => emit('mouseup', event),\n\t};\n\n\treturn {\n\t\t'aria-describedby': props.ariaDescribedby,\n\t\tautofocus: props.autofocus,\n\t\tchecked: checked.value,\n\t\t// There is no such thing as readonly checkbox so we disable and style it with css\n\t\tdisabled: props.disabled || props.readonly,\n\t\tid: props.id,\n\t\tindeterminate: props.indeterminate,\n\t\tname: props.name,\n\t\trequired: props.required,\n\t\ttabindex: props.disabled ? -1 : undefined,\n\t\ttype: 'checkbox',\n\t\tvalue: value,\n\t\tclass: 'sr-only',\n\t\t...eventListeners,\n\t};\n});\n\nconst slotAttributes = computed(() => ({\n\tchecked: checked.value,\n\tdisabled: props.disabled,\n\tfalseValue: props.falseValue,\n\tfocused: hasFocus.value,\n\thasErrors: props.hasErrors,\n\tid: props.id,\n\tname: props.name,\n\tparsedValue: inputAttributes.value.value,\n\treadonly: props.readonly,\n\trequired: props.required,\n\ttrueValue: props.trueValue,\n\tvalue: checked.value ? props.trueValue : props.falseValue,\n}));\n\nconst iconAttributes = computed(() => {\n\tlet style: { [key: string]: string } = {};\n\tif (props.color && isCssColor(props.color)) {\n\t\tstyle.color = props.color;\n\t}\n\treturn {\n\t\tclass: 'bb-base-switch-container__icon',\n\t\tstyle,\n\t};\n});\n\n/**\n * Indeterminate is a very volatile prop that is reset upon clicking,\n * this keeps the state and the prop aligned\n */\nwatch(\n\t() => [props.modelValue, props.checked, props.indeterminate],\n\t() => {\n\t\tif (checkboxInput.value) {\n\t\t\tcheckboxInput.value.indeterminate = !!props.indeterminate;\n\t\t}\n\t}\n);\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BaseSwitch';\n</style>\n"],"names":["props","__props","emit","__emit","checkboxInput","ref","checked","computed","hasFocus","containerAttributes","attributes","isCssColor","makeInputValue","when","item","hiddenInputAttributes","value","inputAttributes","eventListeners","event","slotAttributes","iconAttributes","style","watch"],"mappings":"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"}
1
+ {"version":3,"file":"index40.js","sources":["../src/components/BaseSwitch/BaseSwitch.vue"],"sourcesContent":["<template>\n\t<span v-bind=\"containerAttributes\">\n\t\t<input v-if=\"!checked && submitWhenFalse\" v-bind=\"hiddenInputAttributes\" />\n\t\t<input v-bind=\"inputAttributes\" ref=\"checkboxInput\" />\n\t\t<span class=\"bb-base-switch-container\">\n\t\t\t<slot name=\"icon\" v-bind=\"slotAttributes\">\n\t\t\t\t<span v-bind=\"iconAttributes\">\n\t\t\t\t\t<span class=\"bb-base-switch-container__icon-thumb\"></span>\n\t\t\t\t</span>\n\t\t\t</slot>\n\t\t</span>\n\t</span>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, watch } from 'vue';\nimport { isCssColor } from '@/utilities/functions/isCssColor';\nimport { when } from '@/utilities/functions/when';\nimport type {\n\tBaseCheckboxEvents,\n\tBaseCheckboxProps,\n\tSlotAttributes,\n} from '../BaseCheckbox/BaseCheckbox.vue';\n\nexport type BaseSwitchProps = BaseCheckboxProps;\n\nexport type BaseSwitchEvents = BaseCheckboxEvents;\n\nconst props = withDefaults(defineProps<BaseSwitchProps>(), {\n\ttrueValue: true,\n\tfalseValue: false,\n});\n\nconst emit = defineEmits<BaseSwitchEvents>();\n\nexport type BaseSwitchSlots = {\n\ticon?: (props: SlotAttributes) => any;\n};\n\ndefineSlots<BaseSwitchSlots>();\n\nconst checkboxInput = ref<HTMLInputElement | null>(null);\n\nconst checked = computed(() => {\n\tif (props.checked) return true;\n\treturn JSON.stringify(props.trueValue) === JSON.stringify(props.modelValue);\n});\nconst hasFocus = ref(false);\n\nconst containerAttributes = computed(() => {\n\tconst attributes: Record<string, any> = {\n\t\tclass: {\n\t\t\t'bb-base-switch': true,\n\t\t\t'bb-base-switch--disabled': props.disabled,\n\t\t\t'bb-base-switch--errors': props.hasErrors,\n\t\t\t'bb-base-switch--indeterminate': props.indeterminate,\n\t\t\t'bb-base-switch--readonly': props.readonly,\n\t\t\t[`bb-base-switch--${props.color}`]:\n\t\t\t\tprops.color && !isCssColor(props.color),\n\t\t},\n\t};\n\tif (props.color && isCssColor(props.color)) {\n\t\tattributes['style'] = `--color: ${props.color}`;\n\t}\n\treturn attributes;\n});\n\n/**\n * This is used to keep the value compatible to common html expected values.\n * Convert to string everything that's not but do not double encode strings\n */\nconst makeInputValue = when(\n\t(item: unknown) => typeof item !== 'string',\n\tJSON.stringify\n);\n\nconst hiddenInputAttributes = computed(() => {\n\tconst value = makeInputValue(props.falseValue);\n\treturn {\n\t\tdisabled: props.disabled,\n\t\tname: props.name,\n\t\ttype: 'hidden',\n\t\tvalue: value,\n\t};\n});\n\nconst inputAttributes = computed(() => {\n\tconst value = makeInputValue(props.trueValue);\n\n\tconst onBlur = (event: FocusEvent): void => {\n\t\thasFocus.value = false;\n\t\temit('blur', event);\n\t};\n\n\tconst onChange = (event: Event): void => {\n\t\tif (event.target instanceof HTMLInputElement) {\n\t\t\tlet value = event.target.checked ? props.trueValue : props.falseValue;\n\n\t\t\temit('change', event);\n\t\t\temit('update:modelValue', value);\n\t\t}\n\t};\n\n\tconst onFocus = (event: FocusEvent): void => {\n\t\thasFocus.value = true;\n\t\temit('focus', event);\n\t};\n\n\tconst eventListeners = {\n\t\tonBlur,\n\t\tonChange,\n\t\tonClick: (event: MouseEvent) => emit('click', event),\n\t\tonFocus,\n\t\tonInput: (event: Event) => emit('input', event),\n\t\tonKeydown: (event: KeyboardEvent) => emit('keydown', event),\n\t\tonMousedown: (event: MouseEvent) => emit('mousedown', event),\n\t\tonMouseup: (event: MouseEvent) => emit('mouseup', event),\n\t};\n\n\treturn {\n\t\t'aria-describedby': props.ariaDescribedby,\n\t\tautofocus: props.autofocus,\n\t\tchecked: checked.value,\n\t\t// There is no such thing as readonly checkbox so we disable and style it with css\n\t\tdisabled: props.disabled || props.readonly,\n\t\tid: props.id,\n\t\tindeterminate: props.indeterminate,\n\t\tname: props.name,\n\t\trequired: props.required,\n\t\ttabindex: props.disabled ? -1 : undefined,\n\t\ttype: 'checkbox',\n\t\tvalue: value,\n\t\tclass: 'sr-only',\n\t\t...eventListeners,\n\t};\n});\n\nconst slotAttributes = computed(() => ({\n\tchecked: checked.value,\n\tdisabled: props.disabled,\n\tfalseValue: props.falseValue,\n\tfocused: hasFocus.value,\n\thasErrors: props.hasErrors,\n\tid: props.id,\n\tname: props.name,\n\tparsedValue: inputAttributes.value.value,\n\treadonly: props.readonly,\n\trequired: props.required,\n\ttrueValue: props.trueValue,\n\tvalue: checked.value ? props.trueValue : props.falseValue,\n}));\n\nconst iconAttributes = computed(() => {\n\tlet style: { [key: string]: string } = {};\n\tif (props.color && isCssColor(props.color)) {\n\t\tstyle.color = props.color;\n\t}\n\treturn {\n\t\tclass: 'bb-base-switch-container__icon',\n\t\tstyle,\n\t};\n});\n\n/**\n * Indeterminate is a very volatile prop that is reset upon clicking,\n * this keeps the state and the prop aligned\n */\nwatch(\n\t() => [props.modelValue, props.checked, props.indeterminate],\n\t() => {\n\t\tif (checkboxInput.value) {\n\t\t\tcheckboxInput.value.indeterminate = !!props.indeterminate;\n\t\t}\n\t}\n);\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BaseSwitch';\n</style>\n"],"names":["props","__props","emit","__emit","checkboxInput","ref","checked","computed","hasFocus","containerAttributes","attributes","isCssColor","makeInputValue","when","item","hiddenInputAttributes","value","inputAttributes","eventListeners","event","slotAttributes","iconAttributes","style","watch"],"mappings":"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"}
@@ -1,8 +1,8 @@
1
1
  import { defineComponent as $, ref as p, toRef as l, openBlock as w, createBlock as B, unref as f, withCtx as i, renderSlot as s, normalizeProps as b, guardReactiveProps as h, createVNode as O, mergeProps as v, createSlots as z } from "vue";
2
- import { useOptions as F } from "./index231.js";
3
- import M from "./index39.js";
2
+ import { useOptions as F } from "./index216.js";
3
+ import M from "./index40.js";
4
4
  /* empty css */
5
- import S from "./index232.js";
5
+ import S from "./index217.js";
6
6
  /* empty css */
7
7
  const I = /* @__PURE__ */ $({
8
8
  __name: "BaseSwitchGroup",
@@ -132,4 +132,4 @@ const I = /* @__PURE__ */ $({
132
132
  export {
133
133
  I as default
134
134
  };
135
- //# sourceMappingURL=index41.js.map
135
+ //# sourceMappingURL=index42.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index41.js","sources":["../src/components/BaseSwitchGroup/BaseSwitchGroup.vue"],"sourcesContent":["<template>\n\t<OptionsContainer\n\t\tclass=\"bb-base-switch-group\"\n\t\t:direction=\"direction\"\n\t\t:has-errors=\"hasErrors\"\n\t\t:hide-label=\"hideLabel\"\n\t\t:loading=\"!!loading\"\n\t\t:loading-text=\"loadingText\"\n\t\t:no-data-text=\"noDataText\"\n\t\t:options=\"options\"\n\t>\n\t\t<template #prepend><slot name=\"prepend\"></slot></template>\n\t\t<template #loading><slot name=\"loading\"></slot></template>\n\t\t<template #no-data><slot name=\"no-data\"></slot></template>\n\t\t<template #option:prepend=\"data\"\n\t\t\t><slot name=\"option:prepend\" v-bind=\"data\"></slot\n\t\t></template>\n\t\t<template #input=\"{ option, index }\">\n\t\t\t<BaseSwitch\n\t\t\t\t:id=\"option.valueHash\"\n\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t:autofocus=\"autofocus && !index\"\n\t\t\t\t:checked=\"option.selected\"\n\t\t\t\t:color=\"color\"\n\t\t\t\t:disabled=\"option.disabled\"\n\t\t\t\t:has-errors=\"hasErrors\"\n\t\t\t\t:name=\"name\"\n\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t:true-value=\"option.value\"\n\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t\t@change=\"(event: Event) => onChange(event, option)\"\n\t\t\t>\n\t\t\t\t<template v-if=\"$slots.icon\" #icon=\"data\">\n\t\t\t\t\t<slot\n\t\t\t\t\t\t:item=\"option.item\"\n\t\t\t\t\t\tname=\"icon\"\n\t\t\t\t\t\t:text=\"option.text\"\n\t\t\t\t\t\tv-bind=\"data\"\n\t\t\t\t\t/>\n\t\t\t\t</template>\n\t\t\t</BaseSwitch>\n\t\t</template>\n\t\t<template #option:append=\"data\"\n\t\t\t><slot name=\"option:prepend\" v-bind=\"data\"></slot\n\t\t></template>\n\t\t<template #append><slot name=\"prepend\"></slot></template>\n\t</OptionsContainer>\n</template>\n\n<script setup lang=\"ts\" generic=\"T = any\">\nimport { ref, toRef } from 'vue';\nimport { useOptions } from '@/composables/useOptions';\nimport BaseSwitch from '../BaseSwitch/BaseSwitch.vue';\nimport type { Option } from '@/types/Option';\nimport type { SlotAttributes } from '../BaseCheckbox/BaseCheckbox.vue';\nimport type {\n\tBaseCheckboxGroupEvents,\n\tBaseCheckboxGroupProps,\n} from '../BaseCheckboxGroup/BaseCheckboxGroup.vue';\nimport OptionsContainer from '../OptionsContainer.vue';\n\nexport type BaseSwitchGroupEvents = BaseCheckboxGroupEvents;\n\nexport type BaseSwitchGroupProps<T> = BaseCheckboxGroupProps<T>;\n\nconst props = withDefaults(defineProps<BaseSwitchGroupProps<T>>(), {\n\tdepsDebounceTime: 0,\n\tdirection: 'horizontal',\n\titems: () => [],\n\tloadingText: 'Caricamento...',\n\tmodelValueDebounceTime: 0,\n\tnoDataText: 'Nessun elemento da visualizzare',\n});\n\nconst emit = defineEmits<BaseSwitchGroupEvents>();\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}>();\n\nconst container = ref<HTMLElement>();\nconst active = ref(false);\n\nconst {\n\tinnerLoading: loading,\n\toptions,\n\tselectOption,\n\tunselectOption,\n} = useOptions({\n\tdependencies: toRef(props, 'dependencies'),\n\tdepsDebounceTime: props.depsDebounceTime,\n\tdisabled: toRef(props, 'disabled'),\n\temit,\n\tenforceCoherence: props.enforceCoherence,\n\titems: toRef(props, 'items'),\n\titemText: props.itemText,\n\titemValue: props.itemValue,\n\tmodelValue: toRef(props, 'modelValue'),\n\tmodelValueDebounceTime: props.modelValueDebounceTime,\n\tmultiple: true,\n\tprefill: true,\n\tqueryDebounceTime: 0,\n\tresetQueryOnOptionSelected: false,\n\tstash: false,\n});\n\nconst onChange = (event: Event, option: Option) => {\n\temit('change', event);\n\tif (!option.selected) {\n\t\tselectOption(option);\n\t} else {\n\t\tunselectOption(option);\n\t}\n};\n\nconst onFocus = (event: FocusEvent) => {\n\temit('focus', event);\n\tif (!active.value) {\n\t\tdocument.addEventListener('focusin', onDocumentFocus, { passive: true });\n\t\tdocument.addEventListener('click', onDocumentClick, { passive: true });\n\t\tactive.value = true;\n\t}\n};\n\nconst eventListeners = {\n\tonBlur: (event: FocusEvent) => emit('blur', event),\n\tonClick: (event: MouseEvent) => emit('click', event),\n\tonFocus,\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};\n\nconst onDocumentFocus = (event: FocusEvent) => {\n\tif (event.target instanceof HTMLElement) {\n\t\tif (!container.value?.contains(event.target)) {\n\t\t\temit('inactive');\n\t\t\tactive.value = false;\n\t\t\tdocument.removeEventListener('focusin', onDocumentFocus);\n\t\t\tdocument.removeEventListener('click', onDocumentClick);\n\t\t}\n\t}\n};\n\nconst onDocumentClick = (event: MouseEvent) => {\n\tif (event.target instanceof HTMLElement) {\n\t\tif (!container.value?.contains(event.target)) {\n\t\t\temit('inactive');\n\t\t\tactive.value = false;\n\t\t\tdocument.removeEventListener('focusin', onDocumentFocus);\n\t\t\tdocument.removeEventListener('click', onDocumentClick);\n\t\t}\n\t}\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BaseSwitchGroup';\n</style>\n"],"names":["props","__props","emit","__emit","container","ref","active","loading","options","selectOption","unselectOption","useOptions","toRef","onChange","event","option","eventListeners","onDocumentFocus","onDocumentClick","_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,UAAMA,IAAQC,GASRC,IAAOC,GA8BPC,IAAYC,KACZC,IAASD,EAAI,EAAK,GAElB;AAAA,MACL,cAAcE;AAAA,MACd,SAAAC;AAAA,MACA,cAAAC;AAAA,MACA,gBAAAC;AAAA,QACGC,EAAW;AAAA,MACd,cAAcC,EAAMZ,GAAO,cAAc;AAAA,MACzC,kBAAkBA,EAAM;AAAA,MACxB,UAAUY,EAAMZ,GAAO,UAAU;AAAA,MACjC,MAAAE;AAAA,MACA,kBAAkBF,EAAM;AAAA,MACxB,OAAOY,EAAMZ,GAAO,OAAO;AAAA,MAC3B,UAAUA,EAAM;AAAA,MAChB,WAAWA,EAAM;AAAA,MACjB,YAAYY,EAAMZ,GAAO,YAAY;AAAA,MACrC,wBAAwBA,EAAM;AAAA,MAC9B,UAAU;AAAA,MACV,SAAS;AAAA,MACT,mBAAmB;AAAA,MACnB,4BAA4B;AAAA,MAC5B,OAAO;AAAA,IAAA,CACP,GAEKa,IAAW,CAACC,GAAcC,MAAmB;AAClD,MAAAb,EAAK,UAAUY,CAAK,GACfC,EAAO,WAGXL,EAAeK,CAAM,IAFrBN,EAAaM,CAAM;AAAA,IAGpB,GAYKC,IAAiB;AAAA,MACtB,QAAQ,CAACF,MAAsBZ,EAAK,QAAQY,CAAK;AAAA,MACjD,SAAS,CAACA,MAAsBZ,EAAK,SAASY,CAAK;AAAA,MACnD,SAZe,CAACA,MAAsB;AACtC,QAAAZ,EAAK,SAASY,CAAK,GACdR,EAAO,UACX,SAAS,iBAAiB,WAAWW,GAAiB,EAAE,SAAS,IAAM,GACvE,SAAS,iBAAiB,SAASC,GAAiB,EAAE,SAAS,IAAM,GACrEZ,EAAO,QAAQ;AAAA,MAChB;AAAA,MAOA,SAAS,CAACQ,MAAiBZ,EAAK,SAASY,CAAK;AAAA,MAC9C,WAAW,CAACA,MAAyBZ,EAAK,WAAWY,CAAK;AAAA,MAC1D,aAAa,CAACA,MAAsBZ,EAAK,aAAaY,CAAK;AAAA,MAC3D,WAAW,CAACA,MAAsBZ,EAAK,WAAWY,CAAK;AAAA,IAAA,GAGlDG,IAAkB,CAACH,MAAsB;;AAC1C,MAAAA,EAAM,kBAAkB,iBACtBK,IAAAf,EAAU,UAAV,QAAAe,EAAiB,SAASL,EAAM,YACpCZ,EAAK,UAAU,GACfI,EAAO,QAAQ,IACN,SAAA,oBAAoB,WAAWW,CAAe,GAC9C,SAAA,oBAAoB,SAASC,CAAe;AAAA,IAEvD,GAGKA,IAAkB,CAACJ,MAAsB;;AAC1C,MAAAA,EAAM,kBAAkB,iBACtBK,IAAAf,EAAU,UAAV,QAAAe,EAAiB,SAASL,EAAM,YACpCZ,EAAK,UAAU,GACfI,EAAO,QAAQ,IACN,SAAA,oBAAoB,WAAWW,CAAe,GAC9C,SAAA,oBAAoB,SAASC,CAAe;AAAA,IAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index42.js","sources":["../src/components/BaseSwitchGroup/BaseSwitchGroup.vue"],"sourcesContent":["<template>\n\t<OptionsContainer\n\t\tclass=\"bb-base-switch-group\"\n\t\t:direction=\"direction\"\n\t\t:has-errors=\"hasErrors\"\n\t\t:hide-label=\"hideLabel\"\n\t\t:loading=\"!!loading\"\n\t\t:loading-text=\"loadingText\"\n\t\t:no-data-text=\"noDataText\"\n\t\t:options=\"options\"\n\t>\n\t\t<template #prepend><slot name=\"prepend\"></slot></template>\n\t\t<template #loading><slot name=\"loading\"></slot></template>\n\t\t<template #no-data><slot name=\"no-data\"></slot></template>\n\t\t<template #option:prepend=\"data\"\n\t\t\t><slot name=\"option:prepend\" v-bind=\"data\"></slot\n\t\t></template>\n\t\t<template #input=\"{ option, index }\">\n\t\t\t<BaseSwitch\n\t\t\t\t:id=\"option.valueHash\"\n\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t:autofocus=\"autofocus && !index\"\n\t\t\t\t:checked=\"option.selected\"\n\t\t\t\t:color=\"color\"\n\t\t\t\t:disabled=\"option.disabled\"\n\t\t\t\t:has-errors=\"hasErrors\"\n\t\t\t\t:name=\"name\"\n\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t:true-value=\"option.value\"\n\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t\t@change=\"(event: Event) => onChange(event, option)\"\n\t\t\t>\n\t\t\t\t<template v-if=\"$slots.icon\" #icon=\"data\">\n\t\t\t\t\t<slot\n\t\t\t\t\t\t:item=\"option.item\"\n\t\t\t\t\t\tname=\"icon\"\n\t\t\t\t\t\t:text=\"option.text\"\n\t\t\t\t\t\tv-bind=\"data\"\n\t\t\t\t\t/>\n\t\t\t\t</template>\n\t\t\t</BaseSwitch>\n\t\t</template>\n\t\t<template #option:append=\"data\"\n\t\t\t><slot name=\"option:prepend\" v-bind=\"data\"></slot\n\t\t></template>\n\t\t<template #append><slot name=\"prepend\"></slot></template>\n\t</OptionsContainer>\n</template>\n\n<script setup lang=\"ts\" generic=\"T = any\">\nimport { ref, toRef } from 'vue';\nimport { useOptions } from '@/composables/useOptions';\nimport BaseSwitch from '../BaseSwitch/BaseSwitch.vue';\nimport type { Option } from '@/types/Option';\nimport type { SlotAttributes } from '../BaseCheckbox/BaseCheckbox.vue';\nimport type {\n\tBaseCheckboxGroupEvents,\n\tBaseCheckboxGroupProps,\n} from '../BaseCheckboxGroup/BaseCheckboxGroup.vue';\nimport OptionsContainer from '../OptionsContainer.vue';\n\nexport type BaseSwitchGroupEvents = BaseCheckboxGroupEvents;\n\nexport type BaseSwitchGroupProps<T> = BaseCheckboxGroupProps<T>;\n\nconst props = withDefaults(defineProps<BaseSwitchGroupProps<T>>(), {\n\tdepsDebounceTime: 0,\n\tdirection: 'horizontal',\n\titems: () => [],\n\tloadingText: 'Caricamento...',\n\tmodelValueDebounceTime: 0,\n\tnoDataText: 'Nessun elemento da visualizzare',\n});\n\nconst emit = defineEmits<BaseSwitchGroupEvents>();\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}>();\n\nconst container = ref<HTMLElement>();\nconst active = ref(false);\n\nconst {\n\tinnerLoading: loading,\n\toptions,\n\tselectOption,\n\tunselectOption,\n} = useOptions({\n\tdependencies: toRef(props, 'dependencies'),\n\tdepsDebounceTime: props.depsDebounceTime,\n\tdisabled: toRef(props, 'disabled'),\n\temit,\n\tenforceCoherence: props.enforceCoherence,\n\titems: toRef(props, 'items'),\n\titemText: props.itemText,\n\titemValue: props.itemValue,\n\tmodelValue: toRef(props, 'modelValue'),\n\tmodelValueDebounceTime: props.modelValueDebounceTime,\n\tmultiple: true,\n\tprefill: true,\n\tqueryDebounceTime: 0,\n\tresetQueryOnOptionSelected: false,\n\tstash: false,\n});\n\nconst onChange = (event: Event, option: Option) => {\n\temit('change', event);\n\tif (!option.selected) {\n\t\tselectOption(option);\n\t} else {\n\t\tunselectOption(option);\n\t}\n};\n\nconst onFocus = (event: FocusEvent) => {\n\temit('focus', event);\n\tif (!active.value) {\n\t\tdocument.addEventListener('focusin', onDocumentFocus, { passive: true });\n\t\tdocument.addEventListener('click', onDocumentClick, { passive: true });\n\t\tactive.value = true;\n\t}\n};\n\nconst eventListeners = {\n\tonBlur: (event: FocusEvent) => emit('blur', event),\n\tonClick: (event: MouseEvent) => emit('click', event),\n\tonFocus,\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};\n\nconst onDocumentFocus = (event: FocusEvent) => {\n\tif (event.target instanceof HTMLElement) {\n\t\tif (!container.value?.contains(event.target)) {\n\t\t\temit('inactive');\n\t\t\tactive.value = false;\n\t\t\tdocument.removeEventListener('focusin', onDocumentFocus);\n\t\t\tdocument.removeEventListener('click', onDocumentClick);\n\t\t}\n\t}\n};\n\nconst onDocumentClick = (event: MouseEvent) => {\n\tif (event.target instanceof HTMLElement) {\n\t\tif (!container.value?.contains(event.target)) {\n\t\t\temit('inactive');\n\t\t\tactive.value = false;\n\t\t\tdocument.removeEventListener('focusin', onDocumentFocus);\n\t\t\tdocument.removeEventListener('click', onDocumentClick);\n\t\t}\n\t}\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BaseSwitchGroup';\n</style>\n"],"names":["props","__props","emit","__emit","container","ref","active","loading","options","selectOption","unselectOption","useOptions","toRef","onChange","event","option","eventListeners","onDocumentFocus","onDocumentClick","_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEA,UAAMA,IAAQC,GASRC,IAAOC,GA8BPC,IAAYC,KACZC,IAASD,EAAI,EAAK,GAElB;AAAA,MACL,cAAcE;AAAA,MACd,SAAAC;AAAA,MACA,cAAAC;AAAA,MACA,gBAAAC;AAAA,QACGC,EAAW;AAAA,MACd,cAAcC,EAAMZ,GAAO,cAAc;AAAA,MACzC,kBAAkBA,EAAM;AAAA,MACxB,UAAUY,EAAMZ,GAAO,UAAU;AAAA,MACjC,MAAAE;AAAA,MACA,kBAAkBF,EAAM;AAAA,MACxB,OAAOY,EAAMZ,GAAO,OAAO;AAAA,MAC3B,UAAUA,EAAM;AAAA,MAChB,WAAWA,EAAM;AAAA,MACjB,YAAYY,EAAMZ,GAAO,YAAY;AAAA,MACrC,wBAAwBA,EAAM;AAAA,MAC9B,UAAU;AAAA,MACV,SAAS;AAAA,MACT,mBAAmB;AAAA,MACnB,4BAA4B;AAAA,MAC5B,OAAO;AAAA,IAAA,CACP,GAEKa,IAAW,CAACC,GAAcC,MAAmB;AAClD,MAAAb,EAAK,UAAUY,CAAK,GACfC,EAAO,WAGXL,EAAeK,CAAM,IAFrBN,EAAaM,CAAM;AAAA,IAGpB,GAYKC,IAAiB;AAAA,MACtB,QAAQ,CAACF,MAAsBZ,EAAK,QAAQY,CAAK;AAAA,MACjD,SAAS,CAACA,MAAsBZ,EAAK,SAASY,CAAK;AAAA,MACnD,SAZe,CAACA,MAAsB;AACtC,QAAAZ,EAAK,SAASY,CAAK,GACdR,EAAO,UACX,SAAS,iBAAiB,WAAWW,GAAiB,EAAE,SAAS,IAAM,GACvE,SAAS,iBAAiB,SAASC,GAAiB,EAAE,SAAS,IAAM,GACrEZ,EAAO,QAAQ;AAAA,MAChB;AAAA,MAOA,SAAS,CAACQ,MAAiBZ,EAAK,SAASY,CAAK;AAAA,MAC9C,WAAW,CAACA,MAAyBZ,EAAK,WAAWY,CAAK;AAAA,MAC1D,aAAa,CAACA,MAAsBZ,EAAK,aAAaY,CAAK;AAAA,MAC3D,WAAW,CAACA,MAAsBZ,EAAK,WAAWY,CAAK;AAAA,IAAA,GAGlDG,IAAkB,CAACH,MAAsB;;AAC1C,MAAAA,EAAM,kBAAkB,iBACtBK,IAAAf,EAAU,UAAV,QAAAe,EAAiB,SAASL,EAAM,YACpCZ,EAAK,UAAU,GACfI,EAAO,QAAQ,IACN,SAAA,oBAAoB,WAAWW,CAAe,GAC9C,SAAA,oBAAoB,SAASC,CAAe;AAAA,IAEvD,GAGKA,IAAkB,CAACJ,MAAsB;;AAC1C,MAAAA,EAAM,kBAAkB,iBACtBK,IAAAf,EAAU,UAAV,QAAAe,EAAiB,SAASL,EAAM,YACpCZ,EAAK,UAAU,GACfI,EAAO,QAAQ,IACN,SAAA,oBAAoB,WAAWW,CAAe,GAC9C,SAAA,oBAAoB,SAASC,CAAe;AAAA,IAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,19 +1,20 @@
1
1
  import { defineComponent as Y, ref as r, computed as k, toRef as B, openBlock as f, createBlock as C, normalizeClass as x, withCtx as a, renderSlot as u, createVNode as O, unref as v, createElementVNode as $, createElementBlock as ee, Fragment as oe, createCommentVNode as te, withDirectives as ne, mergeProps as le, isRef as ae, withModifiers as s, withKeys as y, vModelDynamic as ie, nextTick as re } from "vue";
2
2
  /* empty css */
3
3
  /* empty css */
4
- import ue from "./index123.js";
4
+ /* empty css */
5
+ import ue from "./index124.js";
5
6
  /* empty css */
6
- import { isNotNil as se } from "./index130.js";
7
- import { last as de } from "./index211.js";
8
- import { useOptions as pe } from "./index231.js";
9
- import ce from "./index236.js";
7
+ import { isNotNil as se } from "./index131.js";
8
+ import { last as de } from "./index207.js";
9
+ import { useOptions as pe } from "./index216.js";
10
+ import ce from "./index238.js";
10
11
  /* empty css */
11
- import me from "./index238.js";
12
+ import me from "./index240.js";
12
13
  /* empty css */
13
- import fe from "./index215.js";
14
+ import fe from "./index211.js";
14
15
  /* empty css */
15
- import ve from "./index217.js";
16
- const ye = { class: "bb-base-tag__input-container" }, be = ["id", "aria-describedby", "autocomplete", "autofocus", "disabled", "placeholder", "readonly", "required", "onKeydown"], Ne = /* @__PURE__ */ Y({
16
+ import ve from "./index213.js";
17
+ const ye = { class: "bb-base-tag__input-container" }, be = ["id", "aria-describedby", "autocomplete", "autofocus", "disabled", "placeholder", "readonly", "required", "onKeydown"], qe = /* @__PURE__ */ Y({
17
18
  __name: "BaseTag",
18
19
  props: {
19
20
  "append:icon": {},
@@ -218,6 +219,6 @@ const ye = { class: "bb-base-tag__input-container" }, be = ["id", "aria-describe
218
219
  }
219
220
  });
220
221
  export {
221
- Ne as default
222
+ qe as default
222
223
  };
223
- //# sourceMappingURL=index43.js.map
224
+ //# sourceMappingURL=index44.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index43.js","sources":["../src/components/BaseTag/BaseTag.vue"],"sourcesContent":["<template>\n\t<CommonInputOuterContainer\n\t\tref=\"outerContainer\"\n\t\t:class=\"{\n\t\t\t'bb-base-tag': true,\n\t\t\t'bb-base-tag--active': active,\n\t\t\t'bb-base-tag--disabled': disabled,\n\t\t\t'bb-base-tag--loading': loading,\n\t\t\t'bb-base-tag--errors': hasErrors,\n\t\t\t'bb-base-tag--readonly': readonly,\n\t\t}\"\n\t\t@click=\"onOuterContainerClick\"\n\t>\n\t\t<template #prepend-outer><slot name=\"prepend-outer\"></slot></template>\n\t\t<CommonInputInnerContainer\n\t\t\tref=\"innerContainer\"\n\t\t\t:append:icon=\"props['append:icon']\"\n\t\t\t:prepend:icon=\"props['prepend:icon']\"\n\t\t>\n\t\t\t<template #prepend><slot name=\"prepend\" /></template>\n\t\t\t<template #prefix><slot name=\"prefix\" /></template>\n\t\t\t<BbSmoothHeight tag=\"span\">\n\t\t\t\t<span class=\"bb-base-tag__input-container\">\n\t\t\t\t\t<template v-if=\"multiple\">\n\t\t\t\t\t\t<template v-if=\"comma\">\n\t\t\t\t\t\t\t<CommaBox ref=\"commaBox\" :options=\"selectedOptions\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<template v-else>\n\t\t\t\t\t\t\t<ChipsBox\n\t\t\t\t\t\t\t\tref=\"chipsBox\"\n\t\t\t\t\t\t\t\t:options=\"selectedOptions\"\n\t\t\t\t\t\t\t\t@option:unselected=\"onOptionUnselected\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</template>\n\n\t\t\t\t\t<input\n\t\t\t\t\t\t:id=\"id\"\n\t\t\t\t\t\tref=\"input\"\n\t\t\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t\t\t\tv-model=\"query\"\n\t\t\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t\t\t:autocomplete=\"autocomplete\"\n\t\t\t\t\t\t:autofocus=\"autofocus\"\n\t\t\t\t\t\t:class=\"'bb-base-tag__text-input'\"\n\t\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\t\tenter-key-hint=\"next\"\n\t\t\t\t\t\t:placeholder=\"computedPlaceholder\"\n\t\t\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t\t\t:required=\"\n\t\t\t\t\t\t\t(required && !multiple) || (multiple && !modelValue.length)\n\t\t\t\t\t\t\"\n\t\t\t\t\t\t:type=\"'text'\"\n\t\t\t\t\t\t@focus.stop=\"onInputFocus\"\n\t\t\t\t\t\t@keydown.stop.delete=\"onBackspace\"\n\t\t\t\t\t\t@keydown.stop.left=\"onArrowLeft\"\n\t\t\t\t\t\t@keydown.stop.prevent.esc=\"onEscape\"\n\t\t\t\t\t\t@keydown.stop.right=\"onArrowRight\"\n\t\t\t\t\t\t@keyup.stop=\"onInputKeyup\"\n\t\t\t\t\t/>\n\t\t\t\t</span>\n\t\t\t</BbSmoothHeight>\n\t\t\t<template #append><slot name=\"append\" /></template>\n\t\t\t<template #suffix><slot name=\"suffix\" /></template>\n\t\t</CommonInputInnerContainer>\n\n\t\t<template #append-outer><slot name=\"append-outer\"></slot></template>\n\t</CommonInputOuterContainer>\n</template>\n\n<script setup lang=\"ts\">\nimport { BbSmoothHeight } from '@/index';\nimport { computed, ref } from 'vue';\nimport { isNotNil } from '@/utilities/functions/isNotNil';\nimport { last } from '@/utilities/functions/last';\nimport { nextTick } from 'vue';\nimport { toRef } from 'vue';\nimport { useOptions } from '@/composables/useOptions';\nimport ChipsBox from '../ChipsBox.vue';\nimport CommaBox from '../CommaBox.vue';\nimport CommonInputInnerContainer from '../CommonInputInnerContainer.vue';\nimport CommonInputOuterContainer from '../CommonInputOuterContainer.vue';\nimport type { InputHTMLAttributes, HTMLAttributes } from 'vue';\nimport type { Option as BaseOption } from '@/types/Option';\n\nexport type BaseTagProps = {\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\tariaDescribedby?: InputHTMLAttributes['aria-describedby'];\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 * Sets the display model for selected values to a list\n\t * of comma separated string. In this mode the user\n\t * cannot deselect an option by pressing the close button.\n\t */\n\tcomma?: boolean;\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * The divider key used to separate values from one another. By default it is \"Enter\"\n\t */\n\tdivider?: KeyboardEvent['key'];\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Sets the component in a loading state, usually triggering some visual styles.\n\t */\n\tloading?: boolean;\n\n\t/**\n\t * Used by v-model. Can be any serializable type.\n\t */\n\tmodelValue: any;\n\n\t/**\n\t * Allows the selection of multiple items.\n\t */\n\tmultiple?: boolean;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * String displayed when there's no data.\n\t */\n\tplaceholder?: InputHTMLAttributes['placeholder'];\n\n\t/**\n\t * Name of the icon to be added at the start of the input.\n\t */\n\t// eslint-disable-next-line vue/prop-name-casing\n\t'prepend:icon'?: string;\n\n\t/**\n\t * 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\nconst props = withDefaults(defineProps<BaseTagProps>(), {\n\tdivider: 'Enter',\n\tmultiple: true,\n});\n\nexport type BaseTagEvents = {\n\t(e: 'blur', event: FocusEvent): void;\n\t(e: 'change', event: Event): void;\n\t(e: 'click', event: MouseEvent): void;\n\t(e: 'duplicate', string: string): void;\n\t(e: 'focus', event: FocusEvent): void;\n\t(e: 'inactive'): void;\n\t(e: 'input', event: Event): void;\n\t(e: 'keydown', event: KeyboardEvent): void;\n\t(e: 'keyup', event: KeyboardEvent): void;\n\t(e: 'update:modelValue', value: any): void;\n};\n\nconst emit = defineEmits<BaseTagEvents>();\n\nexport type BaseTagSlots = {\n\tappend?: (props: object) => any;\n\t'append-outer'?: (props: object) => any;\n\tprepend?: (props: object) => any;\n\t'prepend-outer'?: (props: object) => any;\n\tprefix?: (props: object) => any;\n\tsuffix?: (props: object) => any;\n};\n\ndefineSlots<BaseTagSlots>();\n\nif (props.multiple && !Array.isArray(props.modelValue)) {\n\tthrow new Error('Multiple is set to \"true\" but modelValue is not an array.');\n}\n\nconst outerContainer = ref<InstanceType<\n\ttypeof CommonInputOuterContainer\n> | null>(null);\nconst innerContainer = ref<InstanceType<\n\ttypeof CommonInputInnerContainer\n> | null>(null);\nconst computedPlaceholder = computed(() => {\n\treturn props.placeholder;\n});\nconst commaBox = ref<InstanceType<typeof CommaBox> | null>(null);\nconst chipsBox = ref<InstanceType<typeof ChipsBox> | null>(null);\nconst selectedBox = computed(() =>\n\tprops.comma ? commaBox.value : chipsBox.value\n);\n\nconst input = ref<HTMLElement | null>(null);\nconst focusInput = () => {\n\tif (input.value instanceof HTMLInputElement) {\n\t\tinput.value.focus();\n\t}\n};\n/**\n * It should prefill if asked, or\n * when single if modelValue is not null\n * when multiple if modelValue is not empty\n */\nconst shouldPrefill =\n\t(!props.multiple && isNotNil(props.modelValue)) ||\n\t(props.multiple && !!props.modelValue.length);\n\nconst dependencies = ref([]);\n\nconst {\n\tquery,\n\talignQueryToState,\n\taddCurrentQueryToManualItems,\n\tselectedOptions,\n\tselectOption,\n\tunselectOption,\n\tvalueIsSelected,\n\tmanualItems,\n} = useOptions({\n\temit,\n\titemText: undefined,\n\titemValue: undefined,\n\tmodelValue: toRef(props, 'modelValue'),\n\tmultiple: props.multiple,\n\tresetQueryOnOptionSelected: true,\n\tstash: false,\n\titems: toRef(props, 'modelValue'),\n\tenforceCoherence: false,\n\tprefill: shouldPrefill,\n\tmodelValueDebounceTime: 0,\n\tdependencies,\n\tdepsDebounceTime: 0,\n\tqueryDebounceTime: 0,\n\tdisabled: toRef(props, 'disabled'),\n});\n\n/**\n * Applies a class when the user is inside this whole component.\n * We cannot use focus within as it doesn't work for elements that are teleported.\n * Also we cannot use the <input/> if we physically move focus to the options so\n * we track it manually.\n */\nconst active = ref(false);\n\nconst setActive = () => {\n\tactive.value = true;\n};\nconst setInactive = () => {\n\tactive.value = false;\n\temit('inactive');\n};\n\nconst canProcessKeyboardBindings = computed(() => {\n\tif (props.readonly) return false;\n\tif (props.disabled) return false;\n\tif (!selectedBox.value && props.multiple) return false;\n\treturn true;\n});\n\nconst onArrowLeft = (event: KeyboardEvent) => {\n\tif (!canProcessKeyboardBindings.value) {\n\t\treturn;\n\t}\n\tif (!props.multiple || query.value) {\n\t\treturn;\n\t}\n\tevent.preventDefault();\n\tif (!selectedOptions.value.length) return;\n\tselectedBox.value?.focusPrevious();\n};\nconst onArrowRight = (event: KeyboardEvent) => {\n\tif (!canProcessKeyboardBindings.value) {\n\t\treturn;\n\t}\n\tif (!props.multiple || query.value) {\n\t\treturn;\n\t}\n\tevent.preventDefault();\n\tif (!selectedOptions.value.length) return;\n\tselectedBox.value?.focusNext();\n};\n\nconst onBackspace = async () => {\n\tif (\n\t\t!canProcessKeyboardBindings.value ||\n\t\tquery.value ||\n\t\t!selectedOptions.value.length\n\t) {\n\t\treturn;\n\t}\n\tif (selectedBox.value?.getHighlighted()) {\n\t\tselectedBox.value.confirmOption();\n\t}\n\tawait nextTick();\n\tselectedBox.value?.focusPrevious();\n};\n\nconst onEscape = () => {\n\tselectedBox.value?.blur();\n};\n\nconst onInputKeyup = async (event: KeyboardEvent) => {\n\temit('keyup', event);\n\tif (props.readonly || props.disabled) {\n\t\tevent.preventDefault();\n\t\treturn;\n\t}\n\t// Reset focused chips on key input\n\tif (/^[A-Za-z0-9]$/.test(event.key)) {\n\t\tselectedBox.value?.blur();\n\t}\n\tif (\n\t\tevent.key === props.divider ||\n\t\t(event.key === 'Unidentified' && query.value.includes(props.divider))\n\t) {\n\t\tif (props.divider.length === 1 && query.value.includes(props.divider)) {\n\t\t\tconst found = query.value.split(props.divider)[0];\n\t\t\tif (found) {\n\t\t\t\tquery.value = found;\n\t\t\t} else {\n\t\t\t\tquery.value = '';\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (!query.value) return;\n\t\tif (valueIsSelected(query.value)) {\n\t\t\temit('duplicate', query.value);\n\t\t\tquery.value = '';\n\t\t} else {\n\t\t\taddCurrentQueryToManualItems();\n\t\t\tonOptionSelected(last(manualItems.value)!);\n\t\t}\n\t}\n};\n\nconst onOptionSelected = (option: BaseOption) => {\n\tselectOption(option);\n\tfocusInput();\n\tif (!props.multiple) {\n\t\tclose();\n\t}\n};\n\nconst onOptionUnselected = (option: BaseOption) => {\n\tunselectOption(option);\n\tfocusInput();\n};\n\nconst onInputFocus = (event: FocusEvent) => {\n\temit('focus', event);\n\tsetActive();\n\tdocument.addEventListener('click', onOutsideInteraction);\n\tdocument.addEventListener('focusin', onOutsideInteraction);\n};\n\n/**\n * When clicking on the outside container seamlessly move focus to the input and open the panel\n */\nconst onOuterContainerClick = (event: MouseEvent) => {\n\temit('click', event);\n\tif (props.disabled || props.readonly) return;\n\tif (input.value instanceof HTMLElement) {\n\t\tinput.value.focus();\n\t}\n};\n\n/**\n * On click outside of the container close the panel, remove active state.\n * In multiple selection clear query after a timeout\n */\nconst onOutsideInteraction = async (event: Event) => {\n\tif (event.target instanceof Node) {\n\t\tif (outerContainer.value) {\n\t\t\tif (!outerContainer.value.$el.contains(event.target)) {\n\t\t\t\tclose();\n\t\t\t\tsetInactive();\n\t\t\t\tdocument.removeEventListener('click', onOutsideInteraction);\n\t\t\t\tdocument.removeEventListener('focusin', onOutsideInteraction);\n\t\t\t\talignQueryToState();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n};\nconst eventListeners = {\n\tonBlur: (event: FocusEvent) => emit('blur', event),\n\tonChange: (event: Event) => emit('change', event),\n\tonKeydown: (event: KeyboardEvent) => emit('keydown', event),\n\tonInput: (event: Event) => emit('input', event),\n};\n</script>\n<style lang=\"postcss\">\n@import '@/assets/css/BaseTag';\n</style>\n"],"names":["props","__props","emit","__emit","outerContainer","ref","innerContainer","computedPlaceholder","computed","commaBox","chipsBox","selectedBox","input","focusInput","shouldPrefill","isNotNil","dependencies","query","alignQueryToState","addCurrentQueryToManualItems","selectedOptions","selectOption","unselectOption","valueIsSelected","manualItems","useOptions","toRef","active","setActive","setInactive","canProcessKeyboardBindings","onArrowLeft","event","_a","onArrowRight","onBackspace","nextTick","_b","onEscape","onInputKeyup","found","onOptionSelected","last","option","onOptionUnselected","onInputFocus","onOutsideInteraction","onOuterContainerClick","eventListeners"],"mappings":"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"}
1
+ {"version":3,"file":"index44.js","sources":["../src/components/BaseTag/BaseTag.vue"],"sourcesContent":["<template>\n\t<CommonInputOuterContainer\n\t\tref=\"outerContainer\"\n\t\t:class=\"{\n\t\t\t'bb-base-tag': true,\n\t\t\t'bb-base-tag--active': active,\n\t\t\t'bb-base-tag--disabled': disabled,\n\t\t\t'bb-base-tag--loading': loading,\n\t\t\t'bb-base-tag--errors': hasErrors,\n\t\t\t'bb-base-tag--readonly': readonly,\n\t\t}\"\n\t\t@click=\"onOuterContainerClick\"\n\t>\n\t\t<template #prepend-outer><slot name=\"prepend-outer\"></slot></template>\n\t\t<CommonInputInnerContainer\n\t\t\tref=\"innerContainer\"\n\t\t\t:append:icon=\"props['append:icon']\"\n\t\t\t:prepend:icon=\"props['prepend:icon']\"\n\t\t>\n\t\t\t<template #prepend><slot name=\"prepend\" /></template>\n\t\t\t<template #prefix><slot name=\"prefix\" /></template>\n\t\t\t<BbSmoothHeight tag=\"span\">\n\t\t\t\t<span class=\"bb-base-tag__input-container\">\n\t\t\t\t\t<template v-if=\"multiple\">\n\t\t\t\t\t\t<template v-if=\"comma\">\n\t\t\t\t\t\t\t<CommaBox ref=\"commaBox\" :options=\"selectedOptions\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<template v-else>\n\t\t\t\t\t\t\t<ChipsBox\n\t\t\t\t\t\t\t\tref=\"chipsBox\"\n\t\t\t\t\t\t\t\t:options=\"selectedOptions\"\n\t\t\t\t\t\t\t\t@option:unselected=\"onOptionUnselected\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</template>\n\n\t\t\t\t\t<input\n\t\t\t\t\t\t:id=\"id\"\n\t\t\t\t\t\tref=\"input\"\n\t\t\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t\t\t\tv-model=\"query\"\n\t\t\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t\t\t:autocomplete=\"autocomplete\"\n\t\t\t\t\t\t:autofocus=\"autofocus\"\n\t\t\t\t\t\t:class=\"'bb-base-tag__text-input'\"\n\t\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\t\tenter-key-hint=\"next\"\n\t\t\t\t\t\t:placeholder=\"computedPlaceholder\"\n\t\t\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t\t\t:required=\"\n\t\t\t\t\t\t\t(required && !multiple) || (multiple && !modelValue.length)\n\t\t\t\t\t\t\"\n\t\t\t\t\t\t:type=\"'text'\"\n\t\t\t\t\t\t@focus.stop=\"onInputFocus\"\n\t\t\t\t\t\t@keydown.stop.delete=\"onBackspace\"\n\t\t\t\t\t\t@keydown.stop.left=\"onArrowLeft\"\n\t\t\t\t\t\t@keydown.stop.prevent.esc=\"onEscape\"\n\t\t\t\t\t\t@keydown.stop.right=\"onArrowRight\"\n\t\t\t\t\t\t@keyup.stop=\"onInputKeyup\"\n\t\t\t\t\t/>\n\t\t\t\t</span>\n\t\t\t</BbSmoothHeight>\n\t\t\t<template #append><slot name=\"append\" /></template>\n\t\t\t<template #suffix><slot name=\"suffix\" /></template>\n\t\t</CommonInputInnerContainer>\n\n\t\t<template #append-outer><slot name=\"append-outer\"></slot></template>\n\t</CommonInputOuterContainer>\n</template>\n\n<script setup lang=\"ts\">\nimport { BbSmoothHeight } from '@/index';\nimport { computed, ref } from 'vue';\nimport { isNotNil } from '@/utilities/functions/isNotNil';\nimport { last } from '@/utilities/functions/last';\nimport { nextTick } from 'vue';\nimport { toRef } from 'vue';\nimport { useOptions } from '@/composables/useOptions';\nimport ChipsBox from '../ChipsBox.vue';\nimport CommaBox from '../CommaBox.vue';\nimport CommonInputInnerContainer from '../CommonInputInnerContainer.vue';\nimport CommonInputOuterContainer from '../CommonInputOuterContainer.vue';\nimport type { InputHTMLAttributes, HTMLAttributes } from 'vue';\nimport type { Option as BaseOption } from '@/types/Option';\n\nexport type BaseTagProps = {\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\tariaDescribedby?: InputHTMLAttributes['aria-describedby'];\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 * Sets the display model for selected values to a list\n\t * of comma separated string. In this mode the user\n\t * cannot deselect an option by pressing the close button.\n\t */\n\tcomma?: boolean;\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * The divider key used to separate values from one another. By default it is \"Enter\"\n\t */\n\tdivider?: KeyboardEvent['key'];\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Sets the component in a loading state, usually triggering some visual styles.\n\t */\n\tloading?: boolean;\n\n\t/**\n\t * Used by v-model. Can be any serializable type.\n\t */\n\tmodelValue: any;\n\n\t/**\n\t * Allows the selection of multiple items.\n\t */\n\tmultiple?: boolean;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * String displayed when there's no data.\n\t */\n\tplaceholder?: InputHTMLAttributes['placeholder'];\n\n\t/**\n\t * Name of the icon to be added at the start of the input.\n\t */\n\t// eslint-disable-next-line vue/prop-name-casing\n\t'prepend:icon'?: string;\n\n\t/**\n\t * 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\nconst props = withDefaults(defineProps<BaseTagProps>(), {\n\tdivider: 'Enter',\n\tmultiple: true,\n});\n\nexport type BaseTagEvents = {\n\t(e: 'blur', event: FocusEvent): void;\n\t(e: 'change', event: Event): void;\n\t(e: 'click', event: MouseEvent): void;\n\t(e: 'duplicate', string: string): void;\n\t(e: 'focus', event: FocusEvent): void;\n\t(e: 'inactive'): void;\n\t(e: 'input', event: Event): void;\n\t(e: 'keydown', event: KeyboardEvent): void;\n\t(e: 'keyup', event: KeyboardEvent): void;\n\t(e: 'update:modelValue', value: any): void;\n};\n\nconst emit = defineEmits<BaseTagEvents>();\n\nexport type BaseTagSlots = {\n\tappend?: (props: object) => any;\n\t'append-outer'?: (props: object) => any;\n\tprepend?: (props: object) => any;\n\t'prepend-outer'?: (props: object) => any;\n\tprefix?: (props: object) => any;\n\tsuffix?: (props: object) => any;\n};\n\ndefineSlots<BaseTagSlots>();\n\nif (props.multiple && !Array.isArray(props.modelValue)) {\n\tthrow new Error('Multiple is set to \"true\" but modelValue is not an array.');\n}\n\nconst outerContainer = ref<InstanceType<\n\ttypeof CommonInputOuterContainer\n> | null>(null);\nconst innerContainer = ref<InstanceType<\n\ttypeof CommonInputInnerContainer\n> | null>(null);\nconst computedPlaceholder = computed(() => {\n\treturn props.placeholder;\n});\nconst commaBox = ref<InstanceType<typeof CommaBox> | null>(null);\nconst chipsBox = ref<InstanceType<typeof ChipsBox> | null>(null);\nconst selectedBox = computed(() =>\n\tprops.comma ? commaBox.value : chipsBox.value\n);\n\nconst input = ref<HTMLElement | null>(null);\nconst focusInput = () => {\n\tif (input.value instanceof HTMLInputElement) {\n\t\tinput.value.focus();\n\t}\n};\n/**\n * It should prefill if asked, or\n * when single if modelValue is not null\n * when multiple if modelValue is not empty\n */\nconst shouldPrefill =\n\t(!props.multiple && isNotNil(props.modelValue)) ||\n\t(props.multiple && !!props.modelValue.length);\n\nconst dependencies = ref([]);\n\nconst {\n\tquery,\n\talignQueryToState,\n\taddCurrentQueryToManualItems,\n\tselectedOptions,\n\tselectOption,\n\tunselectOption,\n\tvalueIsSelected,\n\tmanualItems,\n} = useOptions({\n\temit,\n\titemText: undefined,\n\titemValue: undefined,\n\tmodelValue: toRef(props, 'modelValue'),\n\tmultiple: props.multiple,\n\tresetQueryOnOptionSelected: true,\n\tstash: false,\n\titems: toRef(props, 'modelValue'),\n\tenforceCoherence: false,\n\tprefill: shouldPrefill,\n\tmodelValueDebounceTime: 0,\n\tdependencies,\n\tdepsDebounceTime: 0,\n\tqueryDebounceTime: 0,\n\tdisabled: toRef(props, 'disabled'),\n});\n\n/**\n * Applies a class when the user is inside this whole component.\n * We cannot use focus within as it doesn't work for elements that are teleported.\n * Also we cannot use the <input/> if we physically move focus to the options so\n * we track it manually.\n */\nconst active = ref(false);\n\nconst setActive = () => {\n\tactive.value = true;\n};\nconst setInactive = () => {\n\tactive.value = false;\n\temit('inactive');\n};\n\nconst canProcessKeyboardBindings = computed(() => {\n\tif (props.readonly) return false;\n\tif (props.disabled) return false;\n\tif (!selectedBox.value && props.multiple) return false;\n\treturn true;\n});\n\nconst onArrowLeft = (event: KeyboardEvent) => {\n\tif (!canProcessKeyboardBindings.value) {\n\t\treturn;\n\t}\n\tif (!props.multiple || query.value) {\n\t\treturn;\n\t}\n\tevent.preventDefault();\n\tif (!selectedOptions.value.length) return;\n\tselectedBox.value?.focusPrevious();\n};\nconst onArrowRight = (event: KeyboardEvent) => {\n\tif (!canProcessKeyboardBindings.value) {\n\t\treturn;\n\t}\n\tif (!props.multiple || query.value) {\n\t\treturn;\n\t}\n\tevent.preventDefault();\n\tif (!selectedOptions.value.length) return;\n\tselectedBox.value?.focusNext();\n};\n\nconst onBackspace = async () => {\n\tif (\n\t\t!canProcessKeyboardBindings.value ||\n\t\tquery.value ||\n\t\t!selectedOptions.value.length\n\t) {\n\t\treturn;\n\t}\n\tif (selectedBox.value?.getHighlighted()) {\n\t\tselectedBox.value.confirmOption();\n\t}\n\tawait nextTick();\n\tselectedBox.value?.focusPrevious();\n};\n\nconst onEscape = () => {\n\tselectedBox.value?.blur();\n};\n\nconst onInputKeyup = async (event: KeyboardEvent) => {\n\temit('keyup', event);\n\tif (props.readonly || props.disabled) {\n\t\tevent.preventDefault();\n\t\treturn;\n\t}\n\t// Reset focused chips on key input\n\tif (/^[A-Za-z0-9]$/.test(event.key)) {\n\t\tselectedBox.value?.blur();\n\t}\n\tif (\n\t\tevent.key === props.divider ||\n\t\t(event.key === 'Unidentified' && query.value.includes(props.divider))\n\t) {\n\t\tif (props.divider.length === 1 && query.value.includes(props.divider)) {\n\t\t\tconst found = query.value.split(props.divider)[0];\n\t\t\tif (found) {\n\t\t\t\tquery.value = found;\n\t\t\t} else {\n\t\t\t\tquery.value = '';\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (!query.value) return;\n\t\tif (valueIsSelected(query.value)) {\n\t\t\temit('duplicate', query.value);\n\t\t\tquery.value = '';\n\t\t} else {\n\t\t\taddCurrentQueryToManualItems();\n\t\t\tonOptionSelected(last(manualItems.value)!);\n\t\t}\n\t}\n};\n\nconst onOptionSelected = (option: BaseOption) => {\n\tselectOption(option);\n\tfocusInput();\n\tif (!props.multiple) {\n\t\tclose();\n\t}\n};\n\nconst onOptionUnselected = (option: BaseOption) => {\n\tunselectOption(option);\n\tfocusInput();\n};\n\nconst onInputFocus = (event: FocusEvent) => {\n\temit('focus', event);\n\tsetActive();\n\tdocument.addEventListener('click', onOutsideInteraction);\n\tdocument.addEventListener('focusin', onOutsideInteraction);\n};\n\n/**\n * When clicking on the outside container seamlessly move focus to the input and open the panel\n */\nconst onOuterContainerClick = (event: MouseEvent) => {\n\temit('click', event);\n\tif (props.disabled || props.readonly) return;\n\tif (input.value instanceof HTMLElement) {\n\t\tinput.value.focus();\n\t}\n};\n\n/**\n * On click outside of the container close the panel, remove active state.\n * In multiple selection clear query after a timeout\n */\nconst onOutsideInteraction = async (event: Event) => {\n\tif (event.target instanceof Node) {\n\t\tif (outerContainer.value) {\n\t\t\tif (!outerContainer.value.$el.contains(event.target)) {\n\t\t\t\tclose();\n\t\t\t\tsetInactive();\n\t\t\t\tdocument.removeEventListener('click', onOutsideInteraction);\n\t\t\t\tdocument.removeEventListener('focusin', onOutsideInteraction);\n\t\t\t\talignQueryToState();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n};\nconst eventListeners = {\n\tonBlur: (event: FocusEvent) => emit('blur', event),\n\tonChange: (event: Event) => emit('change', event),\n\tonKeydown: (event: KeyboardEvent) => emit('keydown', event),\n\tonInput: (event: Event) => emit('input', event),\n};\n</script>\n<style lang=\"postcss\">\n@import '@/assets/css/BaseTag';\n</style>\n"],"names":["props","__props","emit","__emit","outerContainer","ref","innerContainer","computedPlaceholder","computed","commaBox","chipsBox","selectedBox","input","focusInput","shouldPrefill","isNotNil","dependencies","query","alignQueryToState","addCurrentQueryToManualItems","selectedOptions","selectOption","unselectOption","valueIsSelected","manualItems","useOptions","toRef","active","setActive","setInactive","canProcessKeyboardBindings","onArrowLeft","event","_a","onArrowRight","onBackspace","nextTick","_b","onEscape","onInputKeyup","found","onOptionSelected","last","option","onOptionUnselected","onInputFocus","onOutsideInteraction","onOuterContainerClick","eventListeners"],"mappings":"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"}
@@ -1,8 +1,8 @@
1
1
  import { defineComponent as w, ref as g, computed as u, onMounted as y, watch as V, nextTick as k, openBlock as x, createBlock as B, normalizeClass as $, withCtx as r, renderSlot as t, createVNode as i, createElementVNode as C, mergeProps as T } from "vue";
2
- import v from "./index217.js";
3
- import E from "./index215.js";
2
+ import v from "./index213.js";
3
+ import E from "./index211.js";
4
4
  /* empty css */
5
- import G from "./index123.js";
5
+ import G from "./index124.js";
6
6
  /* empty css */
7
7
  const M = ["id", "aria-describedby", "autocomplete", "autofocus", "disabled", "name", "placeholder", "readonly", "required", "rows", "value"], z = /* @__PURE__ */ w({
8
8
  __name: "BaseTextarea",
@@ -131,4 +131,4 @@ const M = ["id", "aria-describedby", "autocomplete", "autofocus", "disabled", "n
131
131
  export {
132
132
  z as default
133
133
  };
134
- //# sourceMappingURL=index45.js.map
134
+ //# sourceMappingURL=index46.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index45.js","sources":["../src/components/BaseTextarea/BaseTextarea.vue"],"sourcesContent":["<template>\n\t<CommonInputOuterContainer :class=\"classes\">\n\t\t<template #prepend-outer><slot name=\"prepend-outer\"></slot></template>\n\t\t<CommonInputInnerContainer\n\t\t\t:append:icon=\"props['append:icon']\"\n\t\t\t:prepend:icon=\"props['prepend:icon']\"\n\t\t>\n\t\t\t<template #prepend><slot name=\"prepend\" /></template>\n\t\t\t<template #prefix><slot name=\"prefix\" /></template>\n\t\t\t<BbSmoothHeight>\n\t\t\t\t<textarea\n\t\t\t\t\t:id=\"id\"\n\t\t\t\t\tref=\"textarea\"\n\t\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t\t:autocomplete=\"autocomplete\"\n\t\t\t\t\t:autofocus=\"autofocus\"\n\t\t\t\t\t:class=\"'bb-base-textarea__input scrollbar-border'\"\n\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\t:name=\"name\"\n\t\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t\t:required=\"required\"\n\t\t\t\t\t:rows=\"rows\"\n\t\t\t\t\t:value=\"modelValueWithDefault\"\n\t\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t\t\t@input=\"onInput\"\n\t\t\t\t\t@keydown=\"onKeydown\"\n\t\t\t\t></textarea>\n\t\t\t</BbSmoothHeight>\n\t\t\t<template #append><slot name=\"append\" /></template>\n\t\t\t<template #suffix><slot name=\"suffix\" /></template>\n\t\t</CommonInputInnerContainer>\n\t\t<template #append-outer><slot name=\"append-outer\"></slot></template>\n\t</CommonInputOuterContainer>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, nextTick, onMounted, ref, watch } from 'vue';\nimport type { HTMLAttributes, InputHTMLAttributes, Ref } from 'vue';\nimport CommonInputOuterContainer from '../CommonInputOuterContainer.vue';\nimport CommonInputInnerContainer from '../CommonInputInnerContainer.vue';\nimport BbSmoothHeight from '../BbSmoothHeight/BbSmoothHeight.vue';\n\nexport type BaseTextareaProps = {\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\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tariaDescribedby?: InputHTMLAttributes['aria-describedby'];\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 * Expands the textarea to match its content\n\t */\n\tautoGrow?: boolean;\n\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Sets the component in a loading state, usually triggering some visual styles.\n\t */\n\tloading?: boolean;\n\n\t/**\n\t * Used by v-model\n\t */\n\tmodelValue: string | null;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * String displayed when there's no data.\n\t */\n\tplaceholder?: InputHTMLAttributes['placeholder'];\n\n\t/**\n\t * Name of the icon to be added at the start of the input.\n\t */\n\t// eslint-disable-next-line vue/prop-name-casing\n\t'prepend:icon'?: string;\n\n\t/**\n\t * 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 * Sets the input in a readonly state.\n\t */\n\trows?: string | number;\n};\nconst props = defineProps<BaseTextareaProps>();\n\nexport type BaseTextareaEvents = {\n\t(e: 'blur', event: FocusEvent): void;\n\t(e: 'change', event: Event): void;\n\t(e: 'click', event: MouseEvent): void;\n\t(e: 'focus', event: FocusEvent): void;\n\t(e: 'input', event: Event): void;\n\t(e: 'keydown', event: KeyboardEvent): void;\n\t(e: 'mousedown', event: MouseEvent): void;\n\t(e: 'mouseup', event: MouseEvent): void;\n\t(e: 'update:modelValue', value: string | null): void;\n};\nconst emit = defineEmits<BaseTextareaEvents>();\n\nexport type BaseTextareaSlots = {\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\tprefix?: (props: object) => any;\n\tsuffix?: (props: object) => any;\n};\n\ndefineSlots<BaseTextareaSlots>();\n\nif (props.rows && props.autoGrow) {\n\tthrow new Error(\n\t\t'Textarea: You cannot set rows and auto-grow attributes together. You either use rows and let the user resize or define a minimum height in CSS with auto-grow.'\n\t);\n}\n\nconst textarea: Ref<HTMLTextAreaElement | null> = ref(null);\n\nconst classes = computed(() => ({\n\t'bb-base-textarea': true,\n\t'bb-base-textarea--auto-grow': props.autoGrow,\n\t'bb-base-textarea--disabled': props.disabled,\n\t'bb-base-textarea--errors': props.hasErrors,\n\t'bb-base-textarea--loading': props.loading,\n\t'bb-base-textarea--readonly': props.readonly,\n}));\n\n// Allow modelvalue to be reset to null\nconst modelValueWithDefault = computed(() =>\n\tprops.modelValue ? props.modelValue : ''\n);\nonMounted(() => {\n\tif (props.autoGrow && props.modelValue) {\n\t\tcomputeTextareaHeight();\n\t}\n});\nwatch(\n\t() => props.modelValue,\n\t() => {\n\t\tif (props.autoGrow) {\n\t\t\tnextTick(computeTextareaHeight);\n\t\t}\n\t}\n);\n\nfunction onInput(event: Event): void {\n\t// Prevent enter from triggering smt else\n\tevent.stopPropagation();\n\tif (event.target instanceof HTMLTextAreaElement) {\n\t\tlet value = event.target.value;\n\t\temit('input', event);\n\t\temit('update:modelValue', value || null);\n\t}\n}\nfunction onKeydown(event: KeyboardEvent): void {\n\t// Prevent enter from triggering smt else\n\tevent.stopPropagation();\n\tif (event.target instanceof HTMLTextAreaElement) {\n\t\temit('keydown', event);\n\t}\n}\n\n/**\n * These events are just propagated\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) => emit('focus', event),\n\tonMousedown: (event: MouseEvent) => emit('mousedown', event),\n\tonMouseup: (event: MouseEvent) => emit('mouseup', event),\n};\n\n/* \nReset height and the apply scroll height otherwise it would not be able to shrink\n*/\nfunction computeTextareaHeight() {\n\tif (!textarea.value) return;\n\ttextarea.value.style.height = '0px';\n\n\ttextarea.value.style.height = `${textarea.value.scrollHeight}px`;\n}\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BaseTextarea';\n</style>\n"],"names":["props","__props","emit","__emit","textarea","ref","classes","computed","modelValueWithDefault","onMounted","computeTextareaHeight","watch","nextTick","onInput","event","value","onKeydown","eventListeners"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6HA,UAAMA,IAAQC,GAaRC,IAAOC;AAaT,QAAAH,EAAM,QAAQA,EAAM;AACvB,YAAM,IAAI;AAAA,QACT;AAAA,MAAA;AAII,UAAAI,IAA4CC,EAAI,IAAI,GAEpDC,IAAUC,EAAS,OAAO;AAAA,MAC/B,oBAAoB;AAAA,MACpB,+BAA+BP,EAAM;AAAA,MACrC,8BAA8BA,EAAM;AAAA,MACpC,4BAA4BA,EAAM;AAAA,MAClC,6BAA6BA,EAAM;AAAA,MACnC,8BAA8BA,EAAM;AAAA,IACnC,EAAA,GAGIQ,IAAwBD;AAAA,MAAS,MACtCP,EAAM,aAAaA,EAAM,aAAa;AAAA,IAAA;AAEvC,IAAAS,EAAU,MAAM;AACX,MAAAT,EAAM,YAAYA,EAAM,cACLU;IACvB,CACA,GACDC;AAAA,MACC,MAAMX,EAAM;AAAA,MACZ,MAAM;AACL,QAAIA,EAAM,YACTY,EAASF,CAAqB;AAAA,MAEhC;AAAA,IAAA;AAGD,aAASG,EAAQC,GAAoB;AAGhC,UADJA,EAAM,gBAAgB,GAClBA,EAAM,kBAAkB,qBAAqB;AAC5C,YAAAC,IAAQD,EAAM,OAAO;AACzB,QAAAZ,EAAK,SAASY,CAAK,GACdZ,EAAA,qBAAqBa,KAAS,IAAI;AAAA,MACxC;AAAA,IACD;AACA,aAASC,EAAUF,GAA4B;AAE9C,MAAAA,EAAM,gBAAgB,GAClBA,EAAM,kBAAkB,uBAC3BZ,EAAK,WAAWY,CAAK;AAAA,IAEvB;AAKA,UAAMG,IAAiB;AAAA,MACtB,QAAQ,CAACH,MAAsBZ,EAAK,QAAQY,CAAK;AAAA,MACjD,UAAU,CAACA,MAAiBZ,EAAK,UAAUY,CAAK;AAAA,MAChD,SAAS,CAACA,MAAsBZ,EAAK,SAASY,CAAK;AAAA,MACnD,SAAS,CAACA,MAAsBZ,EAAK,SAASY,CAAK;AAAA,MACnD,aAAa,CAACA,MAAsBZ,EAAK,aAAaY,CAAK;AAAA,MAC3D,WAAW,CAACA,MAAsBZ,EAAK,WAAWY,CAAK;AAAA,IAAA;AAMxD,aAASJ,IAAwB;AAC5B,MAACN,EAAS,UACLA,EAAA,MAAM,MAAM,SAAS,OAE9BA,EAAS,MAAM,MAAM,SAAS,GAAGA,EAAS,MAAM,YAAY;AAAA,IAC7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index46.js","sources":["../src/components/BaseTextarea/BaseTextarea.vue"],"sourcesContent":["<template>\n\t<CommonInputOuterContainer :class=\"classes\">\n\t\t<template #prepend-outer><slot name=\"prepend-outer\"></slot></template>\n\t\t<CommonInputInnerContainer\n\t\t\t:append:icon=\"props['append:icon']\"\n\t\t\t:prepend:icon=\"props['prepend:icon']\"\n\t\t>\n\t\t\t<template #prepend><slot name=\"prepend\" /></template>\n\t\t\t<template #prefix><slot name=\"prefix\" /></template>\n\t\t\t<BbSmoothHeight>\n\t\t\t\t<textarea\n\t\t\t\t\t:id=\"id\"\n\t\t\t\t\tref=\"textarea\"\n\t\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t\t:autocomplete=\"autocomplete\"\n\t\t\t\t\t:autofocus=\"autofocus\"\n\t\t\t\t\t:class=\"'bb-base-textarea__input scrollbar-border'\"\n\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\t:name=\"name\"\n\t\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t\t:required=\"required\"\n\t\t\t\t\t:rows=\"rows\"\n\t\t\t\t\t:value=\"modelValueWithDefault\"\n\t\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t\t\t@input=\"onInput\"\n\t\t\t\t\t@keydown=\"onKeydown\"\n\t\t\t\t></textarea>\n\t\t\t</BbSmoothHeight>\n\t\t\t<template #append><slot name=\"append\" /></template>\n\t\t\t<template #suffix><slot name=\"suffix\" /></template>\n\t\t</CommonInputInnerContainer>\n\t\t<template #append-outer><slot name=\"append-outer\"></slot></template>\n\t</CommonInputOuterContainer>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, nextTick, onMounted, ref, watch } from 'vue';\nimport type { HTMLAttributes, InputHTMLAttributes, Ref } from 'vue';\nimport CommonInputOuterContainer from '../CommonInputOuterContainer.vue';\nimport CommonInputInnerContainer from '../CommonInputInnerContainer.vue';\nimport BbSmoothHeight from '../BbSmoothHeight/BbSmoothHeight.vue';\n\nexport type BaseTextareaProps = {\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\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tariaDescribedby?: InputHTMLAttributes['aria-describedby'];\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 * Expands the textarea to match its content\n\t */\n\tautoGrow?: boolean;\n\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Sets the component in a loading state, usually triggering some visual styles.\n\t */\n\tloading?: boolean;\n\n\t/**\n\t * Used by v-model\n\t */\n\tmodelValue: string | null;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * String displayed when there's no data.\n\t */\n\tplaceholder?: InputHTMLAttributes['placeholder'];\n\n\t/**\n\t * Name of the icon to be added at the start of the input.\n\t */\n\t// eslint-disable-next-line vue/prop-name-casing\n\t'prepend:icon'?: string;\n\n\t/**\n\t * 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 * Sets the input in a readonly state.\n\t */\n\trows?: string | number;\n};\nconst props = defineProps<BaseTextareaProps>();\n\nexport type BaseTextareaEvents = {\n\t(e: 'blur', event: FocusEvent): void;\n\t(e: 'change', event: Event): void;\n\t(e: 'click', event: MouseEvent): void;\n\t(e: 'focus', event: FocusEvent): void;\n\t(e: 'input', event: Event): void;\n\t(e: 'keydown', event: KeyboardEvent): void;\n\t(e: 'mousedown', event: MouseEvent): void;\n\t(e: 'mouseup', event: MouseEvent): void;\n\t(e: 'update:modelValue', value: string | null): void;\n};\nconst emit = defineEmits<BaseTextareaEvents>();\n\nexport type BaseTextareaSlots = {\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\tprefix?: (props: object) => any;\n\tsuffix?: (props: object) => any;\n};\n\ndefineSlots<BaseTextareaSlots>();\n\nif (props.rows && props.autoGrow) {\n\tthrow new Error(\n\t\t'Textarea: You cannot set rows and auto-grow attributes together. You either use rows and let the user resize or define a minimum height in CSS with auto-grow.'\n\t);\n}\n\nconst textarea: Ref<HTMLTextAreaElement | null> = ref(null);\n\nconst classes = computed(() => ({\n\t'bb-base-textarea': true,\n\t'bb-base-textarea--auto-grow': props.autoGrow,\n\t'bb-base-textarea--disabled': props.disabled,\n\t'bb-base-textarea--errors': props.hasErrors,\n\t'bb-base-textarea--loading': props.loading,\n\t'bb-base-textarea--readonly': props.readonly,\n}));\n\n// Allow modelvalue to be reset to null\nconst modelValueWithDefault = computed(() =>\n\tprops.modelValue ? props.modelValue : ''\n);\nonMounted(() => {\n\tif (props.autoGrow && props.modelValue) {\n\t\tcomputeTextareaHeight();\n\t}\n});\nwatch(\n\t() => props.modelValue,\n\t() => {\n\t\tif (props.autoGrow) {\n\t\t\tnextTick(computeTextareaHeight);\n\t\t}\n\t}\n);\n\nfunction onInput(event: Event): void {\n\t// Prevent enter from triggering smt else\n\tevent.stopPropagation();\n\tif (event.target instanceof HTMLTextAreaElement) {\n\t\tlet value = event.target.value;\n\t\temit('input', event);\n\t\temit('update:modelValue', value || null);\n\t}\n}\nfunction onKeydown(event: KeyboardEvent): void {\n\t// Prevent enter from triggering smt else\n\tevent.stopPropagation();\n\tif (event.target instanceof HTMLTextAreaElement) {\n\t\temit('keydown', event);\n\t}\n}\n\n/**\n * These events are just propagated\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) => emit('focus', event),\n\tonMousedown: (event: MouseEvent) => emit('mousedown', event),\n\tonMouseup: (event: MouseEvent) => emit('mouseup', event),\n};\n\n/* \nReset height and the apply scroll height otherwise it would not be able to shrink\n*/\nfunction computeTextareaHeight() {\n\tif (!textarea.value) return;\n\ttextarea.value.style.height = '0px';\n\n\ttextarea.value.style.height = `${textarea.value.scrollHeight}px`;\n}\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BaseTextarea';\n</style>\n"],"names":["props","__props","emit","__emit","textarea","ref","classes","computed","modelValueWithDefault","onMounted","computeTextareaHeight","watch","nextTick","onInput","event","value","onKeydown","eventListeners"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6HA,UAAMA,IAAQC,GAaRC,IAAOC;AAaT,QAAAH,EAAM,QAAQA,EAAM;AACvB,YAAM,IAAI;AAAA,QACT;AAAA,MAAA;AAII,UAAAI,IAA4CC,EAAI,IAAI,GAEpDC,IAAUC,EAAS,OAAO;AAAA,MAC/B,oBAAoB;AAAA,MACpB,+BAA+BP,EAAM;AAAA,MACrC,8BAA8BA,EAAM;AAAA,MACpC,4BAA4BA,EAAM;AAAA,MAClC,6BAA6BA,EAAM;AAAA,MACnC,8BAA8BA,EAAM;AAAA,IACnC,EAAA,GAGIQ,IAAwBD;AAAA,MAAS,MACtCP,EAAM,aAAaA,EAAM,aAAa;AAAA,IAAA;AAEvC,IAAAS,EAAU,MAAM;AACX,MAAAT,EAAM,YAAYA,EAAM,cACLU;IACvB,CACA,GACDC;AAAA,MACC,MAAMX,EAAM;AAAA,MACZ,MAAM;AACL,QAAIA,EAAM,YACTY,EAASF,CAAqB;AAAA,MAEhC;AAAA,IAAA;AAGD,aAASG,EAAQC,GAAoB;AAGhC,UADJA,EAAM,gBAAgB,GAClBA,EAAM,kBAAkB,qBAAqB;AAC5C,YAAAC,IAAQD,EAAM,OAAO;AACzB,QAAAZ,EAAK,SAASY,CAAK,GACdZ,EAAA,qBAAqBa,KAAS,IAAI;AAAA,MACxC;AAAA,IACD;AACA,aAASC,EAAUF,GAA4B;AAE9C,MAAAA,EAAM,gBAAgB,GAClBA,EAAM,kBAAkB,uBAC3BZ,EAAK,WAAWY,CAAK;AAAA,IAEvB;AAKA,UAAMG,IAAiB;AAAA,MACtB,QAAQ,CAACH,MAAsBZ,EAAK,QAAQY,CAAK;AAAA,MACjD,UAAU,CAACA,MAAiBZ,EAAK,UAAUY,CAAK;AAAA,MAChD,SAAS,CAACA,MAAsBZ,EAAK,SAASY,CAAK;AAAA,MACnD,SAAS,CAACA,MAAsBZ,EAAK,SAASY,CAAK;AAAA,MACnD,aAAa,CAACA,MAAsBZ,EAAK,aAAaY,CAAK;AAAA,MAC3D,WAAW,CAACA,MAAsBZ,EAAK,WAAWY,CAAK;AAAA,IAAA;AAMxD,aAASJ,IAAwB;AAC5B,MAACN,EAAS,UACLA,EAAA,MAAM,MAAM,SAAS,OAE9BA,EAAS,MAAM,MAAM,SAAS,GAAGA,EAAS,MAAM,YAAY;AAAA,IAC7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as i, computed as c, openBlock as m, createElementBlock as b, Fragment as f, createVNode as r, normalizeClass as y, withCtx as n, renderSlot as t, createElementVNode as p, mergeProps as h } from "vue";
2
- import g from "./index215.js";
2
+ import g from "./index211.js";
3
3
  /* empty css */
4
- import B from "./index217.js";
4
+ import B from "./index213.js";
5
5
  const k = ["id", "aria-describedby", "aria-invalid", "autocomplete", "autofocus", "disabled", "name", "placeholder", "readonly", "required", "type", "value"], w = /* @__PURE__ */ p("span", null, null, -1), q = /* @__PURE__ */ i({
6
6
  __name: "BaseTextInput",
7
7
  props: {
@@ -99,4 +99,4 @@ const k = ["id", "aria-describedby", "aria-invalid", "autocomplete", "autofocus"
99
99
  export {
100
100
  q as default
101
101
  };
102
- //# sourceMappingURL=index47.js.map
102
+ //# sourceMappingURL=index48.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index47.js","sources":["../src/components/BaseTextInput/BaseTextInput.vue"],"sourcesContent":["<template>\n\t<CommonInputOuterContainer :class=\"classes\">\n\t\t<template #prepend-outer><slot name=\"prepend-outer\"></slot></template>\n\t\t<CommonInputInnerContainer\n\t\t\t:append:icon=\"props['append:icon']\"\n\t\t\t:prepend:icon=\"props['prepend:icon']\"\n\t\t>\n\t\t\t<template #prepend><slot name=\"prepend\" /></template>\n\t\t\t<template #prefix><slot name=\"prefix\" /></template>\n\n\t\t\t<input\n\t\t\t\t:id=\"id\"\n\t\t\t\tref=\"input\"\n\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t:aria-invalid=\"hasErrors ? true : undefined\"\n\t\t\t\t:autocomplete=\"autocomplete\"\n\t\t\t\t:autofocus=\"autofocus\"\n\t\t\t\t:class=\"'bb-base-text-input__input'\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:name=\"name\"\n\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t:required=\"required\"\n\t\t\t\tsize=\"1\"\n\t\t\t\t:type=\"type\"\n\t\t\t\t:value=\"modelValue\"\n\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t/>\n\n\t\t\t<template #append><slot name=\"append\" /></template>\n\t\t\t<template #suffix><slot name=\"suffix\" /></template>\n\t\t</CommonInputInnerContainer>\n\t\t<template #append-outer><slot name=\"append-outer\"></slot></template>\n\t</CommonInputOuterContainer>\n\t<span> </span>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport CommonInputInnerContainer from '../CommonInputInnerContainer.vue';\nimport CommonInputOuterContainer from '../CommonInputOuterContainer.vue';\nimport type { HTMLAttributes, InputHTMLAttributes } from 'vue';\n\nexport type BaseTextInputProps = {\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\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tariaDescribedby?: InputHTMLAttributes['aria-describedby'];\n\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tautocomplete?: InputHTMLAttributes['autocomplete'];\n\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Sets the component in a loading state, usually triggering some visual styles.\n\t */\n\tloading?: boolean;\n\n\t/**\n\t * Used my v-model\n\t */\n\tmodelValue: string | null;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * String displayed when there's no data.\n\t */\n\tplaceholder?: InputHTMLAttributes['placeholder'];\n\n\t/**\n\t * Name of the icon to be added at the start of the input.\n\t */\n\t// eslint-disable-next-line vue/prop-name-casing\n\t'prepend:icon'?: string;\n\n\t/**\n\t * 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 * Type of the input. Returns the content type of the object.\n\t */\n\ttype?: HTMLInputElement['type'];\n};\n\nconst props = withDefaults(defineProps<BaseTextInputProps>(), {\n\ttype: 'text',\n});\n\nexport type BaseTextInputEvents = {\n\t(e: 'blur', event: FocusEvent): void;\n\t(e: 'change', event: Event): void;\n\t(e: 'click', event: MouseEvent): void;\n\t(e: 'focus', event: FocusEvent): void;\n\t(e: 'input', event: Event): void;\n\t(e: 'keydown', event: KeyboardEvent): void;\n\t(e: 'mousedown', event: MouseEvent): void;\n\t(e: 'mouseup', event: MouseEvent): void;\n\t(e: 'update:modelValue', value: string | null): void;\n};\nconst emit = defineEmits<BaseTextInputEvents>();\n\nexport type BaseTextInputSlots = {\n\t'append-outer'?: (props: object) => any;\n\tappend?: (props: object) => any;\n\tprefix?: (props: object) => any;\n\tprepend?: (props: object) => any;\n\t'prepend-outer'?: (props: object) => any;\n\tsuffix?: (props: object) => any;\n};\n\ndefineSlots<BaseTextInputSlots>();\n\nconst classes = computed(() => ({\n\t'bb-base-text-input': true,\n\t'bb-base-text-input--disabled': props.disabled,\n\t'bb-base-text-input--errors': props.hasErrors,\n\t'bb-base-text-input--loading': props.loading,\n\t'bb-base-text-input--readonly': props.readonly,\n}));\n\n/**\n * These events are just propagated\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) => emit('focus', event),\n\tonKeydown: (event: KeyboardEvent) => emit('keydown', event),\n\tonInput: (event: Event) => {\n\t\tif (event.target instanceof HTMLInputElement) {\n\t\t\temit('update:modelValue', event.target.value || null);\n\t\t}\n\t\temit('input', event);\n\t},\n\tonMousedown: (event: MouseEvent) => emit('mousedown', event),\n\tonMouseup: (event: MouseEvent) => emit('mouseup', event),\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BaseTextInput';\n</style>\n"],"names":["props","__props","emit","__emit","classes","computed","eventListeners","event"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA0HA,UAAMA,IAAQC,GAeRC,IAAOC,GAaPC,IAAUC,EAAS,OAAO;AAAA,MAC/B,sBAAsB;AAAA,MACtB,gCAAgCL,EAAM;AAAA,MACtC,8BAA8BA,EAAM;AAAA,MACpC,+BAA+BA,EAAM;AAAA,MACrC,gCAAgCA,EAAM;AAAA,IACrC,EAAA,GAKIM,IAAiB;AAAA,MACtB,QAAQ,CAACC,MAAsBL,EAAK,QAAQK,CAAK;AAAA,MACjD,UAAU,CAACA,MAAiBL,EAAK,UAAUK,CAAK;AAAA,MAChD,SAAS,CAACA,MAAsBL,EAAK,SAASK,CAAK;AAAA,MACnD,SAAS,CAACA,MAAsBL,EAAK,SAASK,CAAK;AAAA,MACnD,WAAW,CAACA,MAAyBL,EAAK,WAAWK,CAAK;AAAA,MAC1D,SAAS,CAACA,MAAiB;AACtB,QAAAA,EAAM,kBAAkB,oBAC3BL,EAAK,qBAAqBK,EAAM,OAAO,SAAS,IAAI,GAErDL,EAAK,SAASK,CAAK;AAAA,MACpB;AAAA,MACA,aAAa,CAACA,MAAsBL,EAAK,aAAaK,CAAK;AAAA,MAC3D,WAAW,CAACA,MAAsBL,EAAK,WAAWK,CAAK;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index48.js","sources":["../src/components/BaseTextInput/BaseTextInput.vue"],"sourcesContent":["<template>\n\t<CommonInputOuterContainer :class=\"classes\">\n\t\t<template #prepend-outer><slot name=\"prepend-outer\"></slot></template>\n\t\t<CommonInputInnerContainer\n\t\t\t:append:icon=\"props['append:icon']\"\n\t\t\t:prepend:icon=\"props['prepend:icon']\"\n\t\t>\n\t\t\t<template #prepend><slot name=\"prepend\" /></template>\n\t\t\t<template #prefix><slot name=\"prefix\" /></template>\n\n\t\t\t<input\n\t\t\t\t:id=\"id\"\n\t\t\t\tref=\"input\"\n\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t:aria-invalid=\"hasErrors ? true : undefined\"\n\t\t\t\t:autocomplete=\"autocomplete\"\n\t\t\t\t:autofocus=\"autofocus\"\n\t\t\t\t:class=\"'bb-base-text-input__input'\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:name=\"name\"\n\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t:required=\"required\"\n\t\t\t\tsize=\"1\"\n\t\t\t\t:type=\"type\"\n\t\t\t\t:value=\"modelValue\"\n\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t/>\n\n\t\t\t<template #append><slot name=\"append\" /></template>\n\t\t\t<template #suffix><slot name=\"suffix\" /></template>\n\t\t</CommonInputInnerContainer>\n\t\t<template #append-outer><slot name=\"append-outer\"></slot></template>\n\t</CommonInputOuterContainer>\n\t<span> </span>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport CommonInputInnerContainer from '../CommonInputInnerContainer.vue';\nimport CommonInputOuterContainer from '../CommonInputOuterContainer.vue';\nimport type { HTMLAttributes, InputHTMLAttributes } from 'vue';\n\nexport type BaseTextInputProps = {\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\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tariaDescribedby?: InputHTMLAttributes['aria-describedby'];\n\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tautocomplete?: InputHTMLAttributes['autocomplete'];\n\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Sets the component in a loading state, usually triggering some visual styles.\n\t */\n\tloading?: boolean;\n\n\t/**\n\t * Used my v-model\n\t */\n\tmodelValue: string | null;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * String displayed when there's no data.\n\t */\n\tplaceholder?: InputHTMLAttributes['placeholder'];\n\n\t/**\n\t * Name of the icon to be added at the start of the input.\n\t */\n\t// eslint-disable-next-line vue/prop-name-casing\n\t'prepend:icon'?: string;\n\n\t/**\n\t * 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 * Type of the input. Returns the content type of the object.\n\t */\n\ttype?: HTMLInputElement['type'];\n};\n\nconst props = withDefaults(defineProps<BaseTextInputProps>(), {\n\ttype: 'text',\n});\n\nexport type BaseTextInputEvents = {\n\t(e: 'blur', event: FocusEvent): void;\n\t(e: 'change', event: Event): void;\n\t(e: 'click', event: MouseEvent): void;\n\t(e: 'focus', event: FocusEvent): void;\n\t(e: 'input', event: Event): void;\n\t(e: 'keydown', event: KeyboardEvent): void;\n\t(e: 'mousedown', event: MouseEvent): void;\n\t(e: 'mouseup', event: MouseEvent): void;\n\t(e: 'update:modelValue', value: string | null): void;\n};\nconst emit = defineEmits<BaseTextInputEvents>();\n\nexport type BaseTextInputSlots = {\n\t'append-outer'?: (props: object) => any;\n\tappend?: (props: object) => any;\n\tprefix?: (props: object) => any;\n\tprepend?: (props: object) => any;\n\t'prepend-outer'?: (props: object) => any;\n\tsuffix?: (props: object) => any;\n};\n\ndefineSlots<BaseTextInputSlots>();\n\nconst classes = computed(() => ({\n\t'bb-base-text-input': true,\n\t'bb-base-text-input--disabled': props.disabled,\n\t'bb-base-text-input--errors': props.hasErrors,\n\t'bb-base-text-input--loading': props.loading,\n\t'bb-base-text-input--readonly': props.readonly,\n}));\n\n/**\n * These events are just propagated\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) => emit('focus', event),\n\tonKeydown: (event: KeyboardEvent) => emit('keydown', event),\n\tonInput: (event: Event) => {\n\t\tif (event.target instanceof HTMLInputElement) {\n\t\t\temit('update:modelValue', event.target.value || null);\n\t\t}\n\t\temit('input', event);\n\t},\n\tonMousedown: (event: MouseEvent) => emit('mousedown', event),\n\tonMouseup: (event: MouseEvent) => emit('mouseup', event),\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BaseTextInput';\n</style>\n"],"names":["props","__props","emit","__emit","classes","computed","eventListeners","event"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA0HA,UAAMA,IAAQC,GAeRC,IAAOC,GAaPC,IAAUC,EAAS,OAAO;AAAA,MAC/B,sBAAsB;AAAA,MACtB,gCAAgCL,EAAM;AAAA,MACtC,8BAA8BA,EAAM;AAAA,MACpC,+BAA+BA,EAAM;AAAA,MACrC,gCAAgCA,EAAM;AAAA,IACrC,EAAA,GAKIM,IAAiB;AAAA,MACtB,QAAQ,CAACC,MAAsBL,EAAK,QAAQK,CAAK;AAAA,MACjD,UAAU,CAACA,MAAiBL,EAAK,UAAUK,CAAK;AAAA,MAChD,SAAS,CAACA,MAAsBL,EAAK,SAASK,CAAK;AAAA,MACnD,SAAS,CAACA,MAAsBL,EAAK,SAASK,CAAK;AAAA,MACnD,WAAW,CAACA,MAAyBL,EAAK,WAAWK,CAAK;AAAA,MAC1D,SAAS,CAACA,MAAiB;AACtB,QAAAA,EAAM,kBAAkB,oBAC3BL,EAAK,qBAAqBK,EAAM,OAAO,SAAS,IAAI,GAErDL,EAAK,SAASK,CAAK;AAAA,MACpB;AAAA,MACA,aAAa,CAACA,MAAsBL,EAAK,aAAaK,CAAK;AAAA,MAC3D,WAAW,CAACA,MAAsBL,EAAK,WAAWK,CAAK;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index5.js CHANGED
@@ -1,43 +1,17 @@
1
- import { ref as i, onBeforeUnmount as h } from "vue";
2
- const b = (l = "bitboss-ui") => {
3
- let r = 0;
4
- return { useBroadCastChannel: () => {
5
- r++;
6
- const f = i(!1), o = i(), s = {};
7
- function d(e, n = void 0) {
8
- o.value && o.value.postMessage({ type: e, params: n });
9
- }
10
- const v = () => {
11
- r--, o.value && !r && o.value.close(), f.value = !0;
12
- }, p = (e, n, a = {
13
- removeonUnmount: !0
14
- }) => {
15
- var t;
16
- s[e] === void 0 && (s[e] = []), (t = s[e]) == null || t.push(n), a.removeonUnmount && s[e] && h(() => {
17
- const c = s[e], u = c.indexOf(n);
18
- u !== -1 && c.splice(u, 1);
19
- });
20
- };
21
- try {
22
- o.value = new BroadcastChannel(l), o.value.addEventListener(
23
- "message",
24
- (e) => {
25
- const n = e.data, a = s[n.type] ?? [];
26
- "params" in n ? a.forEach((t) => t(n.params)) : a.forEach((t) => t());
27
- },
28
- { passive: !0 }
29
- );
30
- } catch (e) {
31
- console.error(e);
32
- }
33
- return {
34
- on: p,
35
- post: d,
36
- close: v
37
- };
38
- } };
39
- };
1
+ import { reactive as i } from "vue";
2
+ const c = i({
3
+ inertiaLinkName: "Link",
4
+ nuxtLinkName: "NuxtLink",
5
+ mobileMaxWidth: 768,
6
+ documentationURL: "https://ui-components-docs.vercel.app/it"
7
+ }), s = (t) => {
8
+ Object.keys(t).forEach((e) => {
9
+ const n = e, o = t[n];
10
+ c[n] = o;
11
+ });
12
+ }, r = () => ({ setConfig: s });
40
13
  export {
41
- b as useBroadcastChannelInstance
14
+ c as _config,
15
+ r as useBbConfig
42
16
  };
43
17
  //# sourceMappingURL=index5.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index5.js","sources":["../src/composables/useBroadcastChannelInstance.ts"],"sourcesContent":["import { onBeforeUnmount, ref } from 'vue';\n\ntype MessageMap = { [key: string]: any };\n\ntype Message<T extends MessageMap> = {\n\t[Name in keyof T]: T[Name] extends void\n\t\t? { type: Name }\n\t\t: { type: Name; params: T[Name] };\n}[keyof T];\n\nexport const useBroadcastChannelInstance = <T extends MessageMap>(\n\tname = 'bitboss-ui'\n) => {\n\tlet instances = 0;\n\tconst useBroadCastChannel = () => {\n\t\tinstances++;\n\n\t\tconst isClosed = ref(false);\n\t\tconst channel = ref<BroadcastChannel | undefined>();\n\t\tconst subscribers: Partial<Record<keyof T, ((...args: any[]) => any)[]>> =\n\t\t\t{};\n\n\t\tfunction post<Key extends keyof T>(message: Key, params: T[Key]): void;\n\t\tfunction post<Key extends keyof T>(message: Key, params?: never): void;\n\t\tfunction post(message: keyof T, params: any = undefined) {\n\t\t\tif (channel.value) channel.value.postMessage({ type: message, params });\n\t\t}\n\n\t\tconst close = () => {\n\t\t\tinstances--;\n\t\t\tif (channel.value && !instances) {\n\t\t\t\tchannel.value.close();\n\t\t\t}\n\t\t\tisClosed.value = true;\n\t\t};\n\n\t\tconst on = <Key extends keyof T>(\n\t\t\tmessage: Key,\n\t\t\tfn: T[Key] extends void ? () => any : (arg: T[Key]) => any,\n\t\t\toptions: {\n\t\t\t\tremoveonUnmount: boolean;\n\t\t\t} = {\n\t\t\t\tremoveonUnmount: true,\n\t\t\t}\n\t\t) => {\n\t\t\tif (subscribers[message] === undefined) subscribers[message] = [];\n\n\t\t\tsubscribers[message]?.push(fn);\n\t\t\tif (options.removeonUnmount && subscribers[message]) {\n\t\t\t\tonBeforeUnmount(() => {\n\t\t\t\t\tconst arr = subscribers[message]!;\n\t\t\t\t\tconst indexOfFn = arr.indexOf(fn);\n\t\t\t\t\tif (indexOfFn !== -1) {\n\t\t\t\t\t\tarr.splice(indexOfFn, 1);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\ttry {\n\t\t\tchannel.value = new BroadcastChannel(name);\n\n\t\t\tchannel.value.addEventListener(\n\t\t\t\t'message',\n\t\t\t\t(e: MessageEvent) => {\n\t\t\t\t\tconst data = e.data as Message<T>;\n\t\t\t\t\tconst subs = subscribers[data.type] ?? [];\n\t\t\t\t\tif ('params' in data) {\n\t\t\t\t\t\tsubs.forEach((s) => s(data.params));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsubs.forEach((s) => s());\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{ passive: true }\n\t\t\t);\n\t\t} catch (error) {\n\t\t\tconsole.error(error);\n\t\t}\n\n\t\treturn {\n\t\t\ton,\n\t\t\tpost,\n\t\t\tclose,\n\t\t};\n\t};\n\treturn { useBroadCastChannel };\n};\n"],"names":["useBroadcastChannelInstance","name","instances","isClosed","ref","channel","subscribers","post","message","params","close","on","fn","options","_a","onBeforeUnmount","arr","indexOfFn","data","subs","s","error"],"mappings":";AAUa,MAAAA,IAA8B,CAC1CC,IAAO,iBACH;AACJ,MAAIC,IAAY;AAwEhB,SAAO,EAAE,qBAvEmB,MAAM;AACjC,IAAAA;AAEM,UAAAC,IAAWC,EAAI,EAAK,GACpBC,IAAUD,KACVE,IACL,CAAA;AAIQ,aAAAC,EAAKC,GAAkBC,IAAc,QAAW;AACpD,MAAAJ,EAAQ,SAAeA,EAAA,MAAM,YAAY,EAAE,MAAMG,GAAS,QAAAC,EAAA,CAAQ;AAAA,IACvE;AAEA,UAAMC,IAAQ,MAAM;AACnB,MAAAR,KACIG,EAAQ,SAAS,CAACH,KACrBG,EAAQ,MAAM,SAEfF,EAAS,QAAQ;AAAA,IAAA,GAGZQ,IAAK,CACVH,GACAI,GACAC,IAEI;AAAA,MACH,iBAAiB;AAAA,IAAA,MAEd;;AACJ,MAAIP,EAAYE,CAAO,MAAM,WAAuBF,EAAAE,CAAO,IAAI,MAEnDM,IAAAR,EAAAE,CAAO,MAAP,QAAAM,EAAU,KAAKF,IACvBC,EAAQ,mBAAmBP,EAAYE,CAAO,KACjDO,EAAgB,MAAM;AACf,cAAAC,IAAMV,EAAYE,CAAO,GACzBS,IAAYD,EAAI,QAAQJ,CAAE;AAChC,QAAIK,MAAc,MACbD,EAAA,OAAOC,GAAW,CAAC;AAAA,MACxB,CACA;AAAA,IACF;AAGG,QAAA;AACK,MAAAZ,EAAA,QAAQ,IAAI,iBAAiBJ,CAAI,GAEzCI,EAAQ,MAAM;AAAA,QACb;AAAA,QACA,CAAC,MAAoB;AACpB,gBAAMa,IAAO,EAAE,MACTC,IAAOb,EAAYY,EAAK,IAAI,KAAK,CAAA;AACvC,UAAI,YAAYA,IACfC,EAAK,QAAQ,CAACC,MAAMA,EAAEF,EAAK,MAAM,CAAC,IAElCC,EAAK,QAAQ,CAACC,MAAMA,EAAG,CAAA;AAAA,QAEzB;AAAA,QACA,EAAE,SAAS,GAAK;AAAA,MAAA;AAAA,aAETC,GAAO;AACf,cAAQ,MAAMA,CAAK;AAAA,IACpB;AAEO,WAAA;AAAA,MACN,IAAAV;AAAA,MACA,MAAAJ;AAAA,MACA,OAAAG;AAAA,IAAA;AAAA,EACD,EAE4B;AAC9B;"}
1
+ {"version":3,"file":"index5.js","sources":["../src/composables/useBbConfig.ts"],"sourcesContent":["import { reactive } from 'vue';\n\ntype Config = {\n\tinertiaLinkName: string;\n\tnuxtLinkName: string;\n\tmobileMaxWidth: number;\n};\n\nexport const _config = reactive<Config & Record<string, any>>({\n\tinertiaLinkName: 'Link',\n\tnuxtLinkName: 'NuxtLink',\n\tmobileMaxWidth: 768,\n\tdocumentationURL: 'https://ui-components-docs.vercel.app/it',\n});\n\nconst setConfig = (config: Partial<Config>) => {\n\tObject.keys(config).forEach((k) => {\n\t\tconst _k = k as keyof Config;\n\t\tconst value = config[_k]!;\n\t\t// @ts-expect-error this breaks in TS\n\t\t_config[_k] = value;\n\t});\n};\nexport const useBbConfig = () => {\n\treturn { setConfig };\n};\n"],"names":["_config","reactive","setConfig","config","k","_k","value","useBbConfig"],"mappings":";AAQO,MAAMA,IAAUC,EAAuC;AAAA,EAC7D,iBAAiB;AAAA,EACjB,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,kBAAkB;AACnB,CAAC,GAEKC,IAAY,CAACC,MAA4B;AAC9C,SAAO,KAAKA,CAAM,EAAE,QAAQ,CAACC,MAAM;AAClC,UAAMC,IAAKD,GACLE,IAAQH,EAAOE,CAAE;AAEvB,IAAAL,EAAQK,CAAE,IAAIC;AAAA,EAAA,CACd;AACF,GACaC,IAAc,OACnB,EAAE,WAAAL,EAAU;"}
@@ -1,8 +1,8 @@
1
1
  import { defineComponent as f, ref as _, watch as v, openBlock as b, createElementBlock as h, createVNode as n, unref as t, normalizeClass as d, withModifiers as g, withCtx as s, renderSlot as u } from "vue";
2
- import { useId as V } from "./index8.js";
3
- import $ from "./index13.js";
2
+ import { useId as V } from "./index9.js";
3
+ import $ from "./index14.js";
4
4
  /* empty css */
5
- import B from "./index121.js";
5
+ import B from "./index122.js";
6
6
  /* empty css */
7
7
  const y = { class: "bb-accordion" }, A = /* @__PURE__ */ f({
8
8
  __name: "BbAccordion",
@@ -64,4 +64,4 @@ const y = { class: "bb-accordion" }, A = /* @__PURE__ */ f({
64
64
  export {
65
65
  A as default
66
66
  };
67
- //# sourceMappingURL=index49.js.map
67
+ //# sourceMappingURL=index50.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index49.js","sources":["../src/components/BbAccordion/BbAccordion.vue"],"sourcesContent":["<template>\n\t<div class=\"bb-accordion\">\n\t\t<BaseButton\n\t\t\t:id=\"`${id}_header`\"\n\t\t\t:aria-controls=\"id\"\n\t\t\t:aria-expanded=\"internalValue\"\n\t\t\t:class=\"'bb-accordion__header'\"\n\t\t\t@click.self=\"toggle\"\n\t\t\t><slot name=\"header\" :toggle=\"toggle\" :value=\"internalValue\"></slot\n\t\t></BaseButton>\n\t\t<BbCollapsible\n\t\t\t:id=\"id\"\n\t\t\t:aria-labelledby=\"`${id}_header`\"\n\t\t\t:class=\"'bb-accordion__content'\"\n\t\t\t:eager=\"eager\"\n\t\t\t:model-value=\"internalValue\"\n\t\t\t:role=\"'region'\"\n\t\t\t:transition-duration=\"transitionDuration\"\n\t\t\t><slot :toggle=\"toggle\" :value=\"internalValue\"></slot\n\t\t></BbCollapsible>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch } from 'vue';\nimport { useId } from '@/composables/useId';\nimport BaseButton from '../BaseButton/BaseButton.vue';\nimport BbCollapsible from '../BbCollapsible/BbCollapsible.vue';\nimport type { BbCollapsibleProps } from '../BbCollapsible/BbCollapsible.vue';\nimport type { CommonProps } from '@/types/CommonProps';\n\nexport type BbAccordionProps = Partial<BbCollapsibleProps> &\n\tPick<CommonProps, 'id'>;\n\nexport type BbAccordionEvents = {\n\t(e: 'update:modelValue', value: boolean): void;\n};\nconst emit = defineEmits<BbAccordionEvents>();\n\nconst props = withDefaults(defineProps<BbAccordionProps>(), {\n\ttransitionDuration: 250,\n});\n\nconst id = props.id || `bba_${useId().id.value}`;\n\nconst internalValue = ref(props.modelValue);\n/**\n * Watch external changes and align internal value\n */\nwatch(\n\t() => props.modelValue,\n\t(current, previous) => {\n\t\tif (current !== previous && current !== internalValue.value) {\n\t\t\tinternalValue.value = current;\n\t\t}\n\t}\n);\n\nconst toggle = () => {\n\tinternalValue.value = !internalValue.value;\n\temit('update:modelValue', !props.modelValue);\n};\n\ndefineSlots<{\n\theader?: (props: {\n\t\tvalue: BbAccordionProps['modelValue'];\n\t\ttoggle: typeof toggle;\n\t}) => any;\n\tdefault?: (props: {\n\t\tvalue: BbAccordionProps['modelValue'];\n\t\ttoggle: typeof toggle;\n\t}) => any;\n}>();\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbAccordion';\n</style>\n"],"names":["emit","__emit","props","__props","id","useId","internalValue","ref","watch","current","previous","toggle"],"mappings":";;;;;;;;;;;;;;;;;AAqCA,UAAMA,IAAOC,GAEPC,IAAQC,GAIRC,IAAKF,EAAM,MAAM,OAAOG,IAAQ,GAAG,KAAK,IAExCC,IAAgBC,EAAIL,EAAM,UAAU;AAI1C,IAAAM;AAAA,MACC,MAAMN,EAAM;AAAA,MACZ,CAACO,GAASC,MAAa;AACtB,QAAID,MAAYC,KAAYD,MAAYH,EAAc,UACrDA,EAAc,QAAQG;AAAA,MAExB;AAAA,IAAA;AAGD,UAAME,IAAS,MAAM;AACN,MAAAL,EAAA,QAAQ,CAACA,EAAc,OAChCN,EAAA,qBAAqB,CAACE,EAAM,UAAU;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index50.js","sources":["../src/components/BbAccordion/BbAccordion.vue"],"sourcesContent":["<template>\n\t<div class=\"bb-accordion\">\n\t\t<BaseButton\n\t\t\t:id=\"`${id}_header`\"\n\t\t\t:aria-controls=\"id\"\n\t\t\t:aria-expanded=\"internalValue\"\n\t\t\t:class=\"'bb-accordion__header'\"\n\t\t\t@click.self=\"toggle\"\n\t\t\t><slot name=\"header\" :toggle=\"toggle\" :value=\"internalValue\"></slot\n\t\t></BaseButton>\n\t\t<BbCollapsible\n\t\t\t:id=\"id\"\n\t\t\t:aria-labelledby=\"`${id}_header`\"\n\t\t\t:class=\"'bb-accordion__content'\"\n\t\t\t:eager=\"eager\"\n\t\t\t:model-value=\"internalValue\"\n\t\t\t:role=\"'region'\"\n\t\t\t:transition-duration=\"transitionDuration\"\n\t\t\t><slot :toggle=\"toggle\" :value=\"internalValue\"></slot\n\t\t></BbCollapsible>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch } from 'vue';\nimport { useId } from '@/composables/useId';\nimport BaseButton from '../BaseButton/BaseButton.vue';\nimport BbCollapsible from '../BbCollapsible/BbCollapsible.vue';\nimport type { BbCollapsibleProps } from '../BbCollapsible/BbCollapsible.vue';\nimport type { CommonProps } from '@/types/CommonProps';\n\nexport type BbAccordionProps = Partial<BbCollapsibleProps> &\n\tPick<CommonProps, 'id'>;\n\nexport type BbAccordionEvents = {\n\t(e: 'update:modelValue', value: boolean): void;\n};\nconst emit = defineEmits<BbAccordionEvents>();\n\nconst props = withDefaults(defineProps<BbAccordionProps>(), {\n\ttransitionDuration: 250,\n});\n\nconst id = props.id || `bba_${useId().id.value}`;\n\nconst internalValue = ref(props.modelValue);\n/**\n * Watch external changes and align internal value\n */\nwatch(\n\t() => props.modelValue,\n\t(current, previous) => {\n\t\tif (current !== previous && current !== internalValue.value) {\n\t\t\tinternalValue.value = current;\n\t\t}\n\t}\n);\n\nconst toggle = () => {\n\tinternalValue.value = !internalValue.value;\n\temit('update:modelValue', !props.modelValue);\n};\n\ndefineSlots<{\n\theader?: (props: {\n\t\tvalue: BbAccordionProps['modelValue'];\n\t\ttoggle: typeof toggle;\n\t}) => any;\n\tdefault?: (props: {\n\t\tvalue: BbAccordionProps['modelValue'];\n\t\ttoggle: typeof toggle;\n\t}) => any;\n}>();\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbAccordion';\n</style>\n"],"names":["emit","__emit","props","__props","id","useId","internalValue","ref","watch","current","previous","toggle"],"mappings":";;;;;;;;;;;;;;;;;AAqCA,UAAMA,IAAOC,GAEPC,IAAQC,GAIRC,IAAKF,EAAM,MAAM,OAAOG,IAAQ,GAAG,KAAK,IAExCC,IAAgBC,EAAIL,EAAM,UAAU;AAI1C,IAAAM;AAAA,MACC,MAAMN,EAAM;AAAA,MACZ,CAACO,GAASC,MAAa;AACtB,QAAID,MAAYC,KAAYD,MAAYH,EAAc,UACrDA,EAAc,QAAQG;AAAA,MAExB;AAAA,IAAA;AAGD,UAAME,IAAS,MAAM;AACN,MAAAL,EAAA,QAAQ,CAACA,EAAc,OAChCN,EAAA,qBAAqB,CAACE,EAAM,UAAU;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as h, ref as f, watch as v, openBlock as s, createBlock as a, normalizeClass as k, withCtx as C, createElementVNode as t, createCommentVNode as i, renderSlot as n, normalizeProps as r, guardReactiveProps as c, createTextVNode as d, toDisplayString as m, createElementBlock as w } from "vue";
2
- import V from "./index121.js";
2
+ import V from "./index122.js";
3
3
  /* empty css */
4
- import y from "./index122.js";
4
+ import y from "./index123.js";
5
5
  /* empty css */
6
6
  const z = {
7
7
  class: "bb-alert__inner-container",
@@ -92,4 +92,4 @@ const z = {
92
92
  export {
93
93
  q as default
94
94
  };
95
- //# sourceMappingURL=index51.js.map
95
+ //# sourceMappingURL=index52.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index51.js","sources":["../src/components/BbAlert/BbAlert.vue"],"sourcesContent":["<template>\n\t<BbCollapsible\n\t\tclass=\"bb-alert\"\n\t\t:class=\"{ [`bb-alert--${theme}`]: theme }\"\n\t\t:model-value=\"innerValue\"\n\t>\n\t\t<div class=\"bb-alert__inner-container\" role=\"alert\">\n\t\t\t<div class=\"bb-alert__icon-container\">\n\t\t\t\t<BbIcon\n\t\t\t\t\tv-if=\"icon\"\n\t\t\t\t\tclass=\"bb-alert__icon\"\n\t\t\t\t\t:size=\"iconSize\"\n\t\t\t\t\t:type=\"icon\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div class=\"bb-alert__content\">\n\t\t\t\t<div class=\"bb-alert__title\">\n\t\t\t\t\t<slot name=\"title\" v-bind=\"{ text: title }\">{{ title }}</slot>\n\t\t\t\t\t<div v-if=\"showClose\" class=\"bb-alert__close\">\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t:aria-label=\"closeLabel\"\n\t\t\t\t\t\t\tblock\n\t\t\t\t\t\t\tclass=\"bb-alert__close-btn\"\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t@click=\"onClickClose\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\td=\"M23 23L1 1M23 1L1 23\"\n\t\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<p class=\"bb-alert__text\">\n\t\t\t\t\t<slot name=\"text\" v-bind=\"{ text: text }\">{{ text }}</slot>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t</div>\n\t</BbCollapsible>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch } from 'vue';\nimport BaseButton from '../BaseButton/BaseButton.vue';\nimport BbCollapsible from '../BbCollapsible/BbCollapsible.vue';\nimport BbIcon from '../BbIcon/BbIcon.vue';\nimport type { BbIconProps } from '../BbIcon/BbIcon.vue';\nimport type { CommonProps } from '@/types/CommonProps';\n\nexport type BbAlertProps = Pick<\n\tCommonProps,\n\t'closeLabel' | 'showClose' | 'text' | 'theme' | 'title'\n> & {\n\t/**\n\t * Name of the icon to use\n\t */\n\ticon?: BbIconProps['type'];\n\t/**\n\t * Size of the icon to use\n\t */\n\ticonSize?: BbIconProps['size'];\n\t/**\n\t * Used by v-model, set type to any to avoid Vue casting it as false\n\t */\n\tmodelValue?: any;\n};\n\nconst props = withDefaults(defineProps<BbAlertProps>(), {\n\tcloseLabel: 'Chiudi',\n\ttheme: 'default',\n});\n\nexport type BbAlertEvents = {\n\t(e: 'update:modelValue', value: boolean): void;\n};\nconst emit = defineEmits<BbAlertEvents>();\n\ndefineSlots<{\n\ttitle?: (props: { text: BbAlertProps['title'] }) => any;\n\ttext?: (props: { text: BbAlertProps['title'] }) => any;\n}>();\n\nconst innerValue = ref(\n\tprops.modelValue === undefined ? true : !!props.modelValue\n);\n\nwatch(\n\t() => props.modelValue,\n\t(value) => {\n\t\tif (innerValue.value !== !!value) {\n\t\t\tinnerValue.value = !!value;\n\t\t}\n\t}\n);\n\nconst onClickClose = () => {\n\tinnerValue.value = false;\n\temit('update:modelValue', false);\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbAlert';\n</style>\n"],"names":["props","__props","emit","__emit","innerValue","ref","watch","value","onClickClose"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2EA,UAAMA,IAAQC,GAQRC,IAAOC,GAOPC,IAAaC;AAAA,MAClBL,EAAM,eAAe,SAAY,KAAO,CAAC,CAACA,EAAM;AAAA,IAAA;AAGjD,IAAAM;AAAA,MACC,MAAMN,EAAM;AAAA,MACZ,CAACO,MAAU;AACV,QAAIH,EAAW,UAAU,CAAC,CAACG,MACfH,EAAA,QAAQ,CAAC,CAACG;AAAA,MAEvB;AAAA,IAAA;AAGD,UAAMC,IAAe,MAAM;AAC1B,MAAAJ,EAAW,QAAQ,IACnBF,EAAK,qBAAqB,EAAK;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index52.js","sources":["../src/components/BbAlert/BbAlert.vue"],"sourcesContent":["<template>\n\t<BbCollapsible\n\t\tclass=\"bb-alert\"\n\t\t:class=\"{ [`bb-alert--${theme}`]: theme }\"\n\t\t:model-value=\"innerValue\"\n\t>\n\t\t<div class=\"bb-alert__inner-container\" role=\"alert\">\n\t\t\t<div class=\"bb-alert__icon-container\">\n\t\t\t\t<BbIcon\n\t\t\t\t\tv-if=\"icon\"\n\t\t\t\t\tclass=\"bb-alert__icon\"\n\t\t\t\t\t:size=\"iconSize\"\n\t\t\t\t\t:type=\"icon\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div class=\"bb-alert__content\">\n\t\t\t\t<div class=\"bb-alert__title\">\n\t\t\t\t\t<slot name=\"title\" v-bind=\"{ text: title }\">{{ title }}</slot>\n\t\t\t\t\t<div v-if=\"showClose\" class=\"bb-alert__close\">\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t:aria-label=\"closeLabel\"\n\t\t\t\t\t\t\tblock\n\t\t\t\t\t\t\tclass=\"bb-alert__close-btn\"\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t@click=\"onClickClose\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\td=\"M23 23L1 1M23 1L1 23\"\n\t\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<p class=\"bb-alert__text\">\n\t\t\t\t\t<slot name=\"text\" v-bind=\"{ text: text }\">{{ text }}</slot>\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t</div>\n\t</BbCollapsible>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch } from 'vue';\nimport BaseButton from '../BaseButton/BaseButton.vue';\nimport BbCollapsible from '../BbCollapsible/BbCollapsible.vue';\nimport BbIcon from '../BbIcon/BbIcon.vue';\nimport type { BbIconProps } from '../BbIcon/BbIcon.vue';\nimport type { CommonProps } from '@/types/CommonProps';\n\nexport type BbAlertProps = Pick<\n\tCommonProps,\n\t'closeLabel' | 'showClose' | 'text' | 'theme' | 'title'\n> & {\n\t/**\n\t * Name of the icon to use\n\t */\n\ticon?: BbIconProps['type'];\n\t/**\n\t * Size of the icon to use\n\t */\n\ticonSize?: BbIconProps['size'];\n\t/**\n\t * Used by v-model, set type to any to avoid Vue casting it as false\n\t */\n\tmodelValue?: any;\n};\n\nconst props = withDefaults(defineProps<BbAlertProps>(), {\n\tcloseLabel: 'Chiudi',\n\ttheme: 'default',\n});\n\nexport type BbAlertEvents = {\n\t(e: 'update:modelValue', value: boolean): void;\n};\nconst emit = defineEmits<BbAlertEvents>();\n\ndefineSlots<{\n\ttitle?: (props: { text: BbAlertProps['title'] }) => any;\n\ttext?: (props: { text: BbAlertProps['title'] }) => any;\n}>();\n\nconst innerValue = ref(\n\tprops.modelValue === undefined ? true : !!props.modelValue\n);\n\nwatch(\n\t() => props.modelValue,\n\t(value) => {\n\t\tif (innerValue.value !== !!value) {\n\t\t\tinnerValue.value = !!value;\n\t\t}\n\t}\n);\n\nconst onClickClose = () => {\n\tinnerValue.value = false;\n\temit('update:modelValue', false);\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbAlert';\n</style>\n"],"names":["props","__props","emit","__emit","innerValue","ref","watch","value","onClickClose"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2EA,UAAMA,IAAQC,GAQRC,IAAOC,GAOPC,IAAaC;AAAA,MAClBL,EAAM,eAAe,SAAY,KAAO,CAAC,CAACA,EAAM;AAAA,IAAA;AAGjD,IAAAM;AAAA,MACC,MAAMN,EAAM;AAAA,MACZ,CAACO,MAAU;AACV,QAAIH,EAAW,UAAU,CAAC,CAACG,MACfH,EAAA,QAAQ,CAAC,CAACG;AAAA,MAEvB;AAAA,IAAA;AAGD,UAAMC,IAAe,MAAM;AAC1B,MAAAJ,EAAW,QAAQ,IACnBF,EAAK,qBAAqB,EAAK;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as z, computed as b, ref as o, onMounted as g, openBlock as l, createElementBlock as i, normalizeProps as h, guardReactiveProps as k, renderSlot as y } from "vue";
2
- import { isCssColor as _ } from "./index200.js";
3
- import { wait as C } from "./index127.js";
2
+ import { isCssColor as _ } from "./index222.js";
3
+ import { wait as C } from "./index128.js";
4
4
  const w = ["alt", "sizes", "src", "srcset"], B = {
5
5
  key: 1,
6
6
  class: "bb-avatar__fallback"
@@ -66,4 +66,4 @@ const w = ["alt", "sizes", "src", "srcset"], B = {
66
66
  export {
67
67
  P as default
68
68
  };
69
- //# sourceMappingURL=index53.js.map
69
+ //# sourceMappingURL=index54.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index53.js","sources":["../src/components/BbAvatar/BbAvatar.vue"],"sourcesContent":["<template>\n\t<span v-bind=\"attributes\">\n\t\t<img\n\t\t\tv-if=\"(src || srcset) && !imageErrored\"\n\t\t\tref=\"image\"\n\t\t\t:alt=\"alt\"\n\t\t\t:sizes=\"sizes\"\n\t\t\t:src=\"src\"\n\t\t\t:srcset=\"srcset\"\n\t\t\t@error=\"onError\"\n\t\t\t@load=\"onLoad\"\n\t\t/>\n\t\t<span v-else class=\"bb-avatar__fallback\">\n\t\t\t<slot></slot>\n\t\t</span>\n\t</span>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, type ImgHTMLAttributes, onMounted } from 'vue';\nimport { isCssColor } from '@/utilities/functions/isCssColor';\nimport type { Classes } from '@/types/Classes';\nimport type { CommonProps } from '@/types/CommonProps';\nimport type { BbIconProps, Size } from '../BbIcon/BbIcon.vue';\nimport { wait } from '@/utilities/functions/wait';\n\nexport type BbAvatarProps = Pick<CommonProps, 'color'> &\n\tPick<BbIconProps, 'size'> & {\n\t\talt?: ImgHTMLAttributes['alt'];\n\t\tsrc?: ImgHTMLAttributes['src'];\n\t\tsrcset?: ImgHTMLAttributes['srcset'];\n\t\tsizes?: ImgHTMLAttributes['sizes'];\n\t\ttimeout?: number;\n\t};\n\nconst props = withDefaults(defineProps<BbAvatarProps>(), {\n\ttimeout: 400,\n});\n\ndefineSlots<{\n\tdefault?: (props: object) => any;\n}>();\n\nconst sizeMap: Size = {\n\txs: 24,\n\tsm: 32,\n\tmd: 40,\n\tlg: 56,\n\txl: 80,\n\txxl: 104,\n};\n\nconst attributes = computed(() => {\n\tconst classes: Classes = {\n\t\t'bb-avatar': true,\n\t};\n\tlet dimension: any;\n\tif (props.size) {\n\t\tif (typeof props.size === 'string') {\n\t\t\tdimension = sizeMap[props.size as keyof Size] ?? parseInt(props.size, 10);\n\t\t} else {\n\t\t\tdimension = props.size;\n\t\t}\n\t\tdimension += `px`;\n\t}\n\n\tlet style: { [key: string]: any } = {\n\t\twidth: dimension,\n\t\theight: dimension,\n\t};\n\tif (props.color) {\n\t\tif (isCssColor(props.color)) {\n\t\t\tstyle.backgroundColor = props.color;\n\t\t} else {\n\t\t\tclasses[`bb-avatar--${props.color}`] = true;\n\t\t}\n\t}\n\treturn {\n\t\tclass: classes,\n\t\tstyle,\n\t};\n});\n\nconst imageHasLoadedCorrectly = (img: HTMLImageElement) => {\n\tif (!img) return false;\n\t// During the onload event, IE correctly identifies any images that\n\t// weren’t downloaded as not complete. Others should too. Gecko-based\n\t// browsers act like NS4 in that they report this incorrectly.\n\tif (!img.complete) {\n\t\treturn false;\n\t}\n\n\t// However, they do have two very useful properties: naturalWidth and\n\t// naturalHeight. These give the true size of the image. If it failed\n\t// to load, either of these should be zero.\n\tif (img.naturalWidth === 0) {\n\t\treturn false;\n\t}\n\n\t// No other way of checking: assume it’s ok.\n\treturn true;\n};\n\nconst image = ref<HTMLImageElement | null>();\nconst imageLoaded = ref(false);\nconst imageErrored = ref(false);\n\nonMounted(async () => {\n\t// Only run when events don't fire (when the page is SSR)\n\tif (!imageErrored.value && !imageLoaded.value) {\n\t\tif (image.value) {\n\t\t\tawait wait(props.timeout);\n\t\t\timageErrored.value = !imageHasLoadedCorrectly(image.value);\n\t\t}\n\t}\n});\nconst onLoad = () => {\n\timageLoaded.value = true;\n};\nconst onError = () => {\n\timageErrored.value = true;\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbAvatar';\n</style>\n"],"names":["props","__props","sizeMap","attributes","computed","classes","dimension","style","isCssColor","imageHasLoadedCorrectly","img","image","ref","imageLoaded","imageErrored","onMounted","wait","onLoad","onError"],"mappings":";;;;;;;;;;;;;;;;;;AAmCA,UAAMA,IAAQC,GAQRC,IAAgB;AAAA,MACrB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,KAAK;AAAA,IAAA,GAGAC,IAAaC,EAAS,MAAM;AACjC,YAAMC,IAAmB;AAAA,QACxB,aAAa;AAAA,MAAA;AAEV,UAAAC;AACJ,MAAIN,EAAM,SACL,OAAOA,EAAM,QAAS,WACzBM,IAAYJ,EAAQF,EAAM,IAAkB,KAAK,SAASA,EAAM,MAAM,EAAE,IAExEM,IAAYN,EAAM,MAENM,KAAA;AAGd,UAAIC,IAAgC;AAAA,QACnC,OAAOD;AAAA,QACP,QAAQA;AAAA,MAAA;AAET,aAAIN,EAAM,UACLQ,EAAWR,EAAM,KAAK,IACzBO,EAAM,kBAAkBP,EAAM,QAE9BK,EAAQ,cAAcL,EAAM,KAAK,EAAE,IAAI,KAGlC;AAAA,QACN,OAAOK;AAAA,QACP,OAAAE;AAAA,MAAA;AAAA,IACD,CACA,GAEKE,IAA0B,CAACC,MAC5B,GAACA,KAID,CAACA,EAAI,YAOLA,EAAI,iBAAiB,IAQpBC,IAAQC,KACRC,IAAcD,EAAI,EAAK,GACvBE,IAAeF,EAAI,EAAK;AAE9B,IAAAG,EAAU,YAAY;AAErB,MAAI,CAACD,EAAa,SAAS,CAACD,EAAY,SACnCF,EAAM,UACH,MAAAK,EAAKhB,EAAM,OAAO,GACxBc,EAAa,QAAQ,CAACL,EAAwBE,EAAM,KAAK;AAAA,IAE3D,CACA;AACD,UAAMM,IAAS,MAAM;AACpB,MAAAJ,EAAY,QAAQ;AAAA,IAAA,GAEfK,IAAU,MAAM;AACrB,MAAAJ,EAAa,QAAQ;AAAA,IAAA;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index54.js","sources":["../src/components/BbAvatar/BbAvatar.vue"],"sourcesContent":["<template>\n\t<span v-bind=\"attributes\">\n\t\t<img\n\t\t\tv-if=\"(src || srcset) && !imageErrored\"\n\t\t\tref=\"image\"\n\t\t\t:alt=\"alt\"\n\t\t\t:sizes=\"sizes\"\n\t\t\t:src=\"src\"\n\t\t\t:srcset=\"srcset\"\n\t\t\t@error=\"onError\"\n\t\t\t@load=\"onLoad\"\n\t\t/>\n\t\t<span v-else class=\"bb-avatar__fallback\">\n\t\t\t<slot></slot>\n\t\t</span>\n\t</span>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, type ImgHTMLAttributes, onMounted } from 'vue';\nimport { isCssColor } from '@/utilities/functions/isCssColor';\nimport type { Classes } from '@/types/Classes';\nimport type { CommonProps } from '@/types/CommonProps';\nimport type { BbIconProps, Size } from '../BbIcon/BbIcon.vue';\nimport { wait } from '@/utilities/functions/wait';\n\nexport type BbAvatarProps = Pick<CommonProps, 'color'> &\n\tPick<BbIconProps, 'size'> & {\n\t\talt?: ImgHTMLAttributes['alt'];\n\t\tsrc?: ImgHTMLAttributes['src'];\n\t\tsrcset?: ImgHTMLAttributes['srcset'];\n\t\tsizes?: ImgHTMLAttributes['sizes'];\n\t\ttimeout?: number;\n\t};\n\nconst props = withDefaults(defineProps<BbAvatarProps>(), {\n\ttimeout: 400,\n});\n\ndefineSlots<{\n\tdefault?: (props: object) => any;\n}>();\n\nconst sizeMap: Size = {\n\txs: 24,\n\tsm: 32,\n\tmd: 40,\n\tlg: 56,\n\txl: 80,\n\txxl: 104,\n};\n\nconst attributes = computed(() => {\n\tconst classes: Classes = {\n\t\t'bb-avatar': true,\n\t};\n\tlet dimension: any;\n\tif (props.size) {\n\t\tif (typeof props.size === 'string') {\n\t\t\tdimension = sizeMap[props.size as keyof Size] ?? parseInt(props.size, 10);\n\t\t} else {\n\t\t\tdimension = props.size;\n\t\t}\n\t\tdimension += `px`;\n\t}\n\n\tlet style: { [key: string]: any } = {\n\t\twidth: dimension,\n\t\theight: dimension,\n\t};\n\tif (props.color) {\n\t\tif (isCssColor(props.color)) {\n\t\t\tstyle.backgroundColor = props.color;\n\t\t} else {\n\t\t\tclasses[`bb-avatar--${props.color}`] = true;\n\t\t}\n\t}\n\treturn {\n\t\tclass: classes,\n\t\tstyle,\n\t};\n});\n\nconst imageHasLoadedCorrectly = (img: HTMLImageElement) => {\n\tif (!img) return false;\n\t// During the onload event, IE correctly identifies any images that\n\t// weren’t downloaded as not complete. Others should too. Gecko-based\n\t// browsers act like NS4 in that they report this incorrectly.\n\tif (!img.complete) {\n\t\treturn false;\n\t}\n\n\t// However, they do have two very useful properties: naturalWidth and\n\t// naturalHeight. These give the true size of the image. If it failed\n\t// to load, either of these should be zero.\n\tif (img.naturalWidth === 0) {\n\t\treturn false;\n\t}\n\n\t// No other way of checking: assume it’s ok.\n\treturn true;\n};\n\nconst image = ref<HTMLImageElement | null>();\nconst imageLoaded = ref(false);\nconst imageErrored = ref(false);\n\nonMounted(async () => {\n\t// Only run when events don't fire (when the page is SSR)\n\tif (!imageErrored.value && !imageLoaded.value) {\n\t\tif (image.value) {\n\t\t\tawait wait(props.timeout);\n\t\t\timageErrored.value = !imageHasLoadedCorrectly(image.value);\n\t\t}\n\t}\n});\nconst onLoad = () => {\n\timageLoaded.value = true;\n};\nconst onError = () => {\n\timageErrored.value = true;\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbAvatar';\n</style>\n"],"names":["props","__props","sizeMap","attributes","computed","classes","dimension","style","isCssColor","imageHasLoadedCorrectly","img","image","ref","imageLoaded","imageErrored","onMounted","wait","onLoad","onError"],"mappings":";;;;;;;;;;;;;;;;;;AAmCA,UAAMA,IAAQC,GAQRC,IAAgB;AAAA,MACrB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,KAAK;AAAA,IAAA,GAGAC,IAAaC,EAAS,MAAM;AACjC,YAAMC,IAAmB;AAAA,QACxB,aAAa;AAAA,MAAA;AAEV,UAAAC;AACJ,MAAIN,EAAM,SACL,OAAOA,EAAM,QAAS,WACzBM,IAAYJ,EAAQF,EAAM,IAAkB,KAAK,SAASA,EAAM,MAAM,EAAE,IAExEM,IAAYN,EAAM,MAENM,KAAA;AAGd,UAAIC,IAAgC;AAAA,QACnC,OAAOD;AAAA,QACP,QAAQA;AAAA,MAAA;AAET,aAAIN,EAAM,UACLQ,EAAWR,EAAM,KAAK,IACzBO,EAAM,kBAAkBP,EAAM,QAE9BK,EAAQ,cAAcL,EAAM,KAAK,EAAE,IAAI,KAGlC;AAAA,QACN,OAAOK;AAAA,QACP,OAAAE;AAAA,MAAA;AAAA,IACD,CACA,GAEKE,IAA0B,CAACC,MAC5B,GAACA,KAID,CAACA,EAAI,YAOLA,EAAI,iBAAiB,IAQpBC,IAAQC,KACRC,IAAcD,EAAI,EAAK,GACvBE,IAAeF,EAAI,EAAK;AAE9B,IAAAG,EAAU,YAAY;AAErB,MAAI,CAACD,EAAa,SAAS,CAACD,EAAY,SACnCF,EAAM,UACH,MAAAK,EAAKhB,EAAM,OAAO,GACxBc,EAAa,QAAQ,CAACL,EAAwBE,EAAM,KAAK;AAAA,IAE3D,CACA;AACD,UAAMM,IAAS,MAAM;AACpB,MAAAJ,EAAY,QAAQ;AAAA,IAAA,GAEfK,IAAU,MAAM;AACrB,MAAAJ,EAAa,QAAQ;AAAA,IAAA;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as p, useSlots as d, computed as n, openBlock as m, createElementBlock as u, normalizeClass as g, createElementVNode as s, renderSlot as l, mergeProps as f, createTextVNode as _, toDisplayString as y } from "vue";
2
- import { isCssColor as r } from "./index200.js";
3
- import { isNil as B } from "./index125.js";
2
+ import { isCssColor as r } from "./index222.js";
3
+ import { isNil as B } from "./index126.js";
4
4
  const C = { class: "bb-badge__wrapper" }, h = { class: "bb-badge__content-inner" }, S = /* @__PURE__ */ p({
5
5
  __name: "BbBadge",
6
6
  props: {
@@ -47,4 +47,4 @@ const C = { class: "bb-badge__wrapper" }, h = { class: "bb-badge__content-inner"
47
47
  export {
48
48
  S as default
49
49
  };
50
- //# sourceMappingURL=index55.js.map
50
+ //# sourceMappingURL=index56.js.map