bitboss-ui 2.0.5 → 2.0.8

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 (431) 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 +89 -87
  4. package/dist/index.js.map +1 -1
  5. package/dist/index10.js +7 -39
  6. package/dist/index10.js.map +1 -1
  7. package/dist/index101.js +60 -87
  8. package/dist/index101.js.map +1 -1
  9. package/dist/index103.js +113 -258
  10. package/dist/index103.js.map +1 -1
  11. package/dist/index105.js +254 -388
  12. package/dist/index105.js.map +1 -1
  13. package/dist/index107.js +387 -98
  14. package/dist/index107.js.map +1 -1
  15. package/dist/index109.js +52 -48
  16. package/dist/index109.js.map +1 -1
  17. package/dist/index11.js +74 -188
  18. package/dist/index11.js.map +1 -1
  19. package/dist/index111.js +35 -34
  20. package/dist/index111.js.map +1 -1
  21. package/dist/index113.js +105 -23
  22. package/dist/index113.js.map +1 -1
  23. package/dist/index115.js +23 -156
  24. package/dist/index115.js.map +1 -1
  25. package/dist/index117.js +153 -112
  26. package/dist/index117.js.map +1 -1
  27. package/dist/index119.js +115 -39
  28. package/dist/index119.js.map +1 -1
  29. package/dist/index12.js +38 -80
  30. package/dist/index12.js.map +1 -1
  31. package/dist/index121.js +36 -40
  32. package/dist/index121.js.map +1 -1
  33. package/dist/index122.js +34 -37
  34. package/dist/index122.js.map +1 -1
  35. package/dist/index123.js +30 -21
  36. package/dist/index123.js.map +1 -1
  37. package/dist/index124.js +47 -2
  38. package/dist/index124.js.map +1 -1
  39. package/dist/index125.js +35 -21
  40. package/dist/index125.js.map +1 -1
  41. package/dist/index126.js +2 -2
  42. package/dist/index126.js.map +1 -1
  43. package/dist/index127.js +21 -312
  44. package/dist/index127.js.map +1 -1
  45. package/dist/index128.js +2 -24
  46. package/dist/index128.js.map +1 -1
  47. package/dist/index129.js +312 -2
  48. package/dist/index129.js.map +1 -1
  49. package/dist/index13.js +196 -0
  50. package/dist/index13.js.map +1 -0
  51. package/dist/index130.js +24 -5
  52. package/dist/index130.js.map +1 -1
  53. package/dist/index131.js +2 -9
  54. package/dist/index131.js.map +1 -1
  55. package/dist/index132.js +5 -6
  56. package/dist/index132.js.map +1 -1
  57. package/dist/index133.js +9 -3
  58. package/dist/index133.js.map +1 -1
  59. package/dist/index134.js +6 -3
  60. package/dist/index134.js.map +1 -1
  61. package/dist/index135.js +1 -1
  62. package/dist/index136.js +1 -1
  63. package/dist/index137.js +1 -1
  64. package/dist/index138.js +1 -1
  65. package/dist/index139.js +1 -1
  66. package/dist/index14.js +73 -121
  67. package/dist/index14.js.map +1 -1
  68. package/dist/index140.js +1 -1
  69. package/dist/index141.js +1 -1
  70. package/dist/index142.js +1 -1
  71. package/dist/index143.js +1 -1
  72. package/dist/index144.js +1 -1
  73. package/dist/index145.js +1 -1
  74. package/dist/index146.js +1 -1
  75. package/dist/index147.js +1 -1
  76. package/dist/index148.js +1 -1
  77. package/dist/index149.js +1 -1
  78. package/dist/index150.js +1 -1
  79. package/dist/index151.js +1 -1
  80. package/dist/index152.js +1 -1
  81. package/dist/index153.js +1 -1
  82. package/dist/index154.js +1 -1
  83. package/dist/index155.js +1 -1
  84. package/dist/index156.js +1 -1
  85. package/dist/index157.js +1 -1
  86. package/dist/index158.js +1 -1
  87. package/dist/index159.js +2 -2
  88. package/dist/index16.js +119 -118
  89. package/dist/index16.js.map +1 -1
  90. package/dist/index160.js +6 -0
  91. package/dist/index160.js.map +1 -0
  92. package/dist/index161.js +1 -1
  93. package/dist/index163.js +2 -2
  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/index170.js +6 -0
  100. package/dist/index170.js.map +1 -0
  101. package/dist/index171.js +3 -2
  102. package/dist/index171.js.map +1 -1
  103. package/dist/index173.js +2 -3
  104. package/dist/index173.js.map +1 -1
  105. package/dist/index174.js +1 -1
  106. package/dist/index175.js +1 -1
  107. package/dist/index176.js +1 -1
  108. package/dist/index177.js +1 -1
  109. package/dist/index178.js +1 -1
  110. package/dist/index179.js +1 -1
  111. package/dist/index18.js +120 -208
  112. package/dist/index18.js.map +1 -1
  113. package/dist/index180.js +1 -1
  114. package/dist/index181.js +1 -1
  115. package/dist/index182.js +1 -1
  116. package/dist/index183.js +2 -2
  117. package/dist/index184.js +6 -0
  118. package/dist/index184.js.map +1 -0
  119. package/dist/index185.js +1 -1
  120. package/dist/index187.js +1 -1
  121. package/dist/index189.js +1 -1
  122. package/dist/index190.js +1 -1
  123. package/dist/index191.js +1 -1
  124. package/dist/index192.js +1 -1
  125. package/dist/index193.js +1 -1
  126. package/dist/index194.js +1 -1
  127. package/dist/index195.js +1 -1
  128. package/dist/index196.js +1 -1
  129. package/dist/index197.js +3 -81
  130. package/dist/index197.js.map +1 -1
  131. package/dist/index198.js +3 -3
  132. package/dist/index198.js.map +1 -1
  133. package/dist/index199.js +81 -5
  134. package/dist/index199.js.map +1 -1
  135. package/dist/index20.js +193 -275
  136. package/dist/index20.js.map +1 -1
  137. package/dist/index200.js +2 -16
  138. package/dist/index200.js.map +1 -1
  139. package/dist/index201.js +3 -16
  140. package/dist/index201.js.map +1 -1
  141. package/dist/index202.js +124 -17
  142. package/dist/index202.js.map +1 -1
  143. package/dist/index203.js +5 -19
  144. package/dist/index203.js.map +1 -1
  145. package/dist/index204.js +119 -23
  146. package/dist/index204.js.map +1 -1
  147. package/dist/index205.js +19 -3
  148. package/dist/index205.js.map +1 -1
  149. package/dist/index206.js +16 -2
  150. package/dist/index206.js.map +1 -1
  151. package/dist/index207.js +16 -8
  152. package/dist/index207.js.map +1 -1
  153. package/dist/index208.js +2 -249
  154. package/dist/index208.js.map +1 -1
  155. package/dist/index209.js +5 -0
  156. package/dist/index209.js.map +1 -0
  157. package/dist/index210.js +35 -52
  158. package/dist/index210.js.map +1 -1
  159. package/dist/index211.js +173 -36
  160. package/dist/index211.js.map +1 -1
  161. package/dist/index212.js +6 -5
  162. package/dist/index212.js.map +1 -1
  163. package/dist/index213.js +39 -36
  164. package/dist/index213.js.map +1 -1
  165. package/dist/index215.js +13 -4
  166. package/dist/index215.js.map +1 -1
  167. package/dist/index216.js +5 -2
  168. package/dist/index216.js.map +1 -1
  169. package/dist/index217.js +369 -2
  170. package/dist/index217.js.map +1 -1
  171. package/dist/index218.js +6 -40
  172. package/dist/index218.js.map +1 -1
  173. package/dist/{index214.js → index219.js} +1 -1
  174. package/dist/{index214.js.map → index219.js.map} +1 -1
  175. package/dist/index22.js +287 -247
  176. package/dist/index22.js.map +1 -1
  177. package/dist/index220.js +4 -13
  178. package/dist/index220.js.map +1 -1
  179. package/dist/index221.js +2 -158
  180. package/dist/index221.js.map +1 -1
  181. package/dist/index222.js +3 -84
  182. package/dist/index222.js.map +1 -1
  183. package/dist/index223.js +10 -0
  184. package/dist/index223.js.map +1 -0
  185. package/dist/index224.js +19 -3
  186. package/dist/index224.js.map +1 -1
  187. package/dist/index225.js +26 -34
  188. package/dist/index225.js.map +1 -1
  189. package/dist/index226.js +3 -6
  190. package/dist/index226.js.map +1 -1
  191. package/dist/index227.js +249 -7
  192. package/dist/index227.js.map +1 -1
  193. package/dist/index228.js +49 -123
  194. package/dist/index228.js.map +1 -1
  195. package/dist/index229.js +44 -123
  196. package/dist/index229.js.map +1 -1
  197. package/dist/index230.js +5 -2
  198. package/dist/index230.js.map +1 -1
  199. package/dist/index231.js +49 -174
  200. package/dist/index231.js.map +1 -1
  201. package/dist/index232.js +158 -5
  202. package/dist/index232.js.map +1 -1
  203. package/dist/index233.js +83 -368
  204. package/dist/index233.js.map +1 -1
  205. package/dist/index235.js +2 -18
  206. package/dist/index235.js.map +1 -1
  207. package/dist/index236.js +17 -105
  208. package/dist/index236.js.map +1 -1
  209. package/dist/index237.js +109 -0
  210. package/dist/index237.js.map +1 -0
  211. package/dist/{index238.js → index239.js} +3 -3
  212. package/dist/{index238.js.map → index239.js.map} +1 -1
  213. package/dist/index24.js +249 -120
  214. package/dist/index24.js.map +1 -1
  215. package/dist/index241.js +2 -10
  216. package/dist/index241.js.map +1 -1
  217. package/dist/index242.js +9 -2
  218. package/dist/index242.js.map +1 -1
  219. package/dist/index243.js +3 -224
  220. package/dist/index243.js.map +1 -1
  221. package/dist/index244.js +9 -281
  222. package/dist/index244.js.map +1 -1
  223. package/dist/index245.js +23 -6
  224. package/dist/index245.js.map +1 -1
  225. package/dist/index246.js +6 -2
  226. package/dist/index246.js.map +1 -1
  227. package/dist/index247.js +16 -2
  228. package/dist/index247.js.map +1 -1
  229. package/dist/index248.js +224 -2
  230. package/dist/index248.js.map +1 -1
  231. package/dist/index249.js +281 -2
  232. package/dist/index249.js.map +1 -1
  233. package/dist/index250.js +6 -2
  234. package/dist/index250.js.map +1 -1
  235. package/dist/index251.js +2 -2
  236. package/dist/index252.js +2 -3
  237. package/dist/index252.js.map +1 -1
  238. package/dist/index253.js +2 -2
  239. package/dist/index254.js +2 -2
  240. package/dist/index255.js +2 -2
  241. package/dist/index256.js +122 -24
  242. package/dist/index256.js.map +1 -1
  243. package/dist/index257.js +429 -20
  244. package/dist/index257.js.map +1 -1
  245. package/dist/index258.js +6 -0
  246. package/dist/index258.js.map +1 -0
  247. package/dist/index26.js +119 -142
  248. package/dist/index26.js.map +1 -1
  249. package/dist/index260.js +6 -3
  250. package/dist/index260.js.map +1 -1
  251. package/dist/index261.js +21 -8
  252. package/dist/index261.js.map +1 -1
  253. package/dist/index263.js +9 -3
  254. package/dist/index263.js.map +1 -1
  255. package/dist/index264.js +439 -0
  256. package/dist/index264.js.map +1 -0
  257. package/dist/index265.js +127 -6
  258. package/dist/index265.js.map +1 -1
  259. package/dist/index266.js +199 -15
  260. package/dist/index266.js.map +1 -1
  261. package/dist/index267.js +4 -9
  262. package/dist/index267.js.map +1 -1
  263. package/dist/index268.js +89 -3
  264. package/dist/index268.js.map +1 -1
  265. package/dist/index269.js +2 -12
  266. package/dist/index269.js.map +1 -1
  267. package/dist/index270.js +2 -9
  268. package/dist/index270.js.map +1 -1
  269. package/dist/index271.js +2 -9
  270. package/dist/index271.js.map +1 -1
  271. package/dist/index272.js +2 -17
  272. package/dist/index272.js.map +1 -1
  273. package/dist/index273.js +2 -431
  274. package/dist/index273.js.map +1 -1
  275. package/dist/index274.js +2 -89
  276. package/dist/index274.js.map +1 -1
  277. package/dist/index275.js +28 -2
  278. package/dist/index275.js.map +1 -1
  279. package/dist/index276.js +17 -64
  280. package/dist/index276.js.map +1 -1
  281. package/dist/index278.js +3 -200
  282. package/dist/index278.js.map +1 -1
  283. package/dist/index279.js +12 -2
  284. package/dist/index279.js.map +1 -1
  285. package/dist/index28.js +138 -83
  286. package/dist/index28.js.map +1 -1
  287. package/dist/index280.js +7 -124
  288. package/dist/index280.js.map +1 -1
  289. package/dist/index281.js +7 -20
  290. package/dist/index281.js.map +1 -1
  291. package/dist/index282.js +20 -0
  292. package/dist/index282.js.map +1 -0
  293. package/dist/index283.js +2 -436
  294. package/dist/index283.js.map +1 -1
  295. package/dist/index284.js +68 -126
  296. package/dist/index284.js.map +1 -1
  297. package/dist/index285.js +5 -3
  298. package/dist/index285.js.map +1 -1
  299. package/dist/index286.js +1 -1
  300. package/dist/index287.js +3 -211
  301. package/dist/index287.js.map +1 -1
  302. package/dist/index288.js +214 -0
  303. package/dist/index288.js.map +1 -0
  304. package/dist/index290.js +4 -7
  305. package/dist/index290.js.map +1 -1
  306. package/dist/index291.js +4 -19
  307. package/dist/index291.js.map +1 -1
  308. package/dist/index292.js +58 -6
  309. package/dist/index292.js.map +1 -1
  310. package/dist/index293.js +35 -4
  311. package/dist/index293.js.map +1 -1
  312. package/dist/index294.js +7 -4
  313. package/dist/index294.js.map +1 -1
  314. package/dist/index295.js +6 -58
  315. package/dist/index295.js.map +1 -1
  316. package/dist/index296.js +18 -34
  317. package/dist/index296.js.map +1 -1
  318. package/dist/index297.js +2 -11
  319. package/dist/index297.js.map +1 -1
  320. package/dist/index298.js +47 -2
  321. package/dist/index298.js.map +1 -1
  322. package/dist/index299.js +10 -46
  323. package/dist/index299.js.map +1 -1
  324. package/dist/index30.js +85 -115
  325. package/dist/index30.js.map +1 -1
  326. package/dist/index32.js +111 -112
  327. package/dist/index32.js.map +1 -1
  328. package/dist/index34.js +114 -365
  329. package/dist/index34.js.map +1 -1
  330. package/dist/index36.js +361 -283
  331. package/dist/index36.js.map +1 -1
  332. package/dist/index38.js +288 -106
  333. package/dist/index38.js.map +1 -1
  334. package/dist/index40.js +114 -121
  335. package/dist/index40.js.map +1 -1
  336. package/dist/index42.js +113 -200
  337. package/dist/index42.js.map +1 -1
  338. package/dist/index44.js +180 -90
  339. package/dist/index44.js.map +1 -1
  340. package/dist/index46.js +110 -78
  341. package/dist/index46.js.map +1 -1
  342. package/dist/index48.js +89 -54
  343. package/dist/index48.js.map +1 -1
  344. package/dist/index5.js +14 -78
  345. package/dist/index5.js.map +1 -1
  346. package/dist/index50.js +54 -84
  347. package/dist/index50.js.map +1 -1
  348. package/dist/index52.js +86 -60
  349. package/dist/index52.js.map +1 -1
  350. package/dist/index54.js +59 -40
  351. package/dist/index54.js.map +1 -1
  352. package/dist/index56.js +42 -55
  353. package/dist/index56.js.map +1 -1
  354. package/dist/index58.js +53 -103
  355. package/dist/index58.js.map +1 -1
  356. package/dist/index6.js +36 -58
  357. package/dist/index6.js.map +1 -1
  358. package/dist/index60.js +103 -89
  359. package/dist/index60.js.map +1 -1
  360. package/dist/index62.js +61 -88
  361. package/dist/index62.js.map +1 -1
  362. package/dist/index64.js +119 -77
  363. package/dist/index64.js.map +1 -1
  364. package/dist/index66.js +77 -91
  365. package/dist/index66.js.map +1 -1
  366. package/dist/index68.js +88 -49
  367. package/dist/index68.js.map +1 -1
  368. package/dist/index7.js +78 -20
  369. package/dist/index7.js.map +1 -1
  370. package/dist/index70.js +51 -304
  371. package/dist/index70.js.map +1 -1
  372. package/dist/index72.js +299 -115
  373. package/dist/index72.js.map +1 -1
  374. package/dist/index74.js +120 -214
  375. package/dist/index74.js.map +1 -1
  376. package/dist/index76.js +213 -36
  377. package/dist/index76.js.map +1 -1
  378. package/dist/index78.js +47 -0
  379. package/dist/index78.js.map +1 -0
  380. package/dist/index79.js +119 -230
  381. package/dist/index79.js.map +1 -1
  382. package/dist/index8.js +61 -7
  383. package/dist/index8.js.map +1 -1
  384. package/dist/index81.js +227 -154
  385. package/dist/index81.js.map +1 -1
  386. package/dist/index83.js +154 -207
  387. package/dist/index83.js.map +1 -1
  388. package/dist/index85.js +215 -26
  389. package/dist/index85.js.map +1 -1
  390. package/dist/index87.js +27 -88
  391. package/dist/index87.js.map +1 -1
  392. package/dist/index89.js +53 -88
  393. package/dist/index89.js.map +1 -1
  394. package/dist/index9.js +17 -76
  395. package/dist/index9.js.map +1 -1
  396. package/dist/index91.js +75 -44
  397. package/dist/index91.js.map +1 -1
  398. package/dist/index93.js +89 -15
  399. package/dist/index93.js.map +1 -1
  400. package/dist/index95.js +15 -166
  401. package/dist/index95.js.map +1 -1
  402. package/dist/index97.js +120 -59
  403. package/dist/index97.js.map +1 -1
  404. package/dist/index99.js +66 -52
  405. package/dist/index99.js.map +1 -1
  406. package/dist/style.css +1 -1
  407. package/package.json +2 -2
  408. package/dist/index120.js +0 -47
  409. package/dist/index120.js.map +0 -1
  410. package/dist/index164.js +0 -6
  411. package/dist/index164.js.map +0 -1
  412. package/dist/index172.js +0 -6
  413. package/dist/index172.js.map +0 -1
  414. package/dist/index188.js +0 -6
  415. package/dist/index188.js.map +0 -1
  416. package/dist/index234.js +0 -6
  417. package/dist/index234.js.map +0 -1
  418. package/dist/index240.js +0 -5
  419. package/dist/index240.js.map +0 -1
  420. package/dist/index259.js +0 -10
  421. package/dist/index259.js.map +0 -1
  422. package/dist/index262.js +0 -26
  423. package/dist/index262.js.map +0 -1
  424. package/dist/index277.js +0 -8
  425. package/dist/index277.js.map +0 -1
  426. package/dist/index3.js +0 -17
  427. package/dist/index3.js.map +0 -1
  428. package/dist/index4.js +0 -43
  429. package/dist/index4.js.map +0 -1
  430. package/dist/index77.js +0 -130
  431. package/dist/index77.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index14.js","sources":["../src/components/BaseCheckbox/BaseCheckbox.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 aria-hidden=\"true\" class=\"bb-base-checkbox-container\">\n\t\t\t<slot name=\"icon\" v-bind=\"slotAttributes\">\n\t\t\t\t<svg\n\t\t\t\t\tclass=\"bb-base-checkbox-container__icon\"\n\t\t\t\t\tviewBox=\"276.411 158.834 114.971 114.97\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M 297.574 224.786 L 318.309 243.134 L 371.568 189.232\"\n\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\tstroke-width=\"14px\"\n\t\t\t\t\t></path>\n\t\t\t\t</svg>\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 { HTMLAttributes, InputHTMLAttributes } from 'vue';\nimport { booleanishToBoolean } from '@/utilities/functions/booleanishToBoolean';\n\nexport type BaseCheckboxProps = {\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 * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Defines the input as checked\n\t */\n\tchecked?: boolean | 'true' | 'false';\n\n\t/**\n\t * Define a color for the component.\n\t *\n\t * Either a custom color or a coded color in common HEX, RGB, etc... format.\n\t */\n\tcolor?: string;\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Value of the input when unchecked. It handles any kind of serializable object.\n\t */\n\tfalseValue?: any;\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Sets the input in an indeterminate state.\n\t */\n\tindeterminate?: InputHTMLAttributes['indeterminate'];\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\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 * Will submit \"falseValue\" if the input is not checked. Otherwise \"trueValue\" will be submitted.\n\t */\n\tsubmitWhenFalse?: boolean;\n\n\t/**\n\t * Value of the input when checked. It handles any kind of serializable object.\n\t */\n\ttrueValue?: any;\n\t/**\n\t * Used by v-model. Can be any serializable type.\n\t */\n\tmodelValue?: any;\n};\n\nexport type BaseCheckboxEvents = {\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: any): void;\n};\n\nexport type SlotAttributes = {\n\tchecked: boolean;\n\tdisabled: boolean;\n\tfalseValue: any;\n\tfocused: boolean;\n\thasErrors: boolean;\n\tid: BaseCheckboxProps['id'];\n\tname: BaseCheckboxProps['name'];\n\tparsedValue: any;\n\treadonly: BaseCheckboxProps['readonly'];\n\ttrueValue: any;\n\tvalue: any;\n};\n\nconst props = withDefaults(defineProps<BaseCheckboxProps>(), {\n\ttrueValue: true,\n\tfalseValue: false,\n});\n\nconst emit = defineEmits<BaseCheckboxEvents>();\n\ndefineSlots<{\n\ticon?: (props: SlotAttributes) => any;\n}>();\n\nconst checkboxInput = ref<HTMLInputElement | null>(null);\n\nconst checked = computed(() => {\n\tif (props.checked) return booleanishToBoolean(props.checked);\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-checkbox': true,\n\t\t\t'bb-base-checkbox--disabled': props.disabled,\n\t\t\t'bb-base-checkbox--errors': props.hasErrors,\n\t\t\t'bb-base-checkbox--indeterminate': props.indeterminate,\n\t\t\t'bb-base-checkbox--readonly': props.readonly,\n\t\t\t[`bb-base-checkbox--${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\tonKeydown: (event: KeyboardEvent) => emit('keydown', event),\n\t\tonMousedown: (event: MouseEvent) => emit('mousedown', event),\n\t\tonMouseup: (event: MouseEvent) => emit('mouseup', event),\n\t\tonInput: (event: Event) => emit('input', 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\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\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<style lang=\"postcss\">\n@import '@/assets/css/BaseCheckbox';\n</style>\n"],"names":["props","__props","emit","__emit","checkboxInput","ref","checked","computed","booleanishToBoolean","hasFocus","containerAttributes","attributes","isCssColor","makeInputValue","when","item","hiddenInputAttributes","value","inputAttributes","eventListeners","event","slotAttribut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,EAAQ,QAAQN,EAAM,YAAYA,EAAM;AAAA,IAC9C,EAAA;AAMF,WAAAsB;AAAA,MACC,MAAM,CAACtB,EAAM,YAAYA,EAAM,SAASA,EAAM,aAAa;AAAA,MAC3D,MAAM;AACL,QAAII,EAAc,UACjBA,EAAc,MAAM,gBAAgB,CAAC,CAACJ,EAAM;AAAA,MAE9C;AAAA,IAAA;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index14.js","sources":["../src/components/BaseButton/BaseButton.vue"],"sourcesContent":["<template>\n\t<component :is=\"tag\" :class=\"classes\" v-bind=\"attributes\">\n\t\t<slot>{{ text }}</slot>\n\t</component>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, getCurrentInstance, resolveComponent } from 'vue';\nimport type { RouteLocationRaw } from 'vue-router';\nimport { _config } from '@/composables/useBbConfig';\nimport { useLogger } from '@/composables/useLogger';\n\nexport type BaseButtonProps = {\n\t/**\n\t * Class to apply when the link is active\n\t */\n\tactiveClass?: string;\n\n\t/**\n\t * Value passed to the attribute `aria-current` when the link is exact active.\n\t *\n\t * @defaultValue `'page'`\n\t */\n\tariaCurrentValue?:\n\t\t| 'page'\n\t\t| 'step'\n\t\t| 'location'\n\t\t| 'date'\n\t\t| 'time'\n\t\t| 'true'\n\t\t| 'false';\n\n\t/**\n\t * Displays the component as full width.\n\t */\n\tblock?: boolean;\n\n\tdata?: object;\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Class to apply when the link is exact active\n\t */\n\texactActiveClass?: string;\n\n\theaders?: object;\n\n\t/**\n\t * Returns the hyperlink's URL.\n\t *\n\t * Can be set, to change the URL.\n\t */\n\thref?: HTMLAnchorElement['href'];\n\n\tmethod?: 'get' | 'post' | 'put' | 'patch' | 'delete';\n\n\tonBefore?: () => void;\n\n\tonCancel?: () => void;\n\n\tonCancelToken?: (cancelToken: import('axios').CancelTokenSource) => void;\n\n\tonFinish?: () => void;\n\n\tonly?: string[];\n\n\tonProgress?: (progress: { percentage: number | undefined }) => void;\n\n\tonStart?: () => void;\n\n\tonSuccess?: () => void;\n\n\tpreserveScroll?: boolean | ((props: { [key: string]: unknown }) => boolean);\n\n\tpreserveState?:\n\t\t| boolean\n\t\t| ((props: { [key: string]: unknown }) => boolean)\n\t\t| null;\n\n\tqueryStringArrayFormat?: 'brackets' | 'indices';\n\n\t/**\n\t * Calls `router.replace` instead of `router.push`.\n\t */\n\treplace?: boolean;\n\n\t/**\n\t * Any HTML tag corresponding to a non-void HTMl element.\n\t */\n\ttag?: string;\n\n\t/**\n\t * Sets or retrieves the window or frame at which to target content.\n\t */\n\ttarget?: HTMLAnchorElement['target'];\n\n\t/**\n\t * Text content of the component.\n\t */\n\ttext?: string;\n\n\t/**\n\t * Route Location the link should navigate to when clicked on.\n\t */\n\tto?: RouteLocationRaw;\n\n\t/**\n\t * Gets the classification and default behavior of the button.\n\t */\n\ttype?: HTMLButtonElement['type'];\n};\n\nconst props = withDefaults(defineProps<BaseButtonProps>(), {\n\ttag: 'button',\n\ttype: 'button',\n});\n\ndefineSlots<{\n\tdefault?: (props: object) => any;\n}>();\n\n/* Ignore because possibly undefined */\n// @ts-expect-error possibly undef\nconst isInertia = !!getCurrentInstance()?.proxy?.$inertia;\n\n// @ts-expect-error possibly undef\nconst isNuxt = !!getCurrentInstance()?.proxy?.$nuxt;\n\nconst tag = computed(() => {\n\t// For disabled links always render a\n\tif (props.href || (props.to && props.disabled)) {\n\t\t// Prevent rendering inertia links if target is passed (inertia doesn't support external links)\n\t\tif (isInertia && !props.disabled && !props.target) {\n\t\t\tconst resolved = resolveComponent(_config.inertiaLinkName);\n\t\t\tif (typeof resolved === 'string') {\n\t\t\t\tconst { warn } = useLogger();\n\t\t\t\twarn(\n\t\t\t\t\t`Inertia link component \"${_config.inertiaLinkName}\" could not be resolved. Ensure you app registers a link component with the name \"${_config.inertiaLinkName}\" or set bitboss-ui config key \"inertiaLinkName\" to the correct value globally. Please visit ${_config.documentationURL}/getting-started to resolve setup issues in bitboss-ui.`\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn resolved;\n\t\t}\n\n\t\treturn 'a';\n\t}\n\tif (props.to) {\n\t\tif (isNuxt) {\n\t\t\tconst resolved = resolveComponent(_config.nuxtLinkName);\n\t\t\tif (typeof resolved === 'string') {\n\t\t\t\tconst { warn } = useLogger();\n\t\t\t\twarn(\n\t\t\t\t\t`Nuxt link component \"${_config.nuxtLinkName}\" could not be resolved. Ensure you app registers a link component with the name \"${_config.nuxtLinkName}\" or set bitboss-ui config key \"nuxtLInkName\" to the correct value globally. Please visit ${_config.documentationURL}/getting-started to resolve setup issues in bitboss-ui.`\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn resolved;\n\t\t}\n\t\treturn 'router-link';\n\t}\n\treturn props.tag;\n});\n\nconst classes = computed(() => ({\n\t'base-btn': true,\n\t'base-btn--block': props.block,\n\t'base-btn--disabled': props.disabled,\n}));\n\nconst attributes = computed(() => {\n\ttype PossibleAttributes = {\n\t\tactiveClass: BaseButtonProps['activeClass'];\n\t\t'aria-disabled': boolean;\n\t\tariaCurrentValue: BaseButtonProps['ariaCurrentValue'];\n\t\tdata: BaseButtonProps['data'];\n\t\tdisabled: boolean;\n\t\texactActiveClass: BaseButtonProps['exactActiveClass'];\n\t\theaders: BaseButtonProps['headers'];\n\t\thref: string;\n\t\tmethod: BaseButtonProps['method'];\n\t\tonBefore: BaseButtonProps['onBefore'];\n\t\tonCancel: BaseButtonProps['onCancel'];\n\t\tonCancelToken: BaseButtonProps['onCancelToken'];\n\t\tonFinish: BaseButtonProps['onFinish'];\n\t\tonly: BaseButtonProps['only'];\n\t\tonProgress: BaseButtonProps['onProgress'];\n\t\tonStart: BaseButtonProps['onStart'];\n\t\tonSuccess: BaseButtonProps['onSuccess'];\n\t\tpreserveScroll: BaseButtonProps['preserveScroll'];\n\t\tpreserveState: BaseButtonProps['preserveState'];\n\t\tqueryStringArrayFormat: BaseButtonProps['queryStringArrayFormat'];\n\t\treplace: BaseButtonProps['replace'];\n\t\trole: string;\n\t\tstyle: { [rule: string]: string };\n\t\ttarget: string;\n\t\tto: BaseButtonProps['to'];\n\t\ttype: string;\n\t};\n\tconst initial: Partial<PossibleAttributes> = {};\n\n\tif (tag.value === 'button') {\n\t\tinitial.disabled = props.disabled;\n\t\tinitial.type = props.type;\n\t} else if (\n\t\ttag.value === 'a' ||\n\t\t(isInertia && typeof tag.value !== 'string' && tag.value.name === 'Link')\n\t) {\n\t\t// When rendering as anchor prevent navigation if disabled\n\t\t// https://getbootstrap.com/docs/4.0/components/buttons/#disabled-state\n\t\tif (props.disabled) {\n\t\t\tinitial['aria-disabled'] = true;\n\t\t\tinitial.role = 'link';\n\t\t} else {\n\t\t\t// Only attach the href to active links\n\t\t\t// https://www.scottohara.me/blog/2021/05/28/disabled-links.html\n\t\t\tinitial.href = props.href;\n\t\t\tinitial.target = props.target;\n\n\t\t\tif (isInertia) {\n\t\t\t\tinitial.data = props.data;\n\t\t\t\tinitial.headers = props.headers;\n\t\t\t\tinitial.method = props.method;\n\t\t\t\tinitial.onBefore = props.onBefore;\n\t\t\t\tinitial.onCancel = props.onCancel;\n\t\t\t\tinitial.onCancelToken = props.onCancelToken;\n\t\t\t\tinitial.onFinish = props.onFinish;\n\t\t\t\tinitial.only = props.only;\n\t\t\t\tinitial.onProgress = props.onProgress;\n\t\t\t\tinitial.onStart = props.onStart;\n\t\t\t\tinitial.onSuccess = props.onSuccess;\n\t\t\t\tinitial.preserveScroll = props.preserveScroll;\n\t\t\t\tinitial.preserveState = props.preserveState;\n\t\t\t\tinitial.queryStringArrayFormat = props.queryStringArrayFormat;\n\t\t\t\tinitial.replace = props.replace;\n\t\t\t}\n\t\t}\n\t} else if (\n\t\ttag.value === 'router-link' ||\n\t\t(typeof tag.value !== 'string' && tag.value.name === 'NuxtLink')\n\t) {\n\t\tinitial.activeClass = props.activeClass;\n\t\tinitial.ariaCurrentValue = props.ariaCurrentValue;\n\t\tinitial.exactActiveClass = props.exactActiveClass;\n\t\tinitial.replace = props.replace;\n\t\tinitial.target = props.target;\n\t\tinitial.to = props.to;\n\t}\n\n\treturn initial;\n});\n</script>\n<style lang=\"postcss\">\n@import '@/assets/css/BaseButton';\n</style>\n"],"names":["props","__props","isInertia","_b","_a","getCurrentInstance","isNuxt","_d","_c","tag","computed","resolved","resolveComponent","_config","warn","useLogger","classes","attributes","initial"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoHA,UAAMA,IAAQC,GAWRC,IAAY,CAAC,GAACC,KAAAC,IAAAC,EAAA,MAAA,gBAAAD,EAAsB,UAAtB,QAAAD,EAA6B,WAG3CG,IAAS,CAAC,GAACC,KAAAC,IAAAH,EAAA,MAAA,gBAAAG,EAAsB,UAAtB,QAAAD,EAA6B,QAExCE,IAAMC,EAAS,MAAM;AAE1B,UAAIV,EAAM,QAASA,EAAM,MAAMA,EAAM,UAAW;AAE/C,YAAIE,KAAa,CAACF,EAAM,YAAY,CAACA,EAAM,QAAQ;AAC5C,gBAAAW,IAAWC,EAAiBC,EAAQ,eAAe;AACrD,cAAA,OAAOF,KAAa,UAAU;AAC3B,kBAAA,EAAE,MAAAG,MAASC;AACjB,YAAAD;AAAA,cACC,2BAA2BD,EAAQ,eAAe,qFAAqFA,EAAQ,eAAe,gGAAgGA,EAAQ,gBAAgB;AAAA,YAAA;AAAA,UAExR;AACO,iBAAAF;AAAA,QACR;AAEO,eAAA;AAAA,MACR;AACA,UAAIX,EAAM,IAAI;AACb,YAAIM,GAAQ;AACL,gBAAAK,IAAWC,EAAiBC,EAAQ,YAAY;AAClD,cAAA,OAAOF,KAAa,UAAU;AAC3B,kBAAA,EAAE,MAAAG,MAASC;AACjB,YAAAD;AAAA,cACC,wBAAwBD,EAAQ,YAAY,qFAAqFA,EAAQ,YAAY,6FAA6FA,EAAQ,gBAAgB;AAAA,YAAA;AAAA,UAE5Q;AACO,iBAAAF;AAAA,QACR;AACO,eAAA;AAAA,MACR;AACA,aAAOX,EAA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CACP;;;;;;;;;;;"}
package/dist/index140.js CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index26.js";
1
+ import o from "./index24.js";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index141.js CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index28.js";
1
+ import o from "./index26.js";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index142.js CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index30.js";
1
+ import o from "./index28.js";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index143.js CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index32.js";
1
+ import o from "./index30.js";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index144.js CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index34.js";
1
+ import o from "./index32.js";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index145.js CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index36.js";
1
+ import o from "./index34.js";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index146.js CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index38.js";
1
+ import o from "./index36.js";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index147.js CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index40.js";
1
+ import o from "./index38.js";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index148.js CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index42.js";
1
+ import o from "./index40.js";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index149.js CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index44.js";
1
+ import o from "./index42.js";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index150.js CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index46.js";
1
+ import o from "./index44.js";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index151.js CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index48.js";
1
+ import o from "./index46.js";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index152.js CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index50.js";
1
+ import o from "./index48.js";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index153.js CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index52.js";
1
+ import o from "./index50.js";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index154.js CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index54.js";
1
+ import o from "./index52.js";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index155.js CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index56.js";
1
+ import o from "./index54.js";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index156.js CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index58.js";
1
+ import o from "./index56.js";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index157.js CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index60.js";
1
+ import o from "./index58.js";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index158.js CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index62.js";
1
+ import o from "./index60.js";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index159.js CHANGED
@@ -1,5 +1,5 @@
1
- import o from "./index119.js";
2
- /* empty css */
1
+ import o from "./index62.js";
2
+ /* empty css */
3
3
  export {
4
4
  o as default
5
5
  };
package/dist/index16.js CHANGED
@@ -1,132 +1,133 @@
1
- import { defineComponent as $, ref as p, toRef as l, openBlock as B, createBlock as w, unref as f, withCtx as i, renderSlot as s, normalizeProps as b, guardReactiveProps as h, createVNode as O, mergeProps as v } from "vue";
2
- import { useOptions as z } from "./index221.js";
3
- import F from "./index14.js";
4
- /* empty css */
5
- import M from "./index222.js";
6
- /* empty css */
7
- const G = /* @__PURE__ */ $({
8
- __name: "BaseCheckboxGroup",
1
+ import { defineComponent as C, ref as b, computed as n, watch as E, openBlock as m, createElementBlock as p, normalizeProps as c, guardReactiveProps as h, mergeProps as f, createCommentVNode as I, createElementVNode as s, renderSlot as q } from "vue";
2
+ import { isCssColor as k } from "./index219.js";
3
+ import { when as F } from "./index220.js";
4
+ import { booleanishToBoolean as N } from "./index221.js";
5
+ const S = {
6
+ "aria-hidden": "true",
7
+ class: "bb-base-checkbox-container"
8
+ }, A = /* @__PURE__ */ s("svg", {
9
+ class: "bb-base-checkbox-container__icon",
10
+ viewBox: "276.411 158.834 114.971 114.97"
11
+ }, [
12
+ /* @__PURE__ */ s("path", {
13
+ d: "M 297.574 224.786 L 318.309 243.134 L 371.568 189.232",
14
+ fill: "none",
15
+ "stroke-linecap": "round",
16
+ "stroke-width": "14px"
17
+ })
18
+ ], -1), D = /* @__PURE__ */ C({
19
+ __name: "BaseCheckbox",
9
20
  props: {
10
21
  ariaDescribedby: {},
11
22
  autofocus: {},
23
+ checked: { type: [Boolean, String] },
12
24
  color: {},
13
- dependencies: {},
14
- depsDebounceTime: { default: 0 },
15
- direction: { default: "horizontal" },
16
25
  disabled: { type: Boolean },
17
- enforceCoherence: { type: Boolean },
26
+ falseValue: { default: !1 },
18
27
  hasErrors: { type: Boolean },
19
- hideLabel: { type: Boolean },
20
28
  id: {},
21
- items: { type: [Array, Function], default: () => [] },
22
- itemText: {},
23
- itemValue: {},
24
- loadingText: { default: "Caricamento..." },
25
- modelValue: {},
26
- modelValueDebounceTime: { default: 0 },
29
+ indeterminate: {},
27
30
  name: {},
28
- noDataText: { default: "Nessun elemento da visualizzare" },
29
- readonly: {}
31
+ readonly: {},
32
+ required: { type: Boolean },
33
+ submitWhenFalse: { type: Boolean },
34
+ trueValue: { default: !0 },
35
+ modelValue: {}
30
36
  },
31
- emits: ["blur", "change", "click", "focus", "inactive", "input", "keydown", "mousedown", "mouseup", "update:modelValue"],
32
- setup(g, { emit: y }) {
33
- const a = g, o = y, m = p(), r = p(!1), {
34
- innerLoading: T,
35
- options: k,
36
- selectOption: D,
37
- unselectOption: C
38
- } = z({
39
- dependencies: l(a, "dependencies"),
40
- depsDebounceTime: a.depsDebounceTime,
41
- disabled: l(a, "disabled"),
42
- emit: o,
43
- enforceCoherence: a.enforceCoherence,
44
- items: l(a, "items"),
45
- itemText: a.itemText,
46
- itemValue: a.itemValue,
47
- modelValue: l(a, "modelValue"),
48
- modelValueDebounceTime: a.modelValueDebounceTime,
49
- multiple: !0,
50
- prefill: !0,
51
- queryDebounceTime: 0,
52
- resetQueryOnOptionSelected: !1,
53
- stash: !1
54
- }), L = (e, t) => {
55
- o("change", e), t.selected ? C(t) : D(t);
56
- }, E = {
57
- onBlur: (e) => o("blur", e),
58
- onClick: (e) => o("click", e),
59
- onFocus: (e) => {
60
- o("focus", e), r.value || (document.addEventListener("focusin", d, { passive: !0 }), document.addEventListener("click", u, { passive: !0 }), r.value = !0);
61
- },
62
- onInput: (e) => o("input", e),
63
- onKeydown: (e) => o("keydown", e),
64
- onMousedown: (e) => o("mousedown", e),
65
- onMouseup: (e) => o("mouseup", e)
66
- }, d = (e) => {
67
- var t;
68
- e.target instanceof HTMLElement && ((t = m.value) != null && t.contains(e.target) || (o("inactive"), r.value = !1, document.removeEventListener("focusin", d), document.removeEventListener("click", u)));
69
- }, u = (e) => {
70
- var t;
71
- e.target instanceof HTMLElement && ((t = m.value) != null && t.contains(e.target) || (o("inactive"), r.value = !1, document.removeEventListener("focusin", d), document.removeEventListener("click", u)));
72
- };
73
- return (e, t) => (B(), w(M, {
74
- class: "bb-base-checkbox-group",
75
- direction: e.direction,
76
- "has-errors": e.hasErrors,
77
- "hide-label": e.hideLabel,
78
- loading: !!f(T),
79
- "loading-text": e.loadingText,
80
- "no-data-text": e.noDataText,
81
- options: f(k)
82
- }, {
83
- prepend: i(() => [
84
- s(e.$slots, "prepend")
85
- ]),
86
- loading: i(() => [
87
- s(e.$slots, "loading")
88
- ]),
89
- "no-data": i(() => [
90
- s(e.$slots, "no-data")
91
- ]),
92
- "option:prepend": i((n) => [
93
- s(e.$slots, "option:prepend", b(h(n)))
94
- ]),
95
- input: i(({ option: n, index: V }) => [
96
- O(F, v({
97
- id: n.valueHash,
98
- "aria-describedby": e.ariaDescribedby,
99
- autofocus: e.autofocus && !V,
100
- checked: n.selected,
101
- color: e.color,
102
- disabled: n.disabled,
103
- "has-errors": e.hasErrors,
104
- name: e.name,
105
- readonly: e.readonly,
106
- "true-value": n.value
107
- }, E, {
108
- onChange: (c) => L(c, n)
109
- }), {
110
- icon: i((c) => [
111
- s(e.$slots, "icon", v({
112
- item: n.item,
113
- text: n.text
114
- }, c))
115
- ]),
116
- _: 2
117
- }, 1040, ["id", "aria-describedby", "autofocus", "checked", "color", "disabled", "has-errors", "name", "readonly", "true-value", "onChange"])
118
- ]),
119
- "option:append": i((n) => [
120
- s(e.$slots, "option:prepend", b(h(n)))
121
- ]),
122
- append: i(() => [
123
- s(e.$slots, "prepend")
124
- ]),
125
- _: 3
126
- }, 8, ["direction", "has-errors", "hide-label", "loading", "loading-text", "no-data-text", "options"]));
37
+ emits: ["blur", "change", "click", "focus", "input", "keydown", "mousedown", "mouseup", "update:modelValue"],
38
+ setup(y, { emit: v }) {
39
+ const e = y, t = v, l = b(null), r = n(() => e.checked ? N(e.checked) : JSON.stringify(e.trueValue) === JSON.stringify(e.modelValue)), u = b(!1), V = n(() => {
40
+ const a = {
41
+ class: {
42
+ "bb-base-checkbox": !0,
43
+ "bb-base-checkbox--disabled": e.disabled,
44
+ "bb-base-checkbox--errors": e.hasErrors,
45
+ "bb-base-checkbox--indeterminate": e.indeterminate,
46
+ "bb-base-checkbox--readonly": e.readonly,
47
+ [`bb-base-checkbox--${e.color}`]: e.color && !k(e.color)
48
+ }
49
+ };
50
+ return e.color && k(e.color) && (a.style = `--color: ${e.color}`), a;
51
+ }), i = F(
52
+ (a) => typeof a != "string",
53
+ JSON.stringify
54
+ ), x = n(() => {
55
+ const a = i(e.falseValue);
56
+ return {
57
+ disabled: e.disabled,
58
+ name: e.name,
59
+ type: "hidden",
60
+ value: a
61
+ };
62
+ }), d = n(() => {
63
+ const a = i(e.trueValue), _ = {
64
+ onBlur: (o) => {
65
+ u.value = !1, t("blur", o);
66
+ },
67
+ onChange: (o) => {
68
+ if (o.target instanceof HTMLInputElement) {
69
+ let w = o.target.checked ? e.trueValue : e.falseValue;
70
+ t("change", o), t("update:modelValue", w);
71
+ }
72
+ },
73
+ onClick: (o) => t("click", o),
74
+ onFocus: (o) => {
75
+ u.value = !0, t("focus", o);
76
+ },
77
+ onKeydown: (o) => t("keydown", o),
78
+ onMousedown: (o) => t("mousedown", o),
79
+ onMouseup: (o) => t("mouseup", o),
80
+ onInput: (o) => t("input", o)
81
+ };
82
+ return {
83
+ "aria-describedby": e.ariaDescribedby,
84
+ autofocus: e.autofocus,
85
+ checked: r.value,
86
+ // There is no such thing as readonly checkbox so we disable and style it with css
87
+ disabled: e.disabled || e.readonly,
88
+ id: e.id,
89
+ indeterminate: e.indeterminate,
90
+ name: e.name,
91
+ required: e.required,
92
+ tabindex: e.disabled ? -1 : void 0,
93
+ type: "checkbox",
94
+ value: a,
95
+ ..._
96
+ };
97
+ }), g = n(() => ({
98
+ checked: r.value,
99
+ disabled: e.disabled,
100
+ falseValue: e.falseValue,
101
+ focused: u.value,
102
+ hasErrors: e.hasErrors,
103
+ id: e.id,
104
+ name: e.name,
105
+ parsedValue: d.value.value,
106
+ readonly: e.readonly,
107
+ required: e.required,
108
+ trueValue: e.trueValue,
109
+ value: r.value ? e.trueValue : e.falseValue
110
+ }));
111
+ return E(
112
+ () => [e.modelValue, e.checked, e.indeterminate],
113
+ () => {
114
+ l.value && (l.value.indeterminate = !!e.indeterminate);
115
+ }
116
+ ), (a, B) => (m(), p("span", c(h(V.value)), [
117
+ !r.value && a.submitWhenFalse ? (m(), p("input", c(f({ key: 0 }, x.value)), null, 16)) : I("", !0),
118
+ s("input", f(d.value, {
119
+ ref_key: "checkboxInput",
120
+ ref: l
121
+ }), null, 16),
122
+ s("span", S, [
123
+ q(a.$slots, "icon", c(h(g.value)), () => [
124
+ A
125
+ ])
126
+ ])
127
+ ], 16));
127
128
  }
128
129
  });
129
130
  export {
130
- G as default
131
+ D as default
131
132
  };
132
133
  //# sourceMappingURL=index16.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index16.js","sources":["../src/components/BaseCheckboxGroup/BaseCheckboxGroup.vue"],"sourcesContent":["<template>\n\t<OptionsContainer\n\t\tclass=\"bb-base-checkbox-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<BaseCheckbox\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\t><template #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\" /></template\n\t\t\t></BaseCheckbox>\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 BaseCheckbox from '../BaseCheckbox/BaseCheckbox.vue';\nimport type { HTMLAttributes, InputHTMLAttributes } from 'vue';\nimport type { NestedKeyOf } from '@/types/NestedKeyOf';\nimport type { Option } from '@/types/Option';\nimport type { SlotAttributes } from '../BaseCheckbox/BaseCheckbox.vue';\nimport OptionsContainer from '../OptionsContainer.vue';\n\nexport type BaseCheckboxGroupProps<T> = {\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 * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Define a color for the component.\n\t *\n\t * Either a custom color or a coded color in common HEX, RGB, etc... format.\n\t */\n\tcolor?: string;\n\n\t/**\n\t * Defines an array of dependencies that will trigger actions in the component upon change.\n\t */\n\tdependencies?: any[];\n\n\t/**\n\t * Timeout used to debounce response to changes to dependencies.\n\t */\n\tdepsDebounceTime?: number;\n\n\t/**\n\t * Direction of the layout of the inputs inside the fieldset. It can be either `horizontal` or `vertical`\n\t */\n\tdirection?: 'horizontal' | 'vertical';\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * If coherence is enforce the input cannot have a modelValue the is incoherent with its current items.\n\t *\n\t * e.g. You cannot set v-model to a user that is not present in the items passed.\n\t *\n\t * modelValue will be reset upon incoherence.\n\t */\n\tenforceCoherence?: boolean;\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * Visually hides the label of the input while maintaining accessibility.\n\t */\n\thideLabel?: boolean;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Used to retrieve items can be an array or a function.\n\t */\n\titems:\n\t\t| T[]\n\t\t| ((prefill: boolean, modelValue?: any[]) => Promise<T[]>)\n\t\t| ((prefill: boolean, modelValue?: any[]) => T[]);\n\n\t/**\n\t * Defines a path that returns a property of the object to use as text or a function that returns a string\n\t */\n\titemText?: T extends object\n\t\t? NestedKeyOf<T> | ((item: T) => string)\n\t\t: ((item: T) => string) | undefined;\n\n\t/**\n\t * Defines a path that returns a property of the object to use as value or a function that returns any value\n\t */\n\titemValue?: T extends object\n\t\t? NestedKeyOf<T> | ((item: T) => string)\n\t\t: ((item: T) => any) | undefined;\n\n\t/**\n\t * String displayed while items are being loaded.\n\t */\n\tloadingText?: string;\n\n\t/**\n\t * Used by v-model. Can be an array of any serializable type.\n\t */\n\tmodelValue: any[];\n\n\t/**\n\t * Timeout used to debounce response to changes to modelValue.\n\t */\n\tmodelValueDebounceTime?: number;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * String displayed when there are no items to display.\n\t */\n\tnoDataText?: string;\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: InputHTMLAttributes['readonly'];\n};\n\nexport type BaseCheckboxGroupEvents = {\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: 'inactive'): 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: any): void;\n};\n\nconst props = withDefaults(defineProps<BaseCheckboxGroupProps<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<BaseCheckboxGroupEvents>();\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/BaseCheckboxGroup';\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyLA,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;AAA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U,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":"index16.js","sources":["../src/components/BaseCheckbox/BaseCheckbox.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 aria-hidden=\"true\" class=\"bb-base-checkbox-container\">\n\t\t\t<slot name=\"icon\" v-bind=\"slotAttributes\">\n\t\t\t\t<svg\n\t\t\t\t\tclass=\"bb-base-checkbox-container__icon\"\n\t\t\t\t\tviewBox=\"276.411 158.834 114.971 114.97\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M 297.574 224.786 L 318.309 243.134 L 371.568 189.232\"\n\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\tstroke-width=\"14px\"\n\t\t\t\t\t></path>\n\t\t\t\t</svg>\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 { HTMLAttributes, InputHTMLAttributes } from 'vue';\nimport { booleanishToBoolean } from '@/utilities/functions/booleanishToBoolean';\n\nexport type BaseCheckboxProps = {\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 * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Defines the input as checked\n\t */\n\tchecked?: boolean | 'true' | 'false';\n\n\t/**\n\t * Define a color for the component.\n\t *\n\t * Either a custom color or a coded color in common HEX, RGB, etc... format.\n\t */\n\tcolor?: string;\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Value of the input when unchecked. It handles any kind of serializable object.\n\t */\n\tfalseValue?: any;\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Sets the input in an indeterminate state.\n\t */\n\tindeterminate?: InputHTMLAttributes['indeterminate'];\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\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 * Will submit \"falseValue\" if the input is not checked. Otherwise \"trueValue\" will be submitted.\n\t */\n\tsubmitWhenFalse?: boolean;\n\n\t/**\n\t * Value of the input when checked. It handles any kind of serializable object.\n\t */\n\ttrueValue?: any;\n\t/**\n\t * Used by v-model. Can be any serializable type.\n\t */\n\tmodelValue?: any;\n};\n\nexport type BaseCheckboxEvents = {\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: any): void;\n};\n\nexport type SlotAttributes = {\n\tchecked: boolean;\n\tdisabled: boolean;\n\tfalseValue: any;\n\tfocused: boolean;\n\thasErrors: boolean;\n\tid: BaseCheckboxProps['id'];\n\tname: BaseCheckboxProps['name'];\n\tparsedValue: any;\n\treadonly: BaseCheckboxProps['readonly'];\n\ttrueValue: any;\n\tvalue: any;\n};\n\nconst props = withDefaults(defineProps<BaseCheckboxProps>(), {\n\ttrueValue: true,\n\tfalseValue: false,\n});\n\nconst emit = defineEmits<BaseCheckboxEvents>();\n\ndefineSlots<{\n\ticon?: (props: SlotAttributes) => any;\n}>();\n\nconst checkboxInput = ref<HTMLInputElement | null>(null);\n\nconst checked = computed(() => {\n\tif (props.checked) return booleanishToBoolean(props.checked);\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-checkbox': true,\n\t\t\t'bb-base-checkbox--disabled': props.disabled,\n\t\t\t'bb-base-checkbox--errors': props.hasErrors,\n\t\t\t'bb-base-checkbox--indeterminate': props.indeterminate,\n\t\t\t'bb-base-checkbox--readonly': props.readonly,\n\t\t\t[`bb-base-checkbox--${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\tonKeydown: (event: KeyboardEvent) => emit('keydown', event),\n\t\tonMousedown: (event: MouseEvent) => emit('mousedown', event),\n\t\tonMouseup: (event: MouseEvent) => emit('mouseup', event),\n\t\tonInput: (event: Event) => emit('input', 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\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\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<style lang=\"postcss\">\n@import '@/assets/css/BaseCheckbox';\n</style>\n"],"names":["props","__props","emit","__emit","checkboxInput","ref","checked","computed","booleanishToBoolean","hasFocus","containerAttributes","attributes","isCssColor","makeInputValue","when","item","hiddenInputAttributes","value","inputAttributes","eventListeners","event","slotAttributes","watch"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqIA,UAAMA,IAAQC,GAKRC,IAAOC,GAMPC,IAAgBC,EAA6B,IAAI,GAEjDC,IAAUC,EAAS,MACpBP,EAAM,UAAgBQ,EAAoBR,EAAM,OAAO,IACpD,KAAK,UAAUA,EAAM,SAAS,MAAM,KAAK,UAAUA,EAAM,UAAU,CAC1E,GACKS,IAAWJ,EAAI,EAAK,GAEpBK,IAAsBH,EAAS,MAAM;AAC1C,YAAMI,IAAkC;AAAA,QACvC,OAAO;AAAA,UACN,oBAAoB;AAAA,UACpB,8BAA8BX,EAAM;AAAA,UACpC,4BAA4BA,EAAM;AAAA,UAClC,mCAAmCA,EAAM;AAAA,UACzC,8BAA8BA,EAAM;AAAA,UACpC,CAAC,qBAAqBA,EAAM,KAAK,EAAE,GAClCA,EAAM,SAAS,CAACY,EAAWZ,EAAM,KAAK;AAAA,QACxC;AAAA,MAAA;AAED,aAAIA,EAAM,SAASY,EAAWZ,EAAM,KAAK,MACxCW,EAAW,QAAW,YAAYX,EAAM,KAAK,KAEvCW;AAAA,IAAA,CACP,GAMKE,IAAiBC;AAAA,MACtB,CAACC,MAAkB,OAAOA,KAAS;AAAA,MACnC,KAAK;AAAA,IAAA,GAGAC,IAAwBT,EAAS,MAAM;AACtC,YAAAU,IAAQJ,EAAeb,EAAM,UAAU;AACtC,aAAA;AAAA,QACN,UAAUA,EAAM;AAAA,QAChB,MAAMA,EAAM;AAAA,QACZ,MAAM;AAAA,QACN,OAAAiB;AAAA,MAAA;AAAA,IACD,CACA,GAEKC,IAAkBX,EAAS,MAAM;AAChC,YAAAU,IAAQJ,EAAeb,EAAM,SAAS,GAqBtCmB,IAAiB;AAAA,QACtB,QApBc,CAACC,MAA4B;AAC3C,UAAAX,EAAS,QAA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B,MAAM;AAAA,MACnC,UAAUlB,EAAM;AAAA,MAChB,UAAUA,EAAM;AAAA,MAChB,WAAWA,EAAM;AAAA,MACjB,OAAOM,EAAQ,QAAQN,EAAM,YAAYA,EAAM;AAAA,IAC9C,EAAA;AAMF,WAAAsB;AAAA,MACC,MAAM,CAACtB,EAAM,YAAYA,EAAM,SAASA,EAAM,aAAa;AAAA,MAC3D,MAAM;AACL,QAAII,EAAc,UACjBA,EAAc,MAAM,gBAAgB,CAAC,CAACJ,EAAM;AAAA,MAE9C;AAAA,IAAA;;;;;;;;;;;;;;"}
@@ -0,0 +1,6 @@
1
+ import o from "./index64.js";
2
+ /* empty css */
3
+ export {
4
+ o as default
5
+ };
6
+ //# sourceMappingURL=index160.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index160.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
package/dist/index161.js CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index120.js";
1
+ import o from "./index121.js";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index163.js CHANGED
@@ -1,5 +1,5 @@
1
- import o from "./index64.js";
2
- /* empty css */
1
+ import o from "./index122.js";
2
+ /* empty css */
3
3
  export {
4
4
  o as default
5
5
  };
package/dist/index165.js CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index68.js";
1
+ import o from "./index66.js";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index166.js CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index70.js";
1
+ import o from "./index68.js";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index167.js CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index72.js";
1
+ import o from "./index70.js";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index168.js CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index74.js";
1
+ import o from "./index72.js";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index169.js CHANGED
@@ -1,5 +1,5 @@
1
- import o from "./index121.js";
2
- /* empty css */
1
+ import o from "./index74.js";
2
+ /* empty css */
3
3
  export {
4
4
  o as default
5
5
  };
@@ -0,0 +1,6 @@
1
+ import o from "./index76.js";
2
+ /* empty css */
3
+ export {
4
+ o as default
5
+ };
6
+ //# sourceMappingURL=index170.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index170.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
package/dist/index171.js CHANGED
@@ -1,5 +1,6 @@
1
- import f from "./index76.js";
1
+ import o from "./index123.js";
2
+ /* empty css */
2
3
  export {
3
- f as default
4
+ o as default
4
5
  };
5
6
  //# sourceMappingURL=index171.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index171.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"index171.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
package/dist/index173.js CHANGED
@@ -1,6 +1,5 @@
1
- import o from "./index79.js";
2
- /* empty css */
1
+ import f from "./index78.js";
3
2
  export {
4
- o as default
3
+ f as default
5
4
  };
6
5
  //# sourceMappingURL=index173.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index173.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"index173.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}