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":"index107.js","sources":["../src/components/BbTag/BbTag.vue"],"sourcesContent":["<template>\n\t<BaseInputContainer\n\t\t:id=\"id\"\n\t\tclass=\"bb-tag\"\n\t\t:direction=\"direction\"\n\t\t:errors=\"errors\"\n\t\t:has-errors=\"hasErrors\"\n\t\t:hide-label=\"hideLabel\"\n\t\t:hint=\"hint\"\n\t\t:label=\"label\"\n\t\t:label-position=\"labelPosition\"\n\t\t:model-value=\"modelValue\"\n\t\t:name=\"name\"\n\t\t:reverse=\"reverse\"\n\t\t:show-hint=\"showHint\"\n\t>\n\t\t<template #label=\"data\"><slot name=\"label\" v-bind=\"data\"></slot></template>\n\t\t<template #input=\"{ id, name, hasErrors, ariaDescribedby }\">\n\t\t\t<BaseTag\n\t\t\t\t:id=\"id\"\n\t\t\t\t:append:icon=\"props['append:icon']\"\n\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t:autocomplete=\"autocomplete\"\n\t\t\t\t:autofocus=\"autofocus\"\n\t\t\t\t:comma=\"comma\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:divider=\"divider\"\n\t\t\t\t:has-errors=\"hasErrors\"\n\t\t\t\t:loading=\"loading\"\n\t\t\t\t:model-value=\"modelValue\"\n\t\t\t\t:multiple=\"multiple\"\n\t\t\t\t:name=\"name\"\n\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t:prepend:icon=\"props['prepend:icon']\"\n\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t:required=\"required\"\n\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t>\n\t\t\t\t<template #prepend-outer=\"data\"\n\t\t\t\t\t><slot name=\"prepend-outer\" v-bind=\"data\"\n\t\t\t\t/></template>\n\t\t\t\t<template #prepend=\"data\"\n\t\t\t\t\t><slot name=\"prepend\" v-bind=\"data\"\n\t\t\t\t/></template>\n\t\t\t\t<template #prefix=\"data\"><slot name=\"prefix\" v-bind=\"data\" /></template>\n\t\t\t\t<template #append=\"data\"><slot name=\"append\" v-bind=\"data\" /></template>\n\t\t\t\t<template #suffix=\"data\"><slot name=\"suffix\" v-bind=\"data\" /></template>\n\t\t\t\t<template #append-outer=\"data\"\n\t\t\t\t\t><slot name=\"append-outer\" v-bind=\"data\"\n\t\t\t\t/></template>\n\t\t\t</BaseTag>\n\t\t</template>\n\t</BaseInputContainer>\n</template>\n\n<script setup lang=\"ts\">\nimport BaseInputContainer from '../BaseInputContainer/BaseInputContainer.vue';\nimport BaseTag from '../BaseTag/BaseTag.vue';\nimport type { BaseTagEvents } from '../BaseTag/BaseTag.vue';\nimport {\n\tref,\n\ttype HTMLAttributes,\n\ttype InputHTMLAttributes,\n\tcomputed,\n} from 'vue';\n\nexport type BbTagProps = {\n\t/**\n\t * Name of the icon to be added at the end of the input.\n\t */\n\t// eslint-disable-next-line vue/prop-name-casing\n\t'append:icon'?: string;\n\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tautocomplete?: InputHTMLAttributes['autocomplete'];\n\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Sets the display model for selected values to a list\n\t * of comma separated string. In this mode the user\n\t * cannot deselect an option by pressing the close button.\n\t */\n\tcomma?: boolean;\n\n\t/**\n\t * Direction of the layout of the component. Can either be a predefined value or a pattern separated by a space like `xx xxxxx`.\n\t */\n\tdirection?: 'horizontal' | 'vertical' | 'auto' | string;\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * The divider key used to separate values from one another. By default it is \"Enter\"\n\t */\n\tdivider?: KeyboardEvent['key'];\n\n\t/**\n\t * Can be a string or an array of string containing the messages to display.\n\t */\n\terrors?: string | string[];\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * Visually hides the label of the input while maintaining accessibility.\n\t */\n\thideLabel?: boolean;\n\n\t/**\n\t * Text box to be displayed near the input, usually to indicate instructions.\n\t */\n\thint?: string;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Text content of the label of the element.\n\t */\n\tlabel: string;\n\n\t/**\n\t * Sets the text alignment of the label.\n\t */\n\tlabelPosition?: 'left' | 'center' | 'right';\n\n\t/**\n\t * Sets the component in a loading state, usually triggering some visual styles.\n\t */\n\tloading?: boolean;\n\n\t/**\n\t * Used by v-model. Can be any serializable type.\n\t */\n\tmodelValue: any;\n\n\t/**\n\t * Allows the selection of multiple items.\n\t */\n\tmultiple?: boolean;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * Keeps the hint displayed.\n\t */\n\tpersistentHint?: boolean;\n\n\t/**\n\t * String displayed when there's no data.\n\t */\n\tplaceholder?: InputHTMLAttributes['placeholder'];\n\n\t/**\n\t * Name of the icon to be added at the start of the input.\n\t */\n\t// eslint-disable-next-line vue/prop-name-casing\n\t'prepend:icon'?: string;\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: InputHTMLAttributes['readonly'];\n\n\t/**\n\t * Sets the input as required.\n\t */\n\trequired?: boolean;\n\n\t/**\n\t * Reverses the layout. Applicable in every direction the order of the label and the input is swapped.\n\t */\n\treverse?: boolean;\n};\n\nconst props = withDefaults(defineProps<BbTagProps>(), {\n\tmultiple: true,\n});\n\nexport type BbTagEvents = BaseTagEvents;\n\nconst emit = defineEmits<BbTagEvents>();\n\nexport type BbTagSlots = {\n\tappend?: (props: object) => any;\n\t'append-outer'?: (props: object) => any;\n\tlabel?: (props: { text: string; hasErrors: boolean }) => any;\n\tprepend?: (props: object) => any;\n\tprefix?: (props: object) => any;\n\tsuffix?: (props: object) => any;\n\t'prepend-outer'?: (props: object) => any;\n};\n\ndefineSlots<BbTagSlots>();\n\nconst active = ref(false);\nconst showHint = computed(() => props.persistentHint || active.value);\n\nconst eventListeners = {\n\tonBlur: (event: FocusEvent) => emit('blur', event),\n\tonChange: (event: Event) => emit('change', event),\n\tonClick: (event: MouseEvent) => emit('click', event),\n\tonDuplicate: (string: string) => emit('duplicate', string),\n\tonFocus: (event: FocusEvent) => {\n\t\tactive.value = true;\n\t\temit('focus', event);\n\t},\n\tonInactive: () => {\n\t\tactive.value = false;\n\t\temit('inactive');\n\t},\n\tonInput: (event: Event) => emit('input', event),\n\tonKeydown: (event: KeyboardEvent) => emit('keydown', event),\n\tonKeyup: (event: KeyboardEvent) => emit('keyup', event),\n\t'onUpdate:modelValue': (value: any) => emit('update:modelValue', value),\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbTag';\n</style>\n"],"names":["props","__props","emit","__emit","active","ref","showHint","computed","eventListeners","event","string","value"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiMA,UAAMA,IAAQC,GAMRC,IAAOC,GAcPC,IAASC,EAAI,EAAK,GAClBC,IAAWC,EAAS,MAAMP,EAAM,kBAAkBI,EAAO,KAAK,GAE9DI,IAAiB;AAAA,MACtB,QAAQ,CAACC,MAAsBP,EAAK,QAAQO,CAAK;AAAA,MACjD,UAAU,CAACA,MAAiBP,EAAK,UAAUO,CAAK;AAAA,MAChD,SAAS,CAACA,MAAsBP,EAAK,SAASO,CAAK;AAAA,MACnD,aAAa,CAACC,MAAmBR,EAAK,aAAaQ,CAAM;AAAA,MACzD,SAAS,CAACD,MAAsB;AAC/B,QAAAL,EAAO,QAAQ,IACfF,EAAK,SAASO,CAAK;AAAA,MACpB;AAAA,MACA,YAAY,MAAM;AACjB,QAAAL,EAAO,QAAQ,IACfF,EAAK,UAAU;AAAA,MAChB;AAAA,MACA,SAAS,CAACO,MAAiBP,EAAK,SAASO,CAAK;AAAA,MAC9C,WAAW,CAACA,MAAyBP,EAAK,WAAWO,CAAK;AAAA,MAC1D,SAAS,CAACA,MAAyBP,EAAK,SAASO,CAAK;AAAA,MACtD,uBAAuB,CAACE,MAAeT,EAAK,qBAAqBS,CAAK;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index107.js","sources":["../src/components/BbTable/BbTable.vue"],"sourcesContent":["<template>\n\t<component\n\t\t:is=\"containerTag\"\n\t\tref=\"container\"\n\t\t:class=\"{\n\t\t\t'bb-table': true,\n\t\t\t[`bb-table--align-${align}`]: true,\n\t\t\t'bb-table--compact': compact,\n\t\t\t'bb-table--fixed': fixed,\n\t\t\t'bb-table--fixed-header': fixedHeaders,\n\t\t\t'bb-table--loading': loading,\n\t\t\t'bb-table--empty': !options.length,\n\t\t\t'bb-table--selectable': selectable,\n\t\t}\"\n\t>\n\t\t<legend v-if=\"selectable\">{{ legend }}</legend>\n\t\t<table>\n\t\t\t<caption\n\t\t\t\tv-if=\"caption\"\n\t\t\t\t:class=\"{\n\t\t\t\t\t'bb-table-caption': true,\n\t\t\t\t\t'bb-table-caption--hidden': !displayCaption,\n\t\t\t\t}\"\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\tcaption\n\t\t\t\t}}\n\t\t\t</caption>\n\t\t\t<thead>\n\t\t\t\t<slot name=\"thead\">\n\t\t\t\t\t<tr class=\"bb-table-header-row\">\n\t\t\t\t\t\t<th\n\t\t\t\t\t\t\tv-if=\"selectable\"\n\t\t\t\t\t\t\tclass=\"bb-table-header bb-table-header--select\"\n\t\t\t\t\t\t\t:class=\"thClass\"\n\t\t\t\t\t\t\tscope=\"col\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:multiple=\"multiple\"\n\t\t\t\t\t\t\t\t:name=\"'header:select'\"\n\t\t\t\t\t\t\t\t:select-all=\"!!selectAll\"\n\t\t\t\t\t\t\t\t:text=\"selectText\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<span class=\"bb-table-header__content\">\n\t\t\t\t\t\t\t\t\t<label\n\t\t\t\t\t\t\t\t\t\tv-if=\"allowSelectAll && multiple\"\n\t\t\t\t\t\t\t\t\t\tclass=\"bb-table-check__label\"\n\t\t\t\t\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t\t\t\t\t'bb-table-check__label--disabled': disabled,\n\t\t\t\t\t\t\t\t\t\t}\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<BaseCheckbox\n\t\t\t\t\t\t\t\t\t\t\tclass=\"bb-table-check\"\n\t\t\t\t\t\t\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\t\t\t\t\t\t\t:indeterminate=\"indeterminate\"\n\t\t\t\t\t\t\t\t\t\t\t:model-value=\"allSelected\"\n\t\t\t\t\t\t\t\t\t\t\t:name=\"`select_all_${name || ''}`\"\n\t\t\t\t\t\t\t\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t\t\t\t\t\t\t\t@update:model-value=\"onChangeSelectAll\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t<span class=\"bb-table-check__label-text\"\n\t\t\t\t\t\t\t\t\t\t\t>{{ selectAllLabel }}\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\tv-else-if=\"!multiple\"\n\t\t\t\t\t\t\t\t\t\tclass=\"bb-table-radio__label-text\"\n\t\t\t\t\t\t\t\t\t\t>{{ selectText }}</span\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th\n\t\t\t\t\t\t\tv-for=\"header in mappedHeaders\"\n\t\t\t\t\t\t\t:key=\"header.key\"\n\t\t\t\t\t\t\tclass=\"bb-table-header\"\n\t\t\t\t\t\t\t:class=\"header.classes\"\n\t\t\t\t\t\t\tscope=\"col\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:classes=\"header.classes\"\n\t\t\t\t\t\t\t\t:item=\"undefined as unknown\"\n\t\t\t\t\t\t\t\t:items=\"internalItems\"\n\t\t\t\t\t\t\t\t:label=\"header.label\"\n\t\t\t\t\t\t\t\t:name=\"header.slotName\"\n\t\t\t\t\t\t\t\t><span class=\"bb-table-header__content\">{{\n\t\t\t\t\t\t\t\t\theader.label\n\t\t\t\t\t\t\t\t}}</span></slot\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<th\n\t\t\t\t\t\t\tv-if=\"actions\"\n\t\t\t\t\t\t\tclass=\"bb-table-header bb-table-header--actions\"\n\t\t\t\t\t\t\t:class=\"thClass\"\n\t\t\t\t\t\t\tscope=\"col\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<slot name=\"header:actions\" :text=\"actionsText\">\n\t\t\t\t\t\t\t\t<span class=\"bb-table-header__content\">\n\t\t\t\t\t\t\t\t\t{{ actionsText }}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t</th>\n\t\t\t\t\t</tr>\n\t\t\t\t</slot>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t\t<slot v-if=\"loading\" :items=\"internalItems\" name=\"loading\">\n\t\t\t\t\t<tr class=\"bb-table-loading__row\">\n\t\t\t\t\t\t<td\n\t\t\t\t\t\t\tclass=\"bb-table-loading__cell\"\n\t\t\t\t\t\t\t:colspan=\"replacementContentSpan\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span class=\"bb-table-loading__text\">{{ loadingText }}</span>\n\n\t\t\t\t\t\t\t<div class=\"bb-table-skeleton__container\" role=\"status\">\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tv-for=\"item in skeletonLength\"\n\t\t\t\t\t\t\t\t\t:key=\"item\"\n\t\t\t\t\t\t\t\t\tclass=\"bb-table-skeleton-item\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<div class=\"bb-table-skeleton-item__avatar-container\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"bb-table-skeleton-item__avatar\"></div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"bb-table-skeleton-item__text\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"bb-table-skeleton-item__line\"></div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"bb-table-skeleton-item__line\"></div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</slot>\n\t\t\t\t<slot v-else-if=\"!options.length\" :name=\"'no-data'\">\n\t\t\t\t\t<tr class=\"bb-table-no-data__row\">\n\t\t\t\t\t\t<td\n\t\t\t\t\t\t\tclass=\"bb-table-no-data__cell\"\n\t\t\t\t\t\t\t:colspan=\"replacementContentSpan\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span class=\"bb-table-no-data__text\">{{ noDataText }}</span>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</slot>\n\t\t\t\t<slot v-else name=\"tbody\">\n\t\t\t\t\t<tr\n\t\t\t\t\t\tv-for=\"item in mappedItems\"\n\t\t\t\t\t\t:key=\"item.valueHash\"\n\t\t\t\t\t\tclass=\"bb-table-data__row\"\n\t\t\t\t\t\t@click=\"item.onRowClick\"\n\t\t\t\t\t\t@contextmenu=\"item.onRowContextMenu\"\n\t\t\t\t\t\t@dblclick=\"item.onRowDblClick\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<td\n\t\t\t\t\t\t\tv-if=\"selectable\"\n\t\t\t\t\t\t\tclass=\"bb-table-data__cell bb-table-data__cell--select\"\n\t\t\t\t\t\t\t:class=\"tdClass\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:checked=\"!!item.selected\"\n\t\t\t\t\t\t\t\t:disabled=\"!!item.disabled\"\n\t\t\t\t\t\t\t\t:input-name=\"randomName\"\n\t\t\t\t\t\t\t\t:item=\"item.item\"\n\t\t\t\t\t\t\t\t:name=\"'select'\"\n\t\t\t\t\t\t\t\t:readonly=\"!!readonly\"\n\t\t\t\t\t\t\t\t:value=\"item.value\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<!-- We use temp names for these inputs because we don't submit them -->\n\t\t\t\t\t\t\t\t<label\n\t\t\t\t\t\t\t\t\tv-if=\"multiple\"\n\t\t\t\t\t\t\t\t\tclass=\"bb-table-check__label\"\n\t\t\t\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t\t\t\t'bb-table-check__label--disabled': item.disabled,\n\t\t\t\t\t\t\t\t\t}\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<BaseCheckbox\n\t\t\t\t\t\t\t\t\t\t:checked=\"item.selected || allSelected\"\n\t\t\t\t\t\t\t\t\t\tclass=\"bb-table-check\"\n\t\t\t\t\t\t\t\t\t\t:disabled=\"item.disabled\"\n\t\t\t\t\t\t\t\t\t\t:name=\"randomName\"\n\t\t\t\t\t\t\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t\t\t\t\t\t\t@change=\"() => onInputChange(item)\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<span class=\"bb-table-check__label-text\">{{\n\t\t\t\t\t\t\t\t\t\titem.accessibleLabel\n\t\t\t\t\t\t\t\t\t}}</span>\n\t\t\t\t\t\t\t\t</label>\n\n\t\t\t\t\t\t\t\t<label\n\t\t\t\t\t\t\t\t\tv-else\n\t\t\t\t\t\t\t\t\tclass=\"bb-table-radio__label\"\n\t\t\t\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t\t\t\t'bb-table-radio__label--disabled': item.disabled,\n\t\t\t\t\t\t\t\t\t}\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<BaseRadio\n\t\t\t\t\t\t\t\t\t\t:checked=\"item.selected\"\n\t\t\t\t\t\t\t\t\t\tclass=\"bb-table-radio\"\n\t\t\t\t\t\t\t\t\t\t:disabled=\"item.disabled\"\n\t\t\t\t\t\t\t\t\t\t:name=\"randomName\"\n\t\t\t\t\t\t\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t\t\t\t\t\t\t:value=\"item.value\"\n\t\t\t\t\t\t\t\t\t\t@change=\"() => onInputChange(item)\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<span class=\"bb-table-radio__label-text\">{{\n\t\t\t\t\t\t\t\t\t\titem.accessibleLabel\n\t\t\t\t\t\t\t\t\t}}</span>\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td\n\t\t\t\t\t\t\tv-for=\"col in item.cols\"\n\t\t\t\t\t\t\t:key=\"col.key\"\n\t\t\t\t\t\t\tclass=\"bb-table-data__cell\"\n\t\t\t\t\t\t\t:class=\"col.classes\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:classes=\"col.classes\"\n\t\t\t\t\t\t\t\t:content=\"col.content\"\n\t\t\t\t\t\t\t\t:item=\"item.item\"\n\t\t\t\t\t\t\t\t:name=\"col.slotName\"\n\t\t\t\t\t\t\t\t:value=\"item.value\"\n\t\t\t\t\t\t\t\t>{{ col.content }}</slot\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td\n\t\t\t\t\t\t\tv-if=\"actions\"\n\t\t\t\t\t\t\tclass=\"bb-table__cell bb-table__cell--actions\"\n\t\t\t\t\t\t\t:class=\"tdClass\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:item=\"item.item\"\n\t\t\t\t\t\t\t\t:name=\"'actions'\"\n\t\t\t\t\t\t\t\t:value=\"item.value\"\n\t\t\t\t\t\t\t></slot>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</slot>\n\t\t\t</tbody>\n\t\t\t<tfoot>\n\t\t\t\t<slot name=\"tfoot\"></slot>\n\t\t\t</tfoot>\n\t\t</table>\n\t\t<input v-for=\"input in hiddenInputs\" :key=\"input.value\" v-bind=\"input\" />\n\t</component>\n</template>\n\n<script setup lang=\"ts\">\nimport { add } from '@/utilities/functions/add';\nimport { clamp } from '@/utilities/functions/clamp';\nimport { isNil } from '@/utilities/functions/isNil';\nimport { computed, ref, toRef, watch } from 'vue';\nimport { useId } from '@/composables/useId';\nimport { useItemValue } from '@/composables/useItemValue';\nimport { when } from '@/utilities/functions/when';\nimport BaseCheckbox from '../BaseCheckbox/BaseCheckbox.vue';\nimport BaseRadio from '../BaseRadio/BaseRadio.vue';\nimport { useOptions } from '@/composables/useOptions';\nimport type { Option as BaseOption } from '@/types/Option';\nimport type {\n\tBbTableProps,\n\tMappedCell,\n\tMappedHeader,\n\tMappedItem,\n\tBbTableColumn,\n\tBbTableEvents,\n\tBbTableSlots,\n} from './types';\nimport type { Classes } from '@/types/Classes';\n\nconst { getItemValue } = useItemValue();\n\n/**\n * We do not allow the use of the checkbox or radio themselves as\n * they would not be submitted if the user has changed\n * page in the meantime, rather we provide a temporary\n * name so radio still work but we later add hidden inputs for submission\n */\nconst randomName = useId().id.value;\n\nconst props = withDefaults(defineProps<BbTableProps>(), {\n\talign: 'left',\n\taccessibleLabel: (columns: MappedCell[]) =>\n\t\t['Seleziona'].concat(columns.map((col) => col.content)).join(' '),\n\tactionsText: 'Azioni',\n\tallowSelectAll: true,\n\tcolumns: () => [],\n\tdependencies: () => [],\n\tdepsDebounceTime: 0,\n\tfixedColumns: () => [],\n\titems: () => [],\n\tloadingText: 'Caricamento',\n\tmultiple: true,\n\tmodelValue: () => [],\n\tnoDataText: 'Non ci sono elementi da visualizzare',\n\tselectAllLabel: 'Seleziona tutti gli elementi di questa pagina',\n\tselectText: 'Seleziona un elemento',\n});\n\nconst emit = defineEmits<BbTableEvents>();\n\ndefineSlots<BbTableSlots>();\n\nconst container = ref<HTMLElement>();\n\nconst accessibleLabel = props.accessibleLabel;\nconst loadingText = props.loadingText;\nconst noDataText = props.noDataText;\nconst selectText = props.selectText;\n\n// We render the table in a fieldset to group checkbox / radios if the table is selectable\nconst containerTag = computed(() => (props.selectable ? 'fieldset' : 'div'));\nconst internalLoading = ref(false);\nconst loading = computed(() => props.loading || internalLoading.value);\n\nconst replacementContentSpan = computed(() => {\n\treturn [!!props.selectable, !!props.actions].reduce(\n\t\t(acc: number, current) => acc + Number(!!current),\n\t\tprops.columns.length\n\t);\n});\n\n/**\n * Map column identifiers to slot names\n */\nconst slotNames = computed(() =>\n\tprops.columns.reduce(\n\t\t(acc: { [key: string]: string }, curr: BbTableColumn) => {\n\t\t\tconst mapped = curr.key.split(/\\W+/g).join('_');\n\t\t\tacc[curr.key] = mapped;\n\t\t\treturn acc;\n\t\t},\n\t\t{}\n\t)\n);\n\nconst { options, selectOption, unselectOption, internalItems } = useOptions({\n\temit,\n\titemText: undefined,\n\titemValue: props.itemValue,\n\tmodelValue: toRef(props, 'modelValue'),\n\tmultiple: props.multiple,\n\tresetQueryOnOptionSelected: false,\n\tstash: false,\n\titems: toRef(props, 'items'),\n\tenforceCoherence: true,\n\tprefill: true,\n\tmodelValueDebounceTime: 0,\n\tdependencies: toRef(props, 'dependencies'),\n\tdepsDebounceTime: props.depsDebounceTime,\n\tqueryDebounceTime: 0,\n\tdisabled: toRef(props, 'disabled'),\n});\n\n/**\n * Take the columns and generate a simplified array for headers display\n */\nconst mappedHeaders = computed(() =>\n\tprops.columns.map((column: BbTableColumn): MappedHeader => {\n\t\tconst align = column.align || 'left';\n\t\tconst { label, key } = column;\n\t\tconst slotName = `header:${slotNames.value[column.key]}`;\n\t\t// Create a single merged array of all the passed classes\n\t\tlet classes: Classes = [`bb-table-header--${align}`];\n\t\tif (props.thClass) {\n\t\t\tclasses = classes.concat(props.thClass);\n\t\t}\n\t\tif (column.thClass) {\n\t\t\tclasses = classes.concat(column.thClass);\n\t\t}\n\t\treturn {\n\t\t\talign,\n\t\t\tkey,\n\t\t\tlabel,\n\t\t\tslotName,\n\t\t\tclasses,\n\t\t};\n\t})\n);\n\n/**\n * Map items to an an array that represents the entire row.\n * Track every logic here so we don't have inline callbacks in the template.\n */\nconst mappedItems = computed<MappedItem[]>(() => {\n\treturn options.value.map((item: BaseOption): MappedItem => {\n\t\t/**\n\t\t * Item is selectable only if the table allows or item\n\t\t * passes iteratee and the selection is not disabled\n\t\t */\n\t\tlet disabled = !props.selectable;\n\t\tif (typeof props.selectable === 'function') {\n\t\t\tdisabled = !props.selectable(item);\n\t\t}\n\t\tdisabled = disabled || !!item.disabled;\n\n\t\t// Create a projection of the columns and run all formatter logic so\n\t\t// we just display content in the template\n\t\tconst cols: MappedCell[] = props.columns.map((column) => {\n\t\t\t// Slot identifier\n\t\t\tconst slotName = slotNames.value[column.key];\n\t\t\tconst align = column.align || 'left';\n\t\t\tconst { label, key } = column;\n\t\t\t// The content\n\t\t\tlet content = getItemValue(item.item, column.key);\n\t\t\tif (\n\t\t\t\tcolumn.formatter &&\n\t\t\t\t// By default the formatter runs anyway\n\t\t\t\t(!isNil(content) || column.formatOnNull !== false)\n\t\t\t) {\n\t\t\t\tcontent = column.formatter(content, column.key, item.item);\n\t\t\t}\n\t\t\tif (column.placeholder && isNil(content)) {\n\t\t\t\tcontent = column.placeholder;\n\t\t\t}\n\n\t\t\t// Merge global and specific classes\n\t\t\tlet classes: Classes = [`bb-table-data__cell--${align}`];\n\t\t\tif (props.tdClass) {\n\t\t\t\tif (typeof props.tdClass === 'function') {\n\t\t\t\t\tlet temp = props.tdClass(content, column.key, item.item);\n\t\t\t\t\tif (temp) {\n\t\t\t\t\t\tclasses = classes.concat(temp);\n\t\t\t\t\t}\n\t\t\t\t} else classes = classes.concat(props.tdClass);\n\t\t\t}\n\t\t\tif (column.tdClass) {\n\t\t\t\tif (typeof column.tdClass === 'function') {\n\t\t\t\t\tlet temp = column.tdClass(content, column.key, item.item);\n\t\t\t\t\tif (temp) {\n\t\t\t\t\t\tclasses = classes.concat(temp);\n\t\t\t\t\t}\n\t\t\t\t} else classes = classes.concat(column.tdClass);\n\t\t\t}\n\t\t\treturn {\n\t\t\t\talign,\n\t\t\t\tclasses,\n\t\t\t\tcontent,\n\t\t\t\tkey,\n\t\t\t\tlabel,\n\t\t\t\tslotName,\n\t\t\t};\n\t\t});\n\t\tconst accessibleLabelText = accessibleLabel(cols, item.item);\n\t\tconst res = {\n\t\t\taccessibleLabel: accessibleLabelText,\n\t\t\tcols,\n\t\t\tonRowClick: (event: MouseEvent) =>\n\t\t\t\temit('click:row', event, item, !!item.selected),\n\t\t\tonRowContextMenu: (event: MouseEvent) =>\n\t\t\t\temit('contextmenu:row', event, item, !!item.selected),\n\t\t\tonRowDblClick: (event: MouseEvent) =>\n\t\t\t\temit('dblclick:row', event, item, !!item.selected),\n\t\t\titem: item.item,\n\t\t\ttext: item.text,\n\t\t\tvalueHash: item.valueHash,\n\t\t\tvalue: item.value,\n\t\t\tselected: item.selected,\n\t\t\tdisabled,\n\t\t};\n\t\treturn res;\n\t});\n});\n\n/**\n * Same behavior as GMail.\n * If anything is selected remove it.\n * Then when empty you select all items of this page\n */\nconst onChangeSelectAll = (value: boolean) => {\n\tlet selectAllValue = value;\n\tlet modelValue: any[] = [];\n\n\tif (selectAllValue) {\n\t\tmodelValue = mappedItems.value.reduce((acc: any[], curr) => {\n\t\t\tif (!curr.disabled) acc.push(curr.value);\n\t\t\treturn acc;\n\t\t}, []);\n\t}\n\temit('update:modelValue', modelValue);\n\temit('update:selectAll', value);\n};\n\nconst allSelected = computed(\n\t() =>\n\t\t!!(\n\t\t\tmappedItems.value.length &&\n\t\t\tmappedItems.value\n\t\t\t\t.filter((item) => !item.disabled)\n\t\t\t\t.every((item) => item.selected)\n\t\t)\n);\nconst indeterminate = computed(\n\t() =>\n\t\tmappedItems.value.some((item) => !item.selected) &&\n\t\t!!props.modelValue?.length\n);\n/**\n * Whenever an input changes update modelValue if any\n */\nconst onInputChange = (item: MappedItem) => {\n\tif (item.selected) {\n\t\tunselectOption(item);\n\t} else {\n\t\tselectOption(item);\n\t}\n};\n\n/**\n * When using this component for submission we add a bunch of hidden inputs\n * so the submitted inputs is on par with v-model\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);\nconst hiddenInputs = computed(() => {\n\treturn [].concat(props.modelValue).map((current) => {\n\t\tconst value = makeInputValue(current);\n\t\treturn {\n\t\t\tdisabled: props.disabled,\n\t\t\tname: props.name,\n\t\t\ttype: 'hidden',\n\t\t\tvalue: value,\n\t\t};\n\t});\n});\n\nconst skeletonLength = computed(() => {\n\treturn clamp(options.value.length, 4, 10);\n});\n\nwatch(\n\t() => mappedItems.value,\n\t() => {\n\t\tif (props.fixedColumns.length && props.items) {\n\t\t\tif (container.value) {\n\t\t\t\t// Get all the headers\n\t\t\t\tconst headers = Array.from(\n\t\t\t\t\tcontainer.value.querySelectorAll<HTMLElement>('thead th')\n\t\t\t\t);\n\n\t\t\t\ttype MappedColumn = {\n\t\t\t\t\tindex: number;\n\t\t\t\t\tposition: 'left' | 'right';\n\t\t\t\t\twidth: number;\n\t\t\t\t\toffset: number;\n\t\t\t\t};\n\n\t\t\t\tconst mappedColumns = props.fixedColumns.reduce((acc, curr) => {\n\t\t\t\t\tconst index = typeof curr === 'number' ? curr : curr.index;\n\t\t\t\t\tconst position = typeof curr === 'number' ? 'left' : curr.position;\n\t\t\t\t\tconst clientRect = headers[index].getBoundingClientRect();\n\t\t\t\t\tconst width = Math.floor(clientRect.width);\n\t\t\t\t\tconst offset = acc\n\t\t\t\t\t\t.filter((el) => el.position === position)\n\t\t\t\t\t\t.map((el) => el.width)\n\t\t\t\t\t\t.reduce(add, 0);\n\n\t\t\t\t\tconst mapped: MappedColumn = {\n\t\t\t\t\t\tindex: index,\n\t\t\t\t\t\tposition: position,\n\t\t\t\t\t\twidth: width,\n\t\t\t\t\t\toffset: offset,\n\t\t\t\t\t};\n\t\t\t\t\tacc.push(mapped);\n\t\t\t\t\treturn acc;\n\t\t\t\t}, [] as MappedColumn[]);\n\n\t\t\t\tconst rows = Array.from(container.value?.querySelectorAll('tr'));\n\t\t\t\tconst affectedCells = rows.map((row) =>\n\t\t\t\t\tArray.from(\n\t\t\t\t\t\trow.querySelectorAll<HTMLElement>(\n\t\t\t\t\t\t\tmappedColumns\n\t\t\t\t\t\t\t\t.map((el) => `:scope > :nth-child(${el.index + 1})`)\n\t\t\t\t\t\t\t\t.join(', ')\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\taffectedCells.forEach((row) => {\n\t\t\t\t\trow.forEach((cell, index) => {\n\t\t\t\t\t\tcell.style.position = 'sticky';\n\n\t\t\t\t\t\tif (mappedColumns[index].position === 'left') {\n\t\t\t\t\t\t\tcell.style.left = `${mappedColumns[index].offset}px`;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcell.style.right = `${mappedColumns[index].offset}px`;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t},\n\t{\n\t\tflush: 'post',\n\t}\n);\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbTable';\n</style>\n"],"names":["getItemValue","useItemValue","randomName","useId","props","__props","emit","__emit","container","ref","accessibleLabel","loadingText","noDataText","selectText","containerTag","computed","internalLoading","loading","replacementContentSpan","acc","current","slotNames","curr","mapped","options","selectOption","unselectOption","internalItems","useOptions","toRef","mappedHeaders","column","align","label","key","slotName","classes","mappedItems","item","disabled","cols","content","isNil","temp","event","onChangeSelectAll","value","selectAllValue","modelValue","allSelected","indeterminate","_a","onInputChange","makeInputValue","when","hiddenInputs","skeletonLength","clamp","watch","headers","mappedColumns","index","position","clientRect","width","offset","el","add","row","cell"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4QM,UAAA,EAAE,cAAAA,MAAiBC,MAQnBC,IAAaC,KAAQ,GAAG,OAExBC,IAAQC,GAmBRC,IAAOC,GAIPC,IAAYC,KAEZC,IAAkBN,EAAM,iBACxBO,IAAcP,EAAM,aACpBQ,IAAaR,EAAM,YACnBS,IAAaT,EAAM,YAGnBU,IAAeC,EAAS,MAAOX,EAAM,aAAa,aAAa,KAAM,GACrEY,IAAkBP,EAAI,EAAK,GAC3BQ,IAAUF,EAAS,MAAMX,EAAM,WAAWY,EAAgB,KAAK,GAE/DE,IAAyBH,EAAS,MAChC,CAAC,CAAC,CAACX,EAAM,YAAY,CAAC,CAACA,EAAM,OAAO,EAAE;AAAA,MAC5C,CAACe,GAAaC,MAAYD,IAAM,CAAO,CAAC,CAACC;AAAA,MACzChB,EAAM,QAAQ;AAAA,IAAA,CAEf,GAKKiB,IAAYN;AAAA,MAAS,MAC1BX,EAAM,QAAQ;AAAA,QACb,CAACe,GAAgCG,MAAwB;AACxD,gBAAMC,IAASD,EAAK,IAAI,MAAM,MAAM,EAAE,KAAK,GAAG;AAC1C,iBAAAH,EAAAG,EAAK,GAAG,IAAIC,GACTJ;AAAA,QACR;AAAA,QACA,CAAC;AAAA,MACF;AAAA,IAAA,GAGK,EAAE,SAAAK,GAAS,cAAAC,GAAc,gBAAAC,GAAgB,eAAAC,EAAA,IAAkBC,GAAW;AAAA,MAC3E,MAAAtB;AAAA,MACA,UAAU;AAAA,MACV,WAAWF,EAAM;AAAA,MACjB,YAAYyB,EAAMzB,GA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AAO,GAAGT,EAAcC,CAAK,EAAE,MAAM,OAEhDQ,EAAK,MAAM,QAAQ,GAAGT,EAAcC,CAAK,EAAE,MAAM;AAAA,YAClD,CACA;AAAA,UAAA,CACD;AAAA,QACF;AAAA,MAEF;AAAA,MACA;AAAA,QACC,OAAO;AAAA,MACR;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index109.js CHANGED
@@ -1,17 +1,18 @@
1
- import { defineComponent as w, ref as y, computed as v, openBlock as B, createBlock as g, withCtx as r, renderSlot as a, normalizeProps as d, guardReactiveProps as p, createVNode as $, mergeProps as k } from "vue";
2
- import V from "./index24.js";
1
+ import { defineComponent as v, ref as y, computed as B, openBlock as g, createBlock as k, withCtx as l, renderSlot as r, normalizeProps as n, guardReactiveProps as i, createVNode as $, mergeProps as w } from "vue";
2
+ import V from "./index26.js";
3
3
  /* empty css */
4
4
  import P from "./index44.js";
5
5
  /* empty css */
6
- const M = /* @__PURE__ */ w({
7
- __name: "BbTextarea",
6
+ const K = /* @__PURE__ */ v({
7
+ __name: "BbTag",
8
8
  props: {
9
9
  "append:icon": {},
10
10
  autocomplete: {},
11
11
  autofocus: {},
12
- autoGrow: { type: Boolean },
12
+ comma: { type: Boolean },
13
13
  direction: {},
14
14
  disabled: { type: Boolean },
15
+ divider: {},
15
16
  errors: {},
16
17
  hasErrors: { type: Boolean },
17
18
  hideLabel: { type: Boolean },
@@ -21,35 +22,36 @@ const M = /* @__PURE__ */ w({
21
22
  labelPosition: {},
22
23
  loading: { type: Boolean },
23
24
  modelValue: {},
25
+ multiple: { type: Boolean, default: !0 },
24
26
  name: {},
25
27
  persistentHint: { type: Boolean },
26
28
  placeholder: {},
27
29
  "prepend:icon": {},
28
30
  readonly: {},
29
31
  required: { type: Boolean },
30
- reverse: { type: Boolean },
31
- rows: {}
32
+ reverse: { type: Boolean }
32
33
  },
33
- emits: ["blur", "change", "click", "focus", "input", "keydown", "mousedown", "mouseup", "update:modelValue"],
34
+ emits: ["blur", "change", "click", "duplicate", "focus", "inactive", "input", "keydown", "keyup", "update:modelValue"],
34
35
  setup(t, { emit: u }) {
35
- const n = t, o = u, l = y(!1), m = v(() => n.persistentHint || l.value), h = {
36
- onBlur: (e) => {
37
- l.value = !1, o("blur", e);
38
- },
39
- onChange: (e) => o("change", e),
40
- onClick: (e) => o("click", e),
36
+ const d = t, a = u, p = y(!1), m = B(() => d.persistentHint || p.value), c = {
37
+ onBlur: (e) => a("blur", e),
38
+ onChange: (e) => a("change", e),
39
+ onClick: (e) => a("click", e),
40
+ onDuplicate: (e) => a("duplicate", e),
41
41
  onFocus: (e) => {
42
- l.value = !0, o("focus", e);
42
+ p.value = !0, a("focus", e);
43
+ },
44
+ onInactive: () => {
45
+ p.value = !1, a("inactive");
43
46
  },
44
- onInput: (e) => o("input", e),
45
- onKeydown: (e) => o("keydown", e),
46
- onMousedown: (e) => o("mousedown", e),
47
- onMouseup: (e) => o("mouseup", e),
48
- "onUpdate:modelValue": (e) => o("update:modelValue", e)
47
+ onInput: (e) => a("input", e),
48
+ onKeydown: (e) => a("keydown", e),
49
+ onKeyup: (e) => a("keyup", e),
50
+ "onUpdate:modelValue": (e) => a("update:modelValue", e)
49
51
  };
50
- return (e, q) => (B(), g(V, {
52
+ return (e, q) => (g(), k(V, {
51
53
  id: e.id,
52
- class: "bb-textarea",
54
+ class: "bb-tag",
53
55
  direction: e.direction,
54
56
  errors: e.errors,
55
57
  "has-errors": e.hasErrors,
@@ -62,53 +64,55 @@ const M = /* @__PURE__ */ w({
62
64
  reverse: e.reverse,
63
65
  "show-hint": m.value
64
66
  }, {
65
- label: r((s) => [
66
- a(e.$slots, "label", d(p(s)))
67
+ label: l((s) => [
68
+ r(e.$slots, "label", n(i(s)))
67
69
  ]),
68
- input: r(({ id: s, name: b, hasErrors: c, ariaDescribedby: f }) => [
69
- $(P, k({
70
+ input: l(({ id: s, name: h, hasErrors: b, ariaDescribedby: f }) => [
71
+ $(P, w({
70
72
  id: s,
71
- "append:icon": n["append:icon"],
73
+ "append:icon": d["append:icon"],
72
74
  "aria-describedby": f,
73
- "auto-grow": e.autoGrow,
75
+ autocomplete: e.autocomplete,
74
76
  autofocus: e.autofocus,
77
+ comma: e.comma,
75
78
  disabled: e.disabled,
76
- "has-errors": c,
79
+ divider: e.divider,
80
+ "has-errors": b,
77
81
  loading: e.loading,
78
82
  "model-value": e.modelValue,
79
- name: b,
83
+ multiple: e.multiple,
84
+ name: h,
80
85
  placeholder: e.placeholder,
81
- "prepend:icon": n["prepend:icon"],
86
+ "prepend:icon": d["prepend:icon"],
82
87
  readonly: e.readonly,
83
- required: e.required,
84
- rows: e.rows
85
- }, h), {
86
- "append-outer": r(() => [
87
- a(e.$slots, "append-outer")
88
+ required: e.required
89
+ }, c), {
90
+ "prepend-outer": l((o) => [
91
+ r(e.$slots, "prepend-outer", n(i(o)))
88
92
  ]),
89
- append: r(() => [
90
- a(e.$slots, "append")
93
+ prepend: l((o) => [
94
+ r(e.$slots, "prepend", n(i(o)))
91
95
  ]),
92
- prepend: r(() => [
93
- a(e.$slots, "prepend")
96
+ prefix: l((o) => [
97
+ r(e.$slots, "prefix", n(i(o)))
94
98
  ]),
95
- "prepend-outer": r(() => [
96
- a(e.$slots, "prepend-outer")
99
+ append: l((o) => [
100
+ r(e.$slots, "append", n(i(o)))
97
101
  ]),
98
- prefix: r((i) => [
99
- a(e.$slots, "prefix", d(p(i)))
102
+ suffix: l((o) => [
103
+ r(e.$slots, "suffix", n(i(o)))
100
104
  ]),
101
- suffix: r((i) => [
102
- a(e.$slots, "suffix", d(p(i)))
105
+ "append-outer": l((o) => [
106
+ r(e.$slots, "append-outer", n(i(o)))
103
107
  ]),
104
108
  _: 2
105
- }, 1040, ["id", "append:icon", "aria-describedby", "auto-grow", "autofocus", "disabled", "has-errors", "loading", "model-value", "name", "placeholder", "prepend:icon", "readonly", "required", "rows"])
109
+ }, 1040, ["id", "append:icon", "aria-describedby", "autocomplete", "autofocus", "comma", "disabled", "divider", "has-errors", "loading", "model-value", "multiple", "name", "placeholder", "prepend:icon", "readonly", "required"])
106
110
  ]),
107
111
  _: 3
108
112
  }, 8, ["id", "direction", "errors", "has-errors", "hide-label", "hint", "label", "label-position", "model-value", "name", "reverse", "show-hint"]));
109
113
  }
110
114
  });
111
115
  export {
112
- M as default
116
+ K as default
113
117
  };
114
118
  //# sourceMappingURL=index109.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index109.js","sources":["../src/components/BbTextarea/BbTextarea.vue"],"sourcesContent":["<template>\n\t<BaseInputContainer\n\t\t:id=\"id\"\n\t\tclass=\"bb-textarea\"\n\t\t:direction=\"direction\"\n\t\t:errors=\"errors\"\n\t\t:has-errors=\"hasErrors\"\n\t\t:hide-label=\"hideLabel\"\n\t\t:hint=\"hint\"\n\t\t:label=\"label\"\n\t\t:label-position=\"labelPosition\"\n\t\t:model-value=\"modelValue\"\n\t\t:name=\"name\"\n\t\t:reverse=\"reverse\"\n\t\t:show-hint=\"showHint\"\n\t>\n\t\t<template #label=\"data\"><slot name=\"label\" v-bind=\"data\"></slot></template>\n\t\t<template #input=\"{ id, name, hasErrors, ariaDescribedby }\">\n\t\t\t<BaseTextarea\n\t\t\t\t:id=\"id\"\n\t\t\t\t:append:icon=\"props['append:icon']\"\n\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t:auto-grow=\"autoGrow\"\n\t\t\t\t:autofocus=\"autofocus\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:has-errors=\"hasErrors\"\n\t\t\t\t:loading=\"loading\"\n\t\t\t\t:model-value=\"modelValue\"\n\t\t\t\t:name=\"name\"\n\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t:prepend:icon=\"props['prepend:icon']\"\n\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t:required=\"required\"\n\t\t\t\t:rows=\"rows\"\n\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t>\n\t\t\t\t<template #append-outer><slot name=\"append-outer\" /></template>\n\t\t\t\t<template #append><slot name=\"append\" /></template>\n\t\t\t\t<template #prepend><slot name=\"prepend\" /></template>\n\t\t\t\t<template #prepend-outer><slot name=\"prepend-outer\" /></template>\n\t\t\t\t<template #prefix=\"data\"><slot name=\"prefix\" v-bind=\"data\" /></template>\n\t\t\t\t<template #suffix=\"data\"><slot name=\"suffix\" v-bind=\"data\" /></template>\n\t\t\t</BaseTextarea>\n\t\t</template>\n\t</BaseInputContainer>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed } from 'vue';\nimport BaseInputContainer from '../BaseInputContainer/BaseInputContainer.vue';\nimport BaseTextarea from '../BaseTextarea/BaseTextarea.vue';\nimport type {\n\tBaseTextareaEvents,\n\tBaseTextareaSlots,\n} from '../BaseTextarea/BaseTextarea.vue';\nimport type { HTMLAttributes, InputHTMLAttributes } from 'vue';\n\nexport type BbTextareaProps = {\n\t/**\n\t * Name of the icon to be added at the end of the input.\n\t */\n\t// eslint-disable-next-line vue/prop-name-casing\n\t'append:icon'?: string;\n\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tautocomplete?: InputHTMLAttributes['autocomplete'];\n\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Expands the textarea to match its content\n\t */\n\tautoGrow?: boolean;\n\n\t/**\n\t * Direction of the layout of the component. Can either be a predefined value or a pattern separated by a space like `xx xxxxx`.\n\t */\n\tdirection?: 'horizontal' | 'vertical' | 'auto' | string;\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Can be a string or an array of string containing the messages to display.\n\t */\n\terrors?: string | string[];\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * Visually hides the label of the input while maintaining accessibility.\n\t */\n\thideLabel?: boolean;\n\n\t/**\n\t * Text box to be displayed near the input, usually to indicate instructions.\n\t */\n\thint?: string;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Text content of the label of the element.\n\t */\n\tlabel: string;\n\n\t/**\n\t * Sets the text alignment of the label.\n\t */\n\tlabelPosition?: 'left' | 'center' | 'right';\n\n\t/**\n\t * Sets the component in a loading state, usually triggering some visual styles.\n\t */\n\tloading?: boolean;\n\n\t/**\n\t * Used by v-model\n\t */\n\tmodelValue: string | null;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * Keeps the hint displayed.\n\t */\n\tpersistentHint?: boolean;\n\n\t/**\n\t * String displayed when there's no data.\n\t */\n\tplaceholder?: InputHTMLAttributes['placeholder'];\n\n\t/**\n\t * Name of the icon to be added at the start of the input.\n\t */\n\t// eslint-disable-next-line vue/prop-name-casing\n\t'prepend:icon'?: string;\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: InputHTMLAttributes['readonly'];\n\n\t/**\n\t * Sets the input as required.\n\t */\n\trequired?: boolean;\n\n\t/**\n\t * Reverses the layout. Applicable in every direction the order of the label and the input is swapped.\n\t */\n\treverse?: boolean;\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\trows?: string | number;\n};\n\nconst props = defineProps<BbTextareaProps>();\n\nexport type BbTextareaEvents = BaseTextareaEvents;\nconst emit = defineEmits<BbTextareaEvents>();\n\nexport type BbTextareaSlots = BaseTextareaSlots & {\n\tlabel?: (props: { text: string; hasErrors: boolean }) => any;\n};\n\ndefineSlots<BbTextareaSlots>();\n\nconst active = ref(false);\nconst showHint = computed(() => props.persistentHint || active.value);\n\n/**\n * These events are just propagated\n */\nconst eventListeners = {\n\tonBlur: (event: FocusEvent) => {\n\t\tactive.value = false;\n\t\temit('blur', event);\n\t},\n\tonChange: (event: Event) => emit('change', event),\n\tonClick: (event: MouseEvent) => emit('click', event),\n\tonFocus: (event: FocusEvent) => {\n\t\tactive.value = true;\n\t\temit('focus', event);\n\t},\n\tonInput: (event: Event) => emit('input', event),\n\tonKeydown: (event: KeyboardEvent) => emit('keydown', event),\n\tonMousedown: (event: MouseEvent) => emit('mousedown', event),\n\tonMouseup: (event: MouseEvent) => emit('mouseup', event),\n\t'onUpdate:modelValue': (value: string | null) =>\n\t\temit('update:modelValue', value),\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbTextarea';\n</style>\n"],"names":["props","__props","emit","__emit","active","ref","showHint","computed","eventListeners","event","value"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiLA,UAAMA,IAAQC,GAGRC,IAAOC,GAQPC,IAASC,EAAI,EAAK,GAClBC,IAAWC,EAAS,MAAMP,EAAM,kBAAkBI,EAAO,KAAK,GAK9DI,IAAiB;AAAA,MACtB,QAAQ,CAACC,MAAsB;AAC9B,QAAAL,EAAO,QAAQ,IACfF,EAAK,QAAQO,CAAK;AAAA,MACnB;AAAA,MACA,UAAU,CAACA,MAAiBP,EAAK,UAAUO,CAAK;AAAA,MAChD,SAAS,CAACA,MAAsBP,EAAK,SAASO,CAAK;AAAA,MACnD,SAAS,CAACA,MAAsB;AAC/B,QAAAL,EAAO,QAAQ,IACfF,EAAK,SAASO,CAAK;AAAA,MACpB;AAAA,MACA,SAAS,CAACA,MAAiBP,EAAK,SAASO,CAAK;AAAA,MAC9C,WAAW,CAACA,MAAyBP,EAAK,WAAWO,CAAK;AAAA,MAC1D,aAAa,CAACA,MAAsBP,EAAK,aAAaO,CAAK;AAAA,MAC3D,WAAW,CAACA,MAAsBP,EAAK,WAAWO,CAAK;AAAA,MACvD,uBAAuB,CAACC,MACvBR,EAAK,qBAAqBQ,CAAK;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index109.js","sources":["../src/components/BbTag/BbTag.vue"],"sourcesContent":["<template>\n\t<BaseInputContainer\n\t\t:id=\"id\"\n\t\tclass=\"bb-tag\"\n\t\t:direction=\"direction\"\n\t\t:errors=\"errors\"\n\t\t:has-errors=\"hasErrors\"\n\t\t:hide-label=\"hideLabel\"\n\t\t:hint=\"hint\"\n\t\t:label=\"label\"\n\t\t:label-position=\"labelPosition\"\n\t\t:model-value=\"modelValue\"\n\t\t:name=\"name\"\n\t\t:reverse=\"reverse\"\n\t\t:show-hint=\"showHint\"\n\t>\n\t\t<template #label=\"data\"><slot name=\"label\" v-bind=\"data\"></slot></template>\n\t\t<template #input=\"{ id, name, hasErrors, ariaDescribedby }\">\n\t\t\t<BaseTag\n\t\t\t\t:id=\"id\"\n\t\t\t\t:append:icon=\"props['append:icon']\"\n\t\t\t\t:aria-describedby=\"ariaDescribedby\"\n\t\t\t\t:autocomplete=\"autocomplete\"\n\t\t\t\t:autofocus=\"autofocus\"\n\t\t\t\t:comma=\"comma\"\n\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t:divider=\"divider\"\n\t\t\t\t:has-errors=\"hasErrors\"\n\t\t\t\t:loading=\"loading\"\n\t\t\t\t:model-value=\"modelValue\"\n\t\t\t\t:multiple=\"multiple\"\n\t\t\t\t:name=\"name\"\n\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t:prepend:icon=\"props['prepend:icon']\"\n\t\t\t\t:readonly=\"readonly\"\n\t\t\t\t:required=\"required\"\n\t\t\t\tv-bind=\"eventListeners\"\n\t\t\t>\n\t\t\t\t<template #prepend-outer=\"data\"\n\t\t\t\t\t><slot name=\"prepend-outer\" v-bind=\"data\"\n\t\t\t\t/></template>\n\t\t\t\t<template #prepend=\"data\"\n\t\t\t\t\t><slot name=\"prepend\" v-bind=\"data\"\n\t\t\t\t/></template>\n\t\t\t\t<template #prefix=\"data\"><slot name=\"prefix\" v-bind=\"data\" /></template>\n\t\t\t\t<template #append=\"data\"><slot name=\"append\" v-bind=\"data\" /></template>\n\t\t\t\t<template #suffix=\"data\"><slot name=\"suffix\" v-bind=\"data\" /></template>\n\t\t\t\t<template #append-outer=\"data\"\n\t\t\t\t\t><slot name=\"append-outer\" v-bind=\"data\"\n\t\t\t\t/></template>\n\t\t\t</BaseTag>\n\t\t</template>\n\t</BaseInputContainer>\n</template>\n\n<script setup lang=\"ts\">\nimport BaseInputContainer from '../BaseInputContainer/BaseInputContainer.vue';\nimport BaseTag from '../BaseTag/BaseTag.vue';\nimport type { BaseTagEvents } from '../BaseTag/BaseTag.vue';\nimport {\n\tref,\n\ttype HTMLAttributes,\n\ttype InputHTMLAttributes,\n\tcomputed,\n} from 'vue';\n\nexport type BbTagProps = {\n\t/**\n\t * Name of the icon to be added at the end of the input.\n\t */\n\t// eslint-disable-next-line vue/prop-name-casing\n\t'append:icon'?: string;\n\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tautocomplete?: InputHTMLAttributes['autocomplete'];\n\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Sets the display model for selected values to a list\n\t * of comma separated string. In this mode the user\n\t * cannot deselect an option by pressing the close button.\n\t */\n\tcomma?: boolean;\n\n\t/**\n\t * Direction of the layout of the component. Can either be a predefined value or a pattern separated by a space like `xx xxxxx`.\n\t */\n\tdirection?: 'horizontal' | 'vertical' | 'auto' | string;\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * The divider key used to separate values from one another. By default it is \"Enter\"\n\t */\n\tdivider?: KeyboardEvent['key'];\n\n\t/**\n\t * Can be a string or an array of string containing the messages to display.\n\t */\n\terrors?: string | string[];\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * Visually hides the label of the input while maintaining accessibility.\n\t */\n\thideLabel?: boolean;\n\n\t/**\n\t * Text box to be displayed near the input, usually to indicate instructions.\n\t */\n\thint?: string;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Text content of the label of the element.\n\t */\n\tlabel: string;\n\n\t/**\n\t * Sets the text alignment of the label.\n\t */\n\tlabelPosition?: 'left' | 'center' | 'right';\n\n\t/**\n\t * Sets the component in a loading state, usually triggering some visual styles.\n\t */\n\tloading?: boolean;\n\n\t/**\n\t * Used by v-model. Can be any serializable type.\n\t */\n\tmodelValue: any;\n\n\t/**\n\t * Allows the selection of multiple items.\n\t */\n\tmultiple?: boolean;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * Keeps the hint displayed.\n\t */\n\tpersistentHint?: boolean;\n\n\t/**\n\t * String displayed when there's no data.\n\t */\n\tplaceholder?: InputHTMLAttributes['placeholder'];\n\n\t/**\n\t * Name of the icon to be added at the start of the input.\n\t */\n\t// eslint-disable-next-line vue/prop-name-casing\n\t'prepend:icon'?: string;\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: InputHTMLAttributes['readonly'];\n\n\t/**\n\t * Sets the input as required.\n\t */\n\trequired?: boolean;\n\n\t/**\n\t * Reverses the layout. Applicable in every direction the order of the label and the input is swapped.\n\t */\n\treverse?: boolean;\n};\n\nconst props = withDefaults(defineProps<BbTagProps>(), {\n\tmultiple: true,\n});\n\nexport type BbTagEvents = BaseTagEvents;\n\nconst emit = defineEmits<BbTagEvents>();\n\nexport type BbTagSlots = {\n\tappend?: (props: object) => any;\n\t'append-outer'?: (props: object) => any;\n\tlabel?: (props: { text: string; hasErrors: boolean }) => any;\n\tprepend?: (props: object) => any;\n\tprefix?: (props: object) => any;\n\tsuffix?: (props: object) => any;\n\t'prepend-outer'?: (props: object) => any;\n};\n\ndefineSlots<BbTagSlots>();\n\nconst active = ref(false);\nconst showHint = computed(() => props.persistentHint || active.value);\n\nconst eventListeners = {\n\tonBlur: (event: FocusEvent) => emit('blur', event),\n\tonChange: (event: Event) => emit('change', event),\n\tonClick: (event: MouseEvent) => emit('click', event),\n\tonDuplicate: (string: string) => emit('duplicate', string),\n\tonFocus: (event: FocusEvent) => {\n\t\tactive.value = true;\n\t\temit('focus', event);\n\t},\n\tonInactive: () => {\n\t\tactive.value = false;\n\t\temit('inactive');\n\t},\n\tonInput: (event: Event) => emit('input', event),\n\tonKeydown: (event: KeyboardEvent) => emit('keydown', event),\n\tonKeyup: (event: KeyboardEvent) => emit('keyup', event),\n\t'onUpdate:modelValue': (value: any) => emit('update:modelValue', value),\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbTag';\n</style>\n"],"names":["props","__props","emit","__emit","active","ref","showHint","computed","eventListeners","event","string","value"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiMA,UAAMA,IAAQC,GAMRC,IAAOC,GAcPC,IAASC,EAAI,EAAK,GAClBC,IAAWC,EAAS,MAAMP,EAAM,kBAAkBI,EAAO,KAAK,GAE9DI,IAAiB;AAAA,MACtB,QAAQ,CAACC,MAAsBP,EAAK,QAAQO,CAAK;AAAA,MACjD,UAAU,CAACA,MAAiBP,EAAK,UAAUO,CAAK;AAAA,MAChD,SAAS,CAACA,MAAsBP,EAAK,SAASO,CAAK;AAAA,MACnD,aAAa,CAACC,MAAmBR,EAAK,aAAaQ,CAAM;AAAA,MACzD,SAAS,CAACD,MAAsB;AAC/B,QAAAL,EAAO,QAAQ,IACfF,EAAK,SAASO,CAAK;AAAA,MACpB;AAAA,MACA,YAAY,MAAM;AACjB,QAAAL,EAAO,QAAQ,IACfF,EAAK,UAAU;AAAA,MAChB;AAAA,MACA,SAAS,CAACO,MAAiBP,EAAK,SAASO,CAAK;AAAA,MAC9C,WAAW,CAACA,MAAyBP,EAAK,WAAWO,CAAK;AAAA,MAC1D,SAAS,CAACA,MAAyBP,EAAK,SAASO,CAAK;AAAA,MACtD,uBAAuB,CAACE,MAAeT,EAAK,qBAAqBS,CAAK;AAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index11.js CHANGED
@@ -1,196 +1,82 @@
1
- import { copy as D } from "./index128.js";
2
- import { reactive as G, watch as v, toValue as H, computed as g, provide as Q } from "vue";
3
- import { isNotNil as a } from "./index129.js";
4
- import { mapValues as X } from "./index130.js";
5
- import { useRoute as Z } from "./index131.js";
6
- import { useRouter as _ } from "./index132.js";
7
- import { useStepper as ee } from "./index127.js";
8
- const te = Symbol(), x = /((step\/)(?<step>[\s\S]+?)(?=[/?]))|((step\/)(?<step2>[\s\S]+))/, O = (i) => {
9
- var r, u;
10
- const e = i.match(x);
11
- return ((r = e == null ? void 0 : e.groups) == null ? void 0 : r.step) ?? ((u = e == null ? void 0 : e.groups) == null ? void 0 : u.step2) ?? null;
12
- }, le = (i) => {
13
- if (!i.name)
14
- throw new Error(
15
- "You need to provide a unique name for the current wizard instance to be used to save data"
16
- );
17
- const e = Z(), r = _(), u = i.useNavigation ?? !0, h = i.navigationMode ?? "query", V = i.persist ?? !0;
18
- if (u && (!e.value || !r))
19
- throw new Error(
20
- "Navigation is enabled but could not retrieve the router instance in useWizard."
21
- );
22
- const q = D(i.initialState), l = G(
23
- V && sessionStorage.getItem(i.name) ? {
24
- ...q,
25
- ...JSON.parse(sessionStorage.getItem(i.name))
26
- } : q
27
- );
28
- V && v(l, () => {
29
- sessionStorage.setItem(i.name, JSON.stringify(l));
30
- });
31
- const w = H(i.steps), o = g(
32
- () => Object.entries(w).reduce(
33
- (t, [s, n]) => (n.condition && !n.condition(l) || (t[s] = { ...n, key: s }), t),
34
- {}
35
- )
36
- ), m = g(
37
- () => X(
38
- o.value,
39
- (t) => typeof t.isValid == "function" ? {
40
- ...t,
41
- isValid: t.isValid(l)
42
- } : {
43
- ...t,
44
- isValid: t.isValid ?? !0
45
- }
46
- )
47
- );
48
- let p = null;
49
- if (u && a(e.value)) {
50
- let t = null;
51
- if (h === "query")
52
- e.value.query.step && (t = e.value.query.step);
53
- else {
54
- const s = O(e.value.fullPath);
55
- s && (t = s);
56
- }
57
- p = t;
58
- }
59
- if (p)
60
- for (const t in o.value) {
61
- if (t === p) break;
62
- const s = m.value[t];
63
- if (!s || !s.isValid) {
64
- p = null;
65
- break;
66
- }
67
- }
68
- const {
69
- steps: b,
70
- current: P,
71
- goToNext: j,
72
- goToPrevious: A,
73
- goTo: d,
74
- index: K,
75
- at: z,
76
- get: F,
77
- goBackTo: I,
78
- isAfter: M,
79
- isBefore: U,
80
- isCurrent: B,
81
- isFirst: C,
82
- isLast: E,
83
- isNext: J,
84
- isPrevious: R,
85
- next: W,
86
- previous: $,
87
- stepNames: L
88
- } = ee(
89
- m,
90
- p || Object.values(o.value)[0].key
91
- ), c = g(() => Object.keys(o.value)[K.value]), T = {
92
- at: z,
93
- current: P,
94
- data: l,
95
- get: F,
96
- goBackTo: I,
97
- goTo: d,
98
- goToNext: j,
99
- goToPrevious: A,
100
- isAfter: M,
101
- isBefore: U,
102
- isCurrent: B,
103
- isFirst: C,
104
- isLast: E,
105
- isNext: J,
106
- isPrevious: R,
107
- key: c,
108
- next: W,
109
- previous: $,
110
- stepNames: L,
111
- steps: b
112
- };
113
- if (Q(te, T), u)
114
- if (h === "query")
115
- v(
116
- c,
117
- () => {
118
- a(r) && a(e.value) && r.push({
119
- ...e,
120
- query: { ...e.value.query, step: c.value ?? null }
121
- });
122
- },
123
- { immediate: !0 }
124
- ), v(
125
- () => {
126
- var t;
127
- return (t = e.value) == null ? void 0 : t.query.step;
128
- },
129
- (t) => {
130
- if (t) {
131
- const s = t;
132
- if (s in o.value) {
133
- const n = s, f = Object.keys(o.value);
134
- f.slice(
135
- 0,
136
- f.indexOf(n)
137
- ).every(
138
- (N) => {
139
- var y;
140
- return (y = m.value[N]) == null ? void 0 : y.isValid;
141
- }
142
- ) && d(n);
143
- }
144
- } else {
145
- const s = Object.keys(b)[0];
146
- d(s);
147
- }
1
+ const o = () => {
2
+ }, h = ({
3
+ resolvers: y,
4
+ onSuccess: i = o,
5
+ onCleared: m = o,
6
+ onError: u = o,
7
+ onCompleted: p = o,
8
+ concurrency: c = 1
9
+ }) => {
10
+ let e = [], a = 0;
11
+ const l = async () => {
12
+ if (!(a > c))
13
+ for (; a < c; ) {
14
+ const t = e[a++];
15
+ if (!t) {
16
+ a--;
17
+ return;
148
18
  }
149
- );
150
- else {
151
- const t = g(() => {
152
- if (a(e.value))
153
- return O(e.value.fullPath);
154
- });
155
- v(
156
- c,
157
- (s) => {
158
- a(e.value) && a(r) && s && (e.value.path.includes("step") ? r.push({
159
- query: e.value.query,
160
- path: e.value.path.replace(x, `step/${s}`)
161
- }) : r.push({
162
- query: e.value.query,
163
- // Normalizes paths with / and without
164
- path: (e.value.path + `/step/${s}`).replace("//", "/"),
165
- replace: !0
166
- }));
167
- },
168
- { immediate: !0 }
169
- ), v(
170
- () => t.value,
171
- (s) => {
172
- if (s && s !== c.value) {
173
- const n = s;
174
- if (n in o.value) {
175
- const f = n, S = Object.keys(o.value);
176
- S.slice(
177
- 0,
178
- S.indexOf(f)
179
- ).every(
180
- (y) => {
181
- var k;
182
- return (k = o.value[y]) == null ? void 0 : k.isValid;
183
- }
184
- ) && d(f);
19
+ const n = y[t.type];
20
+ if (!n)
21
+ throw new Error(
22
+ `No resolver defined for job type "${t.type.toString()}"`
23
+ );
24
+ new Promise(async (f) => {
25
+ try {
26
+ if ("params" in t) {
27
+ const r = await n(t.params), s = {
28
+ type: t.type,
29
+ params: t.params,
30
+ result: r
31
+ };
32
+ i(s);
33
+ } else {
34
+ const r = await n(void 0), s = {
35
+ type: t.type,
36
+ result: r
37
+ };
38
+ i(s);
39
+ }
40
+ } catch (r) {
41
+ const s = {
42
+ type: t.type,
43
+ params: "params" in t ? t.params : void 0,
44
+ error: r
45
+ };
46
+ u(s);
47
+ } finally {
48
+ const r = e.indexOf(t);
49
+ if (e.splice(r, 1), a--, "params" in t) {
50
+ const s = {
51
+ type: t.type,
52
+ params: t.params
53
+ };
54
+ p(s);
55
+ } else {
56
+ const s = {
57
+ type: t.type
58
+ };
59
+ p(s);
185
60
  }
186
61
  }
187
- }
188
- );
62
+ if (e.length) return f(new Promise(() => l()));
63
+ m(), f(null);
64
+ });
65
+ }
66
+ }, d = (...t) => {
67
+ e.push(...t), l();
68
+ };
69
+ return {
70
+ addJobs: d,
71
+ addIf: (t, n) => {
72
+ n(e) && d(t);
73
+ },
74
+ filterJobs: (t) => {
75
+ e = e.slice(0, a).concat(e.slice(a).filter(t));
189
76
  }
190
- return T;
77
+ };
191
78
  };
192
79
  export {
193
- le as useWizard,
194
- te as wizardInjectionKey
80
+ h as useQueue
195
81
  };
196
82
  //# sourceMappingURL=index11.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index11.js","sources":["../src/composables/useWizard.ts"],"sourcesContent":["import { cloneDeep } from '@/utilities/functions/cloneDeep';\nimport { computed, provide, reactive, watch, toValue } from 'vue';\nimport { isNotNil } from '@/utilities/functions/isNotNil';\nimport { mapValues } from '@/utilities/functions/mapValues';\nimport { useRoute } from './useRoute';\nimport { useRouter } from './useRouter';\nimport { useStepper } from '@vueuse/core';\nimport type { ComputedRef, MaybeRef } from 'vue';\n\nexport const wizardInjectionKey = Symbol();\nexport type Step<U> = {\n\t/**\n\t * Function that accepts a state object and returns a boolean.\n\t * When step are accessed at the end of the pipeline the result\n\t * is provided so you don't have to run the function yourself.\n\t * It determines if the validation has passed for the step.\n\t */\n\tisValid?: (state: U) => boolean | boolean;\n\t/**\n\t * Function that accepts a state object and returns a boolean.\n\t * When step are accessed at the end of the pipeline the result\n\t * is provided so you don't have to run the function yourself.\n\t * Steps that do not pass the condition are removed.\n\t */\n\tcondition?: (state: U) => boolean;\n\t[key: string]: any;\n};\nexport type WizardState<T extends Record<string, any>> = ReturnType<\n\ttypeof useWizard<T>\n>;\n\nconst regexMatchStep =\n\t/((step\\/)(?<step>[\\s\\S]+?)(?=[/?]))|((step\\/)(?<step2>[\\s\\S]+))/;\n/**\n * With a url that follows the rule xyz.com/anything/step/:nameofthestep[/?query]\n * will match the :nameofthestep substring\n */\nconst extractStepFromUrl = (url: string) => {\n\tconst match = url.match(regexMatchStep);\n\treturn match?.groups?.step ?? match?.groups?.step2 ?? null;\n};\nexport const useWizard = <T extends object>(params: {\n\t/**\n\t * The steps definition for the wizard\n\t */\n\tsteps: MaybeRef<Record<string, Step<T>>>;\n\t/**\n\t * Name of the wizard used to persist state\n\t */\n\tname: string;\n\t/**\n\t * Initial set of data to be made available throughout\n\t */\n\tinitialState: T;\n\t/**\n\t * When navogation is enabled, to whether use the query parameters or an entire substring of the URL like xyz/steps/....\n\t * The latter useful with nuxt so you can leverage the automatic import of components based on the URL.\n\t */\n\tnavigationMode?: 'query' | 'route';\n\t/**\n\t * Whether to use navigation at all. When disabled no query or URL is changed.\n\t */\n\tuseNavigation?: boolean;\n\t/**\n\t *\n\t */\n\tpersist?: boolean;\n}) => {\n\tif (!params.name) {\n\t\tthrow new Error(\n\t\t\t'You need to provide a unique name for the current wizard instance to be used to save data'\n\t\t);\n\t}\n\tconst route = useRoute();\n\tconst router = useRouter();\n\n\tconst useNavigation = params.useNavigation ?? true;\n\tconst navigationMode = params.navigationMode ?? 'query';\n\tconst persist = params.persist ?? true;\n\n\tif (useNavigation && (!route.value || !router)) {\n\t\tthrow new Error(\n\t\t\t'Navigation is enabled but could not retrieve the router instance in useWizard.'\n\t\t);\n\t}\n\n\tconst initialStateCopy = cloneDeep(params.initialState);\n\t/**\n\t * Initial state is either read from session storage or the one provided\n\t */\n\tconst innerState = reactive<typeof params.initialState>(\n\t\tpersist && sessionStorage.getItem(params.name)\n\t\t\t? {\n\t\t\t\t\t...initialStateCopy,\n\t\t\t\t\t...JSON.parse(sessionStorage.getItem(params.name)!),\n\t\t\t\t}\n\t\t\t: initialStateCopy\n\t);\n\n\tif (persist) {\n\t\t/**\n\t\t * Every time the state changes save it to sessionStorage\n\t\t */\n\t\twatch(innerState, () => {\n\t\t\tsessionStorage.setItem(params.name, JSON.stringify(innerState));\n\t\t});\n\t}\n\n\t/**\n\t * Steps can be passed as ref so we need to unwrap them\n\t */\n\tconst unwrappedSteps = toValue(params.steps);\n\tconst filteredSteps = computed(() =>\n\t\tObject.entries(unwrappedSteps).reduce(\n\t\t\t(acc: typeof unwrappedSteps, [key, step]) => {\n\t\t\t\tif (step.condition) {\n\t\t\t\t\tif (!step.condition(innerState as T)) {\n\t\t\t\t\t\treturn acc;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tacc[key] = { ...step, key };\n\t\t\t\treturn acc;\n\t\t\t},\n\t\t\t{}\n\t\t)\n\t);\n\n\t/**\n\t * Steps can have a isValid function that receives the current state\n\t * but we don't want to have to call it every single time so we call it once here\n\t */\n\tconst mappedSteps = computed(() =>\n\t\tmapValues(\n\t\t\tfilteredSteps.value,\n\t\t\t(step): Omit<Step<T>, 'isValid'> & { isValid: boolean } => {\n\t\t\t\tif (typeof step.isValid === 'function') {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...step,\n\t\t\t\t\t\tisValid: step.isValid(innerState as T),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\t...step,\n\t\t\t\t\tisValid: step.isValid ?? true,\n\t\t\t\t};\n\t\t\t}\n\t\t)\n\t);\n\n\t/**\n\t * Get the initial step from the query.\n\t * If it exists check that every step before it is also valid\n\t * so user cannot manually jump by changing the URL\n\t */\n\tlet initialStep = null;\n\tif (useNavigation && isNotNil(route.value)) {\n\t\tlet step: string | null = null;\n\t\tif (navigationMode === 'query') {\n\t\t\tif (route.value.query.step) {\n\t\t\t\tstep = route.value.query.step as string;\n\t\t\t}\n\t\t} else {\n\t\t\tconst stepFromUrl = extractStepFromUrl(route.value.fullPath);\n\t\t\tif (stepFromUrl) {\n\t\t\t\tstep = stepFromUrl;\n\t\t\t}\n\t\t}\n\t\tinitialStep = step;\n\t}\n\n\tif (initialStep) {\n\t\tfor (const stepName in filteredSteps.value) {\n\t\t\tif (stepName === initialStep) break;\n\t\t\tconst current = mappedSteps.value[stepName];\n\t\t\tif (!current || !current.isValid) {\n\t\t\t\tinitialStep = null;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Define the state of the wizard\n\t * A few data come from useStepper\n\t */\n\tconst {\n\t\tsteps,\n\t\tcurrent,\n\t\tgoToNext,\n\t\tgoToPrevious,\n\t\tgoTo,\n\t\tindex,\n\t\tat,\n\t\tget,\n\t\tgoBackTo,\n\t\tisAfter,\n\t\tisBefore,\n\t\tisCurrent,\n\t\tisFirst,\n\t\tisLast,\n\t\tisNext,\n\t\tisPrevious,\n\t\tnext,\n\t\tprevious,\n\t\tstepNames,\n\t} = useStepper(\n\t\tmappedSteps,\n\t\tinitialStep || Object.values(filteredSteps.value)[0].key\n\t);\n\n\tconst key = computed(() => Object.keys(filteredSteps.value)[index.value]);\n\n\t/**\n\t * Complete state object\n\t */\n\tconst state = {\n\t\tat,\n\t\tcurrent: current as ComputedRef<Step<T> & { isValid: boolean }>,\n\t\tdata: innerState,\n\t\tget,\n\t\tgoBackTo,\n\t\tgoTo,\n\t\tgoToNext,\n\t\tgoToPrevious,\n\t\tisAfter,\n\t\tisBefore,\n\t\tisCurrent,\n\t\tisFirst,\n\t\tisLast,\n\t\tisNext,\n\t\tisPrevious,\n\t\tkey,\n\t\tnext,\n\t\tprevious,\n\t\tstepNames,\n\t\tsteps,\n\t};\n\n\tprovide(wizardInjectionKey, state);\n\n\tif (useNavigation) {\n\t\tif (navigationMode === 'query') {\n\t\t\t/**\n\t\t\t * Every time the current step changes update route\n\t\t\t */\n\t\t\twatch(\n\t\t\t\tkey,\n\t\t\t\t() => {\n\t\t\t\t\tif (isNotNil(router) && isNotNil(route.value)) {\n\t\t\t\t\t\trouter.push({\n\t\t\t\t\t\t\t...route,\n\t\t\t\t\t\t\tquery: { ...route.value.query, step: key.value ?? null },\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{ immediate: true }\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Every time the route changes align the current step to the route\n\t\t\t */\n\t\t\twatch(\n\t\t\t\t() => route.value?.query.step,\n\t\t\t\t(value) => {\n\t\t\t\t\tif (value) {\n\t\t\t\t\t\tconst stepAsString = value as string;\n\t\t\t\t\t\tif (stepAsString in filteredSteps.value) {\n\t\t\t\t\t\t\tconst stepAsKey = stepAsString;\n\t\t\t\t\t\t\tconst stepKeys = Object.keys(filteredSteps.value);\n\t\t\t\t\t\t\tconst stepsPriorToTarget = stepKeys.slice(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tstepKeys.indexOf(stepAsKey)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tconst allValid = stepsPriorToTarget.every(\n\t\t\t\t\t\t\t\t(key) => mappedSteps.value[key]?.isValid\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif (allValid) {\n\t\t\t\t\t\t\t\tgoTo(stepAsKey);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst key = Object.keys(steps)[0];\n\t\t\t\t\t\tgoTo(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t} else {\n\t\t\tconst stepFromUrl = computed(() => {\n\t\t\t\tif (isNotNil(route.value)) {\n\t\t\t\t\treturn extractStepFromUrl(route.value.fullPath);\n\t\t\t\t}\n\t\t\t\treturn undefined;\n\t\t\t});\n\n\t\t\t/**\n\t\t\t * Every time the current step changes update route\n\t\t\t */\n\t\t\twatch(\n\t\t\t\tkey,\n\t\t\t\t(value) => {\n\t\t\t\t\tif (isNotNil(route.value) && isNotNil(router) && value) {\n\t\t\t\t\t\tif (route.value.path.includes('step')) {\n\t\t\t\t\t\t\trouter.push({\n\t\t\t\t\t\t\t\tquery: route.value.query,\n\t\t\t\t\t\t\t\tpath: route.value.path.replace(regexMatchStep, `step/${value}`),\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\trouter.push({\n\t\t\t\t\t\t\t\tquery: route.value.query,\n\t\t\t\t\t\t\t\t// Normalizes paths with / and without\n\t\t\t\t\t\t\t\tpath: (route.value.path + `/step/${value}`).replace('//', '/'),\n\t\t\t\t\t\t\t\treplace: true,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{ immediate: true }\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Every time the route changes align the current step to the route\n\t\t\t */\n\t\t\twatch(\n\t\t\t\t() => stepFromUrl.value,\n\t\t\t\t(value) => {\n\t\t\t\t\tif (value && value !== key.value) {\n\t\t\t\t\t\tconst stepAsString = value as string;\n\t\t\t\t\t\tif (stepAsString in filteredSteps.value) {\n\t\t\t\t\t\t\tconst stepAsKey = stepAsString;\n\t\t\t\t\t\t\tconst stepKeys = Object.keys(filteredSteps.value);\n\t\t\t\t\t\t\tconst stepsPriorToTarget = stepKeys.slice(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tstepKeys.indexOf(stepAsKey)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tconst allValid = stepsPriorToTarget.every(\n\t\t\t\t\t\t\t\t(key) => filteredSteps.value[key]?.isValid\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif (allValid) {\n\t\t\t\t\t\t\t\tgoTo(stepAsKey);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}\n\n\treturn state;\n};\n"],"names":["wizardInjectionKey","regexMatchStep","extractStepFromUrl","url","match","_a","_b","useWizard","params","route","useRoute","router","useRouter","useNavigation","navigationMode","persist","initialStateCopy","cloneDeep","innerState","reactive","watch","unwrappedSteps","toValue","filteredSteps","computed","acc","key","step","mappedSteps","mapValues","initialStep","isNotNil","stepFromUrl","stepName","current","steps","goToNext","goToPrevious","goTo","index","at","get","goBackTo","isAfter","isBefore","isCurrent","isFirst","isLast","isNext","isPrevious","next","previous","stepNames","useStepper","state","provide","value","stepAsString","stepAsKey","stepKeys"],"mappings":";;;;;;;AASO,MAAMA,KAAqB,OAAO,GAsBnCC,IACL,mEAKKC,IAAqB,CAACC,MAAgB;;AACrC,QAAAC,IAAQD,EAAI,MAAMF,CAAc;AACtC,WAAOI,IAAAD,KAAA,gBAAAA,EAAO,WAAP,gBAAAC,EAAe,WAAQC,IAAAF,KAAA,gBAAAA,EAAO,WAAP,gBAAAE,EAAe,UAAS;AACvD,GACaC,KAAY,CAAmBC,MA0BtC;AACD,MAAA,CAACA,EAAO;AACX,UAAM,IAAI;AAAA,MACT;AAAA,IAAA;AAGF,QAAMC,IAAQC,KACRC,IAASC,KAETC,IAAgBL,EAAO,iBAAiB,IACxCM,IAAiBN,EAAO,kBAAkB,SAC1CO,IAAUP,EAAO,WAAW;AAElC,MAAIK,MAAkB,CAACJ,EAAM,SAAS,CAACE;AACtC,UAAM,IAAI;AAAA,MACT;AAAA,IAAA;AAII,QAAAK,IAAmBC,EAAUT,EAAO,YAAY,GAIhDU,IAAaC;AAAA,IAClBJ,KAAW,eAAe,QAAQP,EAAO,IAAI,IAC1C;AAAA,MACA,GAAGQ;AAAA,MACH,GAAG,KAAK,MAAM,eAAe,QAAQR,EAAO,IAAI,CAAE;AAAA,IAAA,IAElDQ;AAAA,EAAA;AAGJ,EAAID,KAIHK,EAAMF,GAAY,MAAM;AACvB,mBAAe,QAAQV,EAAO,MAAM,KAAK,UAAUU,CAAU,CAAC;AAAA,EAAA,CAC9D;AAMI,QAAAG,IAAiBC,EAAQd,EAAO,KAAK,GACrCe,IAAgBC;AAAA,IAAS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O;AACxC,oBAAMmC,IAAYD,GACZE,IAAW,OAAO,KAAKpC,EAAc,KAAK;AAQhD,cAP2BoC,EAAS;AAAA,gBACnC;AAAA,gBACAA,EAAS,QAAQD,CAAS;AAAA,cAAA,EAES;AAAA,gBACnC,CAAChC,MAAAA;;AAAQ,0BAAArB,IAAAkB,EAAc,MAAMG,CAAG,MAAvB,gBAAArB,EAA0B;AAAA;AAAA,cAAA,KAGnCiC,EAAKoB,CAAS;AAAA,YAEhB;AAAA,UACD;AAAA,QACD;AAAA,MAAA;AAAA,IAEF;AAGM,SAAAJ;AACR;"}
1
+ {"version":3,"file":"index11.js","sources":["../src/composables/useQueue.ts"],"sourcesContent":["type Resolvers = Record<string, (arg: any) => any>;\n\ntype Jobs<T extends Resolvers> = {\n\t[Name in keyof T]: Parameters<T[Name]> extends [infer Arg]\n\t\t? { type: Name; params: Arg }\n\t\t: { type: Name };\n}[keyof T];\n\ntype OnSuccess<T extends Resolvers> = (\n\tdata: {\n\t\t[Name in keyof T]: {\n\t\t\tdata: Parameters<T[Name]> extends [infer Arg]\n\t\t\t\t? { type: Name; params: Arg; result: Awaited<ReturnType<T[Name]>> }\n\t\t\t\t: { type: Name; result: Awaited<ReturnType<T[Name]>> };\n\t\t}['data'];\n\t}[keyof T]\n) => void;\n\ntype OnError<T extends Resolvers> = (\n\tdata: {\n\t\t[Name in keyof T]: {\n\t\t\tdata: Parameters<T[Name]> extends [infer Arg]\n\t\t\t\t? { type: Name; params: Arg; error: any }\n\t\t\t\t: { type: Name; error: any };\n\t\t}['data'];\n\t}[keyof T]\n) => void;\n\ntype OnCompleted<T extends Resolvers> = (\n\tdata: {\n\t\t[Name in keyof T]: {\n\t\t\tdata: Parameters<T[Name]> extends [infer Arg]\n\t\t\t\t? { type: Name; params: Arg }\n\t\t\t\t: { type: Name };\n\t\t}['data'];\n\t}[keyof T]\n) => void;\n\ntype OnCleared = () => any;\n\ntype Params<T extends Resolvers> = {\n\tresolvers: T;\n\tconcurrency?: number;\n\tonSuccess?: OnSuccess<T>;\n\tonError?: OnError<T>;\n\tonCleared?: OnCleared;\n\tonCompleted?: OnCompleted<T>;\n};\n\nconst noop = () => {};\n\nexport const useQueue = <T extends Resolvers>({\n\tresolvers,\n\tonSuccess = noop,\n\tonCleared = noop,\n\tonError = noop,\n\tonCompleted = noop,\n\tconcurrency = 1,\n}: Params<T>) => {\n\tlet jobs: Jobs<T>[] = [];\n\tlet currentIndex = 0;\n\n\tconst process = async (): Promise<void> => {\n\t\tif (currentIndex > concurrency) {\n\t\t\treturn;\n\t\t}\n\t\twhile (currentIndex < concurrency) {\n\t\t\tconst job = jobs[currentIndex++];\n\t\t\tif (!job) {\n\t\t\t\tcurrentIndex--;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst resolver = resolvers[job.type];\n\t\t\tif (!resolver)\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`No resolver defined for job type \"${job.type.toString()}\"`\n\t\t\t\t);\n\t\t\tnew Promise(async (resolve) => {\n\t\t\t\ttry {\n\t\t\t\t\tif ('params' in job) {\n\t\t\t\t\t\tconst res = await resolver(job.params);\n\t\t\t\t\t\tconst data = {\n\t\t\t\t\t\t\ttype: job.type,\n\t\t\t\t\t\t\tparams: job.params,\n\t\t\t\t\t\t\tresult: res,\n\t\t\t\t\t\t} as Extract<Parameters<OnSuccess<T>>[0], { params: any }>;\n\t\t\t\t\t\tonSuccess(data);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst res = await resolver(undefined);\n\t\t\t\t\t\tconst data = {\n\t\t\t\t\t\t\ttype: job.type,\n\t\t\t\t\t\t\tresult: res,\n\t\t\t\t\t\t} as Extract<Parameters<OnSuccess<T>>[0], { params: never }>;\n\t\t\t\t\t\tonSuccess(data);\n\t\t\t\t\t}\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst data = {\n\t\t\t\t\t\ttype: job.type,\n\t\t\t\t\t\tparams: 'params' in job ? job.params : undefined,\n\t\t\t\t\t\terror: error,\n\t\t\t\t\t} as Parameters<OnError<T>>[0];\n\t\t\t\t\tonError(data);\n\t\t\t\t} finally {\n\t\t\t\t\tconst index = jobs.indexOf(job);\n\t\t\t\t\tjobs.splice(index, 1);\n\t\t\t\t\tcurrentIndex--;\n\n\t\t\t\t\tif ('params' in job) {\n\t\t\t\t\t\tconst data = {\n\t\t\t\t\t\t\ttype: job.type,\n\t\t\t\t\t\t\tparams: job.params,\n\t\t\t\t\t\t} as Extract<Parameters<OnCompleted<T>>[0], { params: any }>;\n\t\t\t\t\t\tonCompleted(data);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst data = {\n\t\t\t\t\t\t\ttype: job.type,\n\t\t\t\t\t\t} as Extract<Parameters<OnCompleted<T>>[0], { params: never }>;\n\t\t\t\t\t\tonCompleted(data);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (jobs.length) return resolve(new Promise(() => process()));\n\t\t\t\tonCleared();\n\t\t\t\tresolve(null);\n\t\t\t});\n\t\t}\n\t};\n\n\tconst addJobs = (...job: (typeof jobs)[number][]) => {\n\t\tjobs.push(...job);\n\t\tprocess();\n\t};\n\n\tconst addIf = (\n\t\tjob: (typeof jobs)[number],\n\t\titeratee: (arr: typeof jobs) => boolean\n\t) => {\n\t\tif (iteratee(jobs)) addJobs(job);\n\t};\n\n\tconst filterJobs = (\n\t\titeratee: (\n\t\t\telement: (typeof jobs)[number],\n\t\t\tindex: number,\n\t\t\tarr: typeof jobs\n\t\t) => boolean\n\t) => {\n\t\tjobs = jobs\n\t\t\t.slice(0, currentIndex)\n\t\t\t.concat(jobs.slice(currentIndex).filter(iteratee));\n\t};\n\n\treturn {\n\t\taddJobs,\n\t\taddIf,\n\t\tfilterJobs,\n\t};\n};\n"],"names":["noop","useQueue","resolvers","onSuccess","onCleared","onError","onCompleted","concurrency","jobs","currentIndex","process","job","resolver","resolve","res","data","error","index","addJobs","iteratee"],"mappings":"AAiDA,MAAMA,IAAO,MAAM;AAAC,GAEPC,IAAW,CAAs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