bitboss-ui 0.2.76 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (491) hide show
  1. package/dist/components/BaseCheckbox/BaseCheckbox.vue.d.ts +4 -0
  2. package/dist/components/BaseCheckboxGroup/BaseCheckboxGroup.vue.d.ts +10 -3
  3. package/dist/components/BaseDatePicker/BaseDatePicker.vue.d.ts +4 -1
  4. package/dist/components/BaseDatePickerInput/BaseDatePickerInput.vue.d.ts +10 -4
  5. package/dist/components/BaseInputContainer/BaseInputContainer.vue.d.ts +9 -0
  6. package/dist/components/BaseNumberInput/BaseNumberInput.vue.d.ts +4 -0
  7. package/dist/components/BaseRadio/BaseRadio.vue.d.ts +4 -0
  8. package/dist/components/BaseRadioGroup/BaseRadioGroup.vue.d.ts +10 -3
  9. package/dist/components/BaseRating/BaseRating.vue.d.ts +5 -1
  10. package/dist/components/BaseSelect/BaseSelect.vue.d.ts +4 -0
  11. package/dist/components/BaseSlider/BaseSlider.vue.d.ts +48 -11
  12. package/dist/components/BaseSwitchGroup/BaseSwitchGroup.vue.d.ts +6 -3
  13. package/dist/components/BaseTag/BaseTag.vue.d.ts +4 -0
  14. package/dist/components/BaseTextInput/BaseTextInput.vue.d.ts +10 -6
  15. package/dist/components/BaseTextarea/BaseTextarea.vue.d.ts +4 -0
  16. package/dist/components/BbButton/BbButton.vue.d.ts +12 -0
  17. package/dist/components/BbCheckbox/BbCheckbox.vue.d.ts +35 -27
  18. package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +38 -24
  19. package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +15 -3
  20. package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +33 -25
  21. package/dist/components/BbRadio/BbRadio.vue.d.ts +33 -25
  22. package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +38 -24
  23. package/dist/components/BbRating/BbRating.vue.d.ts +9 -1
  24. package/dist/components/BbSelect/BbSelect.vue.d.ts +18 -4
  25. package/dist/components/BbSlider/BbSlider.vue.d.ts +44 -11
  26. package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +9 -3
  27. package/dist/components/BbTag/BbTag.vue.d.ts +11 -3
  28. package/dist/components/BbTextInput/BbTextInput.vue.d.ts +33 -25
  29. package/dist/components/BbTextarea/BbTextarea.vue.d.ts +9 -1
  30. package/dist/composables/useQueue.d.ts +58 -0
  31. package/dist/index.js +186 -185
  32. package/dist/index.js.map +1 -1
  33. package/dist/index10.js +65 -1
  34. package/dist/index10.js.map +1 -1
  35. package/dist/index100.js +227 -1
  36. package/dist/index100.js.map +1 -1
  37. package/dist/index101.js +1 -437
  38. package/dist/index101.js.map +1 -1
  39. package/dist/index102.js +437 -1
  40. package/dist/index102.js.map +1 -1
  41. package/dist/index103.js +1 -94
  42. package/dist/index103.js.map +1 -1
  43. package/dist/index104.js +103 -1
  44. package/dist/index104.js.map +1 -1
  45. package/dist/index105.js +1 -88
  46. package/dist/index105.js.map +1 -1
  47. package/dist/index106.js +97 -1
  48. package/dist/index106.js.map +1 -1
  49. package/dist/index107.js +1 -89
  50. package/dist/index107.js.map +1 -1
  51. package/dist/index108.js +98 -1
  52. package/dist/index108.js.map +1 -1
  53. package/dist/index109.js +1 -29
  54. package/dist/index109.js.map +1 -1
  55. package/dist/index11.js +1 -131
  56. package/dist/index11.js.map +1 -1
  57. package/dist/index110.js +29 -1
  58. package/dist/index110.js.map +1 -1
  59. package/dist/index111.js +1 -151
  60. package/dist/index111.js.map +1 -1
  61. package/dist/index112.js +151 -1
  62. package/dist/index112.js.map +1 -1
  63. package/dist/index113.js +1 -122
  64. package/dist/index113.js.map +1 -1
  65. package/dist/index114.js +122 -1
  66. package/dist/index114.js.map +1 -1
  67. package/dist/index115.js +1 -46
  68. package/dist/index115.js.map +1 -1
  69. package/dist/index116.js +40 -33
  70. package/dist/index116.js.map +1 -1
  71. package/dist/index117.js +32 -39
  72. package/dist/index117.js.map +1 -1
  73. package/dist/index118.js +39 -42
  74. package/dist/index118.js.map +1 -1
  75. package/dist/index119.js +43 -39
  76. package/dist/index119.js.map +1 -1
  77. package/dist/index12.js +128 -1
  78. package/dist/index12.js.map +1 -1
  79. package/dist/index120.js +43 -2
  80. package/dist/index120.js.map +1 -1
  81. package/dist/index121.js +2 -21
  82. package/dist/index121.js.map +1 -1
  83. package/dist/index122.js +21 -2
  84. package/dist/index122.js.map +1 -1
  85. package/dist/index123.js +2 -224
  86. package/dist/index123.js.map +1 -1
  87. package/dist/index124.js +224 -2
  88. package/dist/index124.js.map +1 -1
  89. package/dist/index125.js +2 -18
  90. package/dist/index125.js.map +1 -1
  91. package/dist/index126.js +16 -10
  92. package/dist/index126.js.map +1 -1
  93. package/dist/index127.js +12 -24
  94. package/dist/index127.js.map +1 -1
  95. package/dist/index128.js +24 -5
  96. package/dist/index128.js.map +1 -1
  97. package/dist/index129.js +5 -9
  98. package/dist/index129.js.map +1 -1
  99. package/dist/index13.js +1 -159
  100. package/dist/index13.js.map +1 -1
  101. package/dist/index130.js +8 -5
  102. package/dist/index130.js.map +1 -1
  103. package/dist/index131.js +5 -69
  104. package/dist/index131.js.map +1 -1
  105. package/dist/index132.js +70 -3
  106. package/dist/index132.js.map +1 -1
  107. package/dist/index133.js +2 -2
  108. package/dist/index134.js +2 -2
  109. package/dist/index135.js +2 -2
  110. package/dist/index136.js +2 -2
  111. package/dist/index137.js +2 -2
  112. package/dist/index138.js +2 -2
  113. package/dist/index139.js +2 -2
  114. package/dist/index14.js +161 -1
  115. package/dist/index14.js.map +1 -1
  116. package/dist/index140.js +2 -2
  117. package/dist/index141.js +2 -2
  118. package/dist/index142.js +2 -2
  119. package/dist/index143.js +2 -2
  120. package/dist/index144.js +2 -2
  121. package/dist/index145.js +2 -2
  122. package/dist/index146.js +2 -2
  123. package/dist/index147.js +2 -2
  124. package/dist/index148.js +2 -2
  125. package/dist/index149.js +2 -2
  126. package/dist/index15.js +1 -457
  127. package/dist/index15.js.map +1 -1
  128. package/dist/index150.js +2 -2
  129. package/dist/index151.js +2 -2
  130. package/dist/index152.js +2 -2
  131. package/dist/index153.js +2 -2
  132. package/dist/index154.js +2 -2
  133. package/dist/index155.js +2 -2
  134. package/dist/index156.js +2 -2
  135. package/dist/index157.js +2 -2
  136. package/dist/index158.js +5 -1
  137. package/dist/index158.js.map +1 -1
  138. package/dist/index159.js +1 -5
  139. package/dist/index159.js.map +1 -1
  140. package/dist/index16.js +514 -1
  141. package/dist/index16.js.map +1 -1
  142. package/dist/index160.js +5 -1
  143. package/dist/index160.js.map +1 -1
  144. package/dist/index161.js +1 -5
  145. package/dist/index161.js.map +1 -1
  146. package/dist/index162.js +2 -2
  147. package/dist/index163.js +2 -2
  148. package/dist/index164.js +2 -2
  149. package/dist/index165.js +2 -2
  150. package/dist/index166.js +2 -2
  151. package/dist/index167.js +3 -2
  152. package/dist/index167.js.map +1 -1
  153. package/dist/index168.js +2 -3
  154. package/dist/index168.js.map +1 -1
  155. package/dist/index169.js +5 -1
  156. package/dist/index169.js.map +1 -1
  157. package/dist/index17.js +1 -211
  158. package/dist/index17.js.map +1 -1
  159. package/dist/index170.js +1 -4
  160. package/dist/index170.js.map +1 -1
  161. package/dist/index171.js +2 -3
  162. package/dist/index171.js.map +1 -1
  163. package/dist/index172.js +2 -2
  164. package/dist/index173.js +2 -2
  165. package/dist/index174.js +2 -2
  166. package/dist/index175.js +2 -2
  167. package/dist/index176.js +2 -2
  168. package/dist/index177.js +2 -2
  169. package/dist/index178.js +2 -2
  170. package/dist/index179.js +2 -2
  171. package/dist/index18.js +220 -1
  172. package/dist/index18.js.map +1 -1
  173. package/dist/index180.js +2 -2
  174. package/dist/index181.js +2 -2
  175. package/dist/index182.js +2 -2
  176. package/dist/index183.js +5 -1
  177. package/dist/index183.js.map +1 -1
  178. package/dist/index184.js +1 -5
  179. package/dist/index184.js.map +1 -1
  180. package/dist/index185.js +5 -1
  181. package/dist/index185.js.map +1 -1
  182. package/dist/index186.js +1 -5
  183. package/dist/index186.js.map +1 -1
  184. package/dist/index187.js +2 -2
  185. package/dist/index188.js +2 -2
  186. package/dist/index189.js +2 -2
  187. package/dist/index19.js +1 -239
  188. package/dist/index19.js.map +1 -1
  189. package/dist/index190.js +2 -2
  190. package/dist/index191.js +2 -2
  191. package/dist/index192.js +2 -2
  192. package/dist/index193.js +2 -2
  193. package/dist/index194.js +2 -2
  194. package/dist/index195.js +2 -2
  195. package/dist/index196.js +3 -10
  196. package/dist/index196.js.map +1 -1
  197. package/dist/index198.js +2 -3
  198. package/dist/index198.js.map +1 -1
  199. package/dist/index199.js +4 -3
  200. package/dist/index199.js.map +1 -1
  201. package/dist/index2.js +1 -42
  202. package/dist/index2.js.map +1 -1
  203. package/dist/index20.js +239 -1
  204. package/dist/index20.js.map +1 -1
  205. package/dist/index200.js +5 -368
  206. package/dist/index200.js.map +1 -1
  207. package/dist/index201.js +13 -131
  208. package/dist/index201.js.map +1 -1
  209. package/dist/index202.js +16 -5
  210. package/dist/index202.js.map +1 -1
  211. package/dist/index203.js +3 -3
  212. package/dist/index204.js +20 -2
  213. package/dist/index204.js.map +1 -1
  214. package/dist/index205.js +29 -2
  215. package/dist/index205.js.map +1 -1
  216. package/dist/index206.js +8 -174
  217. package/dist/index206.js.map +1 -1
  218. package/dist/index207.js +2 -23
  219. package/dist/index207.js.map +1 -1
  220. package/dist/index208.js +111 -363
  221. package/dist/index208.js.map +1 -1
  222. package/dist/index209.js +131 -13
  223. package/dist/index209.js.map +1 -1
  224. package/dist/index21.js +1 -115
  225. package/dist/index21.js.map +1 -1
  226. package/dist/index210.js +2 -16
  227. package/dist/index210.js.map +1 -1
  228. package/dist/index211.js +35 -20
  229. package/dist/index211.js.map +1 -1
  230. package/dist/index212.js +172 -27
  231. package/dist/index212.js.map +1 -1
  232. package/dist/index213.js +6 -8
  233. package/dist/index213.js.map +1 -1
  234. package/dist/index214.js +346 -213
  235. package/dist/index214.js.map +1 -1
  236. package/dist/index215.js +373 -3
  237. package/dist/index215.js.map +1 -1
  238. package/dist/index216.js +3 -35
  239. package/dist/index216.js.map +1 -1
  240. package/dist/index217.js +3 -6
  241. package/dist/index217.js.map +1 -1
  242. package/dist/index218.js +235 -2
  243. package/dist/index218.js.map +1 -1
  244. package/dist/index219.js +3 -2
  245. package/dist/index219.js.map +1 -1
  246. package/dist/index22.js +131 -1
  247. package/dist/index22.js.map +1 -1
  248. package/dist/index220.js +2 -4
  249. package/dist/index220.js.map +1 -1
  250. package/dist/index221.js +8 -119
  251. package/dist/index221.js.map +1 -1
  252. package/dist/index222.js +2 -2
  253. package/dist/index222.js.map +1 -1
  254. package/dist/index224.js +23 -6
  255. package/dist/index224.js.map +1 -1
  256. package/dist/index225.js +4 -17
  257. package/dist/index225.js.map +1 -1
  258. package/dist/index226.js +294 -78
  259. package/dist/index226.js.map +1 -1
  260. package/dist/index227.js +6 -2
  261. package/dist/index227.js.map +1 -1
  262. package/dist/index228.js +2 -160
  263. package/dist/index228.js.map +1 -1
  264. package/dist/index229.js +4 -1
  265. package/dist/index229.js.map +1 -1
  266. package/dist/index23.js +1 -115
  267. package/dist/index23.js.map +1 -1
  268. package/dist/index230.js +2 -5
  269. package/dist/index230.js.map +1 -1
  270. package/dist/index231.js +2 -69
  271. package/dist/index231.js.map +1 -1
  272. package/dist/index232.js +2 -224
  273. package/dist/index232.js.map +1 -1
  274. package/dist/index233.js +2 -258
  275. package/dist/index233.js.map +1 -1
  276. package/dist/index234.js +78 -5
  277. package/dist/index234.js.map +1 -1
  278. package/dist/index235.js +6 -2
  279. package/dist/index235.js.map +1 -1
  280. package/dist/index236.js +17 -295
  281. package/dist/index236.js.map +1 -1
  282. package/dist/index237.js +2 -2
  283. package/dist/index238.js +106 -2
  284. package/dist/index238.js.map +1 -1
  285. package/dist/index239.js +428 -110
  286. package/dist/index239.js.map +1 -1
  287. package/dist/index24.js +119 -1
  288. package/dist/index24.js.map +1 -1
  289. package/dist/index240.js +218 -100
  290. package/dist/index240.js.map +1 -1
  291. package/dist/index241.js +255 -12
  292. package/dist/index241.js.map +1 -1
  293. package/dist/index242.js +117 -2
  294. package/dist/index242.js.map +1 -1
  295. package/dist/index243.js +200 -2
  296. package/dist/index243.js.map +1 -1
  297. package/dist/index244.js +2 -2
  298. package/dist/index244.js.map +1 -1
  299. package/dist/index245.js +69 -2
  300. package/dist/index245.js.map +1 -1
  301. package/dist/index246.js +5 -435
  302. package/dist/index246.js.map +1 -1
  303. package/dist/index247.js +163 -88
  304. package/dist/index247.js.map +1 -1
  305. package/dist/index248.js +1 -202
  306. package/dist/index248.js.map +1 -1
  307. package/dist/index249.js +2 -4
  308. package/dist/index249.js.map +1 -1
  309. package/dist/index25.js +1 -92
  310. package/dist/index25.js.map +1 -1
  311. package/dist/index250.js +89 -2
  312. package/dist/index250.js.map +1 -1
  313. package/dist/index251.js +15 -4
  314. package/dist/index251.js.map +1 -1
  315. package/dist/index252.js +4 -4
  316. package/dist/index252.js.map +1 -1
  317. package/dist/index253.js +4 -61
  318. package/dist/index253.js.map +1 -1
  319. package/dist/index254.js +61 -2
  320. package/dist/index254.js.map +1 -1
  321. package/dist/index255.js +2 -3
  322. package/dist/index255.js.map +1 -1
  323. package/dist/index256.js +3 -2
  324. package/dist/index256.js.map +1 -1
  325. package/dist/index257.js +5 -0
  326. package/dist/index257.js.map +1 -0
  327. package/dist/index26.js +94 -1
  328. package/dist/index26.js.map +1 -1
  329. package/dist/index27.js +1 -157
  330. package/dist/index27.js.map +1 -1
  331. package/dist/index28.js +160 -1
  332. package/dist/index28.js.map +1 -1
  333. package/dist/index29.js +1 -124
  334. package/dist/index29.js.map +1 -1
  335. package/dist/index3.js +38 -76
  336. package/dist/index3.js.map +1 -1
  337. package/dist/index30.js +126 -1
  338. package/dist/index30.js.map +1 -1
  339. package/dist/index31.js +1 -691
  340. package/dist/index31.js.map +1 -1
  341. package/dist/index32.js +693 -1
  342. package/dist/index32.js.map +1 -1
  343. package/dist/index33.js +1 -145
  344. package/dist/index33.js.map +1 -1
  345. package/dist/index34.js +302 -1
  346. package/dist/index34.js.map +1 -1
  347. package/dist/index35.js +1 -118
  348. package/dist/index35.js.map +1 -1
  349. package/dist/index36.js +120 -1
  350. package/dist/index36.js.map +1 -1
  351. package/dist/index37.js +1 -154
  352. package/dist/index37.js.map +1 -1
  353. package/dist/index38.js +156 -1
  354. package/dist/index38.js.map +1 -1
  355. package/dist/index39.js +1 -83
  356. package/dist/index39.js.map +1 -1
  357. package/dist/index4.js +78 -62
  358. package/dist/index4.js.map +1 -1
  359. package/dist/index40.js +87 -1
  360. package/dist/index40.js.map +1 -1
  361. package/dist/index41.js +1 -61
  362. package/dist/index41.js.map +1 -1
  363. package/dist/index42.js +64 -1
  364. package/dist/index42.js.map +1 -1
  365. package/dist/index43.js +1 -65
  366. package/dist/index43.js.map +1 -1
  367. package/dist/index44.js +65 -1
  368. package/dist/index44.js.map +1 -1
  369. package/dist/index45.js +1 -96
  370. package/dist/index45.js.map +1 -1
  371. package/dist/index46.js +96 -1
  372. package/dist/index46.js.map +1 -1
  373. package/dist/index47.js +1 -61
  374. package/dist/index47.js.map +1 -1
  375. package/dist/index48.js +61 -1
  376. package/dist/index48.js.map +1 -1
  377. package/dist/index49.js +1 -49
  378. package/dist/index49.js.map +1 -1
  379. package/dist/index5.js +60 -38
  380. package/dist/index5.js.map +1 -1
  381. package/dist/index50.js +49 -1
  382. package/dist/index50.js.map +1 -1
  383. package/dist/index51.js +1 -62
  384. package/dist/index51.js.map +1 -1
  385. package/dist/index52.js +62 -1
  386. package/dist/index52.js.map +1 -1
  387. package/dist/index53.js +1 -45
  388. package/dist/index53.js.map +1 -1
  389. package/dist/index54.js +69 -1
  390. package/dist/index54.js.map +1 -1
  391. package/dist/index55.js +1 -89
  392. package/dist/index55.js.map +1 -1
  393. package/dist/index56.js +98 -1
  394. package/dist/index56.js.map +1 -1
  395. package/dist/index57.js +1 -120
  396. package/dist/index57.js.map +1 -1
  397. package/dist/index58.js +129 -1
  398. package/dist/index58.js.map +1 -1
  399. package/dist/index59.js +1 -85
  400. package/dist/index59.js.map +1 -1
  401. package/dist/index6.js +37 -171
  402. package/dist/index6.js.map +1 -1
  403. package/dist/index60.js +85 -1
  404. package/dist/index60.js.map +1 -1
  405. package/dist/index61.js +1 -88
  406. package/dist/index61.js.map +1 -1
  407. package/dist/index62.js +98 -1
  408. package/dist/index62.js.map +1 -1
  409. package/dist/index63.js +1 -59
  410. package/dist/index63.js.map +1 -1
  411. package/dist/index64.js +59 -1
  412. package/dist/index64.js.map +1 -1
  413. package/dist/index65.js +1 -313
  414. package/dist/index65.js.map +1 -1
  415. package/dist/index66.js +313 -1
  416. package/dist/index66.js.map +1 -1
  417. package/dist/index67.js +1 -129
  418. package/dist/index67.js.map +1 -1
  419. package/dist/index68.js +129 -1
  420. package/dist/index68.js.map +1 -1
  421. package/dist/index69.js +1 -225
  422. package/dist/index69.js.map +1 -1
  423. package/dist/index7.js +172 -18
  424. package/dist/index7.js.map +1 -1
  425. package/dist/index70.js +225 -1
  426. package/dist/index70.js.map +1 -1
  427. package/dist/index71.js +1 -24
  428. package/dist/index71.js.map +1 -1
  429. package/dist/index72.js +19 -41
  430. package/dist/index72.js.map +1 -1
  431. package/dist/index73.js +37 -86
  432. package/dist/index73.js.map +1 -1
  433. package/dist/index74.js +104 -1
  434. package/dist/index74.js.map +1 -1
  435. package/dist/index75.js +1 -227
  436. package/dist/index75.js.map +1 -1
  437. package/dist/index76.js +227 -1
  438. package/dist/index76.js.map +1 -1
  439. package/dist/index77.js +1 -143
  440. package/dist/index77.js.map +1 -1
  441. package/dist/index78.js +165 -1
  442. package/dist/index78.js.map +1 -1
  443. package/dist/index79.js +1 -213
  444. package/dist/index79.js.map +1 -1
  445. package/dist/index8.js +18 -192
  446. package/dist/index8.js.map +1 -1
  447. package/dist/index80.js +213 -1
  448. package/dist/index80.js.map +1 -1
  449. package/dist/index81.js +1 -35
  450. package/dist/index81.js.map +1 -1
  451. package/dist/index82.js +35 -1
  452. package/dist/index82.js.map +1 -1
  453. package/dist/index83.js +1 -83
  454. package/dist/index83.js.map +1 -1
  455. package/dist/index84.js +92 -1
  456. package/dist/index84.js.map +1 -1
  457. package/dist/index85.js +1 -120
  458. package/dist/index85.js.map +1 -1
  459. package/dist/index86.js +129 -1
  460. package/dist/index86.js.map +1 -1
  461. package/dist/index87.js +1 -83
  462. package/dist/index87.js.map +1 -1
  463. package/dist/index88.js +92 -1
  464. package/dist/index88.js.map +1 -1
  465. package/dist/index89.js +1 -30
  466. package/dist/index89.js.map +1 -1
  467. package/dist/index9.js +192 -61
  468. package/dist/index9.js.map +1 -1
  469. package/dist/index90.js +30 -1
  470. package/dist/index90.js.map +1 -1
  471. package/dist/index91.js +1 -157
  472. package/dist/index91.js.map +1 -1
  473. package/dist/index92.js +166 -1
  474. package/dist/index92.js.map +1 -1
  475. package/dist/index93.js +1 -86
  476. package/dist/index93.js.map +1 -1
  477. package/dist/index94.js +112 -1
  478. package/dist/index94.js.map +1 -1
  479. package/dist/index95.js +1 -89
  480. package/dist/index95.js.map +1 -1
  481. package/dist/index96.js +98 -1
  482. package/dist/index96.js.map +1 -1
  483. package/dist/index97.js +1 -119
  484. package/dist/index97.js.map +1 -1
  485. package/dist/index98.js +129 -1
  486. package/dist/index98.js.map +1 -1
  487. package/dist/index99.js +1 -227
  488. package/dist/index99.js.map +1 -1
  489. package/dist/style.css +1 -1
  490. package/dist/utilities/functions/last.d.ts +1 -1
  491. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index76.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"index76.js","sources":["../src/components/BbOffCanvas/BbOffCanvas.vue"],"sourcesContent":["<template>\n\t<teleport to=\"body\">\n\t\t<div v-bind=\"overlayAttributes\" ref=\"overlay\">\n\t\t\t<div v-bind=\"panelAttributes\" ref=\"panel\">\n\t\t\t\t<div\n\t\t\t\t\tv-if=\"hasRenderedAtLeastOnce\"\n\t\t\t\t\tref=\"content\"\n\t\t\t\t\tclass=\"bb-offcanvas__content\"\n\t\t\t\t>\n\t\t\t\t\t<slot :close=\"onCloseClick\" name=\"content\">\n\t\t\t\t\t\t<div ref=\"header\" class=\"bb-offcanvas__header\">\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:close=\"onCloseClick\"\n\t\t\t\t\t\t\t\tname=\"header\"\n\t\t\t\t\t\t\t\t:title=\"title\"\n\t\t\t\t\t\t\t\t:title-id=\"titleId\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<span :id=\"titleId\" class=\"bb-offcanvas__title\">\n\t\t\t\t\t\t\t\t\t<slot name=\"title\" :text=\"title\">{{ title }}</slot>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t<span class=\"bb-offcanvas-close\">\n\t\t\t\t\t\t\t\t\t<button v-if=\"showClose\" type=\"button\" @click=\"onCloseClick\">\n\t\t\t\t\t\t\t\t\t\t<slot name=\"close\" :text=\"closeLabel\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"bb-offcanvas-close__content\">\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"bb-offcanvas-close__label\">{{\n\t\t\t\t\t\t\t\t\t\t\t\t\tcloseLabel\n\t\t\t\t\t\t\t\t\t\t\t\t}}</span>\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"bb-offcanvas-close__icon\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t><svg\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\td=\"M23 23L1 1M23 1L1 23\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t\t\t\t</button>\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</div>\n\t\t\t\t\t\t<div ref=\"body\" class=\"bb-offcanvas__body\">\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:description-id=\"descriptionId\"\n\t\t\t\t\t\t\t\tname=\"description\"\n\t\t\t\t\t\t\t\t:text=\"description\"\n\t\t\t\t\t\t\t\t><div\n\t\t\t\t\t\t\t\t\tv-if=\"description\"\n\t\t\t\t\t\t\t\t\t:id=\"descriptionId\"\n\t\t\t\t\t\t\t\t\tclass=\"bb-offcanvas__description\"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{{ description }}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div style=\"flex: 10000 10000 0%\"></div>\n\t\t\t\t\t\t<div ref=\"footer\" class=\"bb-offcanvas__footer\">\n\t\t\t\t\t\t\t<slot name=\"footer\"></slot>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</slot>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</teleport>\n</template>\n\n<script setup lang=\"ts\">\nimport {\n\tcomputed,\n\tnextTick,\n\tonBeforeUnmount,\n\tonMounted,\n\tref,\n\tuseAttrs,\n\twatch,\n} from 'vue';\nimport { useFocusTrap } from '@vueuse/integrations/useFocusTrap';\nimport { useId } from '@/composables/useId';\nimport { wait } from '@/utilities/functions/wait';\nimport type { CommonProps, Size } from '@/types/CommonProps';\n\nexport type Sizes = {\n\tsm: number;\n\tmd: number;\n\tlg: number;\n};\n\nexport type BbOffCanvasProps = Pick<\n\tCommonProps,\n\t| 'closeLabel'\n\t| 'compact'\n\t| 'disabled'\n\t| 'eager'\n\t| 'panelClasses'\n\t| 'overlayClasses'\n\t| 'persistent'\n\t| 'showClose'\n\t| 'title'\n\t| 'transition'\n\t| 'transitionDuration'\n> &\n\tSize<Sizes> & {\n\t\t/**\n\t\t * Description of the content of the modal. Extremely useful for accessibility reasons.\n\t\t */\n\t\tdescription?: string;\n\t\t/**\n\t\t * Displays the modala as fulscreen with no margin to the page\n\t\t */\n\t\tfullscreen?: boolean;\n\t\t/**\n\t\t * Defines the state open / closed of the modal.\n\t\t */\n\t\tmodelValue?: boolean | null;\n\t\t/**\n\t\t * Defines the direction the offcanvas should appear from\n\t\t */\n\t\tdirection?: 'left' | 'top' | 'right' | 'bottom';\n\t};\n\nconst props = withDefaults(defineProps<BbOffCanvasProps>(), {\n\tcloseLabel: 'Chiudi',\n\tdirection: 'left',\n\tshowClose: true,\n\tsize: 'sm',\n\ttransition: 'fade',\n\ttransitionDuration: 350,\n\tpanelClasses: () => [],\n\toverlayClasses: () => [],\n});\n\nexport type BbOffCanvasEvents = {\n\t(e: 'shown'): void;\n\t(e: 'hidden'): void;\n\t(e: 'update:modelValue', value: boolean): void;\n};\n\nconst emit = defineEmits<BbOffCanvasEvents>();\n\nexport type BbOffCanvasSlots = {\n\theader?: (props: {\n\t\ttitleId: typeof titleId;\n\t\tclose: typeof onCloseClick;\n\t\ttitle: BbOffCanvasProps['title'];\n\t}) => any;\n\ttitle?: (props: { text: BbOffCanvasProps['title'] }) => any;\n\tclose?: (props: { text: BbOffCanvasProps['closeLabel'] }) => any;\n\tdescription?: (props: {\n\t\tdescriptionId: typeof descriptionId;\n\t\ttext: BbOffCanvasProps['description'];\n\t}) => any;\n\tdefault?: (props: object) => any;\n\tcontent?: (props: { close: typeof onCloseClick }) => any;\n\tfooter?: (props: object) => any;\n};\n\ndefineSlots<BbOffCanvasSlots>();\n\nconst titleId = `title_${useId().id.value}`;\nconst descriptionId = `description_${useId().id.value}`;\n\nconst overlay = ref<HTMLElement | null>(null);\nconst panel = ref<HTMLElement | null>(null);\nconst content = ref<HTMLElement | null>(null);\nconst header = ref<HTMLElement | null>(null);\nconst body = ref<HTMLElement | null>(null);\nconst footer = ref<HTMLElement | null>(null);\nconst attrs = useAttrs();\n\nconst { activate, deactivate } = useFocusTrap(panel, {\n\tclickOutsideDeactivates: true,\n\t/* On esc deactivate the trap, return focus and then close the modal */\n\tescapeDeactivates: () => {\n\t\tnextTick(() => {\n\t\t\temit('update:modelValue', false);\n\t\t});\n\t\treturn true;\n\t},\n});\n\nconst closeLabel = computed(() => props.closeLabel);\n\nconst open = ref(false);\nconst opening = ref(false);\nconst closed = ref(true);\nconst closing = ref(false);\nconst hasRenderedAtLeastOnce = ref(props.eager || props.modelValue);\nconst lastFocusedElement = ref<Element | null>(null);\n\nconst busy = computed(() => opening.value || closing.value);\n\nonMounted(() => {\n\t/**\n\t * Do not realign if open or opening\n\t */\n\tif (props.modelValue && !(open.value || opening.value)) {\n\t\talignToModelValue();\n\t}\n});\n\n/**\n * Every time modelValue changes align the display to it\n */\nwatch(\n\t() => props.modelValue,\n\t() => {\n\t\talignToModelValue();\n\t}\n);\nonBeforeUnmount(() => {\n\tif (props.modelValue) {\n\t\tlet currentlyOpenCanvases = Number(\n\t\t\tdocument.body.dataset['openCanvases'] ?? '0'\n\t\t);\n\t\t// This prevents overscroll chaining (additional scrolling to the body when the modal has been completely scrolled)\n\t\tcurrentlyOpenCanvases--;\n\t\tdocument.body.dataset['openCanvases'] = currentlyOpenCanvases.toString();\n\t\tif (!currentlyOpenCanvases) {\n\t\t\tdocument.body.style.overflow = 'auto';\n\t\t\tdocument.body.style.paddingRight = '0px';\n\t\t}\n\t}\n});\n\n/**\n * When modelValue becomes true if the component wasn't rendered render it\n * and wait for it to be on the page (or transitions would not work).\n * Stash the latest focused element so we can return it later when it closes.\n * Focus on the panel upon opening.\n * ---\n * Notice all interactions update modelValue and then this function aligns the display to it\n */\nconst alignToModelValue = async () => {\n\tif (props.modelValue) {\n\t\tif (!hasRenderedAtLeastOnce.value) {\n\t\t\thasRenderedAtLeastOnce.value = true;\n\t\t}\n\t\tif (document.activeElement) {\n\t\t\tlastFocusedElement.value = document.activeElement;\n\t\t}\n\n\t\tclosed.value = false;\n\t\tclosing.value = false;\n\t\topening.value = true;\n\n\t\t// This prevents overscroll chaining (additional scrolling to the body when the modal has been completely scrolled)\n\n\t\tlet currentlyOpenCanvases = Number(\n\t\t\tdocument.body.dataset['openCanvases'] ?? '0'\n\t\t);\n\t\tcurrentlyOpenCanvases++;\n\t\tdocument.body.dataset['openCanvases'] = currentlyOpenCanvases.toString();\n\t\tconst scrollBarWidth =\n\t\t\twindow.innerWidth - document.documentElement.clientWidth;\n\t\tdocument.body.style.overflow = 'hidden';\n\t\tdocument.body.style.paddingRight = `${scrollBarWidth}px`;\n\n\t\tawait wait(props.transitionDuration);\n\n\t\topening.value = false;\n\t\topen.value = true;\n\t\temit('shown');\n\t\tactivate();\n\t} else {\n\t\tdeactivate();\n\t\topening.value = false;\n\t\topen.value = false;\n\t\tclosing.value = true;\n\n\t\tawait wait(props.transitionDuration);\n\n\t\tlet currentlyOpenCanvases = Number(\n\t\t\tdocument.body.dataset['openCanvases'] ?? '0'\n\t\t);\n\t\t// This prevents overscroll chaining (additional scrolling to the body when the modal has been completely scrolled)\n\t\tcurrentlyOpenCanvases--;\n\t\tdocument.body.dataset['openCanvases'] = currentlyOpenCanvases.toString();\n\t\tif (!currentlyOpenCanvases) {\n\t\t\tdocument.body.style.overflow = 'auto';\n\t\t\tdocument.body.style.paddingRight = '0px';\n\t\t}\n\t\tclosing.value = false;\n\t\tclosed.value = true;\n\t\temit('hidden');\n\t\tif (lastFocusedElement.value instanceof HTMLElement) {\n\t\t\tlastFocusedElement.value.focus();\n\t\t}\n\t}\n};\n\n/**\n * Disable scrolling\n */\nconst onOverlayScroll = (event: UIEvent) => {\n\tif (event.target === overlay.value) {\n\t\tevent.preventDefault();\n\t}\n};\n\n/**\n * Close the modal on overlay click if not persistent\n */\nconst onOverlayClick = (event: MouseEvent) => {\n\tif (props.disabled || busy.value) return;\n\tif (overlay.value) {\n\t\tif (event.target === overlay.value) {\n\t\t\tif (!props.persistent) {\n\t\t\t\temit('update:modelValue', false);\n\t\t\t}\n\t\t}\n\t}\n};\n\n/**\n * On click on the X button\n */\nconst onCloseClick = () => {\n\tif (props.disabled) return;\n\temit('update:modelValue', false);\n};\n\nconst overlayAttributes = computed(() => {\n\tconst classes = [\n\t\t{\n\t\t\t'bb-offcanvas bb-offcanvas__overlay': true,\n\t\t\t'bb-offcanvas--fullscreen': props.fullscreen,\n\t\t\t'bb-offcanvas--open': open.value,\n\t\t\t'bb-offcanvas--opening': opening.value,\n\t\t\t'bb-offcanvas--closed': closed.value,\n\t\t\t'bb-offcanvas--closing': closing.value,\n\t\t\t[`bb-offcanvas--transition-${props.transition}`]: true,\n\t\t\t[`bb-offcanvas--${props.direction}`]: true,\n\t\t},\n\t\tprops.overlayClasses,\n\t].flat();\n\tconst eventListeners = {\n\t\tonClick: onOverlayClick,\n\t\tonScroll: onOverlayScroll,\n\t\tonTouchmove: onOverlayScroll,\n\t\tonWheel: onOverlayScroll,\n\t\tonKeydown: onOverlayScroll,\n\t};\n\n\tconst style = {\n\t\ttransitionDuration: props.transitionDuration / 1000 + 's',\n\t};\n\treturn {\n\t\tclass: classes,\n\t\tstyle,\n\t\t...eventListeners,\n\t\t...attrs,\n\t};\n});\n\nconst panelAttributes = computed(() => {\n\tconst classes = [\n\t\t{\n\t\t\t'bb-offcanvas__panel': true,\n\t\t\t'bb-offcanvas__panel--compact': props.compact,\n\t\t},\n\t\tprops.panelClasses,\n\t].flat();\n\n\tconst accessibilityAttrs: {\n\t\t[key: string]: string | boolean;\n\t} = {\n\t\trole: 'dialog',\n\t\t'aria-modal': true,\n\t};\n\n\tif (hasRenderedAtLeastOnce.value) {\n\t\taccessibilityAttrs['aria-labelledby'] = titleId;\n\n\t\tif (props.description)\n\t\t\taccessibilityAttrs['aria-describedby'] = descriptionId;\n\t}\n\n\tlet maxWidth;\n\tlet maxHeight;\n\tlet height;\n\tconst sizes: Sizes = {\n\t\tsm: 384,\n\t\tmd: 652,\n\t\tlg: 896,\n\t};\n\tif (props.direction === 'left' || props.direction === 'right') {\n\t\tif (props.fullscreen) maxWidth = '100%';\n\t\telse if (typeof props.size === 'number') maxWidth = props.size + 'px';\n\t\telse if (props.size in sizes)\n\t\t\tmaxWidth = sizes[props.size as keyof Sizes] + 'px';\n\t\telse maxWidth = props.size + 'px';\n\t} else {\n\t\tif (props.fullscreen) height = '100%';\n\t\telse if (typeof props.size === 'number') height = props.size + 'px';\n\t\telse if (props.size in sizes)\n\t\t\theight = sizes[props.size as keyof Sizes] + 'px';\n\t\telse if (!Number.isNaN(Number(props.size))) height = props.size + 'px';\n\t\telse if (props.size === 'auto') height = 'auto';\n\t}\n\n\tconst style = {\n\t\tmaxWidth,\n\t\tmaxHeight,\n\t\theight,\n\t\ttransitionDuration: props.transitionDuration / 1000 + 's',\n\t};\n\n\treturn {\n\t\tclass: classes,\n\t\tstyle,\n\t\t...accessibilityAttrs,\n\t};\n});\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbOffCanvas';\n</style>\n"],"names":["props","__props","emit","__emit","titleId","useId","descriptionId","overlay","ref","panel","content","header","body","footer","attrs","useAttrs","activate","deactivate","useFocusTrap","nextTick","closeLabel","computed","open","opening","closed","closing","hasRenderedAtLeastOnce","lastFocusedElement","busy","onMounted","alignToModelValue","watch","onBeforeUnmount","currentlyOpenCanvases","scrollBarWidth","wait","onOverlayScroll","event","onOverlayClick","onCloseClick","overlayAttributes","classes","eventListeners","style","panelAttributes","accessibilityAttrs","ma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IAAe;AAAA,QACpB,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA;AAEL,MAAIjD,EAAM,cAAc,UAAUA,EAAM,cAAc,UACjDA,EAAM,aAAuB8C,IAAA,SACxB,OAAO9C,EAAM,QAAS,WAAU8C,IAAW9C,EAAM,OAAO,OACxDA,EAAM,QAAQiD,IACXH,IAAAG,EAAMjD,EAAM,IAAmB,IAAI,OAC1C8C,IAAW9C,EAAM,OAAO,OAEzBA,EAAM,aAAqBgD,IAAA,SACtB,OAAOhD,EAAM,QAAS,WAAUgD,IAAShD,EAAM,OAAO,OACtDA,EAAM,QAAQiD,IACbD,IAAAC,EAAMjD,EAAM,IAAmB,IAAI,OACnC,OAAO,MAAM,OAAOA,EAAM,IAAI,CAAC,IAChCA,EAAM,SAAS,WAAiBgD,IAAA,UADGA,IAAShD,EAAM,OAAO;AAInE,YAAM2C,IAAQ;AAAA,QACb,UAAAG;AAAA,QACA,WAAAC;AAAA,QACA,QAAAC;AAAA,QACA,oBAAoBhD,EAAM,qBAAqB,MAAO;AAAA,MAAA;AAGhD,aAAA;AAAA,QACN,OAAOyC;AAAA,QACP,OAAAE;AAAA,QACA,GAAGE;AAAA,MAAA;AAAA,IACJ,CACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index77.js CHANGED
@@ -1,144 +1,2 @@
1
- import { defineComponent as x, computed as y, ref as p, onMounted as A, onBeforeUnmount as B, openBlock as k, createElementBlock as V, createElementVNode as u, renderSlot as g, createTextVNode as b, Fragment as E, renderList as P, normalizeClass as W, toDisplayString as h, nextTick as z } from "vue";
2
- import R from "./index226.js";
3
- const T = { "aria-label": "Navigazione" }, F = ["disabled"], L = ["disabled", "onClick"], D = ["disabled"], O = /* @__PURE__ */ x({
4
- __name: "BbPagination",
5
- props: {
6
- disabled: { type: Boolean },
7
- loading: { type: Boolean },
8
- ellipsis: { default: "..." },
9
- maxSize: { default: 5 },
10
- modelValue: { default: 1 },
11
- totalPages: { default: 1 }
12
- },
13
- emits: ["update:modelValue"],
14
- setup(M, { emit: N }) {
15
- const a = M, m = N, i = y(() => +a.totalPages), r = p(1), n = p(+a.maxSize), o = p(), d = p(), S = p(1 / 0), f = () => {
16
- o.value && d.value && (o.value.clientWidth < d.value.clientWidth ? n.value - 1 > 3 ? (n.value--, z(f)) : n.value = 3 : n.value < +a.maxSize && /* If there is enough space to fit one */
17
- o.value.clientWidth - d.value.clientWidth > S.value && (n.value = Math.min(n.value + 1, +a.maxSize), z(f)));
18
- };
19
- if (globalThis.ResizeObserver) {
20
- const e = new ResizeObserver(R(f, 200));
21
- A(() => {
22
- if (o.value && d.value) {
23
- const t = o.value.querySelectorAll(
24
- ".bb-pagination__page"
25
- )[1];
26
- if (t) {
27
- const v = getComputedStyle(d.value).columnGap.replaceAll(/\D/g, ""), s = Number(v);
28
- S.value = t.clientWidth + s;
29
- }
30
- e.observe(o.value);
31
- }
32
- }), B(() => {
33
- e.disconnect();
34
- });
35
- }
36
- const $ = y(() => {
37
- if (i.value <= 0 || isNaN(i.value) || i.value > Number.MAX_SAFE_INTEGER)
38
- return [];
39
- if (n.value <= 1)
40
- return [a.modelValue];
41
- if (i.value <= n.value)
42
- return c(i.value, r.value);
43
- const e = n.value % 2 === 0, t = e ? n.value / 2 : Math.floor(n.value / 2), l = e ? t : t + 1, v = i.value - t;
44
- if (l - a.modelValue >= 0)
45
- return [
46
- ...c(Math.max(1, n.value - 1), r.value),
47
- a.ellipsis,
48
- i.value
49
- ];
50
- if (a.modelValue - v >= (e ? 1 : 0)) {
51
- const s = n.value - 1, _ = i.value - s + r.value;
52
- return [
53
- r.value,
54
- a.ellipsis,
55
- ...c(s, _)
56
- ];
57
- } else {
58
- const s = Math.max(1, n.value - 3), _ = s === 1 ? a.modelValue : a.modelValue - Math.ceil(s / 2) + r.value;
59
- return [
60
- r.value,
61
- a.ellipsis,
62
- ...c(s, _),
63
- a.ellipsis,
64
- i.value
65
- ];
66
- }
67
- }), C = y(() => $.value.map((e, t) => typeof e == "string" ? {
68
- active: !1,
69
- key: `ellipsis-${t}`,
70
- page: e,
71
- ellipsis: !0,
72
- disabled: !0
73
- } : {
74
- active: e === a.modelValue,
75
- key: e,
76
- page: e,
77
- ellipsis: !1,
78
- disabled: !!a.disabled || +a.totalPages < 2 || a.loading
79
- })), c = (e, t = 0) => Array.from({ length: e }, (l, v) => t + v);
80
- return (e, t) => (k(), V("div", {
81
- ref_key: "outercontainer",
82
- ref: o,
83
- class: "bb-pagination"
84
- }, [
85
- u("nav", T, [
86
- u("ul", {
87
- ref_key: "innercontainer",
88
- ref: d,
89
- class: "bb-pagination__pages"
90
- }, [
91
- u("li", null, [
92
- u("button", {
93
- class: "bb-pagination__page bb-pagination__page--previous",
94
- disabled: a.modelValue <= 1 || e.loading || e.disabled,
95
- onClick: t[0] || (t[0] = (l) => m("update:modelValue", a.modelValue - 1))
96
- }, [
97
- g(e.$slots, "previous", {}, () => [
98
- b("Precedente")
99
- ])
100
- ], 8, F)
101
- ]),
102
- (k(!0), V(E, null, P(C.value, (l) => (k(), V("li", {
103
- key: l.key
104
- }, [
105
- u("button", {
106
- class: W(["bb-pagination__page", {
107
- "bb-pagination__page--active": l.active,
108
- "bb-pagination__page--ellipsis": l.ellipsis
109
- }]),
110
- disabled: l.disabled,
111
- onClick: (v) => m("update:modelValue", l.key)
112
- }, [
113
- l.ellipsis === !0 ? g(e.$slots, "ellipsis", { key: 0 }, () => [
114
- b(h(a.ellipsis), 1)
115
- ]) : g(e.$slots, "item", {
116
- key: 1,
117
- active: l.active,
118
- disabled: l.disabled,
119
- item: l.key
120
- }, () => [
121
- b(h(l.key), 1)
122
- ])
123
- ], 10, L)
124
- ]))), 128)),
125
- u("li", null, [
126
- u("button", {
127
- class: "bb-pagination__page bb-pagination__page--next",
128
- disabled: a.modelValue >= +i.value || e.loading || e.disabled,
129
- onClick: t[1] || (t[1] = (l) => m("update:modelValue", a.modelValue + 1))
130
- }, [
131
- g(e.$slots, "next", {}, () => [
132
- b("Successivi")
133
- ])
134
- ], 8, D)
135
- ])
136
- ], 512)
137
- ])
138
- ], 512));
139
- }
140
- });
141
- export {
142
- O as default
143
- };
1
+
144
2
  //# sourceMappingURL=index77.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index77.js","sources":["../src/components/BbPagination/BbPagination.vue"],"sourcesContent":["<template>\n\t<div ref=\"outercontainer\" class=\"bb-pagination\">\n\t\t<nav aria-label=\"Navigazione\">\n\t\t\t<ul ref=\"innercontainer\" class=\"bb-pagination__pages\">\n\t\t\t\t<li>\n\t\t\t\t\t<button\n\t\t\t\t\t\tclass=\"bb-pagination__page bb-pagination__page--previous\"\n\t\t\t\t\t\t:disabled=\"props.modelValue <= 1 || loading || disabled\"\n\t\t\t\t\t\t@click=\"emit('update:modelValue', props.modelValue - 1)\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot name=\"previous\">Precedente</slot>\n\t\t\t\t\t</button>\n\t\t\t\t</li>\n\t\t\t\t<li v-for=\"item in items\" :key=\"item.key\">\n\t\t\t\t\t<button\n\t\t\t\t\t\tclass=\"bb-pagination__page\"\n\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t'bb-pagination__page--active': item.active,\n\t\t\t\t\t\t\t'bb-pagination__page--ellipsis': item.ellipsis,\n\t\t\t\t\t\t}\"\n\t\t\t\t\t\t:disabled=\"item.disabled\"\n\t\t\t\t\t\t@click=\"emit('update:modelValue', item.key)\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<template v-if=\"item.ellipsis === true\">\n\t\t\t\t\t\t\t<slot name=\"ellipsis\">\n\t\t\t\t\t\t\t\t{{ props.ellipsis }}\n\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<template v-else>\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:active=\"item.active\"\n\t\t\t\t\t\t\t\t:disabled=\"item.disabled\"\n\t\t\t\t\t\t\t\t:item=\"item.key\"\n\t\t\t\t\t\t\t\tname=\"item\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{{ item.key }}\n\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</button>\n\t\t\t\t</li>\n\t\t\t\t<li>\n\t\t\t\t\t<button\n\t\t\t\t\t\tclass=\"bb-pagination__page bb-pagination__page--next\"\n\t\t\t\t\t\t:disabled=\"props.modelValue >= +totalPages || loading || disabled\"\n\t\t\t\t\t\t@click=\"emit('update:modelValue', props.modelValue + 1)\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot name=\"next\">Successivi</slot>\n\t\t\t\t\t</button>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</nav>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, nextTick, onBeforeUnmount, onMounted, ref } from 'vue';\nimport { debounce } from '@/utilities/functions/debounce';\nimport type { CommonProps } from '@/types/CommonProps';\n\nexport type BbPaginationProps = Pick<CommonProps, 'disabled' | 'loading'> & {\n\t/**\n\t * String of text displayed in place of hidden pages\n\t */\n\tellipsis?: string;\n\t/**\n\t * Maximum number of clickable pages displayed at all times.\n\t * This has a tolerance of +/- 1 for odd / even numbering.\n\t * It does not include ellipses.\n\t */\n\tmaxSize?: number | string;\n\t/**\n\t * Used by v-model. Indicates the current page.\n\t */\n\tmodelValue: number;\n\t/**\n\t * Total number of pages there is.\n\t */\n\ttotalPages?: number | string;\n};\n\nconst props = withDefaults(defineProps<BbPaginationProps>(), {\n\tmodelValue: 1,\n\ttotalPages: 1,\n\tellipsis: '...',\n\tmaxSize: 5,\n});\n\nexport type BbPaginationEvents = {\n\t(e: 'update:modelValue', value: number): void;\n};\n\nconst emit = defineEmits(['update:modelValue']);\n\ndefineSlots<{\n\tprevious?: (props: object) => any;\n\tnext?: (props: object) => any;\n\titem?: (props: { active: boolean; disabled: boolean; item: number }) => any;\n\tellipsis?: (props: object) => any;\n}>();\n\nconst totalPages = computed(() => +props.totalPages);\nconst start = ref(1);\nconst maxSize = ref(+props.maxSize);\n\nconst outercontainer = ref<HTMLElement>();\nconst innercontainer = ref<HTMLElement>();\n\nconst buttonFootprint = ref<number>(Infinity);\n\n/**\n * Adjusts how many buttons to show.\n * if current buttons can't fit subtract maxSize until they do or until minimum is reached\n * if more buttons could fit add buttons until the don't\n * If minimum or maximum is reached just quit until next resize\n */\nconst adjustMaxElements = () => {\n\tif (outercontainer.value && innercontainer.value) {\n\t\t/* If some buttons do not fit */\n\t\tif (outercontainer.value.clientWidth < innercontainer.value.clientWidth) {\n\t\t\tif (maxSize.value - 1 > 3) {\n\t\t\t\tmaxSize.value--;\n\t\t\t\tnextTick(adjustMaxElements);\n\t\t\t} else {\n\t\t\t\tmaxSize.value = 3;\n\t\t\t}\n\t\t\t/* If all current buttons do fit */\n\t\t} else {\n\t\t\t/* If some buttons have been hidden */\n\t\t\tif (maxSize.value < +props.maxSize) {\n\t\t\t\tif (\n\t\t\t\t\t/* If there is enough space to fit one */\n\t\t\t\t\toutercontainer.value.clientWidth - innercontainer.value.clientWidth >\n\t\t\t\t\tbuttonFootprint.value\n\t\t\t\t) {\n\t\t\t\t\tmaxSize.value = Math.min(maxSize.value + 1, +props.maxSize);\n\t\t\t\t\tnextTick(adjustMaxElements);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\nif (globalThis.ResizeObserver) {\n\tconst observer = new ResizeObserver(debounce(adjustMaxElements, 200));\n\tonMounted(() => {\n\t\tif (outercontainer.value && innercontainer.value) {\n\t\t\tconst button = outercontainer.value.querySelectorAll(\n\t\t\t\t'.bb-pagination__page'\n\t\t\t)[1];\n\t\t\tif (button) {\n\t\t\t\t/* Compute the footprint necessary to render a new button */\n\t\t\t\tconst gapString = getComputedStyle(innercontainer.value).columnGap;\n\t\t\t\tconst numberAsString = gapString.replaceAll(/\\D/g, '');\n\t\t\t\tconst gap = Number(numberAsString);\n\t\t\t\tbuttonFootprint.value = button.clientWidth + gap;\n\t\t\t}\n\t\t\tobserver.observe(outercontainer.value);\n\t\t}\n\t});\n\tonBeforeUnmount(() => {\n\t\tobserver.disconnect();\n\t});\n}\n\nconst range = computed(() => {\n\tif (\n\t\ttotalPages.value <= 0 ||\n\t\tisNaN(totalPages.value) ||\n\t\ttotalPages.value > Number.MAX_SAFE_INTEGER\n\t)\n\t\treturn [];\n\n\tif (maxSize.value <= 1) return [props.modelValue];\n\n\tif (totalPages.value <= maxSize.value) {\n\t\treturn createRange(totalPages.value, start.value);\n\t}\n\n\tconst even = maxSize.value % 2 === 0;\n\tconst middle = even ? maxSize.value / 2 : Math.floor(maxSize.value / 2);\n\tconst left = even ? middle : middle + 1;\n\tconst right = totalPages.value - middle;\n\n\tif (left - props.modelValue >= 0) {\n\t\treturn [\n\t\t\t...createRange(Math.max(1, maxSize.value - 1), start.value),\n\t\t\tprops.ellipsis,\n\t\t\ttotalPages.value,\n\t\t];\n\t} else if (props.modelValue - right >= (even ? 1 : 0)) {\n\t\tconst rangeLength = maxSize.value - 1;\n\t\tconst rangeStart = totalPages.value - rangeLength + start.value;\n\t\treturn [\n\t\t\tstart.value,\n\t\t\tprops.ellipsis,\n\t\t\t...createRange(rangeLength, rangeStart),\n\t\t];\n\t} else {\n\t\tconst rangeLength = Math.max(1, maxSize.value - 3);\n\t\tconst rangeStart =\n\t\t\trangeLength === 1\n\t\t\t\t? props.modelValue\n\t\t\t\t: props.modelValue - Math.ceil(rangeLength / 2) + start.value;\n\t\treturn [\n\t\t\tstart.value,\n\t\t\tprops.ellipsis,\n\t\t\t...createRange(rangeLength, rangeStart),\n\t\t\tprops.ellipsis,\n\t\t\ttotalPages.value,\n\t\t];\n\t}\n});\n\ntype Item =\n\t| {\n\t\t\tactive: boolean;\n\t\t\tkey: string;\n\t\t\tpage: string;\n\t\t\tellipsis: true;\n\t\t\tdisabled: boolean;\n\t }\n\t| {\n\t\t\tactive: boolean;\n\t\t\tkey: number;\n\t\t\tpage: number;\n\t\t\tellipsis: false;\n\t\t\tdisabled: boolean;\n\t };\n\nconst items = computed<Item[]>(() => {\n\treturn range.value.map((item, index) => {\n\t\tif (typeof item === 'string') {\n\t\t\treturn {\n\t\t\t\tactive: false,\n\t\t\t\tkey: `ellipsis-${index}`,\n\t\t\t\tpage: item,\n\t\t\t\tellipsis: true,\n\t\t\t\tdisabled: true,\n\t\t\t};\n\t\t} else {\n\t\t\tconst active = item === props.modelValue;\n\t\t\treturn {\n\t\t\t\tactive,\n\t\t\t\tkey: item,\n\t\t\t\tpage: item,\n\t\t\t\tellipsis: false,\n\t\t\t\tdisabled: !!props.disabled || +props.totalPages < 2 || props.loading,\n\t\t\t};\n\t\t}\n\t});\n});\n\nconst createRange = (length: number, start = 0): number[] => {\n\treturn Array.from({ length }, (_, k) => start + k);\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbPagination';\n</style>\n"],"names":["props","__props","emit","__emit","totalPages","computed","start","ref","maxSize","outercontainer","innercontainer","buttonFootprint","adjustMaxElements","nextTick","observer","debounce","onMounted","button","numberAsString","gap","onBeforeUnmount","range","createRange","even","middle","left","right","rangeLength","rangeStart","items","item","index","length","_","k"],"mappings":";;;;;;;;;;;;;;AAgFA,UAAMA,IAAQC,GAWRC,IAAOC,GASPC,IAAaC,EAAS,MAAM,CAACL,EAAM,UAAU,GAC7CM,IAAQC,EAAI,CAAC,GACbC,IAAUD,EAAI,CAACP,EAAM,OAAO,GAE5BS,IAAiBF,KACjBG,IAAiBH,KAEjBI,IAAkBJ,EAAY,KAAQ,GAQtCK,IAAoB,MAAM;AAC3B,MAAAH,EAAe,SAASC,EAAe,UAEtCD,EAAe,MAAM,cAAcC,EAAe,MAAM,cACvDF,EAAQ,QAAQ,IAAI,KACfA,EAAA,SACRK,EAASD,CAAiB,KAE1BJ,EAAQ,QAAQ,IAKbA,EAAQ,QAAQ,CAACR,EAAM;AAAA,MAGzBS,EAAe,MAAM,cAAcC,EA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sourcesContent":[],"names":[],"mappings":""}
package/dist/index78.js CHANGED
@@ -1,2 +1,166 @@
1
-
1
+ import { defineComponent as P, computed as y, ref as c, onMounted as W, onBeforeUnmount as w, openBlock as k, createElementBlock as V, createElementVNode as o, createVNode as v, unref as b, withCtx as S, renderSlot as _, Fragment as R, renderList as F, normalizeClass as L, toDisplayString as C, nextTick as M } from "vue";
2
+ import T from "./index234.js";
3
+ import "./index2.js";
4
+ import $ from "./index10.js";
5
+ import "./index11.js";
6
+ import N from "./index118.js";
7
+ import "./index170.js";
8
+ const D = { "aria-label": "Navigazione" }, G = /* @__PURE__ */ o("span", { class: "bb-pagination__page-label" }, "Precedente", -1), I = { class: "bb-pagination__page-label" }, O = { class: "bb-pagination__page-label" }, j = /* @__PURE__ */ o("span", { class: "bb-pagination__page-label" }, "Successivo", -1), Y = /* @__PURE__ */ P({
9
+ __name: "BbPagination",
10
+ props: {
11
+ disabled: { type: Boolean },
12
+ loading: { type: Boolean },
13
+ ellipsis: { default: "..." },
14
+ maxSize: { default: 5 },
15
+ modelValue: { default: 1 },
16
+ totalPages: { default: 1 }
17
+ },
18
+ emits: ["update:modelValue"],
19
+ setup(x, { emit: A }) {
20
+ const a = x, m = A, i = y(() => +a.totalPages), r = c(1), t = c(+a.maxSize), u = c(), d = c(), z = c(1 / 0), f = () => {
21
+ u.value && d.value && (u.value.clientWidth < d.value.clientWidth ? t.value - 1 > 3 ? (t.value--, M(f)) : t.value = 3 : t.value < +a.maxSize && /* If there is enough space to fit one */
22
+ u.value.clientWidth - d.value.clientWidth > z.value && (t.value = Math.min(t.value + 1, +a.maxSize), M(f)));
23
+ };
24
+ if (globalThis.ResizeObserver) {
25
+ const e = new ResizeObserver(T(f, 200));
26
+ W(() => {
27
+ if (u.value && d.value) {
28
+ const n = u.value.querySelectorAll(
29
+ ".bb-pagination__page"
30
+ )[1];
31
+ if (n) {
32
+ const p = getComputedStyle(d.value).columnGap.replaceAll(/\D/g, ""), s = Number(p);
33
+ z.value = n.clientWidth + s;
34
+ }
35
+ e.observe(u.value);
36
+ }
37
+ }), w(() => {
38
+ e.disconnect();
39
+ });
40
+ }
41
+ const B = y(() => {
42
+ if (i.value <= 0 || isNaN(i.value) || i.value > Number.MAX_SAFE_INTEGER)
43
+ return [];
44
+ if (t.value <= 1)
45
+ return [a.modelValue];
46
+ if (i.value <= t.value)
47
+ return g(i.value, r.value);
48
+ const e = t.value % 2 === 0, n = e ? t.value / 2 : Math.floor(t.value / 2), l = e ? n : n + 1, p = i.value - n;
49
+ if (l - a.modelValue >= 0)
50
+ return [
51
+ ...g(Math.max(1, t.value - 1), r.value),
52
+ a.ellipsis,
53
+ i.value
54
+ ];
55
+ if (a.modelValue - p >= (e ? 1 : 0)) {
56
+ const s = t.value - 1, h = i.value - s + r.value;
57
+ return [
58
+ r.value,
59
+ a.ellipsis,
60
+ ...g(s, h)
61
+ ];
62
+ } else {
63
+ const s = Math.max(1, t.value - 3), h = s === 1 ? a.modelValue : a.modelValue - Math.ceil(s / 2) + r.value;
64
+ return [
65
+ r.value,
66
+ a.ellipsis,
67
+ ...g(s, h),
68
+ a.ellipsis,
69
+ i.value
70
+ ];
71
+ }
72
+ }), E = y(() => B.value.map((e, n) => typeof e == "string" ? {
73
+ active: !1,
74
+ key: `ellipsis-${n}`,
75
+ page: e,
76
+ ellipsis: !0,
77
+ disabled: !0
78
+ } : {
79
+ active: e === a.modelValue,
80
+ key: e,
81
+ page: e,
82
+ ellipsis: !1,
83
+ disabled: !!a.disabled || +a.totalPages < 2 || a.loading
84
+ })), g = (e, n = 0) => Array.from({ length: e }, (l, p) => n + p);
85
+ return (e, n) => (k(), V("div", {
86
+ ref_key: "outercontainer",
87
+ ref: u,
88
+ class: "bb-pagination"
89
+ }, [
90
+ o("nav", D, [
91
+ o("ul", {
92
+ ref_key: "innercontainer",
93
+ ref: d,
94
+ class: "bb-pagination__pages"
95
+ }, [
96
+ o("li", null, [
97
+ v(b($), {
98
+ class: "bb-pagination__page bb-pagination__page--previous",
99
+ disabled: a.modelValue <= 1 || e.loading || e.disabled,
100
+ onClick: n[0] || (n[0] = (l) => m("update:modelValue", a.modelValue - 1))
101
+ }, {
102
+ default: S(() => [
103
+ _(e.$slots, "previous", {}, () => [
104
+ G,
105
+ v(b(N), {
106
+ type: "chevron_down",
107
+ class: "bb-pagination__page-chevron"
108
+ })
109
+ ])
110
+ ]),
111
+ _: 3
112
+ }, 8, ["disabled"])
113
+ ]),
114
+ (k(!0), V(R, null, F(E.value, (l) => (k(), V("li", {
115
+ key: l.key
116
+ }, [
117
+ v(b($), {
118
+ class: L(["bb-pagination__page", {
119
+ "bb-pagination__page--active": l.active,
120
+ "bb-pagination__page--ellipsis": l.ellipsis
121
+ }]),
122
+ disabled: l.disabled,
123
+ onClick: (p) => m("update:modelValue", l.key)
124
+ }, {
125
+ default: S(() => [
126
+ l.ellipsis === !0 ? _(e.$slots, "ellipsis", { key: 0 }, () => [
127
+ o("span", I, C(a.ellipsis), 1)
128
+ ]) : _(e.$slots, "item", {
129
+ key: 1,
130
+ active: l.active,
131
+ disabled: l.disabled,
132
+ item: l.key
133
+ }, () => [
134
+ o("span", O, C(l.key), 1)
135
+ ])
136
+ ]),
137
+ _: 2
138
+ }, 1032, ["class", "disabled", "onClick"])
139
+ ]))), 128)),
140
+ o("li", null, [
141
+ v(b($), {
142
+ class: "bb-pagination__page bb-pagination__page--next",
143
+ disabled: a.modelValue >= +i.value || e.loading || e.disabled,
144
+ onClick: n[1] || (n[1] = (l) => m("update:modelValue", a.modelValue + 1))
145
+ }, {
146
+ default: S(() => [
147
+ _(e.$slots, "next", {}, () => [
148
+ j,
149
+ v(b(N), {
150
+ type: "chevron_down",
151
+ class: "bb-pagination__page-chevron"
152
+ })
153
+ ])
154
+ ]),
155
+ _: 3
156
+ }, 8, ["disabled"])
157
+ ])
158
+ ], 512)
159
+ ])
160
+ ], 512));
161
+ }
162
+ });
163
+ export {
164
+ Y as default
165
+ };
2
166
  //# sourceMappingURL=index78.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index78.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
1
+ {"version":3,"file":"index78.js","sources":["../src/components/BbPagination/BbPagination.vue"],"sourcesContent":["<template>\n\t<div ref=\"outercontainer\" class=\"bb-pagination\">\n\t\t<nav aria-label=\"Navigazione\">\n\t\t\t<ul ref=\"innercontainer\" class=\"bb-pagination__pages\">\n\t\t\t\t<li>\n\t\t\t\t\t<BaseButton\n\t\t\t\t\t\tclass=\"bb-pagination__page bb-pagination__page--previous\"\n\t\t\t\t\t\t:disabled=\"props.modelValue <= 1 || loading || disabled\"\n\t\t\t\t\t\t@click=\"emit('update:modelValue', props.modelValue - 1)\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot name=\"previous\">\n\t\t\t\t\t\t\t<span class=\"bb-pagination__page-label\">Precedente</span>\n\t\t\t\t\t\t\t<BbIcon type=\"chevron_down\" class=\"bb-pagination__page-chevron\" />\n\t\t\t\t\t\t</slot>\n\t\t\t\t\t</BaseButton>\n\t\t\t\t</li>\n\t\t\t\t<li v-for=\"item in items\" :key=\"item.key\">\n\t\t\t\t\t<BaseButton\n\t\t\t\t\t\tclass=\"bb-pagination__page\"\n\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t'bb-pagination__page--active': item.active,\n\t\t\t\t\t\t\t'bb-pagination__page--ellipsis': item.ellipsis,\n\t\t\t\t\t\t}\"\n\t\t\t\t\t\t:disabled=\"item.disabled\"\n\t\t\t\t\t\t@click=\"emit('update:modelValue', item.key)\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<template v-if=\"item.ellipsis === true\">\n\t\t\t\t\t\t\t<slot name=\"ellipsis\">\n\t\t\t\t\t\t\t\t<span class=\"bb-pagination__page-label\">{{\n\t\t\t\t\t\t\t\t\tprops.ellipsis\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</template>\n\t\t\t\t\t\t<template v-else>\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:active=\"item.active\"\n\t\t\t\t\t\t\t\t:disabled=\"item.disabled\"\n\t\t\t\t\t\t\t\t:item=\"item.key\"\n\t\t\t\t\t\t\t\tname=\"item\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<span class=\"bb-pagination__page-label\">{{ item.key }}</span>\n\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</BaseButton>\n\t\t\t\t</li>\n\t\t\t\t<li>\n\t\t\t\t\t<BaseButton\n\t\t\t\t\t\tclass=\"bb-pagination__page bb-pagination__page--next\"\n\t\t\t\t\t\t:disabled=\"props.modelValue >= +totalPages || loading || disabled\"\n\t\t\t\t\t\t@click=\"emit('update:modelValue', props.modelValue + 1)\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot name=\"next\">\n\t\t\t\t\t\t\t<span class=\"bb-pagination__page-label\">Successivo</span>\n\t\t\t\t\t\t\t<BbIcon type=\"chevron_down\" class=\"bb-pagination__page-chevron\" />\n\t\t\t\t\t\t</slot>\n\t\t\t\t\t</BaseButton>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</nav>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, nextTick, onBeforeUnmount, onMounted, ref } from 'vue';\nimport { debounce } from '@/utilities/functions/debounce';\nimport type { CommonProps } from '@/types/CommonProps';\nimport { BaseButton, BbIcon } from '@/index';\n\nexport type BbPaginationProps = Pick<CommonProps, 'disabled' | 'loading'> & {\n\t/**\n\t * String of text displayed in place of hidden pages\n\t */\n\tellipsis?: string;\n\t/**\n\t * Maximum number of clickable pages displayed at all times.\n\t * This has a tolerance of +/- 1 for odd / even numbering.\n\t * It does not include ellipses.\n\t */\n\tmaxSize?: number | string;\n\t/**\n\t * Used by v-model. Indicates the current page.\n\t */\n\tmodelValue: number;\n\t/**\n\t * Total number of pages there is.\n\t */\n\ttotalPages?: number | string;\n};\n\nconst props = withDefaults(defineProps<BbPaginationProps>(), {\n\tmodelValue: 1,\n\ttotalPages: 1,\n\tellipsis: '...',\n\tmaxSize: 5,\n});\n\nexport type BbPaginationEvents = {\n\t(e: 'update:modelValue', value: number): void;\n};\n\nconst emit = defineEmits(['update:modelValue']);\n\ndefineSlots<{\n\tprevious?: (props: object) => any;\n\tnext?: (props: object) => any;\n\titem?: (props: { active: boolean; disabled: boolean; item: number }) => any;\n\tellipsis?: (props: object) => any;\n}>();\n\nconst totalPages = computed(() => +props.totalPages);\nconst start = ref(1);\nconst maxSize = ref(+props.maxSize);\n\nconst outercontainer = ref<HTMLElement>();\nconst innercontainer = ref<HTMLElement>();\n\nconst buttonFootprint = ref<number>(Infinity);\n\n/**\n * Adjusts how many buttons to show.\n * if current buttons can't fit subtract maxSize until they do or until minimum is reached\n * if more buttons could fit add buttons until the don't\n * If minimum or maximum is reached just quit until next resize\n */\nconst adjustMaxElements = () => {\n\tif (outercontainer.value && innercontainer.value) {\n\t\t/* If some buttons do not fit */\n\t\tif (outercontainer.value.clientWidth < innercontainer.value.clientWidth) {\n\t\t\tif (maxSize.value - 1 > 3) {\n\t\t\t\tmaxSize.value--;\n\t\t\t\tnextTick(adjustMaxElements);\n\t\t\t} else {\n\t\t\t\tmaxSize.value = 3;\n\t\t\t}\n\t\t\t/* If all current buttons do fit */\n\t\t} else {\n\t\t\t/* If some buttons have been hidden */\n\t\t\tif (maxSize.value < +props.maxSize) {\n\t\t\t\tif (\n\t\t\t\t\t/* If there is enough space to fit one */\n\t\t\t\t\toutercontainer.value.clientWidth - innercontainer.value.clientWidth >\n\t\t\t\t\tbuttonFootprint.value\n\t\t\t\t) {\n\t\t\t\t\tmaxSize.value = Math.min(maxSize.value + 1, +props.maxSize);\n\t\t\t\t\tnextTick(adjustMaxElements);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n};\nif (globalThis.ResizeObserver) {\n\tconst observer = new ResizeObserver(debounce(adjustMaxElements, 200));\n\tonMounted(() => {\n\t\tif (outercontainer.value && innercontainer.value) {\n\t\t\tconst button = outercontainer.value.querySelectorAll(\n\t\t\t\t'.bb-pagination__page'\n\t\t\t)[1];\n\t\t\tif (button) {\n\t\t\t\t/* Compute the footprint necessary to render a new button */\n\t\t\t\tconst gapString = getComputedStyle(innercontainer.value).columnGap;\n\t\t\t\tconst numberAsString = gapString.replaceAll(/\\D/g, '');\n\t\t\t\tconst gap = Number(numberAsString);\n\t\t\t\tbuttonFootprint.value = button.clientWidth + gap;\n\t\t\t}\n\t\t\tobserver.observe(outercontainer.value);\n\t\t}\n\t});\n\tonBeforeUnmount(() => {\n\t\tobserver.disconnect();\n\t});\n}\n\nconst range = computed(() => {\n\tif (\n\t\ttotalPages.value <= 0 ||\n\t\tisNaN(totalPages.value) ||\n\t\ttotalPages.value > Number.MAX_SAFE_INTEGER\n\t)\n\t\treturn [];\n\n\tif (maxSize.value <= 1) return [props.modelValue];\n\n\tif (totalPages.value <= maxSize.value) {\n\t\treturn createRange(totalPages.value, start.value);\n\t}\n\n\tconst even = maxSize.value % 2 === 0;\n\tconst middle = even ? maxSize.value / 2 : Math.floor(maxSize.value / 2);\n\tconst left = even ? middle : middle + 1;\n\tconst right = totalPages.value - middle;\n\n\tif (left - props.modelValue >= 0) {\n\t\treturn [\n\t\t\t...createRange(Math.max(1, maxSize.value - 1), start.value),\n\t\t\tprops.ellipsis,\n\t\t\ttotalPages.value,\n\t\t];\n\t} else if (props.modelValue - right >= (even ? 1 : 0)) {\n\t\tconst rangeLength = maxSize.value - 1;\n\t\tconst rangeStart = totalPages.value - rangeLength + start.value;\n\t\treturn [\n\t\t\tstart.value,\n\t\t\tprops.ellipsis,\n\t\t\t...createRange(rangeLength, rangeStart),\n\t\t];\n\t} else {\n\t\tconst rangeLength = Math.max(1, maxSize.value - 3);\n\t\tconst rangeStart =\n\t\t\trangeLength === 1\n\t\t\t\t? props.modelValue\n\t\t\t\t: props.modelValue - Math.ceil(rangeLength / 2) + start.value;\n\t\treturn [\n\t\t\tstart.value,\n\t\t\tprops.ellipsis,\n\t\t\t...createRange(rangeLength, rangeStart),\n\t\t\tprops.ellipsis,\n\t\t\ttotalPages.value,\n\t\t];\n\t}\n});\n\ntype Item =\n\t| {\n\t\t\tactive: boolean;\n\t\t\tkey: string;\n\t\t\tpage: string;\n\t\t\tellipsis: true;\n\t\t\tdisabled: boolean;\n\t }\n\t| {\n\t\t\tactive: boolean;\n\t\t\tkey: number;\n\t\t\tpage: number;\n\t\t\tellipsis: false;\n\t\t\tdisabled: boolean;\n\t };\n\nconst items = computed<Item[]>(() => {\n\treturn range.value.map((item, index) => {\n\t\tif (typeof item === 'string') {\n\t\t\treturn {\n\t\t\t\tactive: false,\n\t\t\t\tkey: `ellipsis-${index}`,\n\t\t\t\tpage: item,\n\t\t\t\tellipsis: true,\n\t\t\t\tdisabled: true,\n\t\t\t};\n\t\t} else {\n\t\t\tconst active = item === props.modelValue;\n\t\t\treturn {\n\t\t\t\tactive,\n\t\t\t\tkey: item,\n\t\t\t\tpage: item,\n\t\t\t\tellipsis: false,\n\t\t\t\tdisabled: !!props.disabled || +props.totalPages < 2 || props.loading,\n\t\t\t};\n\t\t}\n\t});\n});\n\nconst createRange = (length: number, start = 0): number[] => {\n\treturn Array.from({ length }, (_, k) => start + k);\n};\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbPagination';\n</style>\n"],"names":["props","__props","emit","__emit","totalPages","computed","start","ref","maxSize","outercontainer","innercontainer","buttonFootprint","adjustMaxElements","nextTick","observer","debounce","onMounted","button","numberAsString","gap","onBeforeUnmount","range","createRange","even","middle","left","right","rangeLength","rangeStart","items","item","index","length","_","k"],"mappings":";;;;;;;;;;;;;;;;;;;AAyFA,UAAMA,IAAQC,GAWRC,IAAOC,GASPC,IAAaC,EAAS,MAAM,CAACL,EAAM,UAAU,GAC7CM,IAAQC,EAAI,CAAC,GACbC,IAAUD,EAAI,CAACP,EAAM,OAAO,GAE5BS,IAAiBF,KACjBG,IAAiBH,KAEjBI,IAAkBJ,EAAY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AKA,EAAM;AAAA,IAAA,CAG/D,CACD,GAEKsB,IAAc,CAACU,GAAgB1B,IAAQ,MACrC,MAAM,KAAK,EAAE,QAAA0B,KAAU,CAACC,GAAGC,MAAM5B,IAAQ4B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index79.js CHANGED
@@ -1,214 +1,2 @@
1
- import { defineComponent as V, ref as a, computed as _, openBlock as p, createElementBlock as h, mergeProps as B, createElementVNode as d, renderSlot as P, normalizeProps as I, guardReactiveProps as R, unref as g, createBlock as D, Teleport as U, normalizeClass as W, normalizeStyle as j, createCommentVNode as y, withCtx as G, nextTick as J } from "vue";
2
- import { useFloating as K, arrow as Q } from "./index221.js";
3
- import { useFocusTrap as X } from "./index216.js";
4
- import { useId as Y } from "./index7.js";
5
- import { wait as E } from "./index122.js";
6
- import Z from "./index9.js";
7
- import "./index10.js";
8
- import { autoUpdate as ee, flip as oe, shift as te } from "./index200.js";
9
- import { offset as ae } from "./index208.js";
10
- const re = ["id"], ne = {
11
- key: 1,
12
- class: "bb-popover__bubble"
13
- }, se = /* @__PURE__ */ d("span", { class: "bb-popover__close-label" }, "Chiudi", -1), le = /* @__PURE__ */ d("svg", {
14
- fill: "none",
15
- viewBox: "0 0 24 24",
16
- xmlns: "http://www.w3.org/2000/svg"
17
- }, [
18
- /* @__PURE__ */ d("path", {
19
- d: "M23 23L1 1M23 1L1 23",
20
- stroke: "currentColor",
21
- "stroke-linecap": "round",
22
- "stroke-width": "2"
23
- })
24
- ], -1), we = /* @__PURE__ */ V({
25
- __name: "BbPopover",
26
- props: {
27
- arrowPadding: { default: 10 },
28
- block: { type: Boolean },
29
- disabled: { type: Boolean },
30
- eager: { type: Boolean },
31
- offset: { default: 3 },
32
- padding: { default: 10 },
33
- placement: { default: "bottom" },
34
- showClose: { type: Boolean, default: !0 },
35
- theme: { default: "default" },
36
- transitionDuration: { default: 150 },
37
- focusTarget: {},
38
- width: {}
39
- },
40
- emits: ["shown", "hidden"],
41
- setup(M, { emit: N }) {
42
- const o = M, i = N, { id: S } = Y(), b = `bbp_${S.value}`, s = a(), u = a(), k = a(), { activate: L, deactivate: O } = X(u, {
43
- /**
44
- * This traps all clicks outside so we are pressing
45
- * the trigger we just allow and process that in its
46
- * own click handler.
47
- * If we are pressing anything random on the page
48
- * close the popover and be done
49
- */
50
- clickOutsideDeactivates: (e) => {
51
- var T;
52
- const t = e.target;
53
- return t instanceof HTMLElement && (T = s.value) != null && T.contains(t) || (v(), i("hidden")), !0;
54
- },
55
- escapeDeactivates: () => (J(async () => {
56
- await v(), w(), i("hidden");
57
- }), !0),
58
- /* We don't return focus so that when
59
- * we press a button on tyhe page we can focus
60
- * THAT button and not the current trigger
61
- */
62
- returnFocusOnDeactivate: !1
63
- }), { floatingStyles: z, placement: f, middlewareData: $ } = K(
64
- s,
65
- u,
66
- {
67
- placement: o.placement,
68
- whileElementsMounted: ee,
69
- middleware: [
70
- oe(),
71
- ae(o.offset),
72
- te({ padding: o.padding }),
73
- Q({
74
- element: k,
75
- padding: o.arrowPadding
76
- })
77
- ]
78
- }
79
- ), F = _(() => ({
80
- class: {
81
- "bb-popover--block": o.block,
82
- [`bb-popover--theme-${o.theme}`]: o.theme
83
- }
84
- })), r = a(!1), n = a(!1), l = a(!1), c = a(!0), H = _(() => {
85
- if ($.value.arrow) {
86
- const { x: e, y: t } = $.value.arrow;
87
- return {
88
- style: {
89
- left: `${e}px`,
90
- top: `${t}px`
91
- }
92
- };
93
- }
94
- }), q = _(() => {
95
- const e = {
96
- ...z.value,
97
- transitionDuration: `${o.transitionDuration}ms`
98
- };
99
- if (o.width) {
100
- let t;
101
- if (typeof o.width == "string" && Number.isNaN(Number(o.width)))
102
- if (o.width.includes("%")) {
103
- if (!s.value)
104
- return;
105
- t = `${s.value.clientWidth * (+o.width.replace("%", "") / 100)}px`;
106
- } else
107
- t = o.width;
108
- else
109
- t = `${o.width}px`;
110
- e.width = t;
111
- }
112
- return e;
113
- }), x = async () => {
114
- c.value = !1, l.value = !1, r.value = !0, await E(50), n.value = !0, r.value = !1;
115
- }, v = async () => {
116
- n.value = !1, r.value = !1, l.value = !0, await E(o.transitionDuration), l.value = !1, c.value = !0;
117
- }, m = a(!1), A = async () => {
118
- if (n.value) {
119
- await v(), w(), i("hidden");
120
- return;
121
- }
122
- if (r.value || o.disabled)
123
- return;
124
- m.value = !0, await x();
125
- let e = o.focusTarget ?? ".bb-popover__close";
126
- L({
127
- onPostActivate: () => {
128
- if (u.value) {
129
- const t = u.value.querySelector(e);
130
- t instanceof HTMLElement && (t.focus(), i("shown"));
131
- }
132
- }
133
- });
134
- }, w = () => {
135
- var t;
136
- const e = (t = s.value) == null ? void 0 : t.querySelector(`[aria-controls=popover_${b}]`);
137
- e instanceof HTMLElement && e.focus();
138
- }, C = async () => {
139
- O(), await v(), w(), i("hidden");
140
- };
141
- return (e, t) => (p(), h("span", B({ class: "bb-popover" }, F.value), [
142
- d("span", {
143
- ref_key: "wrapper",
144
- ref: s,
145
- class: "bb-popover__wrapper"
146
- }, [
147
- P(e.$slots, "activator", I(R({
148
- props: {
149
- "aria-controls": `popover_${b}`,
150
- "aria-expanded": n.value,
151
- onClick: A,
152
- id: b,
153
- disabled: !!e.disabled
154
- },
155
- closed: c.value,
156
- closing: l.value,
157
- disabled: !!e.disabled,
158
- open: n.value,
159
- opening: r.value,
160
- placement: g(f)
161
- })))
162
- ], 512),
163
- (p(), D(U, { to: "body" }, [
164
- d("span", {
165
- id: `popover_${b}`,
166
- ref_key: "content",
167
- ref: u,
168
- class: W(["bb-popover__bubble-container", {
169
- [`bb-popover__bubble-container--${g(f)}`]: !0,
170
- [`bb-popover__bubble-container--${e.theme}`]: e.theme,
171
- "bb-popover__bubble-container--hidden": c.value,
172
- "bb-popover__bubble-container--closing": l.value,
173
- "bb-popover__bubble-container--opening": r.value,
174
- "bb-popover__bubble-container--open": n.value
175
- }]),
176
- style: j(q.value)
177
- }, [
178
- m.value || e.eager ? (p(), h("span", B({
179
- key: 0,
180
- ref_key: "bubblearrow",
181
- ref: k,
182
- class: "bb-popover__arrow"
183
- }, H.value), null, 16)) : y("", !0),
184
- m.value || e.eager ? (p(), h("span", ne, [
185
- e.showClose ? (p(), D(Z, {
186
- key: 0,
187
- class: "bb-popover__close",
188
- onClick: C
189
- }, {
190
- default: G(() => [
191
- se,
192
- le
193
- ]),
194
- _: 1
195
- })) : y("", !0),
196
- P(e.$slots, "default", {
197
- close: C,
198
- closed: c.value,
199
- closing: l.value,
200
- disabled: !!e.disabled,
201
- open: n.value,
202
- opening: r.value,
203
- placement: g(f)
204
- })
205
- ])) : y("", !0)
206
- ], 14, re)
207
- ]))
208
- ], 16));
209
- }
210
- });
211
- export {
212
- we as default
213
- };
1
+
214
2
  //# sourceMappingURL=index79.js.map