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
package/dist/index12.js CHANGED
@@ -1,85 +1,43 @@
1
- import { defineComponent as y, getCurrentInstance as p, computed as s, resolveComponent as d, openBlock as k, createBlock as h, resolveDynamicComponent as C, mergeProps as x, withCtx as S, renderSlot as L, createTextVNode as B, toDisplayString as N } from "vue";
2
- import { _config as o } from "./index3.js";
3
- import { useLogger as m } from "./index207.js";
4
- const P = /* @__PURE__ */ y({
5
- __name: "BaseButton",
6
- props: {
7
- activeClass: {},
8
- ariaCurrentValue: {},
9
- block: { type: Boolean },
10
- data: {},
11
- disabled: { type: Boolean },
12
- exactActiveClass: {},
13
- headers: {},
14
- href: {},
15
- method: {},
16
- onBefore: {},
17
- onCancel: {},
18
- onCancelToken: {},
19
- onFinish: {},
20
- only: {},
21
- onProgress: {},
22
- onStart: {},
23
- onSuccess: {},
24
- preserveScroll: { type: [Boolean, Function] },
25
- preserveState: { type: [Boolean, Function, null] },
26
- queryStringArrayFormat: {},
27
- replace: { type: Boolean },
28
- tag: { default: "button" },
29
- target: {},
30
- text: {},
31
- to: {},
32
- type: { default: "button" }
33
- },
34
- setup(f) {
35
- var i, l, u, c;
36
- const t = f, a = !!((l = (i = p()) == null ? void 0 : i.proxy) != null && l.$inertia), g = !!((c = (u = p()) == null ? void 0 : u.proxy) != null && c.$nuxt), n = s(() => {
37
- if (t.href || t.to && t.disabled) {
38
- if (a && !t.disabled && !t.target) {
39
- const e = d(o.inertiaLinkName);
40
- if (typeof e == "string") {
41
- const { warn: r } = m();
42
- r(
43
- `Inertia link component "${o.inertiaLinkName}" could not be resolved. Ensure you app registers a link component with the name "${o.inertiaLinkName}" or set bitboss-ui config key "inertiaLinkName" to the correct value globally. Please visit ${o.documentationURL}/getting-started to resolve setup issues in bitboss-ui.`
44
- );
45
- }
46
- return e;
47
- }
48
- return "a";
1
+ import { wait as p } from "./index128.js";
2
+ import { reactive as d } from "vue";
3
+ import { useId as h } from "./index9.js";
4
+ const i = d({
5
+ stack: []
6
+ }), b = () => {
7
+ const c = (t) => i.stack = i.stack.filter((o) => o.id !== t);
8
+ return {
9
+ toast: (t) => {
10
+ const o = h().id.value;
11
+ let l, e, n, s, f;
12
+ const u = 6e3;
13
+ if (typeof t == "string")
14
+ e = t;
15
+ else {
16
+ if (typeof t.timeout == "number" && t.timeout <= 0)
17
+ throw new Error("Toast messages cannot have a zero or less timeout");
18
+ n = t.icon, f = t.showClose, e = t.text, s = t.theme, l = t.title;
49
19
  }
50
- if (t.to) {
51
- if (g) {
52
- const e = d(o.nuxtLinkName);
53
- if (typeof e == "string") {
54
- const { warn: r } = m();
55
- r(
56
- `Nuxt link component "${o.nuxtLinkName}" could not be resolved. Ensure you app registers a link component with the name "${o.nuxtLinkName}" or set bitboss-ui config key "nuxtLInkName" to the correct value globally. Please visit ${o.documentationURL}/getting-started to resolve setup issues in bitboss-ui.`
57
- );
58
- }
59
- return e;
60
- }
61
- return "router-link";
20
+ if (i.stack = i.stack.concat({
21
+ icon: n,
22
+ id: o,
23
+ showClose: f,
24
+ text: e,
25
+ theme: s,
26
+ title: l
27
+ }), typeof t == "object" && !t.persistent || typeof t == "string") {
28
+ let r;
29
+ typeof t == "object" && t.timeout ? r = t.timeout : r = u, p(r).then(() => {
30
+ c(o);
31
+ });
62
32
  }
63
- return t.tag;
64
- }), b = s(() => ({
65
- "base-btn": !0,
66
- "base-btn--block": t.block,
67
- "base-btn--disabled": t.disabled
68
- })), v = s(() => {
69
- const e = {};
70
- return n.value === "button" ? (e.disabled = t.disabled, e.type = t.type) : n.value === "a" || a && typeof n.value != "string" && n.value.name === "Link" ? t.disabled ? (e["aria-disabled"] = !0, e.role = "link") : (e.href = t.href, e.target = t.target, a && (e.data = t.data, e.headers = t.headers, e.method = t.method, e.onBefore = t.onBefore, e.onCancel = t.onCancel, e.onCancelToken = t.onCancelToken, e.onFinish = t.onFinish, e.only = t.only, e.onProgress = t.onProgress, e.onStart = t.onStart, e.onSuccess = t.onSuccess, e.preserveScroll = t.preserveScroll, e.preserveState = t.preserveState, e.queryStringArrayFormat = t.queryStringArrayFormat, e.replace = t.replace)) : (n.value === "router-link" || typeof n.value != "string" && n.value.name === "NuxtLink") && (e.activeClass = t.activeClass, e.ariaCurrentValue = t.ariaCurrentValue, e.exactActiveClass = t.exactActiveClass, e.replace = t.replace, e.target = t.target, e.to = t.to), e;
71
- });
72
- return (e, r) => (k(), h(C(n.value), x({ class: b.value }, v.value), {
73
- default: S(() => [
74
- L(e.$slots, "default", {}, () => [
75
- B(N(e.text), 1)
76
- ])
77
- ]),
78
- _: 3
79
- }, 16, ["class"]));
80
- }
81
- });
33
+ return o;
34
+ },
35
+ dismiss: c,
36
+ dismissAll: () => i.stack = []
37
+ };
38
+ };
82
39
  export {
83
- P as default
40
+ i as state,
41
+ b as useToast
84
42
  };
85
43
  //# sourceMappingURL=index12.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index12.js","sources":["../src/components/BaseButton/BaseButton.vue"],"sourcesContent":["<template>\n\t<component :is=\"tag\" :class=\"classes\" v-bind=\"attributes\">\n\t\t<slot>{{ text }}</slot>\n\t</component>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, getCurrentInstance, resolveComponent } from 'vue';\nimport type { RouteLocationRaw } from 'vue-router';\nimport { _config } from '@/composables/useBbConfig';\nimport { useLogger } from '@/composables/useLogger';\n\nexport type BaseButtonProps = {\n\t/**\n\t * Class to apply when the link is active\n\t */\n\tactiveClass?: string;\n\n\t/**\n\t * Value passed to the attribute `aria-current` when the link is exact active.\n\t *\n\t * @defaultValue `'page'`\n\t */\n\tariaCurrentValue?:\n\t\t| 'page'\n\t\t| 'step'\n\t\t| 'location'\n\t\t| 'date'\n\t\t| 'time'\n\t\t| 'true'\n\t\t| 'false';\n\n\t/**\n\t * Displays the component as full width.\n\t */\n\tblock?: boolean;\n\n\tdata?: object;\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Class to apply when the link is exact active\n\t */\n\texactActiveClass?: string;\n\n\theaders?: object;\n\n\t/**\n\t * Returns the hyperlink's URL.\n\t *\n\t * Can be set, to change the URL.\n\t */\n\thref?: HTMLAnchorElement['href'];\n\n\tmethod?: 'get' | 'post' | 'put' | 'patch' | 'delete';\n\n\tonBefore?: () => void;\n\n\tonCancel?: () => void;\n\n\tonCancelToken?: (cancelToken: import('axios').CancelTokenSource) => void;\n\n\tonFinish?: () => void;\n\n\tonly?: string[];\n\n\tonProgress?: (progress: { percentage: number | undefined }) => void;\n\n\tonStart?: () => void;\n\n\tonSuccess?: () => void;\n\n\tpreserveScroll?: boolean | ((props: { [key: string]: unknown }) => boolean);\n\n\tpreserveState?:\n\t\t| boolean\n\t\t| ((props: { [key: string]: unknown }) => boolean)\n\t\t| null;\n\n\tqueryStringArrayFormat?: 'brackets' | 'indices';\n\n\t/**\n\t * Calls `router.replace` instead of `router.push`.\n\t */\n\treplace?: boolean;\n\n\t/**\n\t * Any HTML tag corresponding to a non-void HTMl element.\n\t */\n\ttag?: string;\n\n\t/**\n\t * Sets or retrieves the window or frame at which to target content.\n\t */\n\ttarget?: HTMLAnchorElement['target'];\n\n\t/**\n\t * Text content of the component.\n\t */\n\ttext?: string;\n\n\t/**\n\t * Route Location the link should navigate to when clicked on.\n\t */\n\tto?: RouteLocationRaw;\n\n\t/**\n\t * Gets the classification and default behavior of the button.\n\t */\n\ttype?: HTMLButtonElement['type'];\n};\n\nconst props = withDefaults(defineProps<BaseButtonProps>(), {\n\ttag: 'button',\n\ttype: 'button',\n});\n\ndefineSlots<{\n\tdefault?: (props: object) => any;\n}>();\n\n/* Ignore because possibly undefined */\n// @ts-expect-error possibly undef\nconst isInertia = !!getCurrentInstance()?.proxy?.$inertia;\n\n// @ts-expect-error possibly undef\nconst isNuxt = !!getCurrentInstance()?.proxy?.$nuxt;\n\nconst tag = computed(() => {\n\t// For disabled links always render a\n\tif (props.href || (props.to && props.disabled)) {\n\t\t// Prevent rendering inertia links if target is passed (inertia doesn't support external links)\n\t\tif (isInertia && !props.disabled && !props.target) {\n\t\t\tconst resolved = resolveComponent(_config.inertiaLinkName);\n\t\t\tif (typeof resolved === 'string') {\n\t\t\t\tconst { warn } = useLogger();\n\t\t\t\twarn(\n\t\t\t\t\t`Inertia link component \"${_config.inertiaLinkName}\" could not be resolved. Ensure you app registers a link component with the name \"${_config.inertiaLinkName}\" or set bitboss-ui config key \"inertiaLinkName\" to the correct value globally. Please visit ${_config.documentationURL}/getting-started to resolve setup issues in bitboss-ui.`\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn resolved;\n\t\t}\n\n\t\treturn 'a';\n\t}\n\tif (props.to) {\n\t\tif (isNuxt) {\n\t\t\tconst resolved = resolveComponent(_config.nuxtLinkName);\n\t\t\tif (typeof resolved === 'string') {\n\t\t\t\tconst { warn } = useLogger();\n\t\t\t\twarn(\n\t\t\t\t\t`Nuxt link component \"${_config.nuxtLinkName}\" could not be resolved. Ensure you app registers a link component with the name \"${_config.nuxtLinkName}\" or set bitboss-ui config key \"nuxtLInkName\" to the correct value globally. Please visit ${_config.documentationURL}/getting-started to resolve setup issues in bitboss-ui.`\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn resolved;\n\t\t}\n\t\treturn 'router-link';\n\t}\n\treturn props.tag;\n});\n\nconst classes = computed(() => ({\n\t'base-btn': true,\n\t'base-btn--block': props.block,\n\t'base-btn--disabled': props.disabled,\n}));\n\nconst attributes = computed(() => {\n\ttype PossibleAttributes = {\n\t\tactiveClass: BaseButtonProps['activeClass'];\n\t\t'aria-disabled': boolean;\n\t\tariaCurrentValue: BaseButtonProps['ariaCurrentValue'];\n\t\tdata: BaseButtonProps['data'];\n\t\tdisabled: boolean;\n\t\texactActiveClass: BaseButtonProps['exactActiveClass'];\n\t\theaders: BaseButtonProps['headers'];\n\t\thref: string;\n\t\tmethod: BaseButtonProps['method'];\n\t\tonBefore: BaseButtonProps['onBefore'];\n\t\tonCancel: BaseButtonProps['onCancel'];\n\t\tonCancelToken: BaseButtonProps['onCancelToken'];\n\t\tonFinish: BaseButtonProps['onFinish'];\n\t\tonly: BaseButtonProps['only'];\n\t\tonProgress: BaseButtonProps['onProgress'];\n\t\tonStart: BaseButtonProps['onStart'];\n\t\tonSuccess: BaseButtonProps['onSuccess'];\n\t\tpreserveScroll: BaseButtonProps['preserveScroll'];\n\t\tpreserveState: BaseButtonProps['preserveState'];\n\t\tqueryStringArrayFormat: BaseButtonProps['queryStringArrayFormat'];\n\t\treplace: BaseButtonProps['replace'];\n\t\trole: string;\n\t\tstyle: { [rule: string]: string };\n\t\ttarget: string;\n\t\tto: BaseButtonProps['to'];\n\t\ttype: string;\n\t};\n\tconst initial: Partial<PossibleAttributes> = {};\n\n\tif (tag.value === 'button') {\n\t\tinitial.disabled = props.disabled;\n\t\tinitial.type = props.type;\n\t} else if (\n\t\ttag.value === 'a' ||\n\t\t(isInertia && typeof tag.value !== 'string' && tag.value.name === 'Link')\n\t) {\n\t\t// When rendering as anchor prevent navigation if disabled\n\t\t// https://getbootstrap.com/docs/4.0/components/buttons/#disabled-state\n\t\tif (props.disabled) {\n\t\t\tinitial['aria-disabled'] = true;\n\t\t\tinitial.role = 'link';\n\t\t} else {\n\t\t\t// Only attach the href to active links\n\t\t\t// https://www.scottohara.me/blog/2021/05/28/disabled-links.html\n\t\t\tinitial.href = props.href;\n\t\t\tinitial.target = props.target;\n\n\t\t\tif (isInertia) {\n\t\t\t\tinitial.data = props.data;\n\t\t\t\tinitial.headers = props.headers;\n\t\t\t\tinitial.method = props.method;\n\t\t\t\tinitial.onBefore = props.onBefore;\n\t\t\t\tinitial.onCancel = props.onCancel;\n\t\t\t\tinitial.onCancelToken = props.onCancelToken;\n\t\t\t\tinitial.onFinish = props.onFinish;\n\t\t\t\tinitial.only = props.only;\n\t\t\t\tinitial.onProgress = props.onProgress;\n\t\t\t\tinitial.onStart = props.onStart;\n\t\t\t\tinitial.onSuccess = props.onSuccess;\n\t\t\t\tinitial.preserveScroll = props.preserveScroll;\n\t\t\t\tinitial.preserveState = props.preserveState;\n\t\t\t\tinitial.queryStringArrayFormat = props.queryStringArrayFormat;\n\t\t\t\tinitial.replace = props.replace;\n\t\t\t}\n\t\t}\n\t} else if (\n\t\ttag.value === 'router-link' ||\n\t\t(typeof tag.value !== 'string' && tag.value.name === 'NuxtLink')\n\t) {\n\t\tinitial.activeClass = props.activeClass;\n\t\tinitial.ariaCurrentValue = props.ariaCurrentValue;\n\t\tinitial.exactActiveClass = props.exactActiveClass;\n\t\tinitial.replace = props.replace;\n\t\tinitial.target = props.target;\n\t\tinitial.to = props.to;\n\t}\n\n\treturn initial;\n});\n</script>\n<style lang=\"postcss\">\n@import '@/assets/css/BaseButton';\n</style>\n"],"names":["props","__props","isInertia","_b","_a","getCurrentInstance","isNuxt","_d","_c","tag","computed","resolved","resolveComponent","_config","warn","useLogger","classes","attributes","initial"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoHA,UAAMA,IAAQC,GAWRC,IAAY,CAAC,GAACC,KAAAC,IAAAC,EAAA,MAAA,gBAAAD,EAAsB,UAAtB,QAAAD,EAA6B,WAG3CG,IAAS,CAAC,GAACC,KAAAC,IAAAH,EAAA,MAAA,gBAAAG,EAAsB,UAAtB,QAAAD,EAA6B,QAExCE,IAAMC,EAAS,MAAM;AAE1B,UAAIV,EAAM,QAASA,EAAM,MAAMA,EAAM,UAAW;AAE/C,YAAIE,KAAa,CAACF,EAAM,YAAY,CAACA,EAAM,QAAQ;AAC5C,gBAAAW,IAAWC,EAAiBC,EAAQ,eAAe;AACrD,cAAA,OAAOF,KAAa,UAAU;AAC3B,kBAAA,EAAE,MAAAG,MAASC;AACjB,YAAAD;AAAA,cACC,2BAA2BD,EAAQ,eAAe,qFAAqFA,EAAQ,eAAe,gGAAgGA,EAAQ,gBAAgB;AAAA,YAAA;AAAA,UAExR;AACO,iBAAAF;AAAA,QACR;AAEO,eAAA;AAAA,MACR;AACA,UAAIX,EAAM,IAAI;AACb,YAAIM,GAAQ;AACL,gBAAAK,IAAWC,EAAiBC,EAAQ,YAAY;AAClD,cAAA,OAAOF,KAAa,UAAU;AAC3B,kBAAA,EAAE,MAAAG,MAASC;AACjB,YAAAD;AAAA,cACC,wBAAwBD,EAAQ,YAAY,qFAAqFA,EAAQ,YAAY,6FAA6FA,EAAQ,gBAAgB;AAAA,YAAA;AAAA,UAE5Q;AACO,iBAAAF;AAAA,QACR;AACO,eAAA;AAAA,MACR;AACA,aAAOX,EAAM;AAAA,IAAA,CACb,GAEKgB,IAAUN,EAAS,OAAO;AAAA,MAC/B,YAAY;AAAA,MACZ,mBAAmBV,EAAM;AAAA,MACzB,sBAAsBA,EAAM;AAAA,IAC3B,EAAA,GAEIiB,IAAaP,EAAS,MAAM;AA6BjC,YAAMQ,IAAuC,CAAA;AAEzC,aAAAT,EAAI,UAAU,YACjBS,EAAQ,WAAWlB,EAAM,UACzBkB,EAAQ,OAAOlB,EAAM,QAErBS,EAAI,UAAU,OACbP,KAAa,OAAOO,EAAI,SAAU,YAAYA,EAAI,MAAM,SAAS,SAI9DT,EAAM,YACTkB,EAAQ,eAAe,IAAI,IAC3BA,EAAQ,OAAO,WAIfA,EAAQ,OAAOlB,EAAM,MACrBkB,EAAQ,SAASlB,EAAM,QAEnBE,MACHgB,EAAQ,OAAOlB,EAAM,MACrBkB,EAAQ,UAAUlB,EAAM,SACxBkB,EAAQ,SAASlB,EAAM,QACvBkB,EAAQ,WAAWlB,EAAM,UACzBkB,EAAQ,WAAWlB,EAAM,UACzBkB,EAAQ,gBAAgBlB,EAAM,eAC9BkB,EAAQ,WAAWlB,EAAM,UACzBkB,EAAQ,OAAOlB,EAAM,MACrBkB,EAAQ,aAAalB,EAAM,YAC3BkB,EAAQ,UAAUlB,EAAM,SACxBkB,EAAQ,YAAYlB,EAAM,WAC1BkB,EAAQ,iBAAiBlB,EAAM,gBAC/BkB,EAAQ,gBAAgBlB,EAAM,eAC9BkB,EAAQ,yBAAyBlB,EAAM,wBACvCkB,EAAQ,UAAUlB,EAAM,aAI1BS,EAAI,UAAU,iBACb,OAAOA,EAAI,SAAU,YAAYA,EAAI,MAAM,SAAS,gBAErDS,EAAQ,cAAclB,EAAM,aAC5BkB,EAAQ,mBAAmBlB,EAAM,kBACjCkB,EAAQ,mBAAmBlB,EAAM,kBACjCkB,EAAQ,UAAUlB,EAAM,SACxBkB,EAAQ,SAASlB,EAAM,QACvBkB,EAAQ,KAAKlB,EAAM,KAGbkB;AAAA,IAAA,CACP;;;;;;;;;;;"}
1
+ {"version":3,"file":"index12.js","sources":["../src/composables/useToast.ts"],"sourcesContent":["import { wait } from '@/utilities/functions/wait';\nimport { reactive } from 'vue';\nimport { useId } from './useId';\nimport type { CommonProps } from '@/types/CommonProps';\n\nexport type Message = {\n\t/**\n\t * Title of the message. Displayed in a more prominant fashion.\n\t */\n\ttitle?: string;\n\t/**\n\t * Text content of the toast message.\n\t */\n\ttext: string;\n\t/**\n\t * Name of the icon to display.\n\t */\n\ticon?: string;\n\t/**\n\t * Theme of the toast message. By default the theme is `default`.\n\t */\n\ttheme?: string;\n\t/**\n\t * Identifier of the message\n\t */\n\tid: string;\n} & Pick<CommonProps, 'showClose'>;\n\ntype MessageParameter =\n\t| string\n\t| (Pick<Message, 'title' | 'text' | 'icon' | 'theme'> &\n\t\t\t/* These props are mutually exclusive */\n\t\t\t(| {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Time in milliseconds before the message disappears\n\t\t\t\t\t\t */\n\t\t\t\t\t\ttimeout?: undefined;\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Setting the message as persistent will prevent the message from being dismissed automatically\n\t\t\t\t\t\t */\n\t\t\t\t\t\tpersistent?: undefined | false;\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Whether to show the closing action to dismiss the message.\n\t\t\t\t\t\t * Show close is optional if the message is not persistent\n\t\t\t\t\t\t */\n\t\t\t\t\t\tshowClose?: Message['showClose'];\n\t\t\t\t }\n\t\t\t\t| {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Time in milliseconds before the message disappears\n\t\t\t\t\t\t */\n\t\t\t\t\t\ttimeout: number;\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Setting the message as persistent will prevent the message from being dismissed automatically\n\t\t\t\t\t\t */\n\t\t\t\t\t\tpersistent?: undefined | false;\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Whether to show the closing action to dismiss the message.\n\t\t\t\t\t\t * Show close is optional if the message is not persistent\n\t\t\t\t\t\t */\n\t\t\t\t\t\tshowClose?: Message['showClose'];\n\t\t\t\t }\n\t\t\t\t| {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Time in milliseconds before the message disappears\n\t\t\t\t\t\t */\n\t\t\t\t\t\ttimeout?: undefined;\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Setting the message as persistent will prevent the message from being dismissed automatically\n\t\t\t\t\t\t */\n\t\t\t\t\t\tpersistent: true;\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Whether to show the closing action to dismiss the message.\n\t\t\t\t\t\t * Show close is mandatory if the message is persistent\n\t\t\t\t\t\t */\n\t\t\t\t\t\tshowClose: true;\n\t\t\t\t }\n\t\t\t));\n\nexport const state = reactive({\n\tstack: [] as Message[],\n});\n\nexport const useToast = () => {\n\t/**\n\t * Dismisses a specific message\n\t */\n\tconst dismiss = (id: Message['id']) =>\n\t\t(state.stack = state.stack.filter((el) => el.id !== id));\n\tconst dismissAll = () => (state.stack = []);\n\tconst toast = (message: MessageParameter) => {\n\t\tconst id = useId().id.value;\n\t\tlet title: Message['title'];\n\t\tlet text: Message['text'];\n\t\tlet icon: Message['icon'];\n\t\tlet theme: Message['theme'];\n\t\tlet showClose: Message['showClose'];\n\t\tconst defaultTimeout = 6000;\n\n\t\tif (typeof message === 'string') {\n\t\t\ttext = message;\n\t\t} else {\n\t\t\tif (typeof message.timeout === 'number' && message.timeout <= 0) {\n\t\t\t\tthrow new Error(`Toast messages cannot have a zero or less timeout`);\n\t\t\t}\n\t\t\ticon = message.icon;\n\t\t\tshowClose = message.showClose;\n\t\t\ttext = message.text;\n\t\t\ttheme = message.theme;\n\t\t\ttitle = message.title;\n\t\t}\n\t\tstate.stack = state.stack.concat({\n\t\t\ticon,\n\t\t\tid,\n\t\t\tshowClose,\n\t\t\ttext,\n\t\t\ttheme,\n\t\t\ttitle,\n\t\t});\n\t\tif (\n\t\t\t(typeof message === 'object' && !message.persistent) ||\n\t\t\ttypeof message === 'string'\n\t\t) {\n\t\t\tlet timeout: number;\n\n\t\t\tif (typeof message === 'object' && message.timeout) {\n\t\t\t\ttimeout = message.timeout;\n\t\t\t} else timeout = defaultTimeout;\n\n\t\t\twait(timeout).then(() => {\n\t\t\t\tdismiss(id);\n\t\t\t});\n\t\t}\n\t\treturn id;\n\t};\n\treturn {\n\t\ttoast,\n\t\tdismiss,\n\t\tdismissAll,\n\t};\n};\n"],"names":["state","reactive","useToast","dismiss","id","el","message","useId","title","text","icon","theme","showClose","defaultTimeout","timeout","wait"],"mappings":";;;AA+EO,MAAMA,IAAQC,EAAS;AAAA,EAC7B,OAAO,CAAC;AACT,CAAC,GAEYC,IAAW,MAAM;AAI7B,QAAMC,IAAU,CAACC,MACfJ,EAAM,QAAQA,EAAM,MAAM,OAAO,CAACK,MAAOA,EAAG,OAAOD,CAAE;AA+ChD,SAAA;AAAA,IACN,OA9Ca,CAACE,MAA8B;AACtC,YAAAF,IAAKG,IAAQ,GAAG;AAClB,UAAAC,GACAC,GACAC,GACAC,GACAC;AACJ,YAAMC,IAAiB;AAEnB,UAAA,OAAOP,KAAY;AACf,QAAAG,IAAAH;AAAA,WACD;AACN,YAAI,OAAOA,EAAQ,WAAY,YAAYA,EAAQ,WAAW;AACvD,gBAAA,IAAI,MAAM,mDAAmD;AAEpE,QAAAI,IAAOJ,EAAQ,MACfM,IAAYN,EAAQ,WACpBG,IAAOH,EAAQ,MACfK,IAAQL,EAAQ,OAChBE,IAAQF,EAAQ;AAAA,MACjB;AAUE,UATIN,EAAA,QAAQA,EAAM,MAAM,OAAO;AAAA,QAChC,MAAAU;AAAA,QACA,IAAAN;AAAA,QACA,WAAAQ;AAAA,QACA,MAAAH;AAAA,QACA,OAAAE;AAAA,QACA,OAAAH;AAAA,MAAA,CACA,GAEC,OAAOF,KAAY,YAAY,CAACA,EAAQ,cACzC,OAAOA,KAAY,UAClB;AACG,YAAAQ;AAEJ,QAAI,OAAOR,KAAY,YAAYA,EAAQ,UAC1CQ,IAAUR,EAAQ,UACFQ,IAAAD,GAEZE,EAAAD,CAAO,EAAE,KAAK,MAAM;AACxB,UAAAX,EAAQC,CAAE;AAAA,QAAA,CACV;AAAA,MACF;AACO,aAAAA;AAAA,IAAA;AAAA,IAIP,SAAAD;AAAA,IACA,YAjDkB,MAAOH,EAAM,QAAQ,CAAA;AAAA,EAiDvC;AAEF;"}
package/dist/index121.js CHANGED
@@ -1,47 +1,43 @@
1
- import { defineComponent as m, getCurrentInstance as d, inject as x, computed as l, ref as y, watchEffect as _, openBlock as b, createElementBlock as h, mergeProps as w } from "vue";
2
- import { isCssColor as z } from "./index214.js";
3
- const g = ["innerHTML"], $ = /* @__PURE__ */ m({
4
- __name: "BbIcon",
1
+ import { defineComponent as c, openBlock as l, createElementBlock as o, createElementVNode as t, renderSlot as r, createTextVNode as i, toDisplayString as p, withModifiers as b, createCommentVNode as _ } from "vue";
2
+ const d = { class: "bb-chip" }, m = { class: "bb-chip__content" }, h = ["aria-label"], u = /* @__PURE__ */ t("svg", {
3
+ viewBox: "0 0 24 24",
4
+ xmlns: "http://www.w3.org/2000/svg"
5
+ }, [
6
+ /* @__PURE__ */ t("path", {
7
+ d: "M6.4 19L5 17.6l5.6-5.6L5 6.4L6.4 5l5.6 5.6L17.6 5L19 6.4L13.4 12l5.6 5.6l-1.4 1.4l-5.6-5.6z",
8
+ fill: "currentColor"
9
+ })
10
+ ], -1), f = [
11
+ u
12
+ ], C = /* @__PURE__ */ c({
13
+ __name: "BbChip",
5
14
  props: {
6
- size: { default: "md" },
7
- color: {},
8
- type: {}
15
+ text: {},
16
+ clearable: { type: Boolean, default: !0 },
17
+ clearableLabel: { default: "Elimina" }
9
18
  },
10
- setup(p) {
11
- var i, r;
12
- const e = p;
13
- let t;
14
- !!((r = (i = d()) == null ? void 0 : i.proxy) != null && r.$nuxt) ? process.client && (t = useNuxtApp().$icons) : t = x("icons");
15
- const u = {
16
- xs: 12,
17
- sm: 16,
18
- md: 24,
19
- lg: 28,
20
- xl: 36,
21
- xxl: 40
22
- }, f = l(() => {
23
- const s = {
24
- "bb-icon": !0
25
- };
26
- let c = { width: l(() => {
27
- let o;
28
- return typeof e.size == "string" ? o = u[e.size] ?? parseInt(e.size, 10) : typeof e.size == "number" ? o = e.size : o = 24, o + "px";
29
- }).value };
30
- return e.color && (z(e.color) ? c.color = e.color : s[`bb-icon--${e.color}`] = !0), {
31
- class: s,
32
- style: c
33
- };
34
- }), n = y(null);
35
- return _(async () => {
36
- if (t) {
37
- if (typeof t[e.type] > "u")
38
- throw new Error(`Icon "${e.type}" does not exist.`);
39
- n.value = await t[e.type]();
40
- }
41
- }), (s, a) => (b(), h("i", w(f.value, { innerHTML: n.value }), null, 16, g));
19
+ emits: ["click:clear"],
20
+ setup(L, { emit: a }) {
21
+ const n = a, s = (e) => {
22
+ n("click:clear", e);
23
+ };
24
+ return (e, k) => (l(), o("span", d, [
25
+ t("span", m, [
26
+ r(e.$slots, "default", {}, () => [
27
+ i(p(e.text), 1)
28
+ ])
29
+ ]),
30
+ e.clearable ? (l(), o("button", {
31
+ key: 0,
32
+ "aria-label": e.clearableLabel,
33
+ class: "bb-chip__clear-button",
34
+ type: "button",
35
+ onClick: b(s, ["stop", "prevent"])
36
+ }, f, 8, h)) : _("", !0)
37
+ ]));
42
38
  }
43
39
  });
44
40
  export {
45
- $ as default
41
+ C as default
46
42
  };
47
43
  //# sourceMappingURL=index121.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index121.js","sources":["../src/components/BbIcon/BbIcon.vue"],"sourcesContent":["<template>\n\t<i v-bind=\"iconAttributes\" v-html=\"icon\"></i>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, getCurrentInstance, inject, ref, watchEffect } from 'vue';\nimport { isCssColor } from '@/utilities/functions/isCssColor';\nimport type { Size as S } from '@/types/CommonProps';\n\nexport type Size = {\n\txs: number;\n\tsm: number;\n\tmd: number;\n\tlg: number;\n\txl: number;\n\txxl: number;\n};\n\nexport type BbIconProps = S<Size> & {\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\t/**\n\t * Name of the icon to use\n\t */\n\ttype: string;\n};\nconst props = withDefaults(defineProps<BbIconProps>(), {\n\tsize: 'md',\n});\nlet icons: Record<string, () => Promise<string>> | undefined;\n// @ts-expect-error possibily undef\nconst isNuxt = !!getCurrentInstance()?.proxy?.$nuxt;\n\nif (isNuxt) {\n\t// @ts-expect-error possibily undef\n\tif (process.client) {\n\t\t// @ts-expect-error possibily undef\n\t\ticons = useNuxtApp()[`$icons`] as typeof icons; // eslint-disable-line no-undef\n\t}\n} else {\n\ticons = inject('icons');\n}\n\nconst sizeMap: Size = {\n\txs: 12,\n\tsm: 16,\n\tmd: 24,\n\tlg: 28,\n\txl: 36,\n\txxl: 40,\n};\n\nconst iconAttributes = computed(() => {\n\tconst classes: any = {\n\t\t'bb-icon': true,\n\t};\n\tconst width = computed(() => {\n\t\tlet dimension: number;\n\t\tif (typeof props.size === 'string') {\n\t\t\tdimension = sizeMap[props.size as keyof Size] ?? parseInt(props.size, 10);\n\t\t} else if (typeof props.size === 'number') {\n\t\t\tdimension = props.size;\n\t\t} else {\n\t\t\tdimension = 24;\n\t\t}\n\t\treturn dimension + `px`;\n\t});\n\tlet style: { [key: string]: any } = { width: width.value };\n\n\tif (props.color) {\n\t\tif (isCssColor(props.color)) {\n\t\t\tstyle.color = props.color;\n\t\t} else {\n\t\t\tclasses[`bb-icon--${props.color}`] = true;\n\t\t}\n\t}\n\treturn {\n\t\tclass: classes,\n\t\tstyle,\n\t};\n});\n\nconst icon = ref<string | null>(null);\n\nwatchEffect(async () => {\n\tif (icons) {\n\t\tif (typeof icons[props.type] === 'undefined')\n\t\t\tthrow new Error(`Icon \"${props.type}\" does not exist.`);\n\t\ticon.value = await icons[props.type]();\n\t}\n});\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbIcon';\n</style>\n"],"names":["props","__props","icons","_b","_a","getCurrentInstance","inject","sizeMap","iconAttributes","computed","classes","style","dimension","isCssColor","icon","ref","watchEffect"],"mappings":";;;;;;;;;;;AA8BA,UAAMA,IAAQC;AAGV,QAAAC;AAIJ,IAFe,CAAC,GAACC,KAAAC,IAAAC,EAAA,MAAA,gBAAAD,EAAsB,UAAtB,QAAAD,EAA6B,SAIzC,QAAQ,WAEHD,IAAA,WAAA,EAAa,UAGtBA,IAAQI,EAAO,OAAO;AAGvB,UAAMC,IAAgB;AAAA,MACrB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,KAAK;AAAA,IAAA,GAGAC,IAAiBC,EAAS,MAAM;AACrC,YAAMC,IAAe;AAAA,QACpB,WAAW;AAAA,MAAA;AAaZ,UAAIC,IAAgC,EAAE,OAXxBF,EAAS,MAAM;AACxB,YAAAG;AACA,eAAA,OAAOZ,EAAM,QAAS,WACzBY,IAAYL,EAAQP,EAAM,IAAkB,KAAK,SAASA,EAAM,MAAM,EAAE,IAC9D,OAAOA,EAAM,QAAS,WAChCY,IAAYZ,EAAM,OAENY,IAAA,IAENA,IAAY;AAAA,MAAA,CACnB,EACkD,MAAM;AAEzD,aAAIZ,EAAM,UACLa,EAAWb,EAAM,KAAK,IACzBW,EAAM,QAAQX,EAAM,QAEpBU,EAAQ,YAAYV,EAAM,KAAK,EAAE,IAAI,KAGhC;AAAA,QACN,OAAOU;AAAA,QACP,OAAAC;AAAA,MAAA;AAAA,IACD,CACA,GAEKG,IAAOC,EAAmB,IAAI;AAEpC,WAAAC,EAAY,YAAY;AACvB,UAAId,GAAO;AACV,YAAI,OAAOA,EAAMF,EAAM,IAAI,IAAM;AAChC,gBAAM,IAAI,MAAM,SAASA,EAAM,IAAI,mBAAmB;AACvD,QAAAc,EAAK,QAAQ,MAAMZ,EAAMF,EAAM,IAAI,EAAE;AAAA,MACtC;AAAA,IAAA,CACA;;;"}
1
+ {"version":3,"file":"index121.js","sources":["../src/components/BbChip/BbChip.vue"],"sourcesContent":["<template>\n\t<span class=\"bb-chip\"\n\t\t><span class=\"bb-chip__content\"\n\t\t\t><slot>{{ text }}</slot></span\n\t\t><button\n\t\t\tv-if=\"clearable\"\n\t\t\t:aria-label=\"clearableLabel\"\n\t\t\tclass=\"bb-chip__clear-button\"\n\t\t\ttype=\"button\"\n\t\t\t@click.stop.prevent=\"onClear\"\n\t\t>\n\t\t\t<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t\t<path\n\t\t\t\t\td=\"M6.4 19L5 17.6l5.6-5.6L5 6.4L6.4 5l5.6 5.6L17.6 5L19 6.4L13.4 12l5.6 5.6l-1.4 1.4l-5.6-5.6z\"\n\t\t\t\t\tfill=\"currentColor\"\n\t\t\t\t/>\n\t\t\t</svg></button\n\t></span>\n</template>\n\n<script setup lang=\"ts\">\nimport type { CommonProps } from '@/types/CommonProps';\n\nexport type BbChipProps = Pick<CommonProps, 'text'> & {\n\t/**\n\t * Renders a button with a close icon. Used to indicate the possibility of deleting the item.\n\t */\n\tclearable?: boolean;\n\t/**\n\t * The label the clearing button must have\n\t */\n\tclearableLabel?: string;\n};\n\nwithDefaults(defineProps<BbChipProps>(), {\n\tclearable: true,\n\tclearableLabel: 'Elimina',\n});\n\nexport type BbChipEvents = {\n\t(e: 'click:clear', event: MouseEvent): void;\n};\n\ndefineSlots<{\n\tdefault?: (props: object) => any;\n}>();\n\nconst emit = defineEmits(['click:clear']);\nconst onClear = (event: MouseEvent) => {\n\temit('click:clear', event);\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbChip';\n</style>\n"],"names":["emit","__emit","onClear","event"],"mappings":";;;;;;;;;;;;;;;;;;;;AA+CA,UAAMA,IAAOC,GACPC,IAAU,CAACC,MAAsB;AACtC,MAAAH,EAAK,eAAeG,CAAK;AAAA,IAAA;;;;;;;;;;;;;;;;;"}
package/dist/index122.js CHANGED
@@ -1,50 +1,47 @@
1
- import { defineComponent as v, ref as r, onMounted as p, onBeforeUnmount as h, openBlock as i, createBlock as l, resolveDynamicComponent as u, normalizeStyle as m, withCtx as f, renderSlot as d } from "vue";
2
- import { throttle as g } from "./index224.js";
3
- const O = /* @__PURE__ */ v({
4
- __name: "BbSmoothHeight",
1
+ import { defineComponent as d, ref as s, watch as m, computed as b, openBlock as r, createBlock as u, resolveDynamicComponent as i, normalizeProps as f, guardReactiveProps as v, withCtx as c, normalizeStyle as y, renderSlot as g, createCommentVNode as V } from "vue";
2
+ const C = /* @__PURE__ */ d({
3
+ __name: "BbCollapsible",
5
4
  props: {
6
- mutationOptions: { default: () => ({ childList: !0 }) },
7
- resizeOptions: {},
8
- strategy: { default: "resize" },
9
- tag: { default: "div" },
10
- transitionDuration: { default: 200 }
5
+ eager: { type: Boolean },
6
+ transitionDuration: { default: 250 },
7
+ modelValue: { type: Boolean },
8
+ tag: { default: "div" }
11
9
  },
12
- setup(c) {
13
- const n = c, s = r(null), e = r(null), t = r(null);
14
- globalThis.ResizeObserver && (p(() => {
15
- n.strategy === "resize" ? e.value && (t.value = new ResizeObserver(a), t.value.observe(e.value, n.resizeOptions)) : n.strategy === "mutation" && e.value && (t.value = new MutationObserver(a), t.value.observe(e.value, n.mutationOptions)), a();
16
- }), h(() => {
17
- t.value && t.value.disconnect();
18
- }));
19
- const a = g(() => {
20
- if (s.value && e.value) {
21
- const o = e.value.scrollHeight;
22
- s.value.style.height = "0px", s.value.style.height = `${o}px`;
10
+ setup(p) {
11
+ const l = p, t = s(l.modelValue), a = s(t.value), o = m(
12
+ () => l.modelValue,
13
+ (e) => {
14
+ e && (a.value = !0, o());
15
+ }
16
+ );
17
+ t.value && o();
18
+ const n = b(() => ({
19
+ class: {
20
+ "bb-collapsible": !0,
21
+ "bb-collapsible--open": l.modelValue,
22
+ "bb-collapsible--closed": !l.modelValue
23
+ },
24
+ style: {
25
+ transitionDuration: l.transitionDuration + "ms"
23
26
  }
24
- }, 200);
25
- return (o, y) => (i(), l(u(o.tag), {
26
- ref_key: "container",
27
- ref: s,
28
- class: "bb-smooth-height",
29
- style: m({ "transition-duration": n.transitionDuration / 1e3 + "s" })
30
- }, {
31
- default: f(() => [
32
- (i(), l(u(o.tag), {
33
- ref_key: "content",
34
- ref: e,
35
- class: "content"
27
+ }));
28
+ return (e, _) => (r(), u(i(e.tag), f(v(n.value)), {
29
+ default: c(() => [
30
+ (r(), u(i(e.tag), {
31
+ class: "bb-collapsible__content",
32
+ style: y(n.value.style)
36
33
  }, {
37
- default: f(() => [
38
- d(o.$slots, "default")
34
+ default: c(() => [
35
+ e.eager || a.value ? g(e.$slots, "default", { key: 0 }) : V("", !0)
39
36
  ]),
40
37
  _: 3
41
- }, 512))
38
+ }, 8, ["style"]))
42
39
  ]),
43
40
  _: 3
44
- }, 8, ["style"]));
41
+ }, 16));
45
42
  }
46
43
  });
47
44
  export {
48
- O as default
45
+ C as default
49
46
  };
50
47
  //# sourceMappingURL=index122.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index122.js","sources":["../src/components/BbSmoothHeight/BbSmoothHeight.vue"],"sourcesContent":["<template>\n\t<component\n\t\t:is=\"tag\"\n\t\tref=\"container\"\n\t\tclass=\"bb-smooth-height\"\n\t\t:style=\"{ 'transition-duration': props.transitionDuration / 1000 + 's' }\"\n\t>\n\t\t<component :is=\"tag\" ref=\"content\" class=\"content\">\n\t\t\t<slot />\n\t\t</component>\n\t</component>\n</template>\n\n<script setup lang=\"ts\">\nimport type { CommonProps, NonVoidElementTag } from '@/types/CommonProps';\nimport { throttle } from '@/utilities/functions/throttle';\nimport { ref, onMounted, onBeforeUnmount } from 'vue';\n\nexport type BbSmoothHeightProps = {\n\t/**\n\t * Options to pass to the MutationObserver\n\t */\n\tmutationOptions?: MutationObserverInit; // eslint-disable-line no-undef\n\t/**\n\t * Options to pass to the ResizeObserver\n\t */\n\tresizeOptions?: ResizeObserverOptions; // eslint-disable-line no-undef\n\t/**\n\t * Define which strategy to use. By default is used 'resize' which means the\n\t * component will update on resizing.\n\t * You can also define 'mutation' to use a MutationObserver\n\t */\n\tstrategy?: 'resize' | 'mutation';\n} & NonVoidElementTag &\n\tPick<CommonProps, 'transitionDuration'>;\n\nconst props = withDefaults(defineProps<BbSmoothHeightProps>(), {\n\ttransitionDuration: 200,\n\tstrategy: 'resize',\n\tmutationOptions: () => ({ childList: true }),\n\ttag: 'div',\n});\n\nexport type BbSmoothHeightSlots = {\n\tdefault?: (props: object) => any;\n};\n\ndefineSlots<BbSmoothHeightSlots>();\n\nconst container = ref<HTMLElement | null>(null);\nconst content = ref<HTMLElement | null>(null);\nconst observer = ref<ResizeObserver | MutationObserver | null>(null);\n\nif (globalThis.ResizeObserver) {\n\tonMounted(() => {\n\t\tif (props.strategy === 'resize') {\n\t\t\tif (content.value) {\n\t\t\t\tobserver.value = new ResizeObserver(onContentGrow);\n\t\t\t\tobserver.value.observe(content.value, props.resizeOptions);\n\t\t\t}\n\t\t} else if (props.strategy === 'mutation') {\n\t\t\tif (content.value) {\n\t\t\t\tobserver.value = new MutationObserver(onContentGrow);\n\t\t\t\tobserver.value.observe(content.value, props.mutationOptions);\n\t\t\t}\n\t\t}\n\t\tonContentGrow();\n\t});\n\tonBeforeUnmount(() => {\n\t\tif (observer.value) {\n\t\t\tobserver.value.disconnect();\n\t\t}\n\t});\n}\n\n/**\n * This is called when content changes.\n * It could be called numerous times so throttle every 200ms\n */\nconst onContentGrow = throttle(() => {\n\tif (container.value && content.value) {\n\t\tconst contentHeight = content.value.scrollHeight;\n\t\tcontainer.value.style.height = '0px';\n\t\tcontainer.value.style.height = `${contentHeight}px`;\n\t}\n}, 200);\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbSmoothHeight';\n</style>\n"],"names":["props","__props","container","ref","content","observer","onMounted","onContentGrow","onBeforeUnmount","throttle","contentHeight"],"mappings":";;;;;;;;;;;;AAoCA,UAAMA,IAAQC,GAaRC,IAAYC,EAAwB,IAAI,GACxCC,IAAUD,EAAwB,IAAI,GACtCE,IAAWF,EAA8C,IAAI;AAEnE,IAAI,WAAW,mBACdG,EAAU,MAAM;AACX,MAAAN,EAAM,aAAa,WAClBI,EAAQ,UACFC,EAAA,QAAQ,IAAI,eAAeE,CAAa,GACjDF,EAAS,MAAM,QAAQD,EAAQ,OAAOJ,EAAM,aAAa,KAEhDA,EAAM,aAAa,cACzBI,EAAQ,UACFC,EAAA,QAAQ,IAAI,iBAAiBE,CAAa,GACnDF,EAAS,MAAM,QAAQD,EAAQ,OAAOJ,EAAM,eAAe,IAG/CO;IAAA,CACd,GACDC,EAAgB,MAAM;AACrB,MAAIH,EAAS,SACZA,EAAS,MAAM;IAChB,CACA;AAOI,UAAAE,IAAgBE,EAAS,MAAM;AAChC,UAAAP,EAAU,SAASE,EAAQ,OAAO;AAC/B,cAAAM,IAAgBN,EAAQ,MAAM;AAC1B,QAAAF,EAAA,MAAM,MAAM,SAAS,OAC/BA,EAAU,MAAM,MAAM,SAAS,GAAGQ,CAAa;AAAA,MAChD;AAAA,OACE,GAAG;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index122.js","sources":["../src/components/BbCollapsible/BbCollapsible.vue"],"sourcesContent":["<template>\n\t<component v-bind=\"collapsibleAttributes\" :is=\"tag\">\n\t\t<component\n\t\t\t:is=\"tag\"\n\t\t\tclass=\"bb-collapsible__content\"\n\t\t\t:style=\"collapsibleAttributes.style\"\n\t\t>\n\t\t\t<slot v-if=\"eager || hasRenderedOnce\"></slot>\n\t\t</component>\n\t</component>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, ref, watch } from 'vue';\n\nimport type { CommonProps } from '@/types/CommonProps';\n\nexport type BbCollapsibleProps = Pick<\n\tCommonProps,\n\t'eager' | 'transitionDuration'\n> & {\n\t/**\n\t * Used by v-model to trigger opening / closing the collapsible\n\t */\n\tmodelValue: boolean;\n\t/**\n\t * Any HTML tag corresponding to a non-void HTMl element.\n\t */\n\ttag?: string;\n};\n\nconst props = withDefaults(defineProps<BbCollapsibleProps>(), {\n\ttransitionDuration: 250,\n\ttag: 'div',\n});\n\ndefineSlots<{\n\tdefault?: (props: object) => any;\n}>();\n\nconst visible = ref(props.modelValue);\nconst hasRenderedOnce = ref(visible.value);\n\n/**\n * If the component is lazy render content on first time modelValue is true\n */\nconst cleanup = watch(\n\t() => props.modelValue,\n\t(value) => {\n\t\tif (value) {\n\t\t\thasRenderedOnce.value = true;\n\t\t\tcleanup();\n\t\t}\n\t}\n);\nif (visible.value) cleanup();\n\nconst collapsibleAttributes = computed(() => {\n\treturn {\n\t\tclass: {\n\t\t\t'bb-collapsible': true,\n\t\t\t'bb-collapsible--open': props.modelValue,\n\t\t\t'bb-collapsible--closed': !props.modelValue,\n\t\t},\n\t\tstyle: {\n\t\t\ttransitionDuration: props.transitionDuration + 'ms',\n\t\t},\n\t};\n});\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbCollapsible';\n</style>\n"],"names":["props","__props","visible","ref","hasRenderedOnce","cleanup","watch","value","collapsibleAttributes","computed"],"mappings":";;;;;;;;;;AA+BA,UAAMA,IAAQC,GASRC,IAAUC,EAAIH,EAAM,UAAU,GAC9BI,IAAkBD,EAAID,EAAQ,KAAK,GAKnCG,IAAUC;AAAA,MACf,MAAMN,EAAM;AAAA,MACZ,CAACO,MAAU;AACV,QAAIA,MACHH,EAAgB,QAAQ,IAChBC;MAEV;AAAA,IAAA;AAEG,IAAAH,EAAQ,SAAeG;AAErB,UAAAG,IAAwBC,EAAS,OAC/B;AAAA,MACN,OAAO;AAAA,QACN,kBAAkB;AAAA,QAClB,wBAAwBT,EAAM;AAAA,QAC9B,0BAA0B,CAACA,EAAM;AAAA,MAClC;AAAA,MACA,OAAO;AAAA,QACN,oBAAoBA,EAAM,qBAAqB;AAAA,MAChD;AAAA,IAAA,EAED;;;;;;;;;;;;;;;;;"}
package/dist/index123.js CHANGED
@@ -1,38 +1,47 @@
1
- import { defineComponent as p, computed as l, openBlock as _, createElementBlock as a, normalizeProps as b, guardReactiveProps as x, createStaticVNode as m } from "vue";
2
- import { isCssColor as d } from "./index214.js";
3
- const u = /* @__PURE__ */ m('<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><circle class="bb-spinner__circle" cx="12" cy="3" r="0"></circle><circle class="bb-spinner__circle circle--1" cx="16.50" cy="4.21" r="0"></circle><circle class="bb-spinner__circle circle--2" cx="7.50" cy="4.21" r="0"></circle><circle class="bb-spinner__circle circle--3" cx="19.79" cy="7.50" r="0"></circle><circle class="bb-spinner__circle circle--4" cx="4.21" cy="7.50" r="0"></circle><circle class="bb-spinner__circle circle--5" cx="21.00" cy="12.00" r="0"></circle><circle class="bb-spinner__circle circle--6" cx="3.00" cy="12.00" r="0"></circle><circle class="bb-spinner__circle circle--7" cx="19.79" cy="16.50" r="0"></circle><circle class="bb-spinner__circle circle--8" cx="4.21" cy="16.50" r="0"></circle><circle class="bb-spinner__circle circle--9" cx="16.50" cy="19.79" r="0"></circle><circle class="bb-spinner__circle circle--10" cx="7.50" cy="19.79" r="0"></circle><circle class="bb-spinner__circle circle--11" cx="12" cy="21" r="0"></circle></svg>', 1), y = [
4
- u
5
- ], g = /* @__PURE__ */ p({
6
- __name: "BbSpinner",
1
+ import { defineComponent as m, getCurrentInstance as d, inject as x, computed as l, ref as y, watchEffect as _, openBlock as b, createElementBlock as h, mergeProps as w } from "vue";
2
+ import { isCssColor as z } from "./index219.js";
3
+ const g = ["innerHTML"], $ = /* @__PURE__ */ m({
4
+ __name: "BbIcon",
7
5
  props: {
6
+ size: { default: "md" },
8
7
  color: {},
9
- size: { default: "md" }
8
+ type: {}
10
9
  },
11
- setup(s) {
12
- const c = s, n = {
10
+ setup(p) {
11
+ var i, r;
12
+ const e = p;
13
+ let t;
14
+ !!((r = (i = d()) == null ? void 0 : i.proxy) != null && r.$nuxt) ? process.client && (t = useNuxtApp().$icons) : t = x("icons");
15
+ const u = {
13
16
  xs: 12,
14
17
  sm: 16,
15
18
  md: 24,
16
19
  lg: 28,
17
20
  xl: 36,
18
21
  xxl: 40
19
- }, o = l(() => {
20
- const e = {
21
- "bb-spinner": !0
22
+ }, f = l(() => {
23
+ const s = {
24
+ "bb-icon": !0
22
25
  };
23
- let i = { width: l(() => {
24
- let r;
25
- return typeof c.size == "string" ? r = n[c.size] ?? parseInt(c.size, 10) : r = c.size, r + "px";
26
+ let c = { width: l(() => {
27
+ let o;
28
+ return typeof e.size == "string" ? o = u[e.size] ?? parseInt(e.size, 10) : typeof e.size == "number" ? o = e.size : o = 24, o + "px";
26
29
  }).value };
27
- return c.color && (d(c.color) ? i.color = c.color : e[`bb-spinner--${c.color}`] = !0), {
28
- class: e,
29
- style: i
30
+ return e.color && (z(e.color) ? c.color = e.color : s[`bb-icon--${e.color}`] = !0), {
31
+ class: s,
32
+ style: c
30
33
  };
31
- });
32
- return (e, t) => (_(), a("span", b(x(o.value)), y, 16));
34
+ }), n = y(null);
35
+ return _(async () => {
36
+ if (t) {
37
+ if (typeof t[e.type] > "u")
38
+ throw new Error(`Icon "${e.type}" does not exist.`);
39
+ n.value = await t[e.type]();
40
+ }
41
+ }), (s, a) => (b(), h("i", w(f.value, { innerHTML: n.value }), null, 16, g));
33
42
  }
34
43
  });
35
44
  export {
36
- g as default
45
+ $ as default
37
46
  };
38
47
  //# sourceMappingURL=index123.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index123.js","sources":["../src/components/BbSpinner/BbSpinner.vue"],"sourcesContent":["<template>\n\t<span v-bind=\"iconAttributes\">\n\t\t<svg viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t<circle class=\"bb-spinner__circle\" cx=\"12\" cy=\"3\" r=\"0\" />\n\t\t\t<circle class=\"bb-spinner__circle circle--1\" cx=\"16.50\" cy=\"4.21\" r=\"0\" />\n\t\t\t<circle class=\"bb-spinner__circle circle--2\" cx=\"7.50\" cy=\"4.21\" r=\"0\" />\n\t\t\t<circle class=\"bb-spinner__circle circle--3\" cx=\"19.79\" cy=\"7.50\" r=\"0\" />\n\t\t\t<circle class=\"bb-spinner__circle circle--4\" cx=\"4.21\" cy=\"7.50\" r=\"0\" />\n\t\t\t<circle\n\t\t\t\tclass=\"bb-spinner__circle circle--5\"\n\t\t\t\tcx=\"21.00\"\n\t\t\t\tcy=\"12.00\"\n\t\t\t\tr=\"0\"\n\t\t\t/>\n\t\t\t<circle class=\"bb-spinner__circle circle--6\" cx=\"3.00\" cy=\"12.00\" r=\"0\" />\n\t\t\t<circle\n\t\t\t\tclass=\"bb-spinner__circle circle--7\"\n\t\t\t\tcx=\"19.79\"\n\t\t\t\tcy=\"16.50\"\n\t\t\t\tr=\"0\"\n\t\t\t/>\n\t\t\t<circle class=\"bb-spinner__circle circle--8\" cx=\"4.21\" cy=\"16.50\" r=\"0\" />\n\t\t\t<circle\n\t\t\t\tclass=\"bb-spinner__circle circle--9\"\n\t\t\t\tcx=\"16.50\"\n\t\t\t\tcy=\"19.79\"\n\t\t\t\tr=\"0\"\n\t\t\t/>\n\t\t\t<circle\n\t\t\t\tclass=\"bb-spinner__circle circle--10\"\n\t\t\t\tcx=\"7.50\"\n\t\t\t\tcy=\"19.79\"\n\t\t\t\tr=\"0\"\n\t\t\t/>\n\t\t\t<circle class=\"bb-spinner__circle circle--11\" cx=\"12\" cy=\"21\" r=\"0\" />\n\t\t</svg>\n\t</span>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport { isCssColor } from '@/utilities/functions/isCssColor';\nimport type { Classes } from '@/types/Classes';\nimport type { CommonProps, Size as S } from '@/types/CommonProps';\nimport type { Size as IconSize } from '../BbIcon/BbIcon.vue';\n\nexport type Size = IconSize;\nexport type BbSpinnerProps = Pick<CommonProps, 'color'> & S<IconSize>;\n\nconst props = withDefaults(defineProps<BbSpinnerProps>(), {\n\tsize: 'md',\n});\n\nconst sizeMap: IconSize = {\n\txs: 12,\n\tsm: 16,\n\tmd: 24,\n\tlg: 28,\n\txl: 36,\n\txxl: 40,\n};\n\nconst iconAttributes = computed(() => {\n\tconst classes: Classes = {\n\t\t'bb-spinner': true,\n\t};\n\tconst width = computed(() => {\n\t\tlet dimension: number;\n\t\tif (typeof props.size === 'string') {\n\t\t\tdimension =\n\t\t\t\tsizeMap[props.size as keyof IconSize] ?? parseInt(props.size, 10);\n\t\t} else {\n\t\t\tdimension = props.size;\n\t\t}\n\t\treturn dimension + `px`;\n\t});\n\tlet style: { [key: string]: any } = { width: width.value };\n\n\tif (props.color) {\n\t\tif (isCssColor(props.color)) {\n\t\t\tstyle.color = props.color;\n\t\t} else {\n\t\t\tclasses[`bb-spinner--${props.color}`] = true;\n\t\t}\n\t}\n\treturn {\n\t\tclass: classes,\n\t\tstyle,\n\t};\n});\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbSpinner';\n</style>\n"],"names":["props","__props","sizeMap","iconAttributes","computed","classes","style","dimension","isCssColor"],"mappings":";;;;;;;;;;;AAiDA,UAAMA,IAAQC,GAIRC,IAAoB;AAAA,MACzB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,KAAK;AAAA,IAAA,GAGAC,IAAiBC,EAAS,MAAM;AACrC,YAAMC,IAAmB;AAAA,QACxB,cAAc;AAAA,MAAA;AAYf,UAAIC,IAAgC,EAAE,OAVxBF,EAAS,MAAM;AACxB,YAAAG;AACA,eAAA,OAAOP,EAAM,QAAS,WACzBO,IACCL,EAAQF,EAAM,IAAsB,KAAK,SAASA,EAAM,MAAM,EAAE,IAEjEO,IAAYP,EAAM,MAEZO,IAAY;AAAA,MAAA,CACnB,EACkD,MAAM;AAEzD,aAAIP,EAAM,UACLQ,EAAWR,EAAM,KAAK,IACzBM,EAAM,QAAQN,EAAM,QAEpBK,EAAQ,eAAeL,EAAM,KAAK,EAAE,IAAI,KAGnC;AAAA,QACN,OAAOK;AAAA,QACP,OAAAC;AAAA,MAAA;AAAA,IACD,CACA;;;;"}
1
+ {"version":3,"file":"index123.js","sources":["../src/components/BbIcon/BbIcon.vue"],"sourcesContent":["<template>\n\t<i v-bind=\"iconAttributes\" v-html=\"icon\"></i>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, getCurrentInstance, inject, ref, watchEffect } from 'vue';\nimport { isCssColor } from '@/utilities/functions/isCssColor';\nimport type { Size as S } from '@/types/CommonProps';\n\nexport type Size = {\n\txs: number;\n\tsm: number;\n\tmd: number;\n\tlg: number;\n\txl: number;\n\txxl: number;\n};\n\nexport type BbIconProps = S<Size> & {\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\t/**\n\t * Name of the icon to use\n\t */\n\ttype: string;\n};\nconst props = withDefaults(defineProps<BbIconProps>(), {\n\tsize: 'md',\n});\nlet icons: Record<string, () => Promise<string>> | undefined;\n// @ts-expect-error possibily undef\nconst isNuxt = !!getCurrentInstance()?.proxy?.$nuxt;\n\nif (isNuxt) {\n\t// @ts-expect-error possibily undef\n\tif (process.client) {\n\t\t// @ts-expect-error possibily undef\n\t\ticons = useNuxtApp()[`$icons`] as typeof icons; // eslint-disable-line no-undef\n\t}\n} else {\n\ticons = inject('icons');\n}\n\nconst sizeMap: Size = {\n\txs: 12,\n\tsm: 16,\n\tmd: 24,\n\tlg: 28,\n\txl: 36,\n\txxl: 40,\n};\n\nconst iconAttributes = computed(() => {\n\tconst classes: any = {\n\t\t'bb-icon': true,\n\t};\n\tconst width = computed(() => {\n\t\tlet dimension: number;\n\t\tif (typeof props.size === 'string') {\n\t\t\tdimension = sizeMap[props.size as keyof Size] ?? parseInt(props.size, 10);\n\t\t} else if (typeof props.size === 'number') {\n\t\t\tdimension = props.size;\n\t\t} else {\n\t\t\tdimension = 24;\n\t\t}\n\t\treturn dimension + `px`;\n\t});\n\tlet style: { [key: string]: any } = { width: width.value };\n\n\tif (props.color) {\n\t\tif (isCssColor(props.color)) {\n\t\t\tstyle.color = props.color;\n\t\t} else {\n\t\t\tclasses[`bb-icon--${props.color}`] = true;\n\t\t}\n\t}\n\treturn {\n\t\tclass: classes,\n\t\tstyle,\n\t};\n});\n\nconst icon = ref<string | null>(null);\n\nwatchEffect(async () => {\n\tif (icons) {\n\t\tif (typeof icons[props.type] === 'undefined')\n\t\t\tthrow new Error(`Icon \"${props.type}\" does not exist.`);\n\t\ticon.value = await icons[props.type]();\n\t}\n});\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbIcon';\n</style>\n"],"names":["props","__props","icons","_b","_a","getCurrentInstance","inject","sizeMap","iconAttributes","computed","classes","style","dimension","isCssColor","icon","ref","watchEffect"],"mappings":";;;;;;;;;;;AA8BA,UAAMA,IAAQC;AAGV,QAAAC;AAIJ,IAFe,CAAC,GAACC,KAAAC,IAAAC,EAAA,MAAA,gBAAAD,EAAsB,UAAtB,QAAAD,EAA6B,SAIzC,QAAQ,WAEHD,IAAA,WAAA,EAAa,UAGtBA,IAAQI,EAAO,OAAO;AAGvB,UAAMC,IAAgB;AAAA,MACrB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,KAAK;AAAA,IAAA,GAGAC,IAAiBC,EAAS,MAAM;AACrC,YAAMC,IAAe;AAAA,QACpB,WAAW;AAAA,MAAA;AAaZ,UAAIC,IAAgC,EAAE,OAXxBF,EAAS,MAAM;AACxB,YAAAG;AACA,eAAA,OAAOZ,EAAM,QAAS,WACzBY,IAAYL,EAAQP,EAAM,IAAkB,KAAK,SAASA,EAAM,MAAM,EAAE,IAC9D,OAAOA,EAAM,QAAS,WAChCY,IAAYZ,EAAM,OAENY,IAAA,IAENA,IAAY;AAAA,MAAA,CACnB,EACkD,MAAM;AAEzD,aAAIZ,EAAM,UACLa,EAAWb,EAAM,KAAK,IACzBW,EAAM,QAAQX,EAAM,QAEpBU,EAAQ,YAAYV,EAAM,KAAK,EAAE,IAAI,KAGhC;AAAA,QACN,OAAOU;AAAA,QACP,OAAAC;AAAA,MAAA;AAAA,IACD,CACA,GAEKG,IAAOC,EAAmB,IAAI;AAEpC,WAAAC,EAAY,YAAY;AACvB,UAAId,GAAO;AACV,YAAI,OAAOA,EAAMF,EAAM,IAAI,IAAM;AAChC,gBAAM,IAAI,MAAM,SAASA,EAAM,IAAI,mBAAmB;AACvD,QAAAc,EAAK,QAAQ,MAAMZ,EAAMF,EAAM,IAAI,EAAE;AAAA,MACtC;AAAA,IAAA,CACA;;;"}
package/dist/index124.js CHANGED
@@ -1,5 +1,50 @@
1
- const r = (e) => typeof e > "u" || e === null;
1
+ import { defineComponent as v, ref as r, onMounted as p, onBeforeUnmount as h, openBlock as i, createBlock as l, resolveDynamicComponent as u, normalizeStyle as m, withCtx as f, renderSlot as d } from "vue";
2
+ import { throttle as g } from "./index222.js";
3
+ const O = /* @__PURE__ */ v({
4
+ __name: "BbSmoothHeight",
5
+ props: {
6
+ mutationOptions: { default: () => ({ childList: !0 }) },
7
+ resizeOptions: {},
8
+ strategy: { default: "resize" },
9
+ tag: { default: "div" },
10
+ transitionDuration: { default: 200 }
11
+ },
12
+ setup(c) {
13
+ const n = c, s = r(null), e = r(null), t = r(null);
14
+ globalThis.ResizeObserver && (p(() => {
15
+ n.strategy === "resize" ? e.value && (t.value = new ResizeObserver(a), t.value.observe(e.value, n.resizeOptions)) : n.strategy === "mutation" && e.value && (t.value = new MutationObserver(a), t.value.observe(e.value, n.mutationOptions)), a();
16
+ }), h(() => {
17
+ t.value && t.value.disconnect();
18
+ }));
19
+ const a = g(() => {
20
+ if (s.value && e.value) {
21
+ const o = e.value.scrollHeight;
22
+ s.value.style.height = "0px", s.value.style.height = `${o}px`;
23
+ }
24
+ }, 200);
25
+ return (o, y) => (i(), l(u(o.tag), {
26
+ ref_key: "container",
27
+ ref: s,
28
+ class: "bb-smooth-height",
29
+ style: m({ "transition-duration": n.transitionDuration / 1e3 + "s" })
30
+ }, {
31
+ default: f(() => [
32
+ (i(), l(u(o.tag), {
33
+ ref_key: "content",
34
+ ref: e,
35
+ class: "content"
36
+ }, {
37
+ default: f(() => [
38
+ d(o.$slots, "default")
39
+ ]),
40
+ _: 3
41
+ }, 512))
42
+ ]),
43
+ _: 3
44
+ }, 8, ["style"]));
45
+ }
46
+ });
2
47
  export {
3
- r as isNil
48
+ O as default
4
49
  };
5
50
  //# sourceMappingURL=index124.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index124.js","sources":["../src/utilities/functions/isNil.ts"],"sourcesContent":["/**\n * Returns true if the item is not null or undefined\n * @param value The item to check\n * @returns true | false\n */\nexport const isNil = (value: unknown) => {\n\tif (typeof value === 'undefined') return true;\n\tif (value === null) return true;\n\treturn false;\n};\n"],"names":["isNil","value"],"mappings":"AAKa,MAAAA,IAAQ,CAACC,MACjB,OAAOA,IAAU,OACjBA,MAAU;"}
1
+ {"version":3,"file":"index124.js","sources":["../src/components/BbSmoothHeight/BbSmoothHeight.vue"],"sourcesContent":["<template>\n\t<component\n\t\t:is=\"tag\"\n\t\tref=\"container\"\n\t\tclass=\"bb-smooth-height\"\n\t\t:style=\"{ 'transition-duration': props.transitionDuration / 1000 + 's' }\"\n\t>\n\t\t<component :is=\"tag\" ref=\"content\" class=\"content\">\n\t\t\t<slot />\n\t\t</component>\n\t</component>\n</template>\n\n<script setup lang=\"ts\">\nimport type { CommonProps, NonVoidElementTag } from '@/types/CommonProps';\nimport { throttle } from '@/utilities/functions/throttle';\nimport { ref, onMounted, onBeforeUnmount } from 'vue';\n\nexport type BbSmoothHeightProps = {\n\t/**\n\t * Options to pass to the MutationObserver\n\t */\n\tmutationOptions?: MutationObserverInit; // eslint-disable-line no-undef\n\t/**\n\t * Options to pass to the ResizeObserver\n\t */\n\tresizeOptions?: ResizeObserverOptions; // eslint-disable-line no-undef\n\t/**\n\t * Define which strategy to use. By default is used 'resize' which means the\n\t * component will update on resizing.\n\t * You can also define 'mutation' to use a MutationObserver\n\t */\n\tstrategy?: 'resize' | 'mutation';\n} & NonVoidElementTag &\n\tPick<CommonProps, 'transitionDuration'>;\n\nconst props = withDefaults(defineProps<BbSmoothHeightProps>(), {\n\ttransitionDuration: 200,\n\tstrategy: 'resize',\n\tmutationOptions: () => ({ childList: true }),\n\ttag: 'div',\n});\n\nexport type BbSmoothHeightSlots = {\n\tdefault?: (props: object) => any;\n};\n\ndefineSlots<BbSmoothHeightSlots>();\n\nconst container = ref<HTMLElement | null>(null);\nconst content = ref<HTMLElement | null>(null);\nconst observer = ref<ResizeObserver | MutationObserver | null>(null);\n\nif (globalThis.ResizeObserver) {\n\tonMounted(() => {\n\t\tif (props.strategy === 'resize') {\n\t\t\tif (content.value) {\n\t\t\t\tobserver.value = new ResizeObserver(onContentGrow);\n\t\t\t\tobserver.value.observe(content.value, props.resizeOptions);\n\t\t\t}\n\t\t} else if (props.strategy === 'mutation') {\n\t\t\tif (content.value) {\n\t\t\t\tobserver.value = new MutationObserver(onContentGrow);\n\t\t\t\tobserver.value.observe(content.value, props.mutationOptions);\n\t\t\t}\n\t\t}\n\t\tonContentGrow();\n\t});\n\tonBeforeUnmount(() => {\n\t\tif (observer.value) {\n\t\t\tobserver.value.disconnect();\n\t\t}\n\t});\n}\n\n/**\n * This is called when content changes.\n * It could be called numerous times so throttle every 200ms\n */\nconst onContentGrow = throttle(() => {\n\tif (container.value && content.value) {\n\t\tconst contentHeight = content.value.scrollHeight;\n\t\tcontainer.value.style.height = '0px';\n\t\tcontainer.value.style.height = `${contentHeight}px`;\n\t}\n}, 200);\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbSmoothHeight';\n</style>\n"],"names":["props","__props","container","ref","content","observer","onMounted","onContentGrow","onBeforeUnmount","throttle","contentHeight"],"mappings":";;;;;;;;;;;;AAoCA,UAAMA,IAAQC,GAaRC,IAAYC,EAAwB,IAAI,GACxCC,IAAUD,EAAwB,IAAI,GACtCE,IAAWF,EAA8C,IAAI;AAEnE,IAAI,WAAW,mBACdG,EAAU,MAAM;AACX,MAAAN,EAAM,aAAa,WAClBI,EAAQ,UACFC,EAAA,QAAQ,IAAI,eAAeE,CAAa,GACjDF,EAAS,MAAM,QAAQD,EAAQ,OAAOJ,EAAM,aAAa,KAEhDA,EAAM,aAAa,cACzBI,EAAQ,UACFC,EAAA,QAAQ,IAAI,iBAAiBE,CAAa,GACnDF,EAAS,MAAM,QAAQD,EAAQ,OAAOJ,EAAM,eAAe,IAG/CO;IAAA,CACd,GACDC,EAAgB,MAAM;AACrB,MAAIH,EAAS,SACZA,EAAS,MAAM;IAChB,CACA;AAOI,UAAAE,IAAgBE,EAAS,MAAM;AAChC,UAAAP,EAAU,SAASE,EAAQ,OAAO;AAC/B,cAAAM,IAAgBN,EAAQ,MAAM;AAC1B,QAAAF,EAAA,MAAM,MAAM,SAAS,OAC/BA,EAAU,MAAM,MAAM,SAAS,GAAGQ,CAAa;AAAA,MAChD;AAAA,OACE,GAAG;;;;;;;;;;;;;;;;;;;;;;;"}