buefy 0.9.29 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (729) hide show
  1. package/{LICENSE → LICENSE.md} +1 -1
  2. package/README.md +114 -27
  3. package/dist/buefy.css +472 -472
  4. package/dist/buefy.d.ts +11713 -0
  5. package/dist/buefy.esm.js +14181 -11095
  6. package/dist/buefy.esm.min.js +2 -2
  7. package/dist/buefy.js +19891 -16744
  8. package/dist/buefy.min.css +1 -1
  9. package/dist/buefy.min.js +2 -2
  10. package/dist/cjs/Autocomplete-bK5HLaUH.js +771 -0
  11. package/dist/cjs/Button-Cq7yqI8p.js +118 -0
  12. package/dist/cjs/CheckRadioMixin-CDu0SN3g.js +58 -0
  13. package/dist/cjs/Checkbox-GPzAMQqM.js +85 -0
  14. package/dist/cjs/CompatFallthroughMixin-hhK0Gkhr.js +48 -0
  15. package/dist/cjs/Datepicker-B-9ReBe6.js +2120 -0
  16. package/dist/cjs/Dropdown-DtpKU9qf.js +470 -0
  17. package/dist/cjs/DropdownItem-IMOKyRGV.js +110 -0
  18. package/dist/cjs/Field-19ZCJFF8.js +405 -0
  19. package/dist/cjs/{FormElementMixin-193a88b8.js → FormElementMixin-DavX4iOv.js} +69 -62
  20. package/dist/cjs/Icon-lsDKE2wQ.js +184 -0
  21. package/dist/cjs/Image-CocPwU3n.js +356 -0
  22. package/dist/cjs/InjectedChildMixin-CUKn09dB.js +150 -0
  23. package/dist/cjs/Input-BcloGeZ3.js +350 -0
  24. package/dist/cjs/Loading-GqqqjipO.js +145 -0
  25. package/dist/cjs/MessageMixin-bGuuzfev.js +136 -0
  26. package/dist/cjs/Modal-CYpSQe2Q.js +315 -0
  27. package/dist/cjs/NoticeMixin--3RjH43z.js +163 -0
  28. package/dist/cjs/Pagination-D1MVdiLp.js +547 -0
  29. package/dist/cjs/Progress-DT9Qc8Id.js +177 -0
  30. package/dist/cjs/Select-DayPKwCY.js +147 -0
  31. package/dist/cjs/SlotComponent-BruGdRW3.js +41 -0
  32. package/dist/cjs/TabbedChildMixin-B3JUUwcf.js +211 -0
  33. package/dist/cjs/Tag-BprnwJJ1.js +167 -0
  34. package/dist/cjs/Timepicker-CDZ3V-2J.js +283 -0
  35. package/dist/cjs/{TimepickerMixin-6c1a4ab4.js → TimepickerMixin-C9WVvcUL.js} +237 -232
  36. package/dist/cjs/Tooltip-Cgighv0j.js +393 -0
  37. package/dist/cjs/_plugin-vue_export-helper-Die8u8yB.js +11 -0
  38. package/dist/cjs/autocomplete.js +14 -13
  39. package/dist/cjs/breadcrumb.js +64 -96
  40. package/dist/cjs/button.js +11 -11
  41. package/dist/cjs/carousel.js +457 -294
  42. package/dist/cjs/checkbox.js +57 -55
  43. package/dist/cjs/clockpicker.js +462 -266
  44. package/dist/cjs/collapse.js +60 -89
  45. package/dist/cjs/colorpicker.js +16 -14
  46. package/dist/cjs/{config-8cfb5a4a.js → config-DR826Ki2.js} +42 -20
  47. package/dist/cjs/config.js +5 -5
  48. package/dist/cjs/datepicker.js +19 -18
  49. package/dist/cjs/datetimepicker.js +278 -172
  50. package/dist/cjs/dialog.js +386 -188
  51. package/dist/cjs/dropdown.js +14 -14
  52. package/dist/cjs/field.js +9 -8
  53. package/dist/cjs/helpers.js +146 -245
  54. package/dist/cjs/icon.js +10 -10
  55. package/dist/cjs/image.js +8 -8
  56. package/dist/cjs/index-DiQy3SCb.js +1942 -0
  57. package/dist/cjs/index.js +190 -132
  58. package/dist/cjs/input.js +13 -12
  59. package/dist/cjs/loading.js +75 -26
  60. package/dist/cjs/menu.js +240 -204
  61. package/dist/cjs/message.js +102 -50
  62. package/dist/cjs/modal.js +80 -36
  63. package/dist/cjs/navbar.js +344 -451
  64. package/dist/cjs/notification.js +236 -136
  65. package/dist/cjs/numberinput.js +250 -142
  66. package/dist/cjs/pagination.js +11 -11
  67. package/dist/cjs/plugins-DbyYGVpp.js +16 -0
  68. package/dist/cjs/progress.js +62 -210
  69. package/dist/cjs/radio.js +106 -99
  70. package/dist/cjs/rate.js +120 -79
  71. package/dist/cjs/select.js +13 -12
  72. package/dist/cjs/sidebar.js +161 -155
  73. package/dist/cjs/skeleton.js +64 -97
  74. package/dist/cjs/slider.js +408 -312
  75. package/dist/cjs/snackbar.js +179 -87
  76. package/dist/cjs/ssr-DVRFTu_P.js +8 -0
  77. package/dist/cjs/steps.js +221 -152
  78. package/dist/cjs/switch.js +93 -71
  79. package/dist/cjs/table.js +1606 -910
  80. package/dist/cjs/tabs.js +196 -152
  81. package/dist/cjs/tag.js +30 -56
  82. package/dist/cjs/taginput.js +262 -168
  83. package/dist/cjs/timepicker.js +18 -17
  84. package/dist/cjs/toast.js +136 -80
  85. package/dist/cjs/tooltip.js +8 -8
  86. package/dist/cjs/trapFocus-BlX6xykt.js +53 -0
  87. package/dist/cjs/upload.js +102 -112
  88. package/dist/components/autocomplete/index.js +1446 -1512
  89. package/dist/components/autocomplete/index.min.js +2 -2
  90. package/dist/components/breadcrumb/index.js +125 -249
  91. package/dist/components/breadcrumb/index.min.js +2 -2
  92. package/dist/components/button/index.js +303 -538
  93. package/dist/components/button/index.min.js +2 -2
  94. package/dist/components/carousel/index.js +1427 -1522
  95. package/dist/components/carousel/index.min.js +2 -2
  96. package/dist/components/checkbox/index.js +148 -191
  97. package/dist/components/checkbox/index.min.js +2 -2
  98. package/dist/components/clockpicker/index.js +2467 -2980
  99. package/dist/components/clockpicker/index.min.js +2 -2
  100. package/dist/components/collapse/index.js +68 -174
  101. package/dist/components/collapse/index.min.js +2 -2
  102. package/dist/components/colorpicker/index.js +3927 -3934
  103. package/dist/components/colorpicker/index.min.js +2 -2
  104. package/dist/components/datepicker/index.js +3839 -3581
  105. package/dist/components/datepicker/index.min.js +2 -2
  106. package/dist/components/datetimepicker/index.js +5115 -4545
  107. package/dist/components/datetimepicker/index.min.js +2 -2
  108. package/dist/components/dialog/index.js +1119 -1085
  109. package/dist/components/dialog/index.min.js +2 -2
  110. package/dist/components/dropdown/index.js +608 -971
  111. package/dist/components/dropdown/index.min.js +2 -2
  112. package/dist/components/field/index.js +400 -479
  113. package/dist/components/field/index.min.js +2 -2
  114. package/dist/components/icon/index.js +187 -438
  115. package/dist/components/icon/index.min.js +2 -2
  116. package/dist/components/image/index.js +363 -480
  117. package/dist/components/image/index.min.js +2 -2
  118. package/dist/components/input/index.js +713 -811
  119. package/dist/components/input/index.min.js +2 -2
  120. package/dist/components/loading/index.js +253 -339
  121. package/dist/components/loading/index.min.js +2 -2
  122. package/dist/components/menu/index.js +412 -574
  123. package/dist/components/menu/index.min.js +2 -2
  124. package/dist/components/message/index.js +568 -607
  125. package/dist/components/message/index.min.js +2 -2
  126. package/dist/components/modal/index.js +322 -430
  127. package/dist/components/modal/index.min.js +2 -2
  128. package/dist/components/navbar/index.js +582 -753
  129. package/dist/components/navbar/index.min.js +2 -2
  130. package/dist/components/notification/index.js +910 -857
  131. package/dist/components/notification/index.min.js +2 -2
  132. package/dist/components/numberinput/index.js +1060 -1051
  133. package/dist/components/numberinput/index.min.js +2 -2
  134. package/dist/components/pagination/index.js +717 -821
  135. package/dist/components/pagination/index.min.js +2 -2
  136. package/dist/components/progress/index.js +244 -585
  137. package/dist/components/progress/index.min.js +2 -2
  138. package/dist/components/radio/index.js +140 -192
  139. package/dist/components/radio/index.min.js +2 -2
  140. package/dist/components/rate/index.js +354 -563
  141. package/dist/components/rate/index.min.js +2 -2
  142. package/dist/components/select/index.js +508 -663
  143. package/dist/components/select/index.min.js +2 -2
  144. package/dist/components/sidebar/index.js +177 -307
  145. package/dist/components/sidebar/index.min.js +2 -2
  146. package/dist/components/skeleton/index.js +70 -183
  147. package/dist/components/skeleton/index.min.js +2 -2
  148. package/dist/components/slider/index.js +1082 -1177
  149. package/dist/components/slider/index.min.js +2 -2
  150. package/dist/components/snackbar/index.js +291 -379
  151. package/dist/components/snackbar/index.min.js +2 -2
  152. package/dist/components/steps/index.js +762 -1017
  153. package/dist/components/steps/index.min.js +2 -2
  154. package/dist/components/switch/index.js +107 -222
  155. package/dist/components/switch/index.min.js +2 -2
  156. package/dist/components/table/index.js +4005 -3277
  157. package/dist/components/table/index.min.js +2 -2
  158. package/dist/components/tabs/index.js +660 -939
  159. package/dist/components/tabs/index.min.js +2 -2
  160. package/dist/components/tag/index.js +338 -249
  161. package/dist/components/tag/index.min.js +2 -2
  162. package/dist/components/taginput/index.js +2002 -1990
  163. package/dist/components/taginput/index.min.js +2 -2
  164. package/dist/components/timepicker/index.js +2737 -2681
  165. package/dist/components/timepicker/index.min.js +2 -2
  166. package/dist/components/toast/index.js +249 -373
  167. package/dist/components/toast/index.min.js +2 -2
  168. package/dist/components/tooltip/index.js +401 -588
  169. package/dist/components/tooltip/index.min.js +2 -2
  170. package/dist/components/upload/index.js +227 -326
  171. package/dist/components/upload/index.min.js +2 -2
  172. package/dist/esm/Autocomplete-DyPAHhWD.js +769 -0
  173. package/dist/esm/Button-DyUYShTZ.js +116 -0
  174. package/dist/esm/CheckRadioMixin-DSD_rjC8.js +56 -0
  175. package/dist/esm/Checkbox-KUMz0sfA.js +83 -0
  176. package/dist/esm/CompatFallthroughMixin-C8LPuwDr.js +46 -0
  177. package/dist/esm/Datepicker-Bl8Wfdkn.js +2118 -0
  178. package/dist/esm/Dropdown-CGTYVyoL.js +467 -0
  179. package/dist/esm/DropdownItem-Cn3nM0A3.js +108 -0
  180. package/dist/esm/Field-B7bX_uUg.js +403 -0
  181. package/dist/esm/FormElementMixin-Dd_wkBN5.js +168 -0
  182. package/dist/esm/Icon-DPyGDeRK.js +182 -0
  183. package/dist/esm/Image-DhX-4hlV.js +354 -0
  184. package/dist/esm/InjectedChildMixin-D2K-FwuO.js +145 -0
  185. package/dist/esm/Input-C4L520az.js +348 -0
  186. package/dist/esm/Loading-tuQoo6TU.js +143 -0
  187. package/dist/esm/MessageMixin-CQ7LIdvq.js +134 -0
  188. package/dist/esm/Modal-tfvyhxw_.js +313 -0
  189. package/dist/esm/NoticeMixin-ByNlva3T.js +161 -0
  190. package/dist/esm/Pagination-B-LAJQay.js +543 -0
  191. package/dist/esm/Progress-BPGTVZgr.js +174 -0
  192. package/dist/esm/Select-bl4qUzij.js +145 -0
  193. package/dist/esm/SlotComponent-BwNpVnfH.js +39 -0
  194. package/dist/esm/TabbedChildMixin-C4i6WP9j.js +208 -0
  195. package/dist/esm/Tag-jS5Bcj6N.js +165 -0
  196. package/dist/esm/Timepicker-DnkqnOBT.js +281 -0
  197. package/dist/esm/{TimepickerMixin-d736b0a9.js → TimepickerMixin-Bikh6_Fg.js} +237 -232
  198. package/dist/esm/Tooltip-CtDSXAqa.js +391 -0
  199. package/dist/esm/_plugin-vue_export-helper-OJRSZE6i.js +9 -0
  200. package/dist/esm/autocomplete.js +13 -13
  201. package/dist/esm/breadcrumb.js +61 -93
  202. package/dist/esm/button.js +10 -11
  203. package/dist/esm/carousel.js +456 -293
  204. package/dist/esm/checkbox.js +56 -55
  205. package/dist/esm/clockpicker.js +461 -265
  206. package/dist/esm/collapse.js +59 -88
  207. package/dist/esm/colorpicker.js +15 -13
  208. package/dist/esm/{config-e7d4b9c2.js → config-CKuo-p6e.js} +43 -21
  209. package/dist/esm/config.js +4 -4
  210. package/dist/esm/datepicker.js +18 -18
  211. package/dist/esm/datetimepicker.js +278 -172
  212. package/dist/esm/dialog.js +386 -188
  213. package/dist/esm/dropdown.js +12 -13
  214. package/dist/esm/field.js +9 -9
  215. package/dist/esm/helpers.js +144 -245
  216. package/dist/esm/icon.js +9 -10
  217. package/dist/esm/image.js +8 -9
  218. package/dist/esm/index-CQegEsxK.js +1938 -0
  219. package/dist/esm/index.js +116 -134
  220. package/dist/esm/input.js +12 -12
  221. package/dist/esm/loading.js +75 -27
  222. package/dist/esm/menu.js +239 -203
  223. package/dist/esm/message.js +101 -49
  224. package/dist/esm/modal.js +81 -38
  225. package/dist/esm/navbar.js +339 -446
  226. package/dist/esm/notification.js +236 -136
  227. package/dist/esm/numberinput.js +249 -141
  228. package/dist/esm/pagination.js +10 -11
  229. package/dist/esm/plugins-B172kuKE.js +13 -0
  230. package/dist/esm/progress.js +57 -205
  231. package/dist/esm/radio.js +102 -95
  232. package/dist/esm/rate.js +119 -78
  233. package/dist/esm/select.js +12 -12
  234. package/dist/esm/sidebar.js +160 -154
  235. package/dist/esm/skeleton.js +63 -96
  236. package/dist/esm/slider.js +407 -311
  237. package/dist/esm/snackbar.js +179 -87
  238. package/dist/esm/ssr-C7yEpGLm.js +5 -0
  239. package/dist/esm/steps.js +220 -151
  240. package/dist/esm/switch.js +92 -70
  241. package/dist/esm/table.js +1607 -911
  242. package/dist/esm/tabs.js +195 -151
  243. package/dist/esm/tag.js +29 -56
  244. package/dist/esm/taginput.js +261 -167
  245. package/dist/esm/timepicker.js +18 -18
  246. package/dist/esm/toast.js +136 -80
  247. package/dist/esm/tooltip.js +8 -9
  248. package/dist/esm/trapFocus-KHP_kCNE.js +51 -0
  249. package/dist/esm/upload.js +101 -111
  250. package/dist/tsdoc-metadata.json +11 -0
  251. package/package.json +48 -137
  252. package/src/components/autocomplete/{Autocomplete.spec.js → Autocomplete.spec.ts} +162 -125
  253. package/src/components/autocomplete/Autocomplete.vue +177 -115
  254. package/src/components/autocomplete/__snapshots__/Autocomplete.spec.ts.snap +21 -0
  255. package/src/components/autocomplete/{index.js → index.ts} +3 -4
  256. package/src/components/breadcrumb/{Breadcrumb.spec.js → Breadcrumb.spec.ts} +10 -8
  257. package/src/components/breadcrumb/Breadcrumb.vue +4 -3
  258. package/src/components/breadcrumb/BreadcrumbItem.spec.ts +74 -0
  259. package/src/components/breadcrumb/BreadcrumbItem.vue +12 -8
  260. package/src/components/breadcrumb/__snapshots__/Breadcrumb.spec.ts.snap +7 -0
  261. package/src/components/breadcrumb/__snapshots__/BreadcrumbItem.spec.ts.snap +3 -0
  262. package/src/components/breadcrumb/{index.js → index.ts} +3 -4
  263. package/src/components/button/{Button.spec.js → Button.spec.ts} +30 -28
  264. package/src/components/button/Button.vue +25 -19
  265. package/src/components/button/__snapshots__/Button.spec.ts.snap +9 -0
  266. package/src/components/button/{index.js → index.ts} +3 -4
  267. package/src/components/carousel/{Carousel.spec.js → Carousel.spec.ts} +73 -73
  268. package/src/components/carousel/Carousel.vue +90 -51
  269. package/src/components/carousel/CarouselItem.spec.ts +105 -0
  270. package/src/components/carousel/CarouselItem.vue +11 -6
  271. package/src/components/carousel/{CarouselList.spec.js → CarouselList.spec.ts} +28 -29
  272. package/src/components/carousel/CarouselList.vue +99 -48
  273. package/src/components/carousel/__snapshots__/Carousel.spec.ts.snap +19 -0
  274. package/src/components/carousel/__snapshots__/CarouselItem.spec.ts.snap +7 -0
  275. package/src/components/carousel/__snapshots__/CarouselList.spec.ts.snap +36 -0
  276. package/src/components/carousel/{index.js → index.ts} +4 -4
  277. package/src/components/carousel/types.ts +17 -0
  278. package/src/components/checkbox/Checkbox.spec.ts +40 -0
  279. package/src/components/checkbox/Checkbox.vue +13 -10
  280. package/src/components/checkbox/CheckboxButton.spec.ts +46 -0
  281. package/src/components/checkbox/CheckboxButton.vue +12 -9
  282. package/src/components/checkbox/__snapshots__/Checkbox.spec.ts.snap +9 -0
  283. package/src/components/checkbox/__snapshots__/CheckboxButton.spec.ts.snap +3 -0
  284. package/src/components/checkbox/{index.js → index.ts} +4 -4
  285. package/src/components/clockpicker/Clockpicker.spec.ts +161 -0
  286. package/src/components/clockpicker/Clockpicker.vue +85 -55
  287. package/src/components/clockpicker/{ClockpickerFace.spec.js → ClockpickerFace.spec.ts} +24 -22
  288. package/src/components/clockpicker/ClockpickerFace.vue +272 -250
  289. package/src/components/clockpicker/__snapshots__/Clockpicker.spec.ts.snap +36 -0
  290. package/src/components/clockpicker/__snapshots__/{ClockpickerFace.spec.js.snap → ClockpickerFace.spec.ts.snap} +4 -4
  291. package/src/components/clockpicker/{index.js → index.ts} +3 -4
  292. package/src/components/collapse/{Collapse.spec.js → Collapse.spec.ts} +24 -35
  293. package/src/components/collapse/Collapse.vue +62 -38
  294. package/src/components/collapse/__snapshots__/Collapse.spec.ts.snap +10 -0
  295. package/src/components/collapse/{index.js → index.ts} +3 -4
  296. package/src/components/colorpicker/Colorpicker.spec.ts +22 -0
  297. package/src/components/colorpicker/Colorpicker.vue +97 -58
  298. package/src/components/colorpicker/{ColorpickerAlphaSlider.spec.js → ColorpickerAlphaSlider.spec.ts} +3 -2
  299. package/src/components/colorpicker/ColorpickerAlphaSlider.vue +32 -21
  300. package/src/components/colorpicker/{ColorpickerHSLRepresentationSquare.spec.js → ColorpickerHSLRepresentationSquare.spec.ts} +4 -3
  301. package/src/components/colorpicker/ColorpickerHSLRepresentationSquare.vue +41 -29
  302. package/src/components/colorpicker/{ColorpickerHSLRepresentationTriangle.spec.js → ColorpickerHSLRepresentationTriangle.spec.ts} +4 -3
  303. package/src/components/colorpicker/ColorpickerHSLRepresentationTriangle.vue +35 -25
  304. package/src/components/colorpicker/__snapshots__/Colorpicker.spec.ts.snap +77 -0
  305. package/src/components/colorpicker/__snapshots__/ColorpickerAlphaSlider.spec.ts.snap +9 -0
  306. package/src/components/colorpicker/__snapshots__/ColorpickerHSLRepresentationSquare.spec.ts.snap +12 -0
  307. package/src/components/colorpicker/__snapshots__/{ColorpickerHSLRepresentationTriangle.spec.js.snap → ColorpickerHSLRepresentationTriangle.spec.ts.snap} +7 -7
  308. package/src/components/colorpicker/{index.js → index.ts} +3 -4
  309. package/src/components/datepicker/{Datepicker.spec.js → Datepicker.spec.ts} +163 -83
  310. package/src/components/datepicker/Datepicker.vue +197 -132
  311. package/src/components/datepicker/{DatepickerMonth.spec.js → DatepickerMonth.spec.ts} +98 -52
  312. package/src/components/datepicker/DatepickerMonth.vue +106 -72
  313. package/src/components/datepicker/{DatepickerTable.spec.js → DatepickerTable.spec.ts} +61 -65
  314. package/src/components/datepicker/DatepickerTable.vue +94 -72
  315. package/src/components/datepicker/{DatepickerTableRow.spec.js → DatepickerTableRow.spec.ts} +90 -52
  316. package/src/components/datepicker/DatepickerTableRow.vue +94 -57
  317. package/src/components/datepicker/__snapshots__/Datepicker.spec.ts.snap +54 -0
  318. package/src/components/datepicker/__snapshots__/DatepickerMonth.spec.ts.snap +33 -0
  319. package/src/components/datepicker/__snapshots__/{DatepickerTable.spec.js.snap → DatepickerTable.spec.ts.snap} +4 -4
  320. package/src/components/datepicker/__snapshots__/DatepickerTableRow.spec.ts.snap +23 -0
  321. package/src/components/datepicker/{index.js → index.ts} +4 -4
  322. package/src/components/datepicker/types.ts +41 -0
  323. package/src/components/datetimepicker/{Datetimepicker.spec.js → Datetimepicker.spec.ts} +33 -45
  324. package/src/components/datetimepicker/Datetimepicker.vue +107 -69
  325. package/src/components/datetimepicker/{index.js → index.ts} +3 -4
  326. package/src/components/dialog/{Dialog.spec.js → Dialog.spec.ts} +32 -31
  327. package/src/components/dialog/Dialog.vue +84 -58
  328. package/src/components/dialog/index.ts +169 -0
  329. package/src/components/dropdown/Dropdown.spec.ts +229 -0
  330. package/src/components/dropdown/Dropdown.vue +95 -60
  331. package/src/components/dropdown/DropdownItem.spec.ts +78 -0
  332. package/src/components/dropdown/DropdownItem.vue +39 -18
  333. package/src/components/dropdown/__snapshots__/Dropdown.spec.ts.snap +15 -0
  334. package/src/components/dropdown/__snapshots__/DropdownItem.spec.ts.snap +3 -0
  335. package/src/components/dropdown/{index.js → index.ts} +4 -4
  336. package/src/components/field/{Field.spec.js → Field.spec.ts} +89 -64
  337. package/src/components/field/Field.vue +92 -59
  338. package/src/components/field/{FieldBody.spec.js → FieldBody.spec.ts} +31 -16
  339. package/src/components/field/FieldBody.vue +61 -15
  340. package/src/components/field/__snapshots__/Field.spec.ts.snap +8 -0
  341. package/src/components/field/__snapshots__/FieldBody.spec.ts.snap +3 -0
  342. package/src/components/field/{index.js → index.ts} +3 -4
  343. package/src/components/icon/{Icon.spec.js → Icon.spec.ts} +38 -32
  344. package/src/components/icon/Icon.vue +28 -17
  345. package/src/components/icon/__snapshots__/Icon.spec.ts.snap +3 -0
  346. package/src/components/icon/{index.js → index.ts} +4 -4
  347. package/src/components/image/{Image.spec.js → Image.spec.ts} +60 -39
  348. package/src/components/image/Image.vue +85 -36
  349. package/src/components/image/__snapshots__/Image.spec.ts.snap +37 -0
  350. package/src/components/image/{index.js → index.ts} +3 -4
  351. package/src/components/{index.js → index.ts} +92 -0
  352. package/src/components/input/Input.spec.ts +396 -0
  353. package/src/components/input/Input.vue +116 -64
  354. package/src/components/input/__snapshots__/Input.spec.ts.snap +9 -0
  355. package/src/components/input/{index.js → index.ts} +4 -4
  356. package/src/components/loading/Loading.spec.ts +151 -0
  357. package/src/components/loading/Loading.vue +42 -28
  358. package/src/components/loading/__snapshots__/Loading.spec.ts.snap +10 -0
  359. package/src/components/loading/index.ts +91 -0
  360. package/src/components/menu/Menu.spec.ts +21 -0
  361. package/src/components/menu/Menu.vue +8 -3
  362. package/src/components/menu/MenuItem.spec.ts +92 -0
  363. package/src/components/menu/MenuItem.vue +63 -32
  364. package/src/components/menu/MenuItemContainerMixin.ts +72 -0
  365. package/src/components/menu/MenuList.spec.ts +35 -0
  366. package/src/components/menu/MenuList.vue +32 -26
  367. package/src/components/menu/__snapshots__/Menu.spec.ts.snap +3 -0
  368. package/src/components/menu/__snapshots__/MenuItem.spec.ts.snap +9 -0
  369. package/src/components/menu/__snapshots__/MenuList.spec.ts.snap +8 -0
  370. package/src/components/menu/{index.js → index.ts} +7 -5
  371. package/src/components/message/{Message.spec.js → Message.spec.ts} +6 -4
  372. package/src/components/message/Message.vue +26 -9
  373. package/src/components/message/__snapshots__/Message.spec.ts.snap +11 -0
  374. package/src/components/message/{index.js → index.ts} +3 -5
  375. package/src/components/modal/Modal.spec.ts +167 -0
  376. package/src/components/modal/Modal.vue +86 -61
  377. package/src/components/modal/__snapshots__/Modal.spec.ts.snap +10 -0
  378. package/src/components/modal/index.ts +107 -0
  379. package/src/components/navbar/{NavBar.spec.js → NavBar.spec.ts} +22 -19
  380. package/src/components/navbar/{NavBarBurger.spec.js → NavBarBurger.spec.ts} +9 -7
  381. package/src/components/navbar/NavBarItem.spec.ts +92 -0
  382. package/src/components/navbar/Navbar.vue +92 -69
  383. package/src/components/navbar/NavbarBurger.vue +10 -8
  384. package/src/components/navbar/NavbarDropdown.spec.ts +84 -0
  385. package/src/components/navbar/NavbarDropdown.vue +18 -9
  386. package/src/components/navbar/NavbarItem.vue +42 -19
  387. package/src/components/navbar/__snapshots__/NavBar.spec.ts.snap +11 -0
  388. package/src/components/navbar/__snapshots__/NavBarBurger.spec.ts.snap +3 -0
  389. package/src/components/navbar/__snapshots__/NavBarItem.spec.ts.snap +3 -0
  390. package/src/components/navbar/__snapshots__/NavbarDropdown.spec.ts.snap +7 -0
  391. package/src/components/navbar/{index.js → index.ts} +3 -4
  392. package/src/components/notification/{Notification.spec.js → Notification.spec.ts} +6 -4
  393. package/src/components/notification/Notification.vue +23 -6
  394. package/src/components/notification/NotificationNotice.vue +44 -10
  395. package/src/components/notification/__snapshots__/Notification.spec.ts.snap +10 -0
  396. package/src/components/notification/index.ts +121 -0
  397. package/src/components/numberinput/{Numberinput.spec.js → Numberinput.spec.ts} +146 -91
  398. package/src/components/numberinput/Numberinput.vue +105 -54
  399. package/src/components/numberinput/{index.js → index.ts} +3 -4
  400. package/src/components/pagination/Pagination.spec.ts +94 -0
  401. package/src/components/pagination/Pagination.vue +98 -82
  402. package/src/components/pagination/{PaginationButton.spec.js → PaginationButton.spec.ts} +13 -10
  403. package/src/components/pagination/PaginationButton.vue +17 -8
  404. package/src/components/pagination/__snapshots__/Pagination.spec.ts.snap +22 -0
  405. package/src/components/pagination/__snapshots__/PaginationButton.spec.ts.snap +3 -0
  406. package/src/components/pagination/{index.js → index.ts} +3 -4
  407. package/src/components/pagination/types.ts +11 -0
  408. package/src/components/progress/{Progress.spec.js → Progress.spec.ts} +9 -10
  409. package/src/components/progress/Progress.vue +44 -19
  410. package/src/components/progress/ProgressBar.spec.ts +45 -0
  411. package/src/components/progress/ProgressBar.vue +30 -13
  412. package/src/components/progress/__snapshots__/Progress.spec.ts.snap +7 -0
  413. package/src/components/progress/__snapshots__/ProgressBar.spec.ts.snap +7 -0
  414. package/src/components/progress/{index.js → index.ts} +3 -5
  415. package/src/components/radio/Radio.spec.ts +40 -0
  416. package/src/components/radio/Radio.vue +14 -9
  417. package/src/components/radio/RadioButton.spec.ts +40 -0
  418. package/src/components/radio/RadioButton.vue +17 -9
  419. package/src/components/radio/__snapshots__/Radio.spec.ts.snap +3 -0
  420. package/src/components/radio/__snapshots__/RadioButton.spec.ts.snap +3 -0
  421. package/src/components/radio/{index.js → index.ts} +3 -5
  422. package/src/components/rate/{Rate.spec.js → Rate.spec.ts} +24 -22
  423. package/src/components/rate/Rate.vue +42 -26
  424. package/src/components/rate/{index.js → index.ts} +3 -5
  425. package/src/components/select/Select.spec.ts +74 -0
  426. package/src/components/select/Select.vue +40 -21
  427. package/src/components/select/__snapshots__/Select.spec.ts.snap +7 -0
  428. package/src/components/select/{index.js → index.ts} +3 -4
  429. package/src/components/sidebar/{Sidebar.spec.js → Sidebar.spec.ts} +30 -28
  430. package/src/components/sidebar/Sidebar.vue +71 -56
  431. package/src/components/sidebar/__snapshots__/Sidebar.spec.ts.snap +25 -0
  432. package/src/components/sidebar/{index.js → index.ts} +3 -4
  433. package/src/components/skeleton/{Skeleton.spec.js → Skeleton.spec.ts} +4 -2
  434. package/src/components/skeleton/Skeleton.vue +92 -57
  435. package/src/components/skeleton/__snapshots__/Skeleton.spec.ts.snap +7 -0
  436. package/src/components/skeleton/index.ts +18 -0
  437. package/src/components/slider/Slider.spec.ts +115 -0
  438. package/src/components/slider/Slider.vue +122 -66
  439. package/src/components/slider/SliderThumb.spec.ts +176 -0
  440. package/src/components/slider/SliderThumb.vue +71 -55
  441. package/src/components/slider/SliderTick.spec.ts +33 -0
  442. package/src/components/slider/SliderTick.vue +19 -12
  443. package/src/components/slider/__snapshots__/Slider.spec.ts.snap +12 -0
  444. package/src/components/slider/__snapshots__/SliderThumb.spec.ts.snap +16 -0
  445. package/src/components/slider/__snapshots__/SliderTick.spec.ts.snap +7 -0
  446. package/src/components/slider/{index.js → index.ts} +3 -4
  447. package/src/components/slider/types.ts +34 -0
  448. package/src/components/snackbar/Snackbar.spec.ts +35 -0
  449. package/src/components/snackbar/Snackbar.vue +28 -12
  450. package/src/components/snackbar/__snapshots__/Snackbar.spec.ts.snap +12 -0
  451. package/src/components/snackbar/index.ts +118 -0
  452. package/src/components/steps/StepItem.spec.ts +114 -0
  453. package/src/components/steps/StepItem.vue +10 -5
  454. package/src/components/steps/Steps.spec.ts +125 -0
  455. package/src/components/steps/Steps.vue +69 -50
  456. package/src/components/steps/__snapshots__/StepItem.spec.ts.snap +7 -0
  457. package/src/components/steps/__snapshots__/Steps.spec.ts.snap +40 -0
  458. package/src/components/steps/{index.js → index.ts} +3 -4
  459. package/src/components/switch/Switch.spec.ts +74 -0
  460. package/src/components/switch/Switch.vue +39 -19
  461. package/src/components/switch/__snapshots__/Switch.spec.ts.snap +3 -0
  462. package/src/components/switch/{index.js → index.ts} +3 -4
  463. package/src/components/table/{Table.spec.js → Table.spec.ts} +184 -90
  464. package/src/components/table/Table.vue +387 -287
  465. package/src/components/table/{TableColumn.spec.js → TableColumn.spec.ts} +23 -16
  466. package/src/components/table/TableColumn.vue +26 -17
  467. package/src/components/table/TableMobileSort.spec.ts +47 -0
  468. package/src/components/table/TableMobileSort.vue +86 -39
  469. package/src/components/table/TablePagination.vue +17 -9
  470. package/src/components/table/__snapshots__/Table.spec.ts.snap +24 -0
  471. package/src/components/table/__snapshots__/TableMobileSort.spec.ts.snap +12 -0
  472. package/src/components/table/{index.js → index.ts} +11 -4
  473. package/src/components/table/mockTableColumn.ts +110 -0
  474. package/src/components/table/types.ts +110 -0
  475. package/src/components/tabs/TabItem.spec.ts +203 -0
  476. package/src/components/tabs/TabItem.vue +6 -4
  477. package/src/components/tabs/{Tabs.spec.js → Tabs.spec.ts} +34 -33
  478. package/src/components/tabs/Tabs.vue +62 -40
  479. package/src/components/tabs/__snapshots__/TabItem.spec.ts.snap +7 -0
  480. package/src/components/tabs/__snapshots__/Tabs.spec.ts.snap +33 -0
  481. package/src/components/tabs/{index.js → index.ts} +3 -4
  482. package/src/components/tag/Tag.spec.ts +32 -0
  483. package/src/components/tag/Tag.vue +40 -18
  484. package/src/components/tag/Taglist.spec.ts +21 -0
  485. package/src/components/tag/Taglist.vue +6 -4
  486. package/src/components/tag/__snapshots__/Tag.spec.ts.snap +6 -0
  487. package/src/components/tag/__snapshots__/Taglist.spec.ts.snap +3 -0
  488. package/src/components/tag/{index.js → index.ts} +3 -4
  489. package/src/components/taginput/Taginput.spec.ts +132 -0
  490. package/src/components/taginput/Taginput.vue +106 -73
  491. package/src/components/taginput/__snapshots__/Taginput.spec.ts.snap +10 -0
  492. package/src/components/taginput/{index.js → index.ts} +3 -4
  493. package/src/components/timepicker/Timepicker.spec.ts +108 -0
  494. package/src/components/timepicker/Timepicker.vue +72 -52
  495. package/src/components/timepicker/__snapshots__/Timepicker.spec.ts.snap +41 -0
  496. package/src/components/timepicker/{index.js → index.ts} +4 -4
  497. package/src/components/toast/Toast.spec.ts +74 -0
  498. package/src/components/toast/Toast.vue +15 -5
  499. package/src/components/toast/__snapshots__/Toast.spec.ts.snap +10 -0
  500. package/src/components/toast/index.ts +120 -0
  501. package/src/components/tooltip/Tooltip.spec.ts +64 -0
  502. package/src/components/tooltip/Tooltip.vue +97 -45
  503. package/src/components/tooltip/__snapshots__/Tooltip.spec.ts.snap +12 -0
  504. package/src/components/tooltip/{index.js → index.ts} +3 -4
  505. package/src/components/upload/Upload.spec.ts +62 -0
  506. package/src/components/upload/Upload.vue +51 -46
  507. package/src/components/upload/__snapshots__/Upload.spec.ts.snap +3 -0
  508. package/src/components/upload/{index.js → index.ts} +3 -5
  509. package/src/directives/{clickOutside.js → clickOutside.ts} +50 -18
  510. package/src/directives/{trapFocus.js → trapFocus.ts} +16 -14
  511. package/src/{index.js → index.ts} +12 -10
  512. package/src/scss/buefy-build.scss +3 -3
  513. package/src/scss/components/_carousel.scss +0 -0
  514. package/src/scss/utils/_animations.scss +9 -9
  515. package/src/utils/CheckRadioMixin.spec.ts +28 -0
  516. package/src/utils/CheckRadioMixin.ts +61 -0
  517. package/src/utils/CompatFallthroughMixin.ts +34 -0
  518. package/src/utils/{ConfigComponent.js → ConfigComponent.ts} +2 -1
  519. package/src/utils/FormElementMixin.spec.ts +41 -0
  520. package/src/utils/{FormElementMixin.js → FormElementMixin.ts} +65 -29
  521. package/src/utils/InjectedChildMixin.ts +139 -0
  522. package/src/utils/MessageMixin.spec.ts +51 -0
  523. package/src/utils/{MessageMixin.js → MessageMixin.ts} +35 -36
  524. package/src/utils/NoticeMixin.spec.ts +55 -0
  525. package/src/utils/{NoticeMixin.js → NoticeMixin.ts} +33 -23
  526. package/src/utils/ProvideInjectTypes.ts +20 -0
  527. package/src/utils/ProviderParentMixin.ts +105 -0
  528. package/src/utils/SlotComponent.spec.ts +55 -0
  529. package/src/utils/SlotComponent.ts +38 -0
  530. package/src/utils/TabbedChildMixin.ts +96 -0
  531. package/src/utils/TabbedMixin.ts +166 -0
  532. package/src/utils/TabbedTypes.ts +33 -0
  533. package/src/utils/TimepickerMixin.spec.ts +75 -0
  534. package/src/utils/{TimepickerMixin.js → TimepickerMixin.ts} +129 -84
  535. package/src/utils/{color.spec.js → color.spec.ts} +1 -0
  536. package/src/utils/{color.js → color.ts} +119 -54
  537. package/src/utils/{config.spec.js → config.spec.ts} +2 -1
  538. package/src/utils/config.ts +619 -0
  539. package/src/utils/{debounce.spec.js → debounce.spec.ts} +14 -14
  540. package/src/utils/debounce.ts +20 -0
  541. package/src/utils/helpers.spec.ts +257 -0
  542. package/src/utils/helpers.ts +527 -0
  543. package/src/utils/{icons.js → icons.ts} +20 -10
  544. package/src/utils/plugins.ts +20 -0
  545. package/src/utils/vue-augmentation.ts +35 -0
  546. package/dist/cjs/Autocomplete-7a39c5ce.js +0 -673
  547. package/dist/cjs/Button-01827709.js +0 -114
  548. package/dist/cjs/CheckRadioMixin-c910f2ed.js +0 -45
  549. package/dist/cjs/Checkbox-43f54cc7.js +0 -70
  550. package/dist/cjs/Datepicker-abdb3610.js +0 -1679
  551. package/dist/cjs/DropdownItem-422f8c34.js +0 -559
  552. package/dist/cjs/Field-ed10a252.js +0 -322
  553. package/dist/cjs/Icon-78961800.js +0 -189
  554. package/dist/cjs/Image-c4bcd9b3.js +0 -299
  555. package/dist/cjs/InjectedChildMixin-d6bf7f91.js +0 -135
  556. package/dist/cjs/Input-e5a72d97.js +0 -248
  557. package/dist/cjs/Loading-6f2c7075.js +0 -150
  558. package/dist/cjs/MessageMixin-8d959514.js +0 -146
  559. package/dist/cjs/Modal-4cf07210.js +0 -278
  560. package/dist/cjs/NoticeMixin-01121bd2.js +0 -154
  561. package/dist/cjs/Pagination-d6b3fb85.js +0 -413
  562. package/dist/cjs/Select-2b3879bc.js +0 -100
  563. package/dist/cjs/SlotComponent-4fb48389.js +0 -53
  564. package/dist/cjs/TabbedChildMixin-907cad32.js +0 -222
  565. package/dist/cjs/Tag-437f65fb.js +0 -154
  566. package/dist/cjs/Timepicker-99784633.js +0 -67
  567. package/dist/cjs/Tooltip-54c708e5.js +0 -372
  568. package/dist/cjs/_rollupPluginBabelHelpers-8b2e54ad.js +0 -365
  569. package/dist/cjs/index-98143f23.js +0 -1633
  570. package/dist/cjs/plugins-7f41b028.js +0 -94
  571. package/dist/cjs/ssr-20dba236.js +0 -10
  572. package/dist/cjs/trapFocus-261420b0.js +0 -49
  573. package/dist/esm/Autocomplete-1a6e8770.js +0 -671
  574. package/dist/esm/Button-521f6efc.js +0 -112
  575. package/dist/esm/CheckRadioMixin-e726a83c.js +0 -43
  576. package/dist/esm/Checkbox-1d02686e.js +0 -68
  577. package/dist/esm/Datepicker-153e1b03.js +0 -1677
  578. package/dist/esm/DropdownItem-55682322.js +0 -556
  579. package/dist/esm/Field-3cb24eff.js +0 -320
  580. package/dist/esm/FormElementMixin-b223d3c7.js +0 -161
  581. package/dist/esm/Icon-60d47b31.js +0 -187
  582. package/dist/esm/Image-75808acb.js +0 -297
  583. package/dist/esm/InjectedChildMixin-b4220787.js +0 -130
  584. package/dist/esm/Input-20612b63.js +0 -246
  585. package/dist/esm/Loading-ae028ea5.js +0 -148
  586. package/dist/esm/MessageMixin-d577a9f5.js +0 -144
  587. package/dist/esm/Modal-7da7641f.js +0 -276
  588. package/dist/esm/NoticeMixin-bd6f61d9.js +0 -152
  589. package/dist/esm/Pagination-68f12c1e.js +0 -409
  590. package/dist/esm/Select-97781d4e.js +0 -98
  591. package/dist/esm/SlotComponent-8871a20f.js +0 -51
  592. package/dist/esm/TabbedChildMixin-bcb13767.js +0 -219
  593. package/dist/esm/Tag-6365aa46.js +0 -152
  594. package/dist/esm/Timepicker-c1e2bbf4.js +0 -65
  595. package/dist/esm/Tooltip-c67e7511.js +0 -370
  596. package/dist/esm/_rollupPluginBabelHelpers-df313029.js +0 -350
  597. package/dist/esm/index-0698ec02.js +0 -1629
  598. package/dist/esm/plugins-218aea86.js +0 -89
  599. package/dist/esm/ssr-b847d137.js +0 -7
  600. package/dist/esm/trapFocus-f0736873.js +0 -47
  601. package/dist/vetur/attributes.json +0 -3238
  602. package/dist/vetur/tags.json +0 -1183
  603. package/src/components/autocomplete/__snapshots__/Autocomplete.spec.js.snap +0 -10
  604. package/src/components/breadcrumb/BreadcrumbItem.spec.js +0 -25
  605. package/src/components/breadcrumb/__snapshots__/Breadcrumb.spec.js.snap +0 -7
  606. package/src/components/breadcrumb/__snapshots__/BreadcrumbItem.spec.js.snap +0 -3
  607. package/src/components/button/__snapshots__/Button.spec.js.snap +0 -3
  608. package/src/components/carousel/CarouselItem.spec.js +0 -57
  609. package/src/components/carousel/__snapshots__/Carousel.spec.js.snap +0 -12
  610. package/src/components/carousel/__snapshots__/CarouselItem.spec.js.snap +0 -3
  611. package/src/components/carousel/__snapshots__/CarouselList.spec.js.snap +0 -137
  612. package/src/components/checkbox/Checkbox.spec.js +0 -40
  613. package/src/components/checkbox/CheckboxButton.spec.js +0 -46
  614. package/src/components/checkbox/__snapshots__/Checkbox.spec.js.snap +0 -3
  615. package/src/components/checkbox/__snapshots__/CheckboxButton.spec.js.snap +0 -3
  616. package/src/components/clockpicker/Clockpicker.spec.js +0 -97
  617. package/src/components/clockpicker/__snapshots__/Clockpicker.spec.js.snap +0 -19
  618. package/src/components/collapse/__snapshots__/Collapse.spec.js.snap +0 -8
  619. package/src/components/colorpicker/Colorpicker.spec.js +0 -10
  620. package/src/components/colorpicker/__snapshots__/Colorpicker.spec.js.snap +0 -11
  621. package/src/components/colorpicker/__snapshots__/ColorpickerAlphaSlider.spec.js.snap +0 -9
  622. package/src/components/colorpicker/__snapshots__/ColorpickerHSLRepresentationSquare.spec.js.snap +0 -12
  623. package/src/components/datepicker/__snapshots__/Datepicker.spec.js.snap +0 -385
  624. package/src/components/datepicker/__snapshots__/DatepickerMonth.spec.js.snap +0 -33
  625. package/src/components/datepicker/__snapshots__/DatepickerTableRow.spec.js.snap +0 -3
  626. package/src/components/dialog/index.js +0 -77
  627. package/src/components/dropdown/Dropdown.spec.js +0 -218
  628. package/src/components/dropdown/DropdownItem.spec.js +0 -73
  629. package/src/components/dropdown/__snapshots__/Dropdown.spec.js.snap +0 -11
  630. package/src/components/dropdown/__snapshots__/DropdownItem.spec.js.snap +0 -3
  631. package/src/components/field/__snapshots__/Field.spec.js.snap +0 -3
  632. package/src/components/field/__snapshots__/FieldBody.spec.js.snap +0 -3
  633. package/src/components/icon/__snapshots__/Icon.spec.js.snap +0 -3
  634. package/src/components/image/__snapshots__/Image.spec.js.snap +0 -21
  635. package/src/components/input/Input.spec.js +0 -284
  636. package/src/components/input/__snapshots__/Input.spec.js.snap +0 -3
  637. package/src/components/loading/Loading.spec.js +0 -126
  638. package/src/components/loading/__snapshots__/Loading.spec.js.snap +0 -10
  639. package/src/components/loading/index.js +0 -40
  640. package/src/components/menu/Menu.spec.js +0 -19
  641. package/src/components/menu/MenuItem.spec.js +0 -43
  642. package/src/components/menu/MenuList.spec.js +0 -31
  643. package/src/components/menu/__snapshots__/Menu.spec.js.snap +0 -3
  644. package/src/components/menu/__snapshots__/MenuItem.spec.js.snap +0 -3
  645. package/src/components/menu/__snapshots__/MenuList.spec.js.snap +0 -8
  646. package/src/components/message/__snapshots__/Message.spec.js.snap +0 -3
  647. package/src/components/modal/Modal.spec.js +0 -134
  648. package/src/components/modal/__snapshots__/Modal.spec.js.snap +0 -10
  649. package/src/components/modal/index.js +0 -61
  650. package/src/components/navbar/NavBarItem.spec.js +0 -81
  651. package/src/components/navbar/NavbarDropdown.spec.js +0 -35
  652. package/src/components/navbar/__snapshots__/NavBar.spec.js.snap +0 -11
  653. package/src/components/navbar/__snapshots__/NavBarBurger.spec.js.snap +0 -3
  654. package/src/components/navbar/__snapshots__/NavBarItem.spec.js.snap +0 -3
  655. package/src/components/navbar/__snapshots__/NavbarDropdown.spec.js.snap +0 -7
  656. package/src/components/notification/__snapshots__/Notification.spec.js.snap +0 -3
  657. package/src/components/notification/index.js +0 -66
  658. package/src/components/pagination/Pagination.spec.js +0 -86
  659. package/src/components/pagination/__snapshots__/Pagination.spec.js.snap +0 -8
  660. package/src/components/pagination/__snapshots__/PaginationButton.spec.js.snap +0 -3
  661. package/src/components/progress/ProgressBar.spec.js +0 -26
  662. package/src/components/progress/__snapshots__/Progress.spec.js.snap +0 -3
  663. package/src/components/progress/__snapshots__/ProgressBar.spec.js.snap +0 -3
  664. package/src/components/radio/Radio.spec.js +0 -40
  665. package/src/components/radio/RadioButton.spec.js +0 -40
  666. package/src/components/radio/__snapshots__/Radio.spec.js.snap +0 -3
  667. package/src/components/radio/__snapshots__/RadioButton.spec.js.snap +0 -3
  668. package/src/components/select/Select.spec.js +0 -31
  669. package/src/components/select/__snapshots__/Select.spec.js.snap +0 -3
  670. package/src/components/sidebar/__snapshots__/Sidebar.spec.js.snap +0 -17
  671. package/src/components/skeleton/__snapshots__/Skeleton.spec.js.snap +0 -7
  672. package/src/components/skeleton/index.js +0 -17
  673. package/src/components/slider/Slider.spec.js +0 -106
  674. package/src/components/slider/SliderThumb.spec.js +0 -99
  675. package/src/components/slider/SliderTick.spec.js +0 -29
  676. package/src/components/slider/__snapshots__/Slider.spec.js.snap +0 -9
  677. package/src/components/slider/__snapshots__/SliderThumb.spec.js.snap +0 -7
  678. package/src/components/slider/__snapshots__/SliderTick.spec.js.snap +0 -3
  679. package/src/components/snackbar/Snackbar.spec.js +0 -35
  680. package/src/components/snackbar/__snapshots__/Snackbar.spec.js.snap +0 -8
  681. package/src/components/snackbar/index.js +0 -62
  682. package/src/components/steps/StepItem.spec.js +0 -72
  683. package/src/components/steps/Steps.spec.js +0 -134
  684. package/src/components/steps/__snapshots__/StepItem.spec.js.snap +0 -3
  685. package/src/components/steps/__snapshots__/Steps.spec.js.snap +0 -28
  686. package/src/components/switch/Switch.spec.js +0 -74
  687. package/src/components/switch/__snapshots__/Switch.spec.js.snap +0 -3
  688. package/src/components/table/TableMobileSort.spec.js +0 -40
  689. package/src/components/table/__snapshots__/Table.spec.js.snap +0 -16
  690. package/src/components/table/__snapshots__/TableMobileSort.spec.js.snap +0 -9
  691. package/src/components/tabs/TabItem.spec.js +0 -143
  692. package/src/components/tabs/__snapshots__/TabItem.spec.js.snap +0 -3
  693. package/src/components/tabs/__snapshots__/Tabs.spec.js.snap +0 -25
  694. package/src/components/tag/Tag.spec.js +0 -32
  695. package/src/components/tag/Taglist.spec.js +0 -19
  696. package/src/components/tag/__snapshots__/Tag.spec.js.snap +0 -3
  697. package/src/components/tag/__snapshots__/Taglist.spec.js.snap +0 -3
  698. package/src/components/taginput/Taginput.spec.js +0 -92
  699. package/src/components/taginput/__snapshots__/Taginput.spec.js.snap +0 -7
  700. package/src/components/timepicker/Timepicker.spec.js +0 -40
  701. package/src/components/timepicker/__snapshots__/Timepicker.spec.js.snap +0 -259
  702. package/src/components/toast/Toast.spec.js +0 -20
  703. package/src/components/toast/__snapshots__/Toast.spec.js.snap +0 -7
  704. package/src/components/toast/index.js +0 -60
  705. package/src/components/tooltip/Tooltip.spec.js +0 -54
  706. package/src/components/tooltip/__snapshots__/Tooltip.spec.js.snap +0 -8
  707. package/src/components/upload/Upload.spec.js +0 -19
  708. package/src/components/upload/__snapshots__/Upload.spec.js.snap +0 -3
  709. package/src/utils/CheckRadioMixin.js +0 -41
  710. package/src/utils/CheckRadioMixin.spec.js +0 -24
  711. package/src/utils/FormElementMixin.spec.js +0 -41
  712. package/src/utils/InjectedChildMixin.js +0 -36
  713. package/src/utils/MessageMixin.spec.js +0 -52
  714. package/src/utils/NoticeMixin.spec.js +0 -51
  715. package/src/utils/ProviderParentMixin.js +0 -83
  716. package/src/utils/SlotComponent.js +0 -51
  717. package/src/utils/SlotComponent.spec.js +0 -136
  718. package/src/utils/TabbedChildMixin.js +0 -88
  719. package/src/utils/TabbedMixin.js +0 -145
  720. package/src/utils/TimepickerMixin.spec.js +0 -82
  721. package/src/utils/config.js +0 -87
  722. package/src/utils/debounce.js +0 -15
  723. package/src/utils/helpers.js +0 -354
  724. package/src/utils/helpers.spec.js +0 -146
  725. package/src/utils/plugins.js +0 -15
  726. package/types/components.d.ts +0 -443
  727. package/types/helpers.d.ts +0 -5
  728. package/types/index.d.ts +0 -44
  729. /package/src/utils/{ssr.js → ssr.ts} +0 -0
@@ -6,26 +6,32 @@
6
6
  :class="dialogClass"
7
7
  v-trap-focus="trapFocus"
8
8
  :role="ariaRole"
9
- :aria-modal="ariaModal">
10
- <div class="modal-background" @click="cancel('outside')"/>
9
+ :aria-modal="ariaModal"
10
+ >
11
+ <div class="modal-background" @click="cancel('outside')" />
11
12
  <div class="modal-card animation-content">
12
13
  <header class="modal-card-head" v-if="title">
13
- <p class="modal-card-title">{{ title }}</p>
14
+ <p class="modal-card-title">
15
+ {{ title }}
16
+ </p>
14
17
  </header>
15
18
 
16
19
  <section
17
20
  class="modal-card-body"
18
- :class="{ 'is-titleless': !title, 'is-flex': hasIcon }">
21
+ :class="{ 'is-titleless': !title, 'is-flex': hasIcon }"
22
+ >
19
23
  <div class="media">
20
24
  <div
21
25
  class="media-left"
22
- v-if="hasIcon && (icon || iconByType)">
26
+ v-if="hasIcon && (icon || iconByType)"
27
+ >
23
28
  <b-icon
24
- :icon="icon ? icon : iconByType"
29
+ :icon="icon ? icon : iconByType!"
25
30
  :pack="iconPack"
26
31
  :type="type"
27
32
  :both="!icon"
28
- size="is-large"/>
33
+ size="is-large"
34
+ />
29
35
  </div>
30
36
  <div class="media-content">
31
37
  <p>
@@ -33,6 +39,7 @@
33
39
  <slot />
34
40
  </template>
35
41
  <template v-else>
42
+ <!-- eslint-disable-next-line vue/no-v-html -->
36
43
  <div v-html="message" />
37
44
  </template>
38
45
  </p>
@@ -44,12 +51,15 @@
44
51
  class="input"
45
52
  ref="input"
46
53
  :class="{ 'is-danger': validationMessage }"
47
- v-bind="inputAttrs"
54
+ v-bind="safeInputAttrs"
48
55
  @compositionstart="isCompositing = true"
49
56
  @compositionend="isCompositing = false"
50
- @keydown.enter="confirm">
57
+ @keydown.enter="confirm"
58
+ >
51
59
  </div>
52
- <p class="help is-danger">{{ validationMessage }}</p>
60
+ <p class="help is-danger">
61
+ {{ validationMessage }}
62
+ </p>
53
63
  </div>
54
64
  </div>
55
65
  </div>
@@ -60,31 +70,43 @@
60
70
  v-if="showCancel"
61
71
  ref="cancelButton"
62
72
  :disabled="isLoading"
63
- @click="cancel('button')">{{ cancelText }}</b-button>
73
+ @click="cancel('button')"
74
+ >
75
+ {{ cancelText }}
76
+ </b-button>
64
77
  <b-button
65
78
  :type="type"
66
79
  ref="confirmButton"
67
80
  :loading="isLoading"
68
- @click="confirm">{{ confirmText }}</b-button>
81
+ @click="confirm"
82
+ >
83
+ {{ confirmText }}
84
+ </b-button>
69
85
  </footer>
70
86
  </div>
71
87
  </div>
72
88
  </transition>
73
89
  </template>
74
90
 
75
- <script>
91
+ <script lang="ts">
92
+ import { defineComponent } from 'vue'
93
+ import type { PropType } from 'vue'
94
+
76
95
  import trapFocus from '../../directives/trapFocus'
77
- import Icon from '../icon/Icon.vue'
96
+ import BIcon from '../icon/Icon.vue'
78
97
  import Modal from '../modal/Modal.vue'
79
- import Button from '../button/Button.vue'
98
+ import BButton from '../button/Button.vue'
80
99
  import config from '../../utils/config'
81
100
  import { removeElement } from '../../utils/helpers'
101
+ import type { ExtractComponentProps } from '../../utils/helpers'
102
+
103
+ type BButtonInstance = InstanceType<typeof BButton>
82
104
 
83
- export default {
105
+ const Dialog = defineComponent({
84
106
  name: 'BDialog',
85
107
  components: {
86
- [Icon.name]: Icon,
87
- [Button.name]: Button
108
+ BIcon,
109
+ BButton
88
110
  },
89
111
  directives: {
90
112
  trapFocus
@@ -122,8 +144,10 @@ export default {
122
144
  type: Object,
123
145
  default: () => ({})
124
146
  },
125
- onConfirm: {
126
- type: Function,
147
+ confirmCallback: {
148
+ // I was not able to figure out how to specify the "self" type here
149
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
150
+ type: Function as PropType<(value: string, dialog: any) => void>,
127
151
  default: () => {}
128
152
  },
129
153
  closeOnConfirm: {
@@ -139,23 +163,14 @@ export default {
139
163
  focusOn: {
140
164
  type: String,
141
165
  default: 'confirm'
142
- },
143
- trapFocus: {
144
- type: Boolean,
145
- default: () => {
146
- return config.defaultTrapFocus
147
- }
148
- },
149
- ariaRole: {
150
- type: String,
151
- validator: (value) => {
152
- return [
153
- 'dialog',
154
- 'alertdialog'
155
- ].indexOf(value) >= 0
156
- }
157
- },
158
- ariaModal: Boolean
166
+ }
167
+ },
168
+ emits: {
169
+ /* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any */
170
+ // second parameter is the dialog instance but typed any
171
+ // because I was not able to figure out how to specify the "self" type here
172
+ confirm: (value: string, dialog: any) => true
173
+ /* eslint-enable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any */
159
174
  },
160
175
  data() {
161
176
  const prompt = this.hasInput
@@ -171,12 +186,23 @@ export default {
171
186
  }
172
187
  },
173
188
  computed: {
189
+ // `safeInputAttrs` is a shallow copy of `inputAttrs` except for `value`
190
+ // `value` should not be specified to `v-bind` of the input element
191
+ // because it inhibits `v-model` of the input on Vue 3
192
+ safeInputAttrs() {
193
+ const attrs = { ...this.inputAttrs }
194
+ delete attrs.value
195
+ if (typeof attrs.required === 'undefined') {
196
+ attrs.required = true
197
+ }
198
+ return attrs
199
+ },
174
200
  dialogClass() {
175
201
  return [this.size, {
176
202
  'has-custom-container': this.container !== null
177
203
  }]
178
204
  },
179
- /**
205
+ /*
180
206
  * Icon name (MDI) based on the type.
181
207
  */
182
208
  iconByType() {
@@ -198,25 +224,26 @@ export default {
198
224
  }
199
225
  },
200
226
  methods: {
201
- /**
227
+ /*
202
228
  * If it's a prompt Dialog, validate the input.
203
- * Call the onConfirm prop (function) and close the Dialog.
229
+ * Call the confirmCallback prop (function) and close the Dialog.
204
230
  */
205
231
  confirm() {
206
- if (this.$refs.input !== undefined) {
232
+ const input = this.$refs.input as HTMLInputElement
233
+ if (input != null) {
207
234
  if (this.isCompositing) return
208
- if (!this.$refs.input.checkValidity()) {
209
- this.validationMessage = this.$refs.input.validationMessage
210
- this.$nextTick(() => this.$refs.input.select())
235
+ if (!input.checkValidity()) {
236
+ this.validationMessage = input.validationMessage
237
+ this.$nextTick(() => input.select())
211
238
  return
212
239
  }
213
240
  }
214
- this.$emit('confirm', this.prompt)
215
- this.onConfirm(this.prompt, this)
241
+ this.$emit('confirm', this.prompt, this)
242
+ this.confirmCallback(this.prompt, this)
216
243
  if (this.closeOnConfirm) this.close()
217
244
  },
218
245
 
219
- /**
246
+ /*
220
247
  * Close the Dialog.
221
248
  */
222
249
  close() {
@@ -224,19 +251,18 @@ export default {
224
251
  this.isLoading = false
225
252
  // Timeout for the animation complete before destroying
226
253
  setTimeout(() => {
227
- this.$destroy()
228
254
  removeElement(this.$el)
229
255
  }, 150)
230
256
  },
231
257
 
232
- /**
258
+ /*
233
259
  * Start the Loading.
234
260
  */
235
261
  startLoading() {
236
262
  this.isLoading = true
237
263
  },
238
264
 
239
- /**
265
+ /*
240
266
  * Cancel the Loading.
241
267
  */
242
268
  cancelLoading() {
@@ -255,20 +281,20 @@ export default {
255
281
  mounted() {
256
282
  this.isActive = true
257
283
 
258
- if (typeof this.inputAttrs.required === 'undefined') {
259
- this.$set(this.inputAttrs, 'required', true)
260
- }
261
-
262
284
  this.$nextTick(() => {
263
285
  // Handle which element receives focus
264
286
  if (this.hasInput) {
265
- this.$refs.input.focus()
287
+ (this.$refs.input as HTMLInputElement).focus()
266
288
  } else if (this.focusOn === 'cancel' && this.showCancel) {
267
- this.$refs.cancelButton.$el.focus()
289
+ (this.$refs.cancelButton as BButtonInstance).$el.focus()
268
290
  } else {
269
- this.$refs.confirmButton.$el.focus()
291
+ (this.$refs.confirmButton as BButtonInstance).$el.focus()
270
292
  }
271
293
  })
272
294
  }
273
- }
295
+ })
296
+
297
+ export type DialogProps = ExtractComponentProps<typeof Dialog>
298
+
299
+ export default Dialog
274
300
  </script>
@@ -0,0 +1,169 @@
1
+ import { createApp, h as createElement } from 'vue'
2
+ import type { App, ComponentPublicInstance } from 'vue'
3
+
4
+ import Dialog from './Dialog.vue'
5
+ import type { DialogProps } from './Dialog.vue'
6
+
7
+ import config from '../../utils/config'
8
+ import type { ModalCancellableOption } from '../../utils/config'
9
+ import { copyAppContext, getComponentFromVNode } from '../../utils/helpers'
10
+ import { registerComponent, registerComponentProgrammatic } from '../../utils/plugins'
11
+
12
+ type DialogInstance = InstanceType<typeof Dialog>
13
+
14
+ export type DialogOpenParams = Omit<
15
+ DialogProps,
16
+ 'programmatic' | 'cancelCallback' | 'confirmCallback'
17
+ > & {
18
+ onConfirm?: (value: string, dialog: DialogInstance) => void
19
+ onCancel?: (method: ModalCancellableOption) => void
20
+ }
21
+
22
+ // Minimal definition of a programmatically opened dialog.
23
+ //
24
+ // ESLint does not like `{}` as a type but allowed here to make them look
25
+ // similar to Vue's definition.
26
+ /* eslint-disable @typescript-eslint/ban-types */
27
+ type DialogProgrammaticInstance = ComponentPublicInstance<
28
+ {}, // P
29
+ {}, // B
30
+ {}, // D
31
+ {}, // C
32
+ { close: () => void } // M
33
+ >
34
+
35
+ function open(propsData: DialogProps, app?: App) {
36
+ let slot: DialogProps['message']
37
+ if (Array.isArray(propsData.message)) {
38
+ slot = propsData.message
39
+ delete propsData.message
40
+ }
41
+ function createDialog(
42
+ onConfirm?: (value: string) => void,
43
+ onCancel?: (method: ModalCancellableOption) => void
44
+ ) {
45
+ const container = document.createElement('div')
46
+ // Vue 3 requires a new app to mount another component
47
+ const vueInstance = createApp({
48
+ data() {
49
+ return {
50
+ dialogVNode: null
51
+ }
52
+ },
53
+ methods: {
54
+ close() {
55
+ const dialog = getComponentFromVNode(this.dialogVNode)
56
+ if (dialog) {
57
+ (dialog as DialogInstance).close()
58
+ }
59
+ },
60
+ startLoading() {
61
+ const dialog = getComponentFromVNode(this.dialogVNode)
62
+ if (dialog) {
63
+ (dialog as DialogInstance).startLoading()
64
+ }
65
+ },
66
+ cancelLoading() {
67
+ const dialog = getComponentFromVNode(this.dialogVNode)
68
+ if (dialog) {
69
+ (dialog as DialogInstance).cancelLoading()
70
+ }
71
+ }
72
+ },
73
+ render() {
74
+ this.dialogVNode = createElement(
75
+ Dialog,
76
+ {
77
+ ...propsData,
78
+ // intentionally overrides propsData.onConfirm
79
+ // to prevent propsData.onConfirm from receiving a "confirm" event
80
+ onConfirm: (value: string) => {
81
+ if (onConfirm != null) {
82
+ onConfirm(value)
83
+ }
84
+ },
85
+ // intentionally override propsData.onCancel
86
+ // to prevent propsData.onCancel from receiving a "cancel" event
87
+ onCancel: (method: ModalCancellableOption) => {
88
+ if (onCancel != null) {
89
+ onCancel(method)
90
+ }
91
+ vueInstance.unmount()
92
+ },
93
+ confirmCallback: (value: string, dialog: DialogInstance) => {
94
+ if (propsData.onConfirm != null) {
95
+ propsData.onConfirm(value, dialog)
96
+ }
97
+ },
98
+ cancelCallback: (method: ModalCancellableOption) => {
99
+ if (propsData.onCancel != null) {
100
+ propsData.onCancel(method)
101
+ }
102
+ }
103
+ },
104
+ slot ? { default: () => slot } : undefined
105
+ )
106
+ return this.dialogVNode
107
+ }
108
+ })
109
+ if (app) {
110
+ copyAppContext(app, vueInstance)
111
+ }
112
+ return vueInstance.mount(container) as DialogProgrammaticInstance
113
+ }
114
+ if (!config.defaultProgrammaticPromise) {
115
+ return createDialog()
116
+ } else {
117
+ return new Promise((resolve) => {
118
+ const dialog = createDialog(
119
+ (event) => resolve({ result: event || true, dialog }),
120
+ () => resolve({ result: false, dialog }))
121
+ })
122
+ }
123
+ }
124
+
125
+ class DialogProgrammatic {
126
+ private app: App | undefined
127
+
128
+ constructor(app?: App) {
129
+ this.app = app // may be undefined in the testing environment
130
+ }
131
+
132
+ alert(params: string | DialogOpenParams) {
133
+ let newParams: DialogOpenParams
134
+ if (typeof params === 'string') {
135
+ newParams = {
136
+ message: params
137
+ }
138
+ } else {
139
+ newParams = params
140
+ }
141
+ newParams = {
142
+ canCancel: false,
143
+ ...newParams
144
+ }
145
+ return open(newParams, this.app)
146
+ }
147
+
148
+ confirm(params: DialogOpenParams) {
149
+ return open(params, this.app)
150
+ }
151
+
152
+ prompt(params: DialogOpenParams) {
153
+ return open({ hasInput: true, ...params }, this.app)
154
+ }
155
+ }
156
+
157
+ const Plugin = {
158
+ install(Vue: App) {
159
+ registerComponent(Vue, Dialog)
160
+ registerComponentProgrammatic(Vue, 'dialog', new DialogProgrammatic(Vue))
161
+ }
162
+ }
163
+
164
+ export default Plugin
165
+
166
+ export {
167
+ DialogProgrammatic,
168
+ Dialog as BDialog
169
+ }
@@ -0,0 +1,229 @@
1
+ import { beforeEach, describe, expect, it, vi } from 'vitest'
2
+ import { shallowMount } from '@vue/test-utils'
3
+ import type { VueWrapper } from '@vue/test-utils'
4
+ import BDropdown from '@components/dropdown/Dropdown.vue'
5
+
6
+ describe('BDropdown', () => {
7
+ const val1 = 'val1'
8
+ const val2 = 'val2'
9
+ let wrapper: VueWrapper<InstanceType<typeof BDropdown>>
10
+
11
+ beforeEach(() => {
12
+ wrapper = shallowMount(BDropdown, {
13
+ slots: {
14
+ trigger: '<button class="trigger">trigger</button>'
15
+ }
16
+ })
17
+ })
18
+
19
+ it('is called', () => {
20
+ expect(wrapper.vm).toBeTruthy()
21
+ expect(wrapper.vm.$options.name).toBe('BDropdown')
22
+ })
23
+
24
+ it('render correctly', () => {
25
+ expect(wrapper.html()).toMatchSnapshot()
26
+ })
27
+
28
+ it('manage props validator', () => {
29
+ const position = wrapper.vm.$options.props.position
30
+
31
+ expect(position.type).toBe(String)
32
+ expect(position.validator && position.validator('is-top')).toBeFalsy()
33
+ expect(position.validator && position.validator('is-top-left')).toBeTruthy()
34
+ expect(position.validator && position.validator('is-top-right')).toBeTruthy()
35
+ expect(position.validator && position.validator('is-bottom-left')).toBeTruthy()
36
+ })
37
+
38
+ it('react accordingly when changing v-model', async () => {
39
+ const value = 'value'
40
+ await wrapper.setProps({ modelValue: value })
41
+ expect(wrapper.vm.selected).toBe(value)
42
+ })
43
+
44
+ it('emit activity when it changes', async () => {
45
+ wrapper.vm.updateAppendToBody = vi.fn(() => wrapper.vm.updateAppendToBody)
46
+ await wrapper.setProps({ appendToBody: true })
47
+
48
+ await wrapper.setData({ isActive: true })
49
+ expect(wrapper.emitted()['active-change']).toBeTruthy()
50
+
51
+ await wrapper.vm.$nextTick()
52
+ expect(wrapper.vm.updateAppendToBody).toHaveBeenCalled()
53
+ })
54
+
55
+ it('react accordingly on mouse over', async () => {
56
+ const trigger = wrapper.find({ ref: 'trigger' })
57
+ trigger.trigger('mouseenter')
58
+ expect(wrapper.vm.isHoverable).toBeFalsy()
59
+
60
+ await wrapper.setProps({ triggers: ['hover'] })
61
+ trigger.trigger('mouseenter')
62
+ expect(wrapper.vm.isHoverable).toBeTruthy()
63
+ })
64
+
65
+ it('react accordingly when new item is selected', async () => {
66
+ wrapper.vm.selectItem(val1)
67
+ expect(wrapper.emitted()['update:modelValue']).toHaveLength(1)
68
+ expect(wrapper.emitted()['update:modelValue'][0]).toEqual([val1])
69
+ expect(wrapper.emitted().change).toHaveLength(1)
70
+ expect(wrapper.emitted().change[0]).toEqual([val1])
71
+
72
+ await wrapper.setProps({
73
+ triggers: ['hover'],
74
+ closeOnClick: true
75
+ })
76
+
77
+ wrapper.vm.selectItem(val2)
78
+ expect(wrapper.emitted()['update:modelValue']).toHaveLength(2)
79
+ expect(wrapper.emitted()['update:modelValue'][1]).toEqual([val2])
80
+ expect(wrapper.emitted().change).toHaveLength(2)
81
+ expect(wrapper.emitted().change[1]).toEqual([val2])
82
+
83
+ expect(wrapper.vm.isHoverable).toBeFalsy()
84
+ })
85
+
86
+ it('react accordingly when same item is selected', async () => {
87
+ // will emit only input event
88
+ await wrapper.setProps({ modelValue: val1 })
89
+ wrapper.vm.selectItem(val1)
90
+ expect(wrapper.emitted()['update:modelValue']).toHaveLength(1)
91
+ expect(wrapper.emitted()['update:modelValue'][0]).toEqual([val1])
92
+ expect(wrapper.emitted().change).toBeUndefined()
93
+ })
94
+
95
+ it('react accordingly when an item is selected with multiple prop', async () => {
96
+ await wrapper.setProps({
97
+ multiple: true
98
+ })
99
+ await wrapper.setData({
100
+ selected: null
101
+ })
102
+
103
+ // no initial value, will return an array with the only selected option
104
+ wrapper.vm.selectItem(val1)
105
+ expect(wrapper.emitted()['update:modelValue']).toHaveLength(1)
106
+ expect(wrapper.emitted()['update:modelValue'][0]).toEqual([[val1]])
107
+ expect(wrapper.emitted().change).toHaveLength(1)
108
+ expect(wrapper.emitted().change[0]).toEqual([[val1]])
109
+
110
+ // will return an array with the new value appended
111
+ await wrapper.setProps({ modelValue: [val1] })
112
+ wrapper.vm.selectItem(val2)
113
+ expect(wrapper.emitted()['update:modelValue']).toHaveLength(2)
114
+ expect(wrapper.emitted()['update:modelValue'][1]).toEqual([[val1, val2]])
115
+ expect(wrapper.emitted().change).toHaveLength(2)
116
+ expect(wrapper.emitted().change[1]).toEqual([[val1, val2]])
117
+
118
+ // will remove the last selection since it was part of the list
119
+ await wrapper.setProps({ modelValue: [val1, val2] })
120
+ wrapper.vm.selectItem(val2)
121
+ expect(wrapper.emitted()['update:modelValue']).toHaveLength(3)
122
+ expect(wrapper.emitted()['update:modelValue'][2]).toEqual([[val1]])
123
+ expect(wrapper.emitted().change).toHaveLength(3)
124
+ expect(wrapper.emitted().change[2]).toEqual([[val1]])
125
+ })
126
+
127
+ it('manage the whitelisted items accordingly', () => {
128
+ let el = wrapper.vm.$refs.dropdownMenu as Element
129
+ expect(wrapper.vm.isInWhiteList(el)).toBeTruthy()
130
+
131
+ el = (wrapper.vm.$refs.dropdownMenu as Element).querySelector('.dropdown-content')!
132
+ expect(wrapper.vm.isInWhiteList(el)).toBeTruthy()
133
+
134
+ el = wrapper.vm.$refs.trigger as Element
135
+ expect(wrapper.vm.isInWhiteList(el)).toBeTruthy()
136
+
137
+ el = (wrapper.vm.$refs.trigger as Element).querySelector('.trigger')!
138
+ expect(wrapper.vm.isInWhiteList(el)).toBeTruthy()
139
+
140
+ el = document.createElement('div')
141
+ expect(wrapper.vm.isInWhiteList(el)).toBeFalsy()
142
+ })
143
+
144
+ it('manage the whitelisted items accordingly without trigger (inline)', async () => {
145
+ const trigger = wrapper.vm.$refs.trigger as Element
146
+ expect(trigger).toBeTruthy()
147
+ const triggerEl = trigger.querySelector('.trigger')
148
+ expect(triggerEl).toBeTruthy()
149
+
150
+ await wrapper.setProps({ inline: true })
151
+ expect(wrapper.vm.$refs.trigger).toBeFalsy()
152
+
153
+ expect(wrapper.vm.isInWhiteList(trigger)).toBeFalsy()
154
+ expect(wrapper.vm.isInWhiteList(triggerEl)).toBeFalsy()
155
+
156
+ const el = document.createElement('div')
157
+ expect(wrapper.vm.isInWhiteList(el)).toBeFalsy()
158
+ })
159
+
160
+ it('manage clicking outside accordingly', async () => {
161
+ const el = document.createElement('div')
162
+ const event = new Event('click')
163
+ vi.spyOn(event, 'target', 'get').mockReturnValue(el)
164
+
165
+ await wrapper.setData({ isActive: true })
166
+ wrapper.vm.clickedOutside(event)
167
+ expect(wrapper.vm.isActive).toBeFalsy()
168
+
169
+ await wrapper.setData({ isActive: true })
170
+ const event2 = new Event('click')
171
+ vi.spyOn(event2, 'target', 'get').mockReturnValue(wrapper.vm.$refs.trigger as Element)
172
+ wrapper.vm.clickedOutside(event2)
173
+ expect(wrapper.vm.isActive).toBeTruthy()
174
+
175
+ await wrapper.setData({ isActive: true })
176
+ await wrapper.setProps({ inline: true })
177
+ wrapper.vm.clickedOutside(event)
178
+ expect(wrapper.vm.isActive).toBeTruthy()
179
+
180
+ await wrapper.setData({ isActive: true })
181
+ await wrapper.setProps({ canClose: false })
182
+ wrapper.vm.clickedOutside(event)
183
+ expect(wrapper.vm.isActive).toBeTruthy()
184
+ })
185
+
186
+ it('close on escape', async () => {
187
+ await wrapper.setData({ isActive: true })
188
+ const event = new KeyboardEvent('keyup', { key: 'Escape' })
189
+ wrapper.vm.keyPress({})
190
+ wrapper.vm.keyPress(event)
191
+ expect(wrapper.vm.isActive).toBeFalsy()
192
+
193
+ await wrapper.setData({ isActive: true })
194
+ await wrapper.setProps({ canClose: ['click'] })
195
+ wrapper.vm.keyPress(event)
196
+ expect(wrapper.vm.isActive).toBeTruthy()
197
+ })
198
+
199
+ it('manage toggle function accordingly', async () => {
200
+ await wrapper.setData({ isActive: true })
201
+ await wrapper.setProps({ disabled: true })
202
+ wrapper.vm.toggle()
203
+ expect(wrapper.vm.isActive).toBeTruthy()
204
+
205
+ await wrapper.setProps({ disabled: false })
206
+ wrapper.vm.toggle()
207
+ expect(wrapper.vm.isActive).toBeFalsy()
208
+
209
+ vi.useFakeTimers()
210
+ vi.spyOn(global, 'setTimeout')
211
+ await wrapper.setData({ isActive: false })
212
+ wrapper.vm.toggle()
213
+ await wrapper.vm.$nextTick()
214
+ expect(setTimeout).toHaveBeenCalled()
215
+ expect(wrapper.vm.isActive).toBeFalsy()
216
+ vi.advanceTimersByTime(1)
217
+ expect(wrapper.vm.isActive).toBeTruthy()
218
+ vi.useRealTimers()
219
+ })
220
+
221
+ it('reset events before destroy', () => {
222
+ document.removeEventListener = vi.fn()
223
+
224
+ wrapper.unmount()
225
+
226
+ expect(document.removeEventListener).toBeCalledWith('click', expect.any(Function))
227
+ expect(document.removeEventListener).toBeCalledWith('keyup', expect.any(Function))
228
+ })
229
+ })