bitboss-ui 0.2.76 → 1.0.1

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 (491) hide show
  1. package/dist/components/BaseCheckbox/BaseCheckbox.vue.d.ts +4 -0
  2. package/dist/components/BaseCheckboxGroup/BaseCheckboxGroup.vue.d.ts +10 -3
  3. package/dist/components/BaseDatePicker/BaseDatePicker.vue.d.ts +4 -1
  4. package/dist/components/BaseDatePickerInput/BaseDatePickerInput.vue.d.ts +10 -4
  5. package/dist/components/BaseInputContainer/BaseInputContainer.vue.d.ts +9 -0
  6. package/dist/components/BaseNumberInput/BaseNumberInput.vue.d.ts +4 -0
  7. package/dist/components/BaseRadio/BaseRadio.vue.d.ts +4 -0
  8. package/dist/components/BaseRadioGroup/BaseRadioGroup.vue.d.ts +10 -3
  9. package/dist/components/BaseRating/BaseRating.vue.d.ts +5 -1
  10. package/dist/components/BaseSelect/BaseSelect.vue.d.ts +4 -0
  11. package/dist/components/BaseSlider/BaseSlider.vue.d.ts +48 -11
  12. package/dist/components/BaseSwitchGroup/BaseSwitchGroup.vue.d.ts +6 -3
  13. package/dist/components/BaseTag/BaseTag.vue.d.ts +4 -0
  14. package/dist/components/BaseTextInput/BaseTextInput.vue.d.ts +10 -6
  15. package/dist/components/BaseTextarea/BaseTextarea.vue.d.ts +4 -0
  16. package/dist/components/BbButton/BbButton.vue.d.ts +12 -0
  17. package/dist/components/BbCheckbox/BbCheckbox.vue.d.ts +35 -27
  18. package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +38 -24
  19. package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +15 -3
  20. package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +33 -25
  21. package/dist/components/BbRadio/BbRadio.vue.d.ts +33 -25
  22. package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +38 -24
  23. package/dist/components/BbRating/BbRating.vue.d.ts +9 -1
  24. package/dist/components/BbSelect/BbSelect.vue.d.ts +18 -4
  25. package/dist/components/BbSlider/BbSlider.vue.d.ts +44 -11
  26. package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +9 -3
  27. package/dist/components/BbTag/BbTag.vue.d.ts +11 -3
  28. package/dist/components/BbTextInput/BbTextInput.vue.d.ts +33 -25
  29. package/dist/components/BbTextarea/BbTextarea.vue.d.ts +9 -1
  30. package/dist/composables/useQueue.d.ts +58 -0
  31. package/dist/index.js +186 -185
  32. package/dist/index.js.map +1 -1
  33. package/dist/index10.js +65 -1
  34. package/dist/index10.js.map +1 -1
  35. package/dist/index100.js +227 -1
  36. package/dist/index100.js.map +1 -1
  37. package/dist/index101.js +1 -437
  38. package/dist/index101.js.map +1 -1
  39. package/dist/index102.js +437 -1
  40. package/dist/index102.js.map +1 -1
  41. package/dist/index103.js +1 -94
  42. package/dist/index103.js.map +1 -1
  43. package/dist/index104.js +103 -1
  44. package/dist/index104.js.map +1 -1
  45. package/dist/index105.js +1 -88
  46. package/dist/index105.js.map +1 -1
  47. package/dist/index106.js +97 -1
  48. package/dist/index106.js.map +1 -1
  49. package/dist/index107.js +1 -89
  50. package/dist/index107.js.map +1 -1
  51. package/dist/index108.js +98 -1
  52. package/dist/index108.js.map +1 -1
  53. package/dist/index109.js +1 -29
  54. package/dist/index109.js.map +1 -1
  55. package/dist/index11.js +1 -131
  56. package/dist/index11.js.map +1 -1
  57. package/dist/index110.js +29 -1
  58. package/dist/index110.js.map +1 -1
  59. package/dist/index111.js +1 -151
  60. package/dist/index111.js.map +1 -1
  61. package/dist/index112.js +151 -1
  62. package/dist/index112.js.map +1 -1
  63. package/dist/index113.js +1 -122
  64. package/dist/index113.js.map +1 -1
  65. package/dist/index114.js +122 -1
  66. package/dist/index114.js.map +1 -1
  67. package/dist/index115.js +1 -46
  68. package/dist/index115.js.map +1 -1
  69. package/dist/index116.js +40 -33
  70. package/dist/index116.js.map +1 -1
  71. package/dist/index117.js +32 -39
  72. package/dist/index117.js.map +1 -1
  73. package/dist/index118.js +39 -42
  74. package/dist/index118.js.map +1 -1
  75. package/dist/index119.js +43 -39
  76. package/dist/index119.js.map +1 -1
  77. package/dist/index12.js +128 -1
  78. package/dist/index12.js.map +1 -1
  79. package/dist/index120.js +43 -2
  80. package/dist/index120.js.map +1 -1
  81. package/dist/index121.js +2 -21
  82. package/dist/index121.js.map +1 -1
  83. package/dist/index122.js +21 -2
  84. package/dist/index122.js.map +1 -1
  85. package/dist/index123.js +2 -224
  86. package/dist/index123.js.map +1 -1
  87. package/dist/index124.js +224 -2
  88. package/dist/index124.js.map +1 -1
  89. package/dist/index125.js +2 -18
  90. package/dist/index125.js.map +1 -1
  91. package/dist/index126.js +16 -10
  92. package/dist/index126.js.map +1 -1
  93. package/dist/index127.js +12 -24
  94. package/dist/index127.js.map +1 -1
  95. package/dist/index128.js +24 -5
  96. package/dist/index128.js.map +1 -1
  97. package/dist/index129.js +5 -9
  98. package/dist/index129.js.map +1 -1
  99. package/dist/index13.js +1 -159
  100. package/dist/index13.js.map +1 -1
  101. package/dist/index130.js +8 -5
  102. package/dist/index130.js.map +1 -1
  103. package/dist/index131.js +5 -69
  104. package/dist/index131.js.map +1 -1
  105. package/dist/index132.js +70 -3
  106. package/dist/index132.js.map +1 -1
  107. package/dist/index133.js +2 -2
  108. package/dist/index134.js +2 -2
  109. package/dist/index135.js +2 -2
  110. package/dist/index136.js +2 -2
  111. package/dist/index137.js +2 -2
  112. package/dist/index138.js +2 -2
  113. package/dist/index139.js +2 -2
  114. package/dist/index14.js +161 -1
  115. package/dist/index14.js.map +1 -1
  116. package/dist/index140.js +2 -2
  117. package/dist/index141.js +2 -2
  118. package/dist/index142.js +2 -2
  119. package/dist/index143.js +2 -2
  120. package/dist/index144.js +2 -2
  121. package/dist/index145.js +2 -2
  122. package/dist/index146.js +2 -2
  123. package/dist/index147.js +2 -2
  124. package/dist/index148.js +2 -2
  125. package/dist/index149.js +2 -2
  126. package/dist/index15.js +1 -457
  127. package/dist/index15.js.map +1 -1
  128. package/dist/index150.js +2 -2
  129. package/dist/index151.js +2 -2
  130. package/dist/index152.js +2 -2
  131. package/dist/index153.js +2 -2
  132. package/dist/index154.js +2 -2
  133. package/dist/index155.js +2 -2
  134. package/dist/index156.js +2 -2
  135. package/dist/index157.js +2 -2
  136. package/dist/index158.js +5 -1
  137. package/dist/index158.js.map +1 -1
  138. package/dist/index159.js +1 -5
  139. package/dist/index159.js.map +1 -1
  140. package/dist/index16.js +514 -1
  141. package/dist/index16.js.map +1 -1
  142. package/dist/index160.js +5 -1
  143. package/dist/index160.js.map +1 -1
  144. package/dist/index161.js +1 -5
  145. package/dist/index161.js.map +1 -1
  146. package/dist/index162.js +2 -2
  147. package/dist/index163.js +2 -2
  148. package/dist/index164.js +2 -2
  149. package/dist/index165.js +2 -2
  150. package/dist/index166.js +2 -2
  151. package/dist/index167.js +3 -2
  152. package/dist/index167.js.map +1 -1
  153. package/dist/index168.js +2 -3
  154. package/dist/index168.js.map +1 -1
  155. package/dist/index169.js +5 -1
  156. package/dist/index169.js.map +1 -1
  157. package/dist/index17.js +1 -211
  158. package/dist/index17.js.map +1 -1
  159. package/dist/index170.js +1 -4
  160. package/dist/index170.js.map +1 -1
  161. package/dist/index171.js +2 -3
  162. package/dist/index171.js.map +1 -1
  163. package/dist/index172.js +2 -2
  164. package/dist/index173.js +2 -2
  165. package/dist/index174.js +2 -2
  166. package/dist/index175.js +2 -2
  167. package/dist/index176.js +2 -2
  168. package/dist/index177.js +2 -2
  169. package/dist/index178.js +2 -2
  170. package/dist/index179.js +2 -2
  171. package/dist/index18.js +220 -1
  172. package/dist/index18.js.map +1 -1
  173. package/dist/index180.js +2 -2
  174. package/dist/index181.js +2 -2
  175. package/dist/index182.js +2 -2
  176. package/dist/index183.js +5 -1
  177. package/dist/index183.js.map +1 -1
  178. package/dist/index184.js +1 -5
  179. package/dist/index184.js.map +1 -1
  180. package/dist/index185.js +5 -1
  181. package/dist/index185.js.map +1 -1
  182. package/dist/index186.js +1 -5
  183. package/dist/index186.js.map +1 -1
  184. package/dist/index187.js +2 -2
  185. package/dist/index188.js +2 -2
  186. package/dist/index189.js +2 -2
  187. package/dist/index19.js +1 -239
  188. package/dist/index19.js.map +1 -1
  189. package/dist/index190.js +2 -2
  190. package/dist/index191.js +2 -2
  191. package/dist/index192.js +2 -2
  192. package/dist/index193.js +2 -2
  193. package/dist/index194.js +2 -2
  194. package/dist/index195.js +2 -2
  195. package/dist/index196.js +3 -10
  196. package/dist/index196.js.map +1 -1
  197. package/dist/index197.js +3 -2
  198. package/dist/index197.js.map +1 -1
  199. package/dist/index198.js +3 -3
  200. package/dist/index198.js.map +1 -1
  201. package/dist/index199.js +2 -3
  202. package/dist/index199.js.map +1 -1
  203. package/dist/index2.js +1 -42
  204. package/dist/index2.js.map +1 -1
  205. package/dist/index20.js +239 -1
  206. package/dist/index20.js.map +1 -1
  207. package/dist/index200.js +4 -368
  208. package/dist/index200.js.map +1 -1
  209. package/dist/index201.js +2 -134
  210. package/dist/index201.js.map +1 -1
  211. package/dist/index202.js +2 -5
  212. package/dist/index202.js.map +1 -1
  213. package/dist/index203.js +2 -19
  214. package/dist/index203.js.map +1 -1
  215. package/dist/index204.js +121 -2
  216. package/dist/index204.js.map +1 -1
  217. package/dist/index205.js +2 -2
  218. package/dist/index205.js.map +1 -1
  219. package/dist/index206.js +2 -174
  220. package/dist/index206.js.map +1 -1
  221. package/dist/index207.js +6 -23
  222. package/dist/index207.js.map +1 -1
  223. package/dist/index208.js +345 -350
  224. package/dist/index208.js.map +1 -1
  225. package/dist/index209.js +371 -14
  226. package/dist/index209.js.map +1 -1
  227. package/dist/index21.js +1 -115
  228. package/dist/index21.js.map +1 -1
  229. package/dist/index210.js +3 -16
  230. package/dist/index210.js.map +1 -1
  231. package/dist/index211.js +35 -20
  232. package/dist/index211.js.map +1 -1
  233. package/dist/index212.js +130 -25
  234. package/dist/index212.js.map +1 -1
  235. package/dist/index213.js +5 -8
  236. package/dist/index213.js.map +1 -1
  237. package/dist/index214.js +18 -234
  238. package/dist/index214.js.map +1 -1
  239. package/dist/index215.js +174 -3
  240. package/dist/index215.js.map +1 -1
  241. package/dist/index216.js +16 -35
  242. package/dist/index216.js.map +1 -1
  243. package/dist/index217.js +16 -6
  244. package/dist/index217.js.map +1 -1
  245. package/dist/index218.js +20 -2
  246. package/dist/index218.js.map +1 -1
  247. package/dist/index219.js +29 -2
  248. package/dist/index219.js.map +1 -1
  249. package/dist/index22.js +131 -1
  250. package/dist/index22.js.map +1 -1
  251. package/dist/index220.js +8 -4
  252. package/dist/index220.js.map +1 -1
  253. package/dist/index221.js +226 -112
  254. package/dist/index221.js.map +1 -1
  255. package/dist/index222.js +10 -2
  256. package/dist/index222.js.map +1 -1
  257. package/dist/index224.js +23 -6
  258. package/dist/index224.js.map +1 -1
  259. package/dist/index225.js +224 -17
  260. package/dist/index225.js.map +1 -1
  261. package/dist/index226.js +253 -74
  262. package/dist/index226.js.map +1 -1
  263. package/dist/index227.js +4 -2
  264. package/dist/index227.js.map +1 -1
  265. package/dist/index228.js +6 -160
  266. package/dist/index228.js.map +1 -1
  267. package/dist/index229.js +19 -1
  268. package/dist/index229.js.map +1 -1
  269. package/dist/index23.js +1 -115
  270. package/dist/index23.js.map +1 -1
  271. package/dist/index230.js +106 -5
  272. package/dist/index230.js.map +1 -1
  273. package/dist/index231.js +433 -67
  274. package/dist/index231.js.map +1 -1
  275. package/dist/index232.js +83 -218
  276. package/dist/index232.js.map +1 -1
  277. package/dist/index233.js +74 -253
  278. package/dist/index233.js.map +1 -1
  279. package/dist/index234.js +2 -6
  280. package/dist/index234.js.map +1 -1
  281. package/dist/index235.js +69 -2
  282. package/dist/index235.js.map +1 -1
  283. package/dist/index236.js +163 -294
  284. package/dist/index236.js.map +1 -1
  285. package/dist/index237.js +1 -4
  286. package/dist/index237.js.map +1 -1
  287. package/dist/index238.js +117 -2
  288. package/dist/index238.js.map +1 -1
  289. package/dist/index239.js +199 -116
  290. package/dist/index239.js.map +1 -1
  291. package/dist/index24.js +119 -1
  292. package/dist/index24.js.map +1 -1
  293. package/dist/index240.js +5 -105
  294. package/dist/index240.js.map +1 -1
  295. package/dist/index241.js +2 -15
  296. package/dist/index241.js.map +1 -1
  297. package/dist/index242.js +295 -2
  298. package/dist/index242.js.map +1 -1
  299. package/dist/index243.js +2 -2
  300. package/dist/index245.js +5 -2
  301. package/dist/index245.js.map +1 -1
  302. package/dist/index246.js +2 -435
  303. package/dist/index246.js.map +1 -1
  304. package/dist/index247.js +2 -89
  305. package/dist/index247.js.map +1 -1
  306. package/dist/index248.js +2 -200
  307. package/dist/index248.js.map +1 -1
  308. package/dist/index249.js +2 -4
  309. package/dist/index249.js.map +1 -1
  310. package/dist/index25.js +1 -92
  311. package/dist/index25.js.map +1 -1
  312. package/dist/index250.js +1 -1
  313. package/dist/index251.js +15 -4
  314. package/dist/index251.js.map +1 -1
  315. package/dist/index252.js +4 -4
  316. package/dist/index252.js.map +1 -1
  317. package/dist/index253.js +4 -61
  318. package/dist/index253.js.map +1 -1
  319. package/dist/index254.js +61 -2
  320. package/dist/index254.js.map +1 -1
  321. package/dist/index255.js +2 -3
  322. package/dist/index255.js.map +1 -1
  323. package/dist/index256.js +3 -2
  324. package/dist/index256.js.map +1 -1
  325. package/dist/index257.js +5 -0
  326. package/dist/index257.js.map +1 -0
  327. package/dist/index26.js +94 -1
  328. package/dist/index26.js.map +1 -1
  329. package/dist/index27.js +1 -157
  330. package/dist/index27.js.map +1 -1
  331. package/dist/index28.js +160 -1
  332. package/dist/index28.js.map +1 -1
  333. package/dist/index29.js +1 -124
  334. package/dist/index29.js.map +1 -1
  335. package/dist/index3.js +38 -76
  336. package/dist/index3.js.map +1 -1
  337. package/dist/index30.js +126 -1
  338. package/dist/index30.js.map +1 -1
  339. package/dist/index31.js +1 -691
  340. package/dist/index31.js.map +1 -1
  341. package/dist/index32.js +693 -1
  342. package/dist/index32.js.map +1 -1
  343. package/dist/index33.js +1 -145
  344. package/dist/index33.js.map +1 -1
  345. package/dist/index34.js +302 -1
  346. package/dist/index34.js.map +1 -1
  347. package/dist/index35.js +1 -118
  348. package/dist/index35.js.map +1 -1
  349. package/dist/index36.js +120 -1
  350. package/dist/index36.js.map +1 -1
  351. package/dist/index37.js +1 -154
  352. package/dist/index37.js.map +1 -1
  353. package/dist/index38.js +156 -1
  354. package/dist/index38.js.map +1 -1
  355. package/dist/index39.js +1 -83
  356. package/dist/index39.js.map +1 -1
  357. package/dist/index4.js +78 -62
  358. package/dist/index4.js.map +1 -1
  359. package/dist/index40.js +87 -1
  360. package/dist/index40.js.map +1 -1
  361. package/dist/index41.js +1 -61
  362. package/dist/index41.js.map +1 -1
  363. package/dist/index42.js +64 -1
  364. package/dist/index42.js.map +1 -1
  365. package/dist/index43.js +1 -65
  366. package/dist/index43.js.map +1 -1
  367. package/dist/index44.js +65 -1
  368. package/dist/index44.js.map +1 -1
  369. package/dist/index45.js +1 -96
  370. package/dist/index45.js.map +1 -1
  371. package/dist/index46.js +96 -1
  372. package/dist/index46.js.map +1 -1
  373. package/dist/index47.js +1 -61
  374. package/dist/index47.js.map +1 -1
  375. package/dist/index48.js +61 -1
  376. package/dist/index48.js.map +1 -1
  377. package/dist/index49.js +1 -49
  378. package/dist/index49.js.map +1 -1
  379. package/dist/index5.js +60 -38
  380. package/dist/index5.js.map +1 -1
  381. package/dist/index50.js +49 -1
  382. package/dist/index50.js.map +1 -1
  383. package/dist/index51.js +1 -62
  384. package/dist/index51.js.map +1 -1
  385. package/dist/index52.js +62 -1
  386. package/dist/index52.js.map +1 -1
  387. package/dist/index53.js +1 -45
  388. package/dist/index53.js.map +1 -1
  389. package/dist/index54.js +69 -1
  390. package/dist/index54.js.map +1 -1
  391. package/dist/index55.js +1 -89
  392. package/dist/index55.js.map +1 -1
  393. package/dist/index56.js +98 -1
  394. package/dist/index56.js.map +1 -1
  395. package/dist/index57.js +1 -120
  396. package/dist/index57.js.map +1 -1
  397. package/dist/index58.js +129 -1
  398. package/dist/index58.js.map +1 -1
  399. package/dist/index59.js +1 -85
  400. package/dist/index59.js.map +1 -1
  401. package/dist/index6.js +37 -171
  402. package/dist/index6.js.map +1 -1
  403. package/dist/index60.js +85 -1
  404. package/dist/index60.js.map +1 -1
  405. package/dist/index61.js +1 -88
  406. package/dist/index61.js.map +1 -1
  407. package/dist/index62.js +98 -1
  408. package/dist/index62.js.map +1 -1
  409. package/dist/index63.js +1 -59
  410. package/dist/index63.js.map +1 -1
  411. package/dist/index64.js +59 -1
  412. package/dist/index64.js.map +1 -1
  413. package/dist/index65.js +1 -313
  414. package/dist/index65.js.map +1 -1
  415. package/dist/index66.js +313 -1
  416. package/dist/index66.js.map +1 -1
  417. package/dist/index67.js +1 -129
  418. package/dist/index67.js.map +1 -1
  419. package/dist/index68.js +129 -1
  420. package/dist/index68.js.map +1 -1
  421. package/dist/index69.js +1 -225
  422. package/dist/index69.js.map +1 -1
  423. package/dist/index7.js +172 -18
  424. package/dist/index7.js.map +1 -1
  425. package/dist/index70.js +225 -1
  426. package/dist/index70.js.map +1 -1
  427. package/dist/index71.js +1 -24
  428. package/dist/index71.js.map +1 -1
  429. package/dist/index72.js +19 -41
  430. package/dist/index72.js.map +1 -1
  431. package/dist/index73.js +37 -86
  432. package/dist/index73.js.map +1 -1
  433. package/dist/index74.js +104 -1
  434. package/dist/index74.js.map +1 -1
  435. package/dist/index75.js +1 -227
  436. package/dist/index75.js.map +1 -1
  437. package/dist/index76.js +227 -1
  438. package/dist/index76.js.map +1 -1
  439. package/dist/index77.js +1 -143
  440. package/dist/index77.js.map +1 -1
  441. package/dist/index78.js +165 -1
  442. package/dist/index78.js.map +1 -1
  443. package/dist/index79.js +1 -213
  444. package/dist/index79.js.map +1 -1
  445. package/dist/index8.js +18 -192
  446. package/dist/index8.js.map +1 -1
  447. package/dist/index80.js +213 -1
  448. package/dist/index80.js.map +1 -1
  449. package/dist/index81.js +1 -35
  450. package/dist/index81.js.map +1 -1
  451. package/dist/index82.js +35 -1
  452. package/dist/index82.js.map +1 -1
  453. package/dist/index83.js +1 -83
  454. package/dist/index83.js.map +1 -1
  455. package/dist/index84.js +92 -1
  456. package/dist/index84.js.map +1 -1
  457. package/dist/index85.js +1 -120
  458. package/dist/index85.js.map +1 -1
  459. package/dist/index86.js +129 -1
  460. package/dist/index86.js.map +1 -1
  461. package/dist/index87.js +1 -83
  462. package/dist/index87.js.map +1 -1
  463. package/dist/index88.js +92 -1
  464. package/dist/index88.js.map +1 -1
  465. package/dist/index89.js +1 -30
  466. package/dist/index89.js.map +1 -1
  467. package/dist/index9.js +192 -61
  468. package/dist/index9.js.map +1 -1
  469. package/dist/index90.js +30 -1
  470. package/dist/index90.js.map +1 -1
  471. package/dist/index91.js +1 -157
  472. package/dist/index91.js.map +1 -1
  473. package/dist/index92.js +166 -1
  474. package/dist/index92.js.map +1 -1
  475. package/dist/index93.js +1 -86
  476. package/dist/index93.js.map +1 -1
  477. package/dist/index94.js +112 -1
  478. package/dist/index94.js.map +1 -1
  479. package/dist/index95.js +1 -89
  480. package/dist/index95.js.map +1 -1
  481. package/dist/index96.js +98 -1
  482. package/dist/index96.js.map +1 -1
  483. package/dist/index97.js +1 -119
  484. package/dist/index97.js.map +1 -1
  485. package/dist/index98.js +129 -1
  486. package/dist/index98.js.map +1 -1
  487. package/dist/index99.js +1 -227
  488. package/dist/index99.js.map +1 -1
  489. package/dist/style.css +1 -1
  490. package/dist/utilities/functions/last.d.ts +1 -1
  491. package/package.json +2 -2
package/dist/index26.js CHANGED
@@ -1,2 +1,95 @@
1
-
1
+ import { defineComponent as g, computed as r, ref as _, openBlock as w, createElementBlock as B, normalizeClass as C, createElementVNode as l, normalizeProps as t, guardReactiveProps as u, renderSlot as V } from "vue";
2
+ import { isCssColor as i } from "./index199.js";
3
+ import { when as E } from "./index200.js";
4
+ const N = {
5
+ "aria-hidden": "true",
6
+ class: "bb-base-radio-container"
7
+ }, x = /* @__PURE__ */ g({
8
+ __name: "BaseRadio",
9
+ props: {
10
+ ariaDescribedby: {},
11
+ autofocus: {},
12
+ checked: {},
13
+ color: {},
14
+ disabled: { type: Boolean },
15
+ hasErrors: { type: Boolean },
16
+ id: {},
17
+ modelValue: {},
18
+ name: {},
19
+ readonly: {},
20
+ value: {}
21
+ },
22
+ emits: ["blur", "change", "click", "focus", "input", "keydown", "mousedown", "mouseup", "update:modelValue"],
23
+ setup(b, { emit: p }) {
24
+ const e = b, a = p, c = r(() => e.checked ? !0 : JSON.stringify(e.modelValue) === JSON.stringify(e.value)), n = _(!1), m = r(() => ({
25
+ "bb-base-radio": !0,
26
+ "bb-base-radio--disabled": e.disabled,
27
+ "bb-base-radio--errors": e.hasErrors,
28
+ "bb-base-radio--readonly": e.readonly,
29
+ [`bb-base-radio--${e.color}`]: e.color && !i(e.color)
30
+ })), f = E(
31
+ (s) => typeof s != "string",
32
+ JSON.stringify
33
+ ), d = r(() => {
34
+ const s = f(e.value), k = {
35
+ onBlur: (o) => {
36
+ n.value = !1, a("blur", o);
37
+ },
38
+ onChange: (o) => {
39
+ a("change", o), a("update:modelValue", e.value);
40
+ },
41
+ onClick: (o) => a("click", o),
42
+ onFocus: (o) => {
43
+ n.value = !0, a("focus", o);
44
+ },
45
+ onInput: (o) => a("input", o),
46
+ onKeydown: (o) => a("keydown", o),
47
+ onMousedown: (o) => a("mousedown", o),
48
+ onMouseup: (o) => a("mouseup", o)
49
+ };
50
+ return {
51
+ "aria-describedby": e.ariaDescribedby,
52
+ autofocus: e.autofocus,
53
+ checked: c.value,
54
+ // There is no such thing as readonly radio so we disable and style it with css
55
+ disabled: e.disabled || e.readonly,
56
+ id: e.id,
57
+ name: e.name,
58
+ tabindex: e.disabled ? -1 : void 0,
59
+ type: "radio",
60
+ value: s,
61
+ ...k
62
+ };
63
+ }), v = r(() => ({
64
+ checked: c.value,
65
+ disabled: e.disabled,
66
+ focused: n.value,
67
+ hasErrors: e.hasErrors,
68
+ id: e.id,
69
+ name: e.name,
70
+ parsedValue: d.value.value,
71
+ readonly: e.readonly,
72
+ value: e.value
73
+ })), y = r(() => {
74
+ let s = {};
75
+ return e.color && i(e.color) && (s.color = e.color), {
76
+ class: "bb-base-radio-container__icon",
77
+ style: s
78
+ };
79
+ });
80
+ return (s, h) => (w(), B("span", {
81
+ class: C(m.value)
82
+ }, [
83
+ l("input", t(u(d.value)), null, 16),
84
+ l("span", N, [
85
+ V(s.$slots, "icon", t(u(v.value)), () => [
86
+ l("span", t(u(y.value)), null, 16)
87
+ ])
88
+ ])
89
+ ], 2));
90
+ }
91
+ });
92
+ export {
93
+ x as default
94
+ };
2
95
  //# sourceMappingURL=index26.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index26.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"index26.js","sources":["../src/components/BaseRadio/BaseRadio.vue"],"sourcesContent":["<template>\n\t<span :class=\"classes\">\n\t\t<input v-bind=\"inputAttributes\" />\n\t\t<span aria-hidden=\"true\" class=\"bb-base-radio-container\">\n\t\t\t<slot name=\"icon\" v-bind=\"slotAttributes\">\n\t\t\t\t<span v-bind=\"iconAttributes\"></span>\n\t\t\t</slot>\n\t\t</span>\n\t</span>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref } from 'vue';\nimport { isCssColor } from '@/utilities/functions/isCssColor';\nimport { when } from '@/utilities/functions/when';\nimport type { InputHTMLAttributes, HTMLAttributes } from 'vue';\n\nexport type BaseRadioProps = {\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 * Defines the input as checked\n\t */\n\tchecked?: InputHTMLAttributes['checked'];\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 * 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 * Used by v-model. Can be any serializable type.\n\t */\n\tmodelValue?: any;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname: InputHTMLAttributes['name'];\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: InputHTMLAttributes['readonly'];\n\n\t/**\n\t * Defines the value of the radio input.\n\t * It can be any serializable value.\n\t */\n\tvalue: any;\n};\n\nexport type BaseRadioEvents = {\n\t(e: 'blur', event: FocusEvent): void;\n\n\t(e: 'change', event: Event): void;\n\n\t(e: 'click', event: MouseEvent): void;\n\n\t(e: 'focus', event: FocusEvent): void;\n\n\t(e: 'input', event: Event): void;\n\n\t(e: 'keydown', event: KeyboardEvent): void;\n\n\t(e: 'mousedown', event: MouseEvent): void;\n\n\t(e: 'mouseup', event: MouseEvent): void;\n\n\t(e: 'update:modelValue', value: any): void;\n};\n\nexport type SlotAttributes = {\n\tchecked: boolean;\n\n\tdisabled: Exclude<BaseRadioProps['disabled'], undefined>;\n\n\tfocused: boolean;\n\n\thasErrors: Exclude<BaseRadioProps['hasErrors'], undefined>;\n\n\tid: BaseRadioProps['id'];\n\n\tname: BaseRadioProps['name'];\n\n\tparsedValue: any;\n\n\treadonly: BaseRadioProps['readonly'];\n\n\tvalue: any;\n};\nconst props = defineProps<BaseRadioProps>();\n\nconst emit = defineEmits<BaseRadioEvents>();\n\ndefineSlots<{\n\ticon?: (props: SlotAttributes) => any;\n}>();\n\nconst checked = computed(() => {\n\tif (props.checked) return true;\n\treturn JSON.stringify(props.modelValue) === JSON.stringify(props.value);\n});\nconst hasFocus = ref(false);\n\nconst classes = computed(() => {\n\treturn {\n\t\t'bb-base-radio': true,\n\t\t'bb-base-radio--disabled': props.disabled,\n\t\t'bb-base-radio--errors': props.hasErrors,\n\t\t'bb-base-radio--readonly': props.readonly,\n\t\t[`bb-base-radio--${props.color}`]: props.color && !isCssColor(props.color),\n\t};\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 inputAttributes = computed(() => {\n\tconst value = makeInputValue(props.value);\n\n\tconst onBlur = (event: FocusEvent): void => {\n\t\thasFocus.value = false;\n\t\temit('blur', event);\n\t};\n\tconst onChange = (event: Event): void => {\n\t\temit('change', event);\n\t\temit('update:modelValue', props.value);\n\t};\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 radio so we disable and style it with css\n\t\tdisabled: props.disabled || props.readonly,\n\t\tid: props.id,\n\t\tname: props.name,\n\t\ttabindex: props.disabled ? -1 : undefined,\n\t\ttype: 'radio',\n\t\tvalue: value,\n\t\t...eventListeners,\n\t};\n});\n\nconst slotAttributes = computed<SlotAttributes>(() => ({\n\tchecked: checked.value,\n\tdisabled: props.disabled,\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\tvalue: props.value,\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-radio-container__icon',\n\t\tstyle,\n\t};\n});\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BaseRadio';\n</style>\n"],"names":["props","__props","emit","__emit","checked","computed","hasFocus","ref","classes","isCssColor","makeInputValue","when","item","inputAttributes","value","eventListeners","event","slotAttributes","iconAttributes","style"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAqHA,UAAMA,IAAQC,GAERC,IAAOC,GAMPC,IAAUC,EAAS,MACpBL,EAAM,UAAgB,KACnB,KAAK,UAAUA,EAAM,UAAU,MAAM,KAAK,UAAUA,EAAM,KAAK,CACtE,GACKM,IAAWC,EAAI,EAAK,GAEpBC,IAAUH,EAAS,OACjB;AAAA,MACN,iBAAiB;AAAA,MACjB,2BAA2BL,EAAM;AAAA,MACjC,yBAAyBA,EAAM;AAAA,MAC/B,2BAA2BA,EAAM;AAAA,MACjC,CAAC,kBAAkBA,EAAM,KAAK,EAAE,GAAGA,EAAM,SAAS,CAACS,EAAWT,EAAM,KAAK;AAAA,IAAA,EAE1E,GAMKU,IAAiBC;AAAA,MACtB,CAACC,MAAkB,OAAOA,KAAS;AAAA,MACnC,KAAK;AAAA,IAAA,GAGAC,IAAkBR,EAAS,MAAM;AAChC,YAAAS,IAAQJ,EAAeV,EAAM,KAAK,GAelCe,IAAiB;AAAA,QACtB,QAdc,CAACC,MAA4B;AAC3C,UAAAV,EAAS,QAAQ,IACjBJ,EAAK,QAAQc,CAAK;AAAA,QAAA;AAAA,QAalB,UAXgB,CAACA,MAAuB;AACxC,UAAAd,EAAK,UAAUc,CAAK,GACfd,EAAA,qBAAqBF,EAAM,KAAK;AAAA,QAAA;AAAA,QAUrC,SAAS,CAACgB,MAAsBd,EAAK,SAASc,CAAK;AAAA,QACnD,SATe,CAACA,MAA4B;AAC5C,UAAAV,EAAS,QAAQ,IACjBJ,EAAK,SAASc,CAAK;AAAA,QAAA;AAAA,QAQnB,SAAS,CAACA,MAAiBd,EAAK,SAASc,CAAK;AAAA,QAC9C,WAAW,CAACA,MAAyBd,EAAK,WAAWc,CAAK;AAAA,QAC1D,aAAa,CAACA,MAAsBd,EAAK,aAAac,CAAK;AAAA,QAC3D,WAAW,CAACA,MAAsBd,EAAK,WAAWc,CAAK;AAAA,MAAA;AAGjD,aAAA;AAAA,QACN,oBAAoBhB,EAAM;AAAA,QAC1B,WAAWA,EAAM;AAAA,QACjB,SAASI,EAAQ;AAAA;AAAA,QAEjB,UAAUJ,EAAM,YAAYA,EAAM;AAAA,QAClC,IAAIA,EAAM;AAAA,QACV,MAAMA,EAAM;AAAA,QACZ,UAAUA,EAAM,WAAW,KAAK;AAAA,QAChC,MAAM;AAAA,QACN,OAAAc;AAAA,QACA,GAAGC;AAAA,MAAA;AAAA,IACJ,CACA,GAEKE,IAAiBZ,EAAyB,OAAO;AAAA,MACtD,SAASD,EAAQ;AAAA,MACjB,UAAUJ,EAAM;AAAA,MAChB,SAASM,EAAS;AAAA,MAClB,WAAWN,EAAM;AAAA,MACjB,IAAIA,EAAM;AAAA,MACV,MAAMA,EAAM;AAAA,MACZ,aAAaa,EAAgB,MAAM;AAAA,MACnC,UAAUb,EAAM;AAAA,MAChB,OAAOA,EAAM;AAAA,IACZ,EAAA,GAEIkB,IAAiBb,EAAS,MAAM;AACrC,UAAIc,IAAmC,CAAA;AACvC,aAAInB,EAAM,SAASS,EAAWT,EAAM,KAAK,MACxCmB,EAAM,QAAQnB,EAAM,QAEd;AAAA,QACN,OAAO;AAAA,QACP,OAAAmB;AAAA,MAAA;AAAA,IACD,CACA;;;;;;;;;;;;;"}
package/dist/index27.js CHANGED
@@ -1,158 +1,2 @@
1
- import { defineComponent as B, ref as k, toRef as l, openBlock as r, createElementBlock as d, normalizeClass as p, createElementVNode as g, renderSlot as s, unref as u, createTextVNode as h, toDisplayString as v, createCommentVNode as w, Fragment as V, renderList as z, createVNode as S, mergeProps as T, createSlots as _, withCtx as F } from "vue";
2
- import { useOptions as N } from "./index6.js";
3
- import M from "./index25.js";
4
- import "./index26.js";
5
- const H = { class: "bb-base-radio-group__container" }, I = {
6
- key: 0,
7
- class: "bb-base-radio-group__loading-container"
8
- }, R = {
9
- key: 1,
10
- class: "bb-base-select__no-data-container"
11
- }, P = /* @__PURE__ */ B({
12
- __name: "BaseRadioGroup",
13
- props: {
14
- autofocus: {},
15
- color: {},
16
- dependencies: {},
17
- depsDebounceTime: { default: 0 },
18
- direction: { default: "horizontal" },
19
- disabled: { type: Boolean },
20
- enforceCoherence: { type: Boolean },
21
- hasErrors: { type: Boolean },
22
- hideLabel: { type: Boolean },
23
- id: {},
24
- items: { type: [Array, Function], default: () => [] },
25
- itemText: {},
26
- itemValue: {},
27
- loadingText: { default: "Caricamento..." },
28
- matchStrategy: { default: "string" },
29
- modelValue: {},
30
- modelValueDebounceTime: { default: 0 },
31
- name: {},
32
- noDataText: { default: "Nessun elemento da visualizzare" },
33
- readonly: {}
34
- },
35
- emits: ["blur", "change", "click", "focus", "input", "keydown", "mousedown", "mouseup", "update:modelValue", "inactive"],
36
- setup(E, { emit: L }) {
37
- const o = E, t = L, c = k(), i = k(!1), { loading: C, options: m } = N({
38
- dependencies: l(() => o.dependencies),
39
- depsDebounceTime: o.depsDebounceTime,
40
- disabled: l(() => o.disabled),
41
- emitter: (e) => t("update:modelValue", e),
42
- enforceCoherence: l(() => o.enforceCoherence),
43
- id: o.id,
44
- immediate: !0,
45
- initialItems: l(() => o.items),
46
- itemText: o.itemText,
47
- itemValue: o.itemValue,
48
- matchStrategy: o.matchStrategy,
49
- modelValue: l(() => o.modelValue),
50
- modelValueDebounceTime: o.modelValueDebounceTime,
51
- multiple: !1
52
- }), D = {
53
- onBlur: (e) => t("blur", e),
54
- onChange: (e) => t("change", e),
55
- onClick: (e) => t("click", e),
56
- onFocus: (e) => {
57
- t("focus", e), i.value || (document.addEventListener("focusin", b, { passive: !0 }), document.addEventListener("click", f, { passive: !0 }), i.value = !0);
58
- },
59
- onInput: (e) => t("input", e),
60
- onKeydown: (e) => t("keydown", e),
61
- onMousedown: (e) => t("mousedown", e),
62
- onMouseup: (e) => t("mouseup", e),
63
- "onUpdate:modelValue": (e) => t("update:modelValue", e)
64
- }, b = (e) => {
65
- var n;
66
- e.target instanceof HTMLElement && ((n = c.value) != null && n.contains(e.target) || (t("inactive"), i.value = !1, document.removeEventListener("focusin", b), document.removeEventListener("click", f)));
67
- }, f = (e) => {
68
- var n;
69
- e.target instanceof HTMLElement && ((n = c.value) != null && n.contains(e.target) || (t("inactive"), i.value = !1, document.removeEventListener("focusin", b), document.removeEventListener("click", f)));
70
- };
71
- return (e, n) => (r(), d("span", {
72
- ref_key: "container",
73
- ref: c,
74
- class: p(["bb-base-radio-group", {
75
- "bb-base-radio-group--errors": e.hasErrors,
76
- "bb-base-radio-group--horizontal": e.direction === "horizontal",
77
- "bb-base-radio-group--vertical": e.direction === "vertical"
78
- }])
79
- }, [
80
- g("span", H, [
81
- s(e.$slots, "prepend"),
82
- !u(m).length && u(C) ? (r(), d("span", I, [
83
- s(e.$slots, "loading", {}, () => [
84
- h(v(e.loadingText), 1)
85
- ])
86
- ])) : u(m).length ? w("", !0) : (r(), d("span", R, [
87
- s(e.$slots, "no-data", {}, () => [
88
- h(v(e.noDataText), 1)
89
- ])
90
- ])),
91
- (r(!0), d(V, null, z(u(m), (a, y) => (r(), d(V, {
92
- key: (a == null ? void 0 : a.id) || y
93
- }, [
94
- s(e.$slots, "option:prepend", {
95
- checked: a.selected,
96
- disabled: !!a.disabled,
97
- id: a.id,
98
- item: a.original,
99
- text: a.text
100
- }),
101
- g("label", {
102
- class: p(["bb-base-radio-group-option", { "bb-base-radio-selected": a.selected }])
103
- }, [
104
- S(M, T({
105
- id: a.id,
106
- autofocus: e.autofocus && !y,
107
- checked: a.selected,
108
- color: e.color,
109
- disabled: a.disabled,
110
- "has-errors": e.hasErrors,
111
- "model-value": o.modelValue,
112
- name: e.name,
113
- readonly: e.readonly,
114
- value: a.value
115
- }, D), _({ _: 2 }, [
116
- e.$slots.icon ? {
117
- name: "icon",
118
- fn: F(($) => [
119
- s(e.$slots, "icon", T({
120
- item: a.original,
121
- text: a.text
122
- }, $))
123
- ]),
124
- key: "0"
125
- } : void 0
126
- ]), 1040, ["id", "autofocus", "checked", "color", "disabled", "has-errors", "model-value", "name", "readonly", "value"]),
127
- g("span", {
128
- class: p({
129
- "bb-base-radio-group-option__text": !0,
130
- "bb-base-radio-group-option__text--hidden": e.hideLabel
131
- })
132
- }, [
133
- s(e.$slots, "label", {
134
- checked: a.selected,
135
- item: a.original,
136
- text: a.text
137
- }, () => [
138
- h(v(a.text), 1)
139
- ])
140
- ], 2)
141
- ], 2),
142
- s(e.$slots, "option:append", {
143
- checked: a.selected,
144
- disabled: !!a.disabled,
145
- id: a.id,
146
- item: a.original,
147
- text: a.text
148
- })
149
- ], 64))), 128)),
150
- s(e.$slots, "append")
151
- ])
152
- ], 2));
153
- }
154
- });
155
- export {
156
- P as default
157
- };
1
+
158
2
  //# sourceMappingURL=index27.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index27.js","sources":["../src/components/BaseRadioGroup/BaseRadioGroup.vue"],"sourcesContent":["<template>\n\t<span\n\t\tref=\"container\"\n\t\tclass=\"bb-base-radio-group\"\n\t\t:class=\"{\n\t\t\t'bb-base-radio-group--errors': hasErrors,\n\t\t\t'bb-base-radio-group--horizontal': direction === 'horizontal',\n\t\t\t'bb-base-radio-group--vertical': direction === 'vertical',\n\t\t}\"\n\t>\n\t\t<span class=\"bb-base-radio-group__container\">\n\t\t\t<slot name=\"prepend\"></slot>\n\t\t\t<span\n\t\t\t\tv-if=\"!options.length && loading\"\n\t\t\t\tclass=\"bb-base-radio-group__loading-container\"\n\t\t\t>\n\t\t\t\t<slot :name=\"'loading'\">{{ loadingText }}</slot></span\n\t\t\t>\n\t\t\t<span\n\t\t\t\tv-else-if=\"!options.length\"\n\t\t\t\tclass=\"bb-base-select__no-data-container\"\n\t\t\t\t><slot :name=\"'no-data'\">{{ noDataText }}</slot></span\n\t\t\t>\n\t\t\t<template v-for=\"(option, index) in options\" :key=\"option?.id || index\">\n\t\t\t\t<slot\n\t\t\t\t\t:checked=\"option.selected\"\n\t\t\t\t\t:disabled=\"!!option.disabled\"\n\t\t\t\t\t:id=\"option.id\"\n\t\t\t\t\t:item=\"option.original\"\n\t\t\t\t\t:text=\"option.text\"\n\t\t\t\t\tname=\"option:prepend\"\n\t\t\t\t></slot>\n\t\t\t\t<label\n\t\t\t\t\tclass=\"bb-base-radio-group-option\"\n\t\t\t\t\t:class=\"{ 'bb-base-radio-selected': option.selected }\"\n\t\t\t\t>\n\t\t\t\t\t<BaseRadio\n\t\t\t\t\t\t:id=\"option.id\"\n\t\t\t\t\t\t:autofocus=\"autofocus && !index\"\n\t\t\t\t\t\t:checked=\"option.selected\"\n\t\t\t\t\t\t:color=\"color\"\n\t\t\t\t\t\t:disabled=\"option.disabled\"\n\t\t\t\t\t\t:has-errors=\"hasErrors\"\n\t\t\t\t\t\t:model-value=\"props.modelValue\"\n\t\t\t\t\t\t:name=\"name\"\n\t\t\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t\t\t:value=\"option.value\"\n\t\t\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<template v-if=\"$slots.icon\" #icon=\"data\">\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:item=\"option.original\"\n\t\t\t\t\t\t\t\tname=\"icon\"\n\t\t\t\t\t\t\t\t:text=\"option.text\"\n\t\t\t\t\t\t\t\tv-bind=\"data\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</BaseRadio>\n\t\t\t\t\t<span\n\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t'bb-base-radio-group-option__text': true,\n\t\t\t\t\t\t\t'bb-base-radio-group-option__text--hidden': hideLabel,\n\t\t\t\t\t\t}\"\n\t\t\t\t\t\t><slot\n\t\t\t\t\t\t\t:checked=\"option.selected\"\n\t\t\t\t\t\t\t:item=\"option.original\"\n\t\t\t\t\t\t\tname=\"label\"\n\t\t\t\t\t\t\t:text=\"option.text\"\n\t\t\t\t\t\t\t>{{ option.text }}</slot\n\t\t\t\t\t\t></span\n\t\t\t\t\t>\n\t\t\t\t</label>\n\t\t\t\t<slot\n\t\t\t\t\t:checked=\"option.selected\"\n\t\t\t\t\t:disabled=\"!!option.disabled\"\n\t\t\t\t\t:id=\"option.id\"\n\t\t\t\t\t:item=\"option.original\"\n\t\t\t\t\t:text=\"option.text\"\n\t\t\t\t\tname=\"option:append\"\n\t\t\t\t></slot>\n\t\t\t</template>\n\t\t\t<slot name=\"append\"></slot>\n\t\t</span>\n\t</span>\n</template>\n\n<script setup lang=\"ts\" generic=\"T = any\">\nimport { ref, toRef } from 'vue';\nimport { useOptions } from '@/index';\nimport BaseRadio from '../BaseRadio/BaseRadio.vue';\nimport type { InputHTMLAttributes, HTMLAttributes } from 'vue';\nimport type { NestedKeyOf } from '@/types/NestedKeyOf';\nimport type { SlotAttributes } from '../BaseRadio/BaseRadio.vue';\n\nexport type BaseRadioGroupProps<T> = {\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Define a color for the component.\n\t *\n\t * Either a custom color or a coded color in common HEX, RGB, etc... format.\n\t */\n\tcolor?: string;\n\n\t/**\n\t * Defines an array of dependencies that will trigger actions in the component upon change.\n\t */\n\tdependencies?: any[];\n\n\t/**\n\t * Timeout used to debounce response to changes to dependencies.\n\t */\n\tdepsDebounceTime?: number;\n\n\t/**\n\t * 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 * Defines the strategy used to understand whether an option has been selected.\n\t * `string` is 40% faster but relies on property order.\n\t * `equality` is more reliable but is slower.\n\t */\n\tmatchStrategy?: 'string' | 'equality';\n\n\t/**\n\t * Used by v-model. Can be 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 BaseRadioGroupEvents = {\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\t(e: 'inactive'): void;\n};\n\nconst props = withDefaults(defineProps<BaseRadioGroupProps<T>>(), {\n\tdepsDebounceTime: 0,\n\tdirection: 'horizontal',\n\titems: () => [],\n\tloadingText: 'Caricamento...',\n\tmatchStrategy: 'string',\n\tmodelValueDebounceTime: 0,\n\tnoDataText: 'Nessun elemento da visualizzare',\n});\n\nconst emit = defineEmits<BaseRadioGroupEvents>();\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 { loading, options } = useOptions({\n\tdependencies: toRef(() => props.dependencies),\n\tdepsDebounceTime: props.depsDebounceTime,\n\tdisabled: toRef(() => props.disabled),\n\temitter: (value) => emit('update:modelValue', value),\n\tenforceCoherence: toRef(() => props.enforceCoherence),\n\tid: props.id,\n\timmediate: true,\n\tinitialItems: toRef(() => props.items),\n\titemText: props.itemText,\n\titemValue: props.itemValue,\n\tmatchStrategy: props.matchStrategy,\n\tmodelValue: toRef(() => props.modelValue),\n\tmodelValueDebounceTime: props.modelValueDebounceTime,\n\tmultiple: false,\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\tonChange: (event: Event) => emit('change', 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\t'onUpdate:modelValue': (value: any) => emit('update:modelValue', value),\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/BaseRadioGroup';\n</style>\n"],"names":["props","__props","emit","__emit","container","ref","active","loading","options","useOptions","toRef","value","eventListeners","event","onDocumentFocus","onDocumentClick","_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiOA,UAAMA,IAAQC,GAURC,IAAOC,GA8BPC,IAAYC,KACZC,IAASD,EAAI,EAAK,GAElB,EAAE,SAAAE,GAAS,SAAAC,EAAQ,IAAIC,EAAW;AAAA,MACvC,cAAcC,EAAM,MAAMV,EAAM,YAAY;AAAA,MAC5C,kBAAkBA,EAAM;AAAA,MACxB,UAAUU,EAAM,MAAMV,EAAM,QAAQ;AAAA,MACpC,SAAS,CAACW,MAAUT,EAAK,qBAAqBS,CAAK;AAAA,MACnD,kBAAkBD,EAAM,MAAMV,EAAM,gBAAgB;AAAA,MACpD,IAAIA,EAAM;AAAA,MACV,WAAW;AAAA,MACX,cAAcU,EAAM,MAAMV,EAAM,KAAK;AAAA,MACrC,UAAUA,EAAM;AAAA,MAChB,WAAWA,EAAM;AAAA,MACjB,eAAeA,EAAM;AAAA,MACrB,YAAYU,EAAM,MAAMV,EAAM,UAAU;AAAA,MACxC,wBAAwBA,EAAM;AAAA,MAC9B,UAAU;AAAA,IAAA,CACV,GAWKY,IAAiB;AAAA,MACtB,QAAQ,CAACC,MAAsBX,EAAK,QAAQW,CAAK;AAAA,MACjD,UAAU,CAACA,MAAiBX,EAAK,UAAUW,CAAK;AAAA,MAChD,SAAS,CAACA,MAAsBX,EAAK,SAASW,CAAK;AAAA,MACnD,SAbe,CAACA,MAAsB;AACtC,QAAAX,EAAK,SAASW,CAAK,GACdP,EAAO,UACX,SAAS,iBAAiB,WAAWQ,GAAiB,EAAE,SAAS,IAAM,GACvE,SAAS,iBAAiB,SAASC,GAAiB,EAAE,SAAS,IAAM,GACrET,EAAO,QAAQ;AAAA,MAChB;AAAA,MAQA,SAAS,CAACO,MAAiBX,EAAK,SAASW,CAAK;AAAA,MAC9C,WAAW,CAACA,MAAyBX,EAAK,WAAWW,CAAK;AAAA,MAC1D,aAAa,CAACA,MAAsBX,EAAK,aAAaW,CAAK;AAAA,MAC3D,WAAW,CAACA,MAAsBX,EAAK,WAAWW,CAAK;AAAA,MACvD,uBAAuB,CAACF,MAAeT,EAAK,qBAAqBS,CAAK;AAAA,IAAA,GAGjEG,IAAkB,CAACD,MAAsB;;AAC1C,MAAAA,EAAM,kBAAkB,iBACtBG,IAAAZ,EAAU,UAAV,QAAAY,EAAiB,SAASH,EAAM,YACpCX,EAAK,UAAU,GACfI,EAAO,QAAQ,IACN,SAAA,oBAAoB,WAAWQ,CAAe,GAC9C,SAAA,oBAAoB,SAASC,CAAe;AAAA,IAEvD,GAGKA,IAAkB,CAACF,MAAsB;;AAC1C,MAAAA,EAAM,kBAAkB,iBACtBG,IAAAZ,EAAU,UAAV,QAAAY,EAAiB,SAASH,EAAM,YACpCX,EAAK,UAAU,GACfI,EAAO,QAAQ,IACN,SAAA,oBAAoB,WAAWQ,CAAe,GAC9C,SAAA,oBAAoB,SAASC,CAAe;AAAA,IAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index27.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/index28.js CHANGED
@@ -1,2 +1,161 @@
1
-
1
+ import { defineComponent as B, ref as k, toRef as r, openBlock as i, createElementBlock as d, normalizeClass as f, createElementVNode as g, renderSlot as s, unref as c, createTextVNode as h, toDisplayString as v, createCommentVNode as w, Fragment as V, renderList as z, createVNode as S, mergeProps as T, createSlots as F, withCtx as N } from "vue";
2
+ import "./index2.js";
3
+ import { useOptions as _ } from "./index7.js";
4
+ import M from "./index26.js";
5
+ import "./index27.js";
6
+ const H = { class: "bb-base-radio-group__container" }, I = {
7
+ key: 0,
8
+ class: "bb-base-radio-group__loading-container"
9
+ }, R = {
10
+ key: 1,
11
+ class: "bb-base-radio-group__no-data-container"
12
+ }, j = /* @__PURE__ */ B({
13
+ __name: "BaseRadioGroup",
14
+ props: {
15
+ ariaDescribedby: {},
16
+ autofocus: {},
17
+ color: {},
18
+ dependencies: {},
19
+ depsDebounceTime: { default: 0 },
20
+ direction: { default: "horizontal" },
21
+ disabled: { type: Boolean },
22
+ enforceCoherence: { type: Boolean },
23
+ hasErrors: { type: Boolean },
24
+ hideLabel: { type: Boolean },
25
+ id: {},
26
+ items: { type: [Array, Function], default: () => [] },
27
+ itemText: {},
28
+ itemValue: {},
29
+ loadingText: { default: "Caricamento..." },
30
+ matchStrategy: { default: "string" },
31
+ modelValue: {},
32
+ modelValueDebounceTime: { default: 0 },
33
+ name: {},
34
+ noDataText: { default: "Nessun elemento da visualizzare" },
35
+ readonly: {}
36
+ },
37
+ emits: ["blur", "change", "click", "focus", "input", "keydown", "mousedown", "mouseup", "update:modelValue", "inactive"],
38
+ setup(D, { emit: E }) {
39
+ const o = D, t = E, u = k(), l = k(!1), { loading: L, options: m } = _({
40
+ dependencies: r(() => o.dependencies),
41
+ depsDebounceTime: o.depsDebounceTime,
42
+ disabled: r(() => o.disabled),
43
+ emitter: (e) => t("update:modelValue", e),
44
+ enforceCoherence: r(() => o.enforceCoherence),
45
+ id: o.id,
46
+ immediate: !0,
47
+ initialItems: r(() => o.items),
48
+ itemText: o.itemText,
49
+ itemValue: o.itemValue,
50
+ matchStrategy: o.matchStrategy,
51
+ modelValue: r(() => o.modelValue),
52
+ modelValueDebounceTime: o.modelValueDebounceTime,
53
+ multiple: !1
54
+ }), C = {
55
+ onBlur: (e) => t("blur", e),
56
+ onChange: (e) => t("change", e),
57
+ onClick: (e) => t("click", e),
58
+ onFocus: (e) => {
59
+ t("focus", e), l.value || (document.addEventListener("focusin", b, { passive: !0 }), document.addEventListener("click", p, { passive: !0 }), l.value = !0);
60
+ },
61
+ onInput: (e) => t("input", e),
62
+ onKeydown: (e) => t("keydown", e),
63
+ onMousedown: (e) => t("mousedown", e),
64
+ onMouseup: (e) => t("mouseup", e),
65
+ "onUpdate:modelValue": (e) => t("update:modelValue", e)
66
+ }, b = (e) => {
67
+ var n;
68
+ e.target instanceof HTMLElement && ((n = u.value) != null && n.contains(e.target) || (t("inactive"), l.value = !1, document.removeEventListener("focusin", b), document.removeEventListener("click", p)));
69
+ }, p = (e) => {
70
+ var n;
71
+ e.target instanceof HTMLElement && ((n = u.value) != null && n.contains(e.target) || (t("inactive"), l.value = !1, document.removeEventListener("focusin", b), document.removeEventListener("click", p)));
72
+ };
73
+ return (e, n) => (i(), d("span", {
74
+ ref_key: "container",
75
+ ref: u,
76
+ class: f(["bb-base-radio-group", {
77
+ "bb-base-radio-group--errors": e.hasErrors,
78
+ "bb-base-radio-group--horizontal": e.direction === "horizontal",
79
+ "bb-base-radio-group--vertical": e.direction === "vertical"
80
+ }])
81
+ }, [
82
+ g("span", H, [
83
+ s(e.$slots, "prepend"),
84
+ !c(m).length && c(L) ? (i(), d("span", I, [
85
+ s(e.$slots, "loading", {}, () => [
86
+ h(v(e.loadingText), 1)
87
+ ])
88
+ ])) : c(m).length ? w("", !0) : (i(), d("span", R, [
89
+ s(e.$slots, "no-data", {}, () => [
90
+ h(v(e.noDataText), 1)
91
+ ])
92
+ ])),
93
+ (i(!0), d(V, null, z(c(m), (a, y) => (i(), d(V, {
94
+ key: (a == null ? void 0 : a.id) || y
95
+ }, [
96
+ s(e.$slots, "option:prepend", {
97
+ checked: a.selected,
98
+ disabled: !!a.disabled,
99
+ id: a.id,
100
+ item: a.original,
101
+ text: a.text
102
+ }),
103
+ g("label", {
104
+ class: f(["bb-base-radio-group-option", { "bb-base-radio-selected": a.selected }])
105
+ }, [
106
+ S(M, T({
107
+ "aria-describedby": e.ariaDescribedby,
108
+ autofocus: e.autofocus && !y,
109
+ checked: a.selected,
110
+ color: e.color,
111
+ disabled: a.disabled,
112
+ "has-errors": e.hasErrors,
113
+ id: a.id,
114
+ "model-value": o.modelValue,
115
+ name: e.name,
116
+ readonly: e.readonly,
117
+ value: a.value
118
+ }, C), F({ _: 2 }, [
119
+ e.$slots.icon ? {
120
+ name: "icon",
121
+ fn: N(($) => [
122
+ s(e.$slots, "icon", T({
123
+ item: a.original,
124
+ text: a.text
125
+ }, $))
126
+ ]),
127
+ key: "0"
128
+ } : void 0
129
+ ]), 1040, ["aria-describedby", "autofocus", "checked", "color", "disabled", "has-errors", "id", "model-value", "name", "readonly", "value"]),
130
+ g("span", {
131
+ class: f({
132
+ "bb-base-radio-group-option__text": !0,
133
+ "bb-base-radio-group-option__text--hidden": e.hideLabel
134
+ })
135
+ }, [
136
+ s(e.$slots, "label", {
137
+ checked: a.selected,
138
+ item: a.original,
139
+ text: a.text
140
+ }, () => [
141
+ h(v(a.text), 1)
142
+ ])
143
+ ], 2)
144
+ ], 2),
145
+ s(e.$slots, "option:append", {
146
+ checked: a.selected,
147
+ disabled: !!a.disabled,
148
+ id: a.id,
149
+ item: a.original,
150
+ text: a.text
151
+ })
152
+ ], 64))), 128)),
153
+ s(e.$slots, "append")
154
+ ])
155
+ ], 2));
156
+ }
157
+ });
158
+ export {
159
+ j as default
160
+ };
2
161
  //# sourceMappingURL=index28.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index28.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"index28.js","sources":["../src/components/BaseRadioGroup/BaseRadioGroup.vue"],"sourcesContent":["<template>\n\t<span\n\t\tref=\"container\"\n\t\tclass=\"bb-base-radio-group\"\n\t\t:class=\"{\n\t\t\t'bb-base-radio-group--errors': hasErrors,\n\t\t\t'bb-base-radio-group--horizontal': direction === 'horizontal',\n\t\t\t'bb-base-radio-group--vertical': direction === 'vertical',\n\t\t}\"\n\t>\n\t\t<span class=\"bb-base-radio-group__container\">\n\t\t\t<slot name=\"prepend\"></slot>\n\t\t\t<span\n\t\t\t\tv-if=\"!options.length && loading\"\n\t\t\t\tclass=\"bb-base-radio-group__loading-container\"\n\t\t\t>\n\t\t\t\t<slot :name=\"'loading'\">{{ loadingText }}</slot></span\n\t\t\t>\n\t\t\t<span\n\t\t\t\tv-else-if=\"!options.length\"\n\t\t\t\tclass=\"bb-base-radio-group__no-data-container\"\n\t\t\t\t><slot :name=\"'no-data'\">{{ noDataText }}</slot></span\n\t\t\t>\n\t\t\t<template v-for=\"(option, index) in options\" :key=\"option?.id || index\">\n\t\t\t\t<slot\n\t\t\t\t\t:checked=\"option.selected\"\n\t\t\t\t\t:disabled=\"!!option.disabled\"\n\t\t\t\t\t:id=\"option.id\"\n\t\t\t\t\t:item=\"option.original\"\n\t\t\t\t\t:text=\"option.text\"\n\t\t\t\t\tname=\"option:prepend\"\n\t\t\t\t></slot>\n\t\t\t\t<label\n\t\t\t\t\tclass=\"bb-base-radio-group-option\"\n\t\t\t\t\t:class=\"{ 'bb-base-radio-selected': option.selected }\"\n\t\t\t\t>\n\t\t\t\t\t<BaseRadio\n\t\t\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t\t\t:autofocus=\"autofocus && !index\"\n\t\t\t\t\t\t:checked=\"option.selected\"\n\t\t\t\t\t\t:color=\"color\"\n\t\t\t\t\t\t:disabled=\"option.disabled\"\n\t\t\t\t\t\t:has-errors=\"hasErrors\"\n\t\t\t\t\t\t:id=\"option.id\"\n\t\t\t\t\t\t:model-value=\"props.modelValue\"\n\t\t\t\t\t\t:name=\"name\"\n\t\t\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t\t\t:value=\"option.value\"\n\t\t\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<template v-if=\"$slots.icon\" #icon=\"data\">\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:item=\"option.original\"\n\t\t\t\t\t\t\t\tname=\"icon\"\n\t\t\t\t\t\t\t\t:text=\"option.text\"\n\t\t\t\t\t\t\t\tv-bind=\"data\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</BaseRadio>\n\t\t\t\t\t<span\n\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t'bb-base-radio-group-option__text': true,\n\t\t\t\t\t\t\t'bb-base-radio-group-option__text--hidden': hideLabel,\n\t\t\t\t\t\t}\"\n\t\t\t\t\t\t><slot\n\t\t\t\t\t\t\t:checked=\"option.selected\"\n\t\t\t\t\t\t\t:item=\"option.original\"\n\t\t\t\t\t\t\tname=\"label\"\n\t\t\t\t\t\t\t:text=\"option.text\"\n\t\t\t\t\t\t\t>{{ option.text }}</slot\n\t\t\t\t\t\t></span\n\t\t\t\t\t>\n\t\t\t\t</label>\n\t\t\t\t<slot\n\t\t\t\t\t:checked=\"option.selected\"\n\t\t\t\t\t:disabled=\"!!option.disabled\"\n\t\t\t\t\t:id=\"option.id\"\n\t\t\t\t\t:item=\"option.original\"\n\t\t\t\t\t:text=\"option.text\"\n\t\t\t\t\tname=\"option:append\"\n\t\t\t\t></slot>\n\t\t\t</template>\n\t\t\t<slot name=\"append\"></slot>\n\t\t</span>\n\t</span>\n</template>\n\n<script setup lang=\"ts\" generic=\"T = any\">\nimport { ref, toRef } from 'vue';\nimport { useOptions } from '@/index';\nimport BaseRadio from '../BaseRadio/BaseRadio.vue';\nimport type { InputHTMLAttributes, HTMLAttributes } from 'vue';\nimport type { NestedKeyOf } from '@/types/NestedKeyOf';\nimport type { SlotAttributes } from '../BaseRadio/BaseRadio.vue';\n\nexport type BaseRadioGroupProps<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 * Defines the strategy used to understand whether an option has been selected.\n\t * `string` is 40% faster but relies on property order.\n\t * `equality` is more reliable but is slower.\n\t */\n\tmatchStrategy?: 'string' | 'equality';\n\n\t/**\n\t * Used by v-model. Can be 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 BaseRadioGroupEvents = {\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\t(e: 'inactive'): void;\n};\n\nconst props = withDefaults(defineProps<BaseRadioGroupProps<T>>(), {\n\tdepsDebounceTime: 0,\n\tdirection: 'horizontal',\n\titems: () => [],\n\tloadingText: 'Caricamento...',\n\tmatchStrategy: 'string',\n\tmodelValueDebounceTime: 0,\n\tnoDataText: 'Nessun elemento da visualizzare',\n});\n\nconst emit = defineEmits<BaseRadioGroupEvents>();\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 { loading, options } = useOptions({\n\tdependencies: toRef(() => props.dependencies),\n\tdepsDebounceTime: props.depsDebounceTime,\n\tdisabled: toRef(() => props.disabled),\n\temitter: (value) => emit('update:modelValue', value),\n\tenforceCoherence: toRef(() => props.enforceCoherence),\n\tid: props.id,\n\timmediate: true,\n\tinitialItems: toRef(() => props.items),\n\titemText: props.itemText,\n\titemValue: props.itemValue,\n\tmatchStrategy: props.matchStrategy,\n\tmodelValue: toRef(() => props.modelValue),\n\tmodelValueDebounceTime: props.modelValueDebounceTime,\n\tmultiple: false,\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\tonChange: (event: Event) => emit('change', 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\t'onUpdate:modelValue': (value: any) => emit('update:modelValue', value),\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/BaseRadioGroup';\n</style>\n"],"names":["props","__props","emit","__emit","container","ref","active","loading","options","useOptions","toRef","value","eventListeners","event","onDocumentFocus","onDocumentClick","_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuOA,UAAMA,IAAQC,GAURC,IAAOC,GA8BPC,IAAYC,KACZC,IAASD,EAAI,EAAK,GAElB,EAAE,SAAAE,GAAS,SAAAC,EAAQ,IAAIC,EAAW;AAAA,MACvC,cAAcC,EAAM,MAAMV,EAAM,YAAY;AAAA,MAC5C,kBAAkBA,EAAM;AAAA,MACxB,UAAUU,EAAM,MAAMV,EAAM,QAAQ;AAAA,MACpC,SAAS,CAACW,MAAUT,EAAK,qBAAqBS,CAAK;AAAA,MACnD,kBAAkBD,EAAM,MAAMV,EAAM,gBAAgB;AAAA,MACpD,IAAIA,EAAM;AAAA,MACV,WAAW;AAAA,MACX,cAAcU,EAAM,MAAMV,EAAM,KAAK;AAAA,MACrC,UAAUA,EAAM;AAAA,MAChB,WAAWA,EAAM;AAAA,MACjB,eAAeA,EAAM;AAAA,MACrB,YAAYU,EAAM,MAAMV,EAAM,UAAU;AAAA,MACxC,wBAAwBA,EAAM;AAAA,MAC9B,UAAU;AAAA,IAAA,CACV,GAWKY,IAAiB;AAAA,MACtB,QAAQ,CAACC,MAAsBX,EAAK,QAAQW,CAAK;AAAA,MACjD,UAAU,CAACA,MAAiBX,EAAK,UAAUW,CAAK;AAAA,MAChD,SAAS,CAACA,MAAsBX,EAAK,SAASW,CAAK;AAAA,MACnD,SAbe,CAACA,MAAsB;AACtC,QAAAX,EAAK,SAASW,CAAK,GACdP,EAAO,UACX,SAAS,iBAAiB,WAAWQ,GAAiB,EAAE,SAAS,IAAM,GACvE,SAAS,iBAAiB,SAASC,GAAiB,EAAE,SAAS,IAAM,GACrET,EAAO,QAAQ;AAAA,MAChB;AAAA,MAQA,SAAS,CAACO,MAAiBX,EAAK,SAASW,CAAK;AAAA,MAC9C,WAAW,CAACA,MAAyBX,EAAK,WAAWW,CAAK;AAAA,MAC1D,aAAa,CAACA,MAAsBX,EAAK,aAAaW,CAAK;AAAA,MAC3D,WAAW,CAACA,MAAsBX,EAAK,WAAWW,CAAK;AAAA,MACvD,uBAAuB,CAACF,MAAeT,EAAK,qBAAqBS,CAAK;AAAA,IAAA,GAGjEG,IAAkB,CAACD,MAAsB;;AAC1C,MAAAA,EAAM,kBAAkB,iBACtBG,IAAAZ,EAAU,UAAV,QAAAY,EAAiB,SAASH,EAAM,YACpCX,EAAK,UAAU,GACfI,EAAO,QAAQ,IACN,SAAA,oBAAoB,WAAWQ,CAAe,GAC9C,SAAA,oBAAoB,SAASC,CAAe;AAAA,IAEvD,GAGKA,IAAkB,CAACF,MAAsB;;AAC1C,MAAAA,EAAM,kBAAkB,iBACtBG,IAAAZ,EAAU,UAAV,QAAAY,EAAiB,SAASH,EAAM,YACpCX,EAAK,UAAU,GACfI,EAAO,QAAQ,IACN,SAAA,oBAAoB,WAAWQ,CAAe,GAC9C,SAAA,oBAAoB,SAASC,CAAe;AAAA,IAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index29.js CHANGED
@@ -1,125 +1,2 @@
1
- import { defineComponent as C, ref as b, computed as f, openBlock as l, createElementBlock as i, mergeProps as g, createElementVNode as r, Fragment as I, renderList as V, normalizeClass as B, toDisplayString as h, renderSlot as x } from "vue";
2
- import { booleanishToBoolean as M } from "./index218.js";
3
- import { identity as F } from "./index204.js";
4
- import { isCssColor as p } from "./index219.js";
5
- import { isNotNil as T } from "./index124.js";
6
- const H = { class: "bb-base-rating__inner-container" }, D = { class: "bb-base-rating__label-text" }, N = ["id", "autofocus", "checked", "disabled", "name", "value"], j = ["height", "width"], A = /* @__PURE__ */ r("path", {
7
- d: "m8.243 7.34l-6.38.925l-.113.023a1 1 0 0 0-.44 1.684l4.622 4.499l-1.09 6.355l-.013.11a1 1 0 0 0 1.464.944l5.706-3l5.693 3l.1.046a1 1 0 0 0 1.352-1.1l-1.091-6.355l4.624-4.5l.078-.085a1 1 0 0 0-.633-1.62l-6.38-.926l-2.852-5.78a1 1 0 0 0-1.794 0L8.243 7.34z",
8
- "stroke-linecap": "round",
9
- "stroke-linejoin": "round"
10
- }, null, -1), S = [
11
- A
12
- ], Q = /* @__PURE__ */ C({
13
- __name: "BaseRating",
14
- props: {
15
- autofocus: {},
16
- color: {},
17
- disabled: { type: Boolean },
18
- hasErrors: { type: Boolean },
19
- id: {},
20
- modelValue: {},
21
- name: {},
22
- readonly: {},
23
- stars: { default: 5 },
24
- size: { default: "md" }
25
- },
26
- emits: ["blur", "change", "click", "focus", "inactive", "input", "keydown", "mousedown", "mouseup", "update:modelValue"],
27
- setup(v, { emit: _ }) {
28
- const t = v, n = _, c = b(), o = b(!1), k = {
29
- onBlur: (e) => n("blur", e),
30
- onChange: (e) => {
31
- n("change", e), e.target instanceof HTMLInputElement && e.target.checked && n("update:modelValue", +e.target.value);
32
- },
33
- onClick: (e) => {
34
- n("click", e), e.target instanceof HTMLInputElement && e.target.checked && +e.target.value === t.modelValue && n("update:modelValue", null);
35
- },
36
- onFocus: (e) => {
37
- n("focus", e), o.value || (document.addEventListener("focusin", u, { passive: !0 }), document.addEventListener("click", d, { passive: !0 }), o.value = !0);
38
- },
39
- onInput: (e) => n("input", e),
40
- onKeydown: (e) => n("keydown", e),
41
- onMousedown: (e) => n("mousedown", e),
42
- onMouseup: (e) => n("mouseup", e)
43
- }, u = (e) => {
44
- var s;
45
- e.target instanceof HTMLElement && ((s = c.value) != null && s.contains(e.target) || (n("inactive"), o.value = !1, document.removeEventListener("focusin", u), document.removeEventListener("click", d)));
46
- }, d = (e) => {
47
- var s;
48
- e.target instanceof HTMLElement && ((s = c.value) != null && s.contains(e.target) || (n("inactive"), o.value = !1, document.removeEventListener("focusin", u), document.removeEventListener("click", d)));
49
- }, y = {
50
- xs: 12,
51
- sm: 16,
52
- md: 24,
53
- lg: 28,
54
- xl: 36,
55
- xxl: 40
56
- }, w = f(() => {
57
- let e;
58
- return typeof t.size == "string" ? e = y[t.size] ?? parseInt(t.size, 10) : e = t.size, e;
59
- }), z = f(() => new Array(t.stars).fill(0).map((e, s) => s + 1).map((e) => {
60
- const s = t.id ? [t.id, e].filter(F).join("_") : void 0, a = e === t.modelValue, m = !!(t.modelValue && e <= t.modelValue), L = !!(t.disabled || T(t.readonly) && M(t.readonly));
61
- return {
62
- checked: a,
63
- disabled: L,
64
- highlighted: m,
65
- id: s,
66
- name: t.name,
67
- size: w.value,
68
- value: e
69
- };
70
- })), E = f(() => {
71
- let e = {};
72
- return t.color && p(t.color) && (e.color = t.color), {
73
- class: {
74
- "bb-base-rating": !0,
75
- "bb-base-rating--has-value": t.modelValue,
76
- "bb-base-rating--disabled": t.disabled,
77
- "bb-base-rating--errors": t.hasErrors,
78
- "bb-base-rating--readonly": t.readonly,
79
- [`bb-base-rating--${t.color}`]: t.color && !p(t.color)
80
- },
81
- style: e
82
- };
83
- });
84
- return (e, s) => (l(), i("span", g(E.value, {
85
- ref_key: "container",
86
- ref: c
87
- }), [
88
- r("span", H, [
89
- (l(!0), i(I, null, V(z.value, (a, m) => (l(), i("label", {
90
- key: a.value,
91
- class: B(["bb-base-rating__option", { "bb-base-rating__option--highlighted": a.highlighted }])
92
- }, [
93
- r("span", D, h(a.value) + " stell" + h(a.value === 1 ? "a" : "e"), 1),
94
- r("input", g({
95
- id: a.id,
96
- autofocus: e.autofocus && !m,
97
- checked: a.checked,
98
- disabled: a.disabled,
99
- name: a.name,
100
- type: "radio",
101
- value: a.value
102
- }, k), null, 16, N),
103
- x(e.$slots, "icon", {
104
- id: a.id,
105
- checked: a.checked,
106
- disabled: a.disabled,
107
- size: a.size,
108
- value: a.value
109
- }, () => [
110
- (l(), i("svg", {
111
- height: a.size,
112
- viewBox: "0 0 24 24",
113
- width: a.size,
114
- xmlns: "http://www.w3.org/2000/svg"
115
- }, S, 8, j))
116
- ])
117
- ], 2))), 128))
118
- ])
119
- ], 16));
120
- }
121
- });
122
- export {
123
- Q as default
124
- };
1
+
125
2
  //# sourceMappingURL=index29.js.map