bitboss-ui 2.0.4 → 2.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (442) hide show
  1. package/dist/components/BaseDialog/BaseDialog.vue.d.ts +1 -3
  2. package/dist/composables/useOptions.d.ts +1 -1
  3. package/dist/index.js +138 -137
  4. package/dist/index.js.map +1 -1
  5. package/dist/index10.js +74 -35
  6. package/dist/index10.js.map +1 -1
  7. package/dist/{index99.js → index100.js} +3 -3
  8. package/dist/index100.js.map +1 -0
  9. package/dist/{index101.js → index102.js} +3 -3
  10. package/dist/{index101.js.map → index102.js.map} +1 -1
  11. package/dist/{index103.js → index104.js} +8 -8
  12. package/dist/{index103.js.map → index104.js.map} +1 -1
  13. package/dist/{index105.js → index106.js} +10 -10
  14. package/dist/{index105.js.map → index106.js.map} +1 -1
  15. package/dist/{index107.js → index108.js} +3 -3
  16. package/dist/{index107.js.map → index108.js.map} +1 -1
  17. package/dist/index11.js +36 -189
  18. package/dist/index11.js.map +1 -1
  19. package/dist/{index109.js → index110.js} +3 -3
  20. package/dist/{index109.js.map → index110.js.map} +1 -1
  21. package/dist/{index111.js → index112.js} +3 -3
  22. package/dist/{index111.js.map → index112.js.map} +1 -1
  23. package/dist/{index113.js → index114.js} +3 -3
  24. package/dist/{index113.js.map → index114.js.map} +1 -1
  25. package/dist/{index115.js → index116.js} +8 -8
  26. package/dist/{index115.js.map → index116.js.map} +1 -1
  27. package/dist/{index117.js → index118.js} +2 -2
  28. package/dist/{index117.js.map → index118.js.map} +1 -1
  29. package/dist/index12.js +189 -78
  30. package/dist/index12.js.map +1 -1
  31. package/dist/index120.js +34 -38
  32. package/dist/index120.js.map +1 -1
  33. package/dist/index121.js +38 -38
  34. package/dist/index121.js.map +1 -1
  35. package/dist/index122.js +39 -42
  36. package/dist/index122.js.map +1 -1
  37. package/dist/index123.js +43 -31
  38. package/dist/index123.js.map +1 -1
  39. package/dist/index124.js +35 -2
  40. package/dist/index124.js.map +1 -1
  41. package/dist/index125.js +2 -21
  42. package/dist/index125.js.map +1 -1
  43. package/dist/index126.js +21 -2
  44. package/dist/index126.js.map +1 -1
  45. package/dist/index127.js +2 -312
  46. package/dist/index127.js.map +1 -1
  47. package/dist/index128.js +309 -21
  48. package/dist/index128.js.map +1 -1
  49. package/dist/index129.js +24 -2
  50. package/dist/index129.js.map +1 -1
  51. package/dist/index13.js +85 -0
  52. package/dist/index13.js.map +1 -0
  53. package/dist/index130.js +2 -5
  54. package/dist/index130.js.map +1 -1
  55. package/dist/index131.js +5 -9
  56. package/dist/index131.js.map +1 -1
  57. package/dist/index132.js +8 -5
  58. package/dist/index132.js.map +1 -1
  59. package/dist/index133.js +6 -3
  60. package/dist/index133.js.map +1 -1
  61. package/dist/index134.js +1 -1
  62. package/dist/index135.js +1 -1
  63. package/dist/index136.js +1 -1
  64. package/dist/index137.js +1 -1
  65. package/dist/index138.js +1 -1
  66. package/dist/index139.js +1 -1
  67. package/dist/index140.js +1 -1
  68. package/dist/index141.js +1 -1
  69. package/dist/index142.js +1 -1
  70. package/dist/index143.js +1 -1
  71. package/dist/index144.js +1 -1
  72. package/dist/index145.js +1 -1
  73. package/dist/index146.js +1 -1
  74. package/dist/index147.js +1 -1
  75. package/dist/index148.js +1 -1
  76. package/dist/index149.js +1 -1
  77. package/dist/{index14.js → index15.js} +4 -4
  78. package/dist/{index14.js.map → index15.js.map} +1 -1
  79. package/dist/index150.js +1 -1
  80. package/dist/index151.js +1 -1
  81. package/dist/index152.js +1 -1
  82. package/dist/index153.js +1 -1
  83. package/dist/index154.js +1 -1
  84. package/dist/index155.js +1 -1
  85. package/dist/index156.js +1 -1
  86. package/dist/index157.js +1 -1
  87. package/dist/index158.js +1 -1
  88. package/dist/index159.js +2 -2
  89. package/dist/{index161.js → index160.js} +1 -1
  90. package/dist/index160.js.map +1 -0
  91. package/dist/index162.js +6 -0
  92. package/dist/index162.js.map +1 -0
  93. package/dist/index164.js +1 -1
  94. package/dist/index165.js +1 -1
  95. package/dist/index166.js +1 -1
  96. package/dist/index167.js +1 -1
  97. package/dist/index168.js +1 -1
  98. package/dist/index169.js +2 -2
  99. package/dist/{index16.js → index17.js} +4 -4
  100. package/dist/{index16.js.map → index17.js.map} +1 -1
  101. package/dist/index170.js +6 -0
  102. package/dist/index170.js.map +1 -0
  103. package/dist/index172.js +2 -3
  104. package/dist/index172.js.map +1 -1
  105. package/dist/index173.js +1 -1
  106. package/dist/index174.js +1 -1
  107. package/dist/index175.js +1 -1
  108. package/dist/index176.js +1 -1
  109. package/dist/index177.js +1 -1
  110. package/dist/index178.js +1 -1
  111. package/dist/index179.js +1 -1
  112. package/dist/index180.js +1 -1
  113. package/dist/index181.js +1 -1
  114. package/dist/index182.js +1 -1
  115. package/dist/index183.js +2 -2
  116. package/dist/{index185.js → index184.js} +1 -1
  117. package/dist/index184.js.map +1 -0
  118. package/dist/index186.js +6 -0
  119. package/dist/index186.js.map +1 -0
  120. package/dist/index188.js +1 -1
  121. package/dist/index189.js +1 -1
  122. package/dist/{index18.js → index19.js} +76 -74
  123. package/dist/index19.js.map +1 -0
  124. package/dist/index190.js +1 -1
  125. package/dist/index191.js +1 -1
  126. package/dist/index192.js +1 -1
  127. package/dist/index193.js +1 -1
  128. package/dist/index194.js +1 -1
  129. package/dist/index195.js +1 -1
  130. package/dist/index196.js +1 -1
  131. package/dist/index197.js +3 -2
  132. package/dist/index197.js.map +1 -1
  133. package/dist/index198.js +77 -154
  134. package/dist/index198.js.map +1 -1
  135. package/dist/index199.js +2 -84
  136. package/dist/index199.js.map +1 -1
  137. package/dist/index200.js +5 -0
  138. package/dist/index200.js.map +1 -0
  139. package/dist/index201.js +4 -2
  140. package/dist/index201.js.map +1 -1
  141. package/dist/index202.js +2 -4
  142. package/dist/index202.js.map +1 -1
  143. package/dist/index203.js +8 -2
  144. package/dist/index203.js.map +1 -1
  145. package/dist/index204.js +117 -72
  146. package/dist/index204.js.map +1 -1
  147. package/dist/index205.js +5 -126
  148. package/dist/index205.js.map +1 -1
  149. package/dist/index206.js +123 -5
  150. package/dist/index206.js.map +1 -1
  151. package/dist/index207.js +17 -121
  152. package/dist/index207.js.map +1 -1
  153. package/dist/index208.js +15 -18
  154. package/dist/index208.js.map +1 -1
  155. package/dist/index209.js +10 -10
  156. package/dist/index209.js.map +1 -1
  157. package/dist/{index20.js → index21.js} +26 -27
  158. package/dist/index21.js.map +1 -0
  159. package/dist/index210.js +2 -16
  160. package/dist/index210.js.map +1 -1
  161. package/dist/index211.js +2 -2
  162. package/dist/index211.js.map +1 -1
  163. package/dist/index212.js +35 -2
  164. package/dist/index212.js.map +1 -1
  165. package/dist/index213.js +172 -33
  166. package/dist/index213.js.map +1 -1
  167. package/dist/index214.js +6 -174
  168. package/dist/index214.js.map +1 -1
  169. package/dist/index215.js +42 -5
  170. package/dist/index215.js.map +1 -1
  171. package/dist/index217.js +16 -0
  172. package/dist/index217.js.map +1 -0
  173. package/dist/index218.js +4 -12
  174. package/dist/index218.js.map +1 -1
  175. package/dist/index219.js +369 -5
  176. package/dist/index219.js.map +1 -1
  177. package/dist/index220.js +17 -367
  178. package/dist/index220.js.map +1 -1
  179. package/dist/index221.js +27 -8
  180. package/dist/index221.js.map +1 -1
  181. package/dist/index222.js +3 -3
  182. package/dist/index222.js.map +1 -1
  183. package/dist/index223.js +249 -7
  184. package/dist/index223.js.map +1 -1
  185. package/dist/index224.js +51 -18
  186. package/dist/index224.js.map +1 -1
  187. package/dist/index225.js +44 -27
  188. package/dist/index225.js.map +1 -1
  189. package/dist/index226.js +5 -3
  190. package/dist/index226.js.map +1 -1
  191. package/dist/index227.js +43 -243
  192. package/dist/index227.js.map +1 -1
  193. package/dist/index228.js +6 -0
  194. package/dist/{index233.js.map → index228.js.map} +1 -1
  195. package/dist/index229.js +3 -52
  196. package/dist/index229.js.map +1 -1
  197. package/dist/{index22.js → index23.js} +74 -76
  198. package/dist/index23.js.map +1 -0
  199. package/dist/index230.js +7 -37
  200. package/dist/index230.js.map +1 -1
  201. package/dist/index231.js +158 -5
  202. package/dist/index231.js.map +1 -1
  203. package/dist/index232.js +77 -34
  204. package/dist/index232.js.map +1 -1
  205. package/dist/index234.js +2 -2
  206. package/dist/index234.js.map +1 -1
  207. package/dist/index235.js +18 -3
  208. package/dist/index235.js.map +1 -1
  209. package/dist/index236.js +105 -17
  210. package/dist/index236.js.map +1 -1
  211. package/dist/{index239.js → index238.js} +3 -3
  212. package/dist/{index239.js.map → index238.js.map} +1 -1
  213. package/dist/index240.js +5 -0
  214. package/dist/index240.js.map +1 -0
  215. package/dist/index244.js +3 -3
  216. package/dist/index248.js +9 -3
  217. package/dist/index248.js.map +1 -1
  218. package/dist/index249.js +281 -12
  219. package/dist/index249.js.map +1 -1
  220. package/dist/{index24.js → index25.js} +6 -6
  221. package/dist/{index24.js.map → index25.js.map} +1 -1
  222. package/dist/index250.js +5 -8
  223. package/dist/index250.js.map +1 -1
  224. package/dist/index251.js +2 -9
  225. package/dist/index251.js.map +1 -1
  226. package/dist/index252.js +2 -17
  227. package/dist/index252.js.map +1 -1
  228. package/dist/index253.js +2 -281
  229. package/dist/index253.js.map +1 -1
  230. package/dist/index254.js +2 -6
  231. package/dist/index254.js.map +1 -1
  232. package/dist/index255.js +2 -2
  233. package/dist/index256.js +126 -2
  234. package/dist/index256.js.map +1 -1
  235. package/dist/index257.js +431 -2
  236. package/dist/index257.js.map +1 -1
  237. package/dist/index258.js +3 -2
  238. package/dist/index258.js.map +1 -1
  239. package/dist/index260.js +7 -126
  240. package/dist/index260.js.map +1 -1
  241. package/dist/index261.js +20 -429
  242. package/dist/index261.js.map +1 -1
  243. package/dist/{index259.js → index263.js} +1 -1
  244. package/dist/index263.js.map +1 -0
  245. package/dist/index264.js +2 -7
  246. package/dist/index264.js.map +1 -1
  247. package/dist/index265.js +1 -21
  248. package/dist/index265.js.map +1 -1
  249. package/dist/index266.js +5 -0
  250. package/dist/index266.js.map +1 -0
  251. package/dist/index267.js +2 -9
  252. package/dist/index267.js.map +1 -1
  253. package/dist/index268.js +2 -200
  254. package/dist/index268.js.map +1 -1
  255. package/dist/index269.js +23 -431
  256. package/dist/index269.js.map +1 -1
  257. package/dist/{index26.js → index27.js} +4 -4
  258. package/dist/{index26.js.map → index27.js.map} +1 -1
  259. package/dist/index270.js +21 -126
  260. package/dist/index270.js.map +1 -1
  261. package/dist/index272.js +224 -2
  262. package/dist/index272.js.map +1 -1
  263. package/dist/index273.js +89 -2
  264. package/dist/index273.js.map +1 -1
  265. package/dist/index274.js +200 -3
  266. package/dist/index274.js.map +1 -1
  267. package/dist/index275.js +436 -2
  268. package/dist/index275.js.map +1 -1
  269. package/dist/index276.js +127 -2
  270. package/dist/index276.js.map +1 -1
  271. package/dist/index277.js +5 -2
  272. package/dist/index277.js.map +1 -1
  273. package/dist/index278.js +2 -28
  274. package/dist/index278.js.map +1 -1
  275. package/dist/index279.js +7 -20
  276. package/dist/index279.js.map +1 -1
  277. package/dist/index280.js +72 -0
  278. package/dist/index280.js.map +1 -0
  279. package/dist/index281.js +3 -2
  280. package/dist/index281.js.map +1 -1
  281. package/dist/index282.js +12 -5
  282. package/dist/index282.js.map +1 -1
  283. package/dist/index283.js +8 -68
  284. package/dist/index283.js.map +1 -1
  285. package/dist/index284.js +17 -224
  286. package/dist/index284.js.map +1 -1
  287. package/dist/index285.js +1 -1
  288. package/dist/index286.js +1 -1
  289. package/dist/index287.js +12 -12
  290. package/dist/index287.js.map +1 -1
  291. package/dist/index288.js +18 -0
  292. package/dist/index288.js.map +1 -0
  293. package/dist/index289.js +4 -15
  294. package/dist/index289.js.map +1 -1
  295. package/dist/{index28.js → index29.js} +19 -19
  296. package/dist/index29.js.map +1 -0
  297. package/dist/index290.js +4 -4
  298. package/dist/index290.js.map +1 -1
  299. package/dist/index291.js +59 -4
  300. package/dist/index291.js.map +1 -1
  301. package/dist/index292.js +34 -58
  302. package/dist/index292.js.map +1 -1
  303. package/dist/index293.js +6 -10
  304. package/dist/index293.js.map +1 -1
  305. package/dist/index294.js +18 -34
  306. package/dist/index294.js.map +1 -1
  307. package/dist/index295.js +6 -6
  308. package/dist/index295.js.map +1 -1
  309. package/dist/index296.js +2 -19
  310. package/dist/index296.js.map +1 -1
  311. package/dist/index297.js +10 -6
  312. package/dist/index297.js.map +1 -1
  313. package/dist/index298.js +47 -2
  314. package/dist/index298.js.map +1 -1
  315. package/dist/index300.js +424 -0
  316. package/dist/index300.js.map +1 -0
  317. package/dist/index301.js +42 -416
  318. package/dist/index301.js.map +1 -1
  319. package/dist/{index30.js → index31.js} +4 -4
  320. package/dist/{index30.js.map → index31.js.map} +1 -1
  321. package/dist/{index32.js → index33.js} +41 -40
  322. package/dist/index33.js.map +1 -0
  323. package/dist/{index34.js → index35.js} +23 -22
  324. package/dist/{index34.js.map → index35.js.map} +1 -1
  325. package/dist/{index36.js → index37.js} +9 -8
  326. package/dist/index37.js.map +1 -0
  327. package/dist/{index38.js → index39.js} +4 -3
  328. package/dist/index39.js.map +1 -0
  329. package/dist/index4.js +14 -40
  330. package/dist/index4.js.map +1 -1
  331. package/dist/{index40.js → index41.js} +4 -4
  332. package/dist/{index40.js.map → index41.js.map} +1 -1
  333. package/dist/{index42.js → index43.js} +34 -33
  334. package/dist/{index42.js.map → index43.js.map} +1 -1
  335. package/dist/{index44.js → index45.js} +9 -9
  336. package/dist/index45.js.map +1 -0
  337. package/dist/{index46.js → index47.js} +3 -3
  338. package/dist/{index46.js.map → index47.js.map} +1 -1
  339. package/dist/{index48.js → index49.js} +4 -4
  340. package/dist/{index48.js.map → index49.js.map} +1 -1
  341. package/dist/index5.js +38 -76
  342. package/dist/index5.js.map +1 -1
  343. package/dist/index51.js +95 -0
  344. package/dist/index51.js.map +1 -0
  345. package/dist/{index52.js → index53.js} +3 -3
  346. package/dist/{index52.js.map → index53.js.map} +1 -1
  347. package/dist/{index54.js → index55.js} +3 -3
  348. package/dist/{index54.js.map → index55.js.map} +1 -1
  349. package/dist/{index56.js → index57.js} +2 -2
  350. package/dist/{index56.js.map → index57.js.map} +1 -1
  351. package/dist/{index58.js → index59.js} +7 -6
  352. package/dist/{index58.js.map → index59.js.map} +1 -1
  353. package/dist/index6.js +78 -62
  354. package/dist/index6.js.map +1 -1
  355. package/dist/{index60.js → index61.js} +3 -3
  356. package/dist/{index60.js.map → index61.js.map} +1 -1
  357. package/dist/{index62.js → index63.js} +3 -3
  358. package/dist/{index62.js.map → index63.js.map} +1 -1
  359. package/dist/{index64.js → index65.js} +5 -5
  360. package/dist/{index64.js.map → index65.js.map} +1 -1
  361. package/dist/{index66.js → index67.js} +3 -3
  362. package/dist/{index66.js.map → index67.js.map} +1 -1
  363. package/dist/{index68.js → index69.js} +2 -2
  364. package/dist/{index68.js.map → index69.js.map} +1 -1
  365. package/dist/index7.js +60 -18
  366. package/dist/index7.js.map +1 -1
  367. package/dist/{index70.js → index71.js} +7 -7
  368. package/dist/{index70.js.map → index71.js.map} +1 -1
  369. package/dist/{index72.js → index73.js} +3 -3
  370. package/dist/{index72.js.map → index73.js.map} +1 -1
  371. package/dist/{index74.js → index75.js} +3 -3
  372. package/dist/{index74.js.map → index75.js.map} +1 -1
  373. package/dist/index77.js +37 -120
  374. package/dist/index77.js.map +1 -1
  375. package/dist/index78.js +130 -0
  376. package/dist/index78.js.map +1 -0
  377. package/dist/index8.js +19 -7
  378. package/dist/index8.js.map +1 -1
  379. package/dist/{index79.js → index80.js} +5 -5
  380. package/dist/{index79.js.map → index80.js.map} +1 -1
  381. package/dist/{index81.js → index82.js} +7 -6
  382. package/dist/{index81.js.map → index82.js.map} +1 -1
  383. package/dist/{index83.js → index84.js} +7 -7
  384. package/dist/{index83.js.map → index84.js.map} +1 -1
  385. package/dist/{index85.js → index86.js} +3 -3
  386. package/dist/{index85.js.map → index86.js.map} +1 -1
  387. package/dist/{index87.js → index88.js} +3 -3
  388. package/dist/{index87.js.map → index88.js.map} +1 -1
  389. package/dist/index9.js +7 -78
  390. package/dist/index9.js.map +1 -1
  391. package/dist/{index89.js → index90.js} +3 -3
  392. package/dist/{index89.js.map → index90.js.map} +1 -1
  393. package/dist/{index91.js → index92.js} +3 -3
  394. package/dist/{index91.js.map → index92.js.map} +1 -1
  395. package/dist/{index93.js → index94.js} +1 -1
  396. package/dist/index94.js.map +1 -0
  397. package/dist/{index95.js → index96.js} +3 -3
  398. package/dist/{index95.js.map → index96.js.map} +1 -1
  399. package/dist/{index97.js → index98.js} +3 -3
  400. package/dist/{index97.js.map → index98.js.map} +1 -1
  401. package/dist/style.css +1 -1
  402. package/package.json +1 -1
  403. package/dist/index119.js +0 -47
  404. package/dist/index119.js.map +0 -1
  405. package/dist/index161.js.map +0 -1
  406. package/dist/index163.js +0 -6
  407. package/dist/index163.js.map +0 -1
  408. package/dist/index171.js +0 -5
  409. package/dist/index171.js.map +0 -1
  410. package/dist/index18.js.map +0 -1
  411. package/dist/index185.js.map +0 -1
  412. package/dist/index187.js +0 -6
  413. package/dist/index187.js.map +0 -1
  414. package/dist/index20.js.map +0 -1
  415. package/dist/index216.js +0 -45
  416. package/dist/index216.js.map +0 -1
  417. package/dist/index22.js.map +0 -1
  418. package/dist/index233.js +0 -6
  419. package/dist/index237.js +0 -109
  420. package/dist/index237.js.map +0 -1
  421. package/dist/index259.js.map +0 -1
  422. package/dist/index262.js +0 -6
  423. package/dist/index262.js.map +0 -1
  424. package/dist/index271.js +0 -92
  425. package/dist/index271.js.map +0 -1
  426. package/dist/index28.js.map +0 -1
  427. package/dist/index299.js +0 -50
  428. package/dist/index299.js.map +0 -1
  429. package/dist/index3.js +0 -17
  430. package/dist/index3.js.map +0 -1
  431. package/dist/index302.js +0 -50
  432. package/dist/index302.js.map +0 -1
  433. package/dist/index32.js.map +0 -1
  434. package/dist/index36.js.map +0 -1
  435. package/dist/index38.js.map +0 -1
  436. package/dist/index44.js.map +0 -1
  437. package/dist/index50.js +0 -97
  438. package/dist/index50.js.map +0 -1
  439. package/dist/index76.js +0 -47
  440. package/dist/index76.js.map +0 -1
  441. package/dist/index93.js.map +0 -1
  442. package/dist/index99.js.map +0 -1
@@ -0,0 +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":";;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,UAAMA,IAAQC,GAKRC,IAAOC,GAQPC,IAAgBC,EAA6B,IAAI,GAEjDC,IAAUC,EAAS,MACpBP,EAAM,UAAgB,KACnB,KAAK,UAAUA,EAAM,SAAS,MAAM,KAAK,UAAUA,EAAM,UAAU,CAC1E,GACKQ,IAAWH,EAAI,EAAK,GAEpBI,IAAsBF,EAAS,MAAM;AAC1C,YAAMG,IAAkC;AAAA,QACvC,OAAO;AAAA,UACN,kBAAkB;A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AAII,EAAc,UACjBA,EAAc,MAAM,gBAAgB,CAAC,CAACJ,EAAM;AAAA,MAE9C;AAAA,IAAA;;;;;;;;;;;;;;"}
package/dist/index4.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=index4.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index4.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":"index4.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 $, 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 "./index198.js";
3
- import M from "./index38.js";
2
+ import { useOptions as F } from "./index231.js";
3
+ import M from "./index39.js";
4
4
  /* empty css */
5
- import S from "./index199.js";
5
+ import S from "./index232.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=index40.js.map
135
+ //# sourceMappingURL=index41.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index40.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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,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":"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,18 +1,19 @@
1
- import { defineComponent as Z, 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 I, 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";
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
- import ue from "./index122.js";
3
+ /* empty css */
4
+ import ue from "./index123.js";
4
5
  /* empty css */
5
- import { isNotNil as se } from "./index129.js";
6
- import { last as de } from "./index212.js";
7
- import { useOptions as pe } from "./index198.js";
8
- import ce from "./index237.js";
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";
9
10
  /* empty css */
10
- import me from "./index239.js";
11
+ import me from "./index238.js";
11
12
  /* empty css */
12
- import fe from "./index216.js";
13
+ import fe from "./index215.js";
13
14
  /* empty css */
14
- import ve from "./index218.js";
15
- const ye = { class: "bb-base-tag__input-container" }, be = ["id", "aria-describedby", "autocomplete", "autofocus", "disabled", "placeholder", "readonly", "required", "onKeydown"], Ke = /* @__PURE__ */ Z({
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
17
  __name: "BaseTag",
17
18
  props: {
18
19
  "append:icon": {},
@@ -34,8 +35,8 @@ const ye = { class: "bb-base-tag__input-container" }, be = ["id", "aria-describe
34
35
  required: { type: Boolean }
35
36
  },
36
37
  emits: ["blur", "change", "click", "duplicate", "focus", "inactive", "input", "keydown", "keyup", "update:modelValue"],
37
- setup($, { emit: D }) {
38
- const o = $, l = D;
38
+ setup(I, { emit: D }) {
39
+ const o = I, l = D;
39
40
  if (o.multiple && !Array.isArray(o.modelValue))
40
41
  throw new Error('Multiple is set to "true" but modelValue is not an array.');
41
42
  const b = r(null), T = r(null), L = k(() => o.placeholder), V = r(null), w = r(null), i = k(
@@ -45,11 +46,11 @@ const ye = { class: "bb-base-tag__input-container" }, be = ["id", "aria-describe
45
46
  }, K = !o.multiple && se(o.modelValue) || o.multiple && !!o.modelValue.length, N = r([]), {
46
47
  query: t,
47
48
  alignQueryToState: q,
48
- addCurrentQueryToManualItems: M,
49
+ addCurrentQueryToManualItems: A,
49
50
  selectedOptions: p,
50
- selectOption: P,
51
- unselectOption: _,
52
- valueIsSelected: A,
51
+ selectOption: M,
52
+ unselectOption: P,
53
+ valueIsSelected: _,
53
54
  manualItems: S
54
55
  } = pe({
55
56
  emit: l,
@@ -83,13 +84,13 @@ const ye = { class: "bb-base-tag__input-container" }, be = ["id", "aria-describe
83
84
  }, z = () => {
84
85
  var e;
85
86
  (e = i.value) == null || e.blur();
86
- }, j = async (e) => {
87
+ }, Z = async (e) => {
87
88
  var n;
88
89
  if (l("keyup", e), o.readonly || o.disabled) {
89
90
  e.preventDefault();
90
91
  return;
91
92
  }
92
- if ((n = i.value) == null || n.blur(), e.key === o.divider || e.key === "Unidentified" && t.value.includes(o.divider)) {
93
+ if (/^[A-Za-z0-9]$/.test(e.key) && ((n = i.value) == null || n.blur()), e.key === o.divider || e.key === "Unidentified" && t.value.includes(o.divider)) {
93
94
  if (o.divider.length === 1 && t.value.includes(o.divider)) {
94
95
  const m = t.value.split(o.divider)[0];
95
96
  if (m)
@@ -100,22 +101,22 @@ const ye = { class: "bb-base-tag__input-container" }, be = ["id", "aria-describe
100
101
  }
101
102
  }
102
103
  if (!t.value) return;
103
- A(t.value) ? (l("duplicate", t.value), t.value = "") : (M(), G(de(S.value)));
104
+ _(t.value) ? (l("duplicate", t.value), t.value = "") : (A(), j(de(S.value)));
104
105
  }
106
+ }, j = (e) => {
107
+ M(e), E(), o.multiple || close();
105
108
  }, G = (e) => {
106
- P(e), E(), o.multiple || close();
109
+ P(e), E();
107
110
  }, J = (e) => {
108
- _(e), E();
109
- }, W = (e) => {
110
111
  l("focus", e), F(), document.addEventListener("click", c), document.addEventListener("focusin", c);
111
- }, X = (e) => {
112
+ }, W = (e) => {
112
113
  l("click", e), !(o.disabled || o.readonly) && d.value instanceof HTMLElement && d.value.focus();
113
114
  }, c = async (e) => {
114
115
  if (e.target instanceof Node && b.value && !b.value.$el.contains(e.target)) {
115
116
  close(), H(), document.removeEventListener("click", c), document.removeEventListener("focusin", c), q();
116
117
  return;
117
118
  }
118
- }, Y = {
119
+ }, X = {
119
120
  onBlur: (e) => l("blur", e),
120
121
  onChange: (e) => l("change", e),
121
122
  onKeydown: (e) => l("keydown", e),
@@ -132,7 +133,7 @@ const ye = { class: "bb-base-tag__input-container" }, be = ["id", "aria-describe
132
133
  "bb-base-tag--errors": e.hasErrors,
133
134
  "bb-base-tag--readonly": e.readonly
134
135
  }),
135
- onClick: X
136
+ onClick: W
136
137
  }, {
137
138
  "prepend-outer": a(() => [
138
139
  u(e.$slots, "prepend-outer")
@@ -162,7 +163,7 @@ const ye = { class: "bb-base-tag__input-container" }, be = ["id", "aria-describe
162
163
  default: a(() => [
163
164
  O(v(ue), { tag: "span" }, {
164
165
  default: a(() => [
165
- I("span", ye, [
166
+ $("span", ye, [
166
167
  e.multiple ? (f(), ee(oe, { key: 0 }, [
167
168
  e.comma ? (f(), C(me, {
168
169
  key: 0,
@@ -174,14 +175,14 @@ const ye = { class: "bb-base-tag__input-container" }, be = ["id", "aria-describe
174
175
  ref_key: "chipsBox",
175
176
  ref: w,
176
177
  options: v(p),
177
- "onOption:unselected": J
178
+ "onOption:unselected": G
178
179
  }, null, 8, ["options"]))
179
180
  ], 64)) : te("", !0),
180
- ne(I("input", le({
181
+ ne($("input", le({
181
182
  id: e.id,
182
183
  ref_key: "input",
183
184
  ref: d
184
- }, Y, {
185
+ }, X, {
185
186
  "onUpdate:modelValue": n[0] || (n[0] = (m) => ae(t) ? t.value = m : null),
186
187
  "aria-describedby": e.ariaDescribedby,
187
188
  autocomplete: e.autocomplete,
@@ -193,14 +194,14 @@ const ye = { class: "bb-base-tag__input-container" }, be = ["id", "aria-describe
193
194
  readonly: e.readonly,
194
195
  required: e.required && !e.multiple || e.multiple && !e.modelValue.length,
195
196
  type: "text",
196
- onFocus: s(W, ["stop"]),
197
+ onFocus: s(J, ["stop"]),
197
198
  onKeydown: [
198
199
  y(s(U, ["stop"]), ["delete"]),
199
200
  y(s(Q, ["stop"]), ["left"]),
200
201
  y(s(z, ["stop", "prevent"]), ["esc"]),
201
202
  y(s(R, ["stop"]), ["right"])
202
203
  ],
203
- onKeyup: s(j, ["stop"])
204
+ onKeyup: s(Z, ["stop"])
204
205
  }), null, 16, be), [
205
206
  [ie, v(t)]
206
207
  ])
@@ -217,6 +218,6 @@ const ye = { class: "bb-base-tag__input-container" }, be = ["id", "aria-describe
217
218
  }
218
219
  });
219
220
  export {
220
- Ke as default
221
+ Ne as default
221
222
  };
222
- //# sourceMappingURL=index42.js.map
223
+ //# sourceMappingURL=index43.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index42.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\tselectedBox.value?.blur();\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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AAK,WAAW8B,CAAK;AAAA,MAC1D,SAAS,CAACA,MAAiB9B,EAAK,SAAS8B,CAAK;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiLA,UAAMA,IAAQC,GAkBRC,IAAOC;AAab,QAAIH,EAAM,YAAY,CAAC,MAAM,QAAQA,EAAM,UAAU;AAC9C,YAAA,IAAI,MAAM,2DAA2D;AAGtE,UAAAI,IAAiBC,EAEb,IAAI,GACRC,IAAiBD,EAEb,IAAI,GACRE,IAAsBC,EAAS,MAC7BR,EAAM,WACb,GACKS,IAAWJ,EAA0C,IAAI,GACzDK,IAAWL,EAA0C,IAAI,GACzDM,IAAcH;AAAA,MAAS,MAC5BR,EAAM,QAAQS,EAAS,QAAQC,EAAS;AAAA,IAA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AAAA,MAE3C;AAAA,IAAA,GAGKiB,IAAmB,CAACE,MAAuB;AAChD,MAAAtB,EAAasB,CAAM,GACR9B,KACNb,EAAM,YACJ;IACP,GAGK4C,IAAqB,CAACD,MAAuB;AAClD,MAAArB,EAAeqB,CAAM,GACV9B;IAAA,GAGNgC,IAAe,CAACb,MAAsB;AAC3C,MAAA9B,EAAK,SAAS8B,CAAK,GACTJ,KACD,SAAA,iBAAiB,SAASkB,CAAoB,GAC9C,SAAA,iBAAiB,WAAWA,CAAoB;AAAA,IAAA,GAMpDC,IAAwB,CAACf,MAAsB;AAEhD,MADJ9B,EAAK,SAAS8B,CAAK,GACf,EAAAhC,EAAM,YAAYA,EAAM,aACxBY,EAAM,iBAAiB,eAC1BA,EAAM,MAAM;IACb,GAOKkC,IAAuB,OAAOd,MAAiB;AAChD,UAAAA,EAAM,kBAAkB,QACvB5B,EAAe,SACd,CAACA,EAAe,MAAM,IAAI,SAAS4B,EAAM,MAAM,GAAG;AAC/C,iBACMH,KACH,SAAA,oBAAoB,SAASiB,CAAoB,GACjD,SAAA,oBAAoB,WAAWA,CAAoB,GAC1C5B;AAClB;AAAA,MACD;AAAA,IAEF,GAEK8B,IAAiB;AAAA,MACtB,QAAQ,CAAChB,MAAsB9B,EAAK,QAAQ8B,CAAK;AAAA,MACjD,UAAU,CAACA,MAAiB9B,EAAK,UAAU8B,CAAK;AAAA,MAChD,WAAW,CAACA,MAAyB9B,EAAK,WAAW8B,CAAK;AAAA,MAC1D,SAAS,CAACA,MAAiB9B,EAAK,SAAS8B,CAAK;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -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 "./index218.js";
3
- import E from "./index216.js";
2
+ import v from "./index217.js";
3
+ import E from "./index215.js";
4
4
  /* empty css */
5
- import G from "./index122.js";
5
+ import G from "./index123.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",
@@ -49,13 +49,13 @@ const M = ["id", "aria-describedby", "autocomplete", "autofocus", "disabled", "n
49
49
  o.autoGrow && k(l);
50
50
  }
51
51
  );
52
- function f(e) {
52
+ function b(e) {
53
53
  if (e.stopPropagation(), e.target instanceof HTMLTextAreaElement) {
54
54
  let s = e.target.value;
55
55
  a("input", e), a("update:modelValue", s || null);
56
56
  }
57
57
  }
58
- function b(e) {
58
+ function f(e) {
59
59
  e.stopPropagation(), e.target instanceof HTMLTextAreaElement && a("keydown", e);
60
60
  }
61
61
  const h = {
@@ -105,7 +105,7 @@ const M = ["id", "aria-describedby", "autocomplete", "autofocus", "disabled", "n
105
105
  "aria-describedby": e.ariaDescribedby,
106
106
  autocomplete: e.autocomplete,
107
107
  autofocus: e.autofocus,
108
- class: "bb-base-textarea__input",
108
+ class: "bb-base-textarea__input scrollbar-border",
109
109
  disabled: e.disabled,
110
110
  name: e.name,
111
111
  placeholder: e.placeholder,
@@ -114,8 +114,8 @@ const M = ["id", "aria-describedby", "autocomplete", "autofocus", "disabled", "n
114
114
  rows: e.rows,
115
115
  value: m.value
116
116
  }, h, {
117
- onInput: f,
118
- onKeydown: b
117
+ onInput: b,
118
+ onKeydown: f
119
119
  }), null, 16, M)
120
120
  ]),
121
121
  _: 1
@@ -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=index44.js.map
134
+ //# sourceMappingURL=index45.js.map
@@ -0,0 +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,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 "./index216.js";
2
+ import g from "./index215.js";
3
3
  /* empty css */
4
- import B from "./index218.js";
4
+ import B from "./index217.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=index46.js.map
102
+ //# sourceMappingURL=index47.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index46.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":"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,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 "./index7.js";
3
- import $ from "./index12.js";
2
+ import { useId as V } from "./index8.js";
3
+ import $ from "./index13.js";
4
4
  /* empty css */
5
- import B from "./index120.js";
5
+ import B from "./index121.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=index48.js.map
67
+ //# sourceMappingURL=index49.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index48.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":"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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}