buefy 1.0.0 → 1.0.2

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 (588) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +242 -0
  3. package/dist/buefy.css +15895 -0
  4. package/dist/buefy.d.ts +11706 -0
  5. package/dist/buefy.esm.js +21082 -0
  6. package/dist/buefy.esm.min.js +2 -0
  7. package/dist/buefy.js +21227 -0
  8. package/dist/buefy.min.css +1 -0
  9. package/dist/buefy.min.js +2 -0
  10. package/dist/cjs/Autocomplete-BMmOsPiK.js +864 -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-DavX4iOv.js +170 -0
  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-C9WVvcUL.js +666 -0
  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 +23 -0
  39. package/dist/cjs/breadcrumb.js +107 -0
  40. package/dist/cjs/button.js +20 -0
  41. package/dist/cjs/carousel.js +825 -0
  42. package/dist/cjs/checkbox.js +88 -0
  43. package/dist/cjs/clockpicker.js +668 -0
  44. package/dist/cjs/collapse.js +99 -0
  45. package/dist/cjs/colorpicker.js +25 -0
  46. package/dist/cjs/config-DR826Ki2.js +103 -0
  47. package/dist/cjs/config.js +18 -0
  48. package/dist/cjs/datepicker.js +28 -0
  49. package/dist/cjs/datetimepicker.js +483 -0
  50. package/dist/cjs/dialog.js +506 -0
  51. package/dist/cjs/dropdown.js +23 -0
  52. package/dist/cjs/field.js +19 -0
  53. package/dist/cjs/helpers.js +276 -0
  54. package/dist/cjs/icon.js +19 -0
  55. package/dist/cjs/image.js +19 -0
  56. package/dist/cjs/index-DiQy3SCb.js +1942 -0
  57. package/dist/cjs/index.js +274 -0
  58. package/dist/cjs/input.js +22 -0
  59. package/dist/cjs/loading.js +87 -0
  60. package/dist/cjs/menu.js +340 -0
  61. package/dist/cjs/message.js +119 -0
  62. package/dist/cjs/modal.js +103 -0
  63. package/dist/cjs/navbar.js +572 -0
  64. package/dist/cjs/notification.js +281 -0
  65. package/dist/cjs/numberinput.js +386 -0
  66. package/dist/cjs/pagination.js +22 -0
  67. package/dist/cjs/plugins-DbyYGVpp.js +16 -0
  68. package/dist/cjs/progress.js +91 -0
  69. package/dist/cjs/radio.js +137 -0
  70. package/dist/cjs/rate.js +197 -0
  71. package/dist/cjs/select.js +22 -0
  72. package/dist/cjs/sidebar.js +309 -0
  73. package/dist/cjs/skeleton.js +78 -0
  74. package/dist/cjs/slider.js +699 -0
  75. package/dist/cjs/snackbar.js +224 -0
  76. package/dist/cjs/ssr-DVRFTu_P.js +8 -0
  77. package/dist/cjs/steps.js +347 -0
  78. package/dist/cjs/switch.js +161 -0
  79. package/dist/cjs/table.js +2391 -0
  80. package/dist/cjs/tabs.js +258 -0
  81. package/dist/cjs/tag.js +44 -0
  82. package/dist/cjs/taginput.js +425 -0
  83. package/dist/cjs/timepicker.js +29 -0
  84. package/dist/cjs/toast.js +162 -0
  85. package/dist/cjs/tooltip.js +19 -0
  86. package/dist/cjs/trapFocus-BlX6xykt.js +53 -0
  87. package/dist/cjs/upload.js +195 -0
  88. package/dist/components/autocomplete/index.js +1647 -0
  89. package/dist/components/autocomplete/index.min.js +2 -0
  90. package/dist/components/breadcrumb/index.js +173 -0
  91. package/dist/components/breadcrumb/index.min.js +2 -0
  92. package/dist/components/button/index.js +334 -0
  93. package/dist/components/button/index.min.js +2 -0
  94. package/dist/components/carousel/index.js +1534 -0
  95. package/dist/components/carousel/index.min.js +2 -0
  96. package/dist/components/checkbox/index.js +236 -0
  97. package/dist/components/checkbox/index.min.js +2 -0
  98. package/dist/components/clockpicker/index.js +2636 -0
  99. package/dist/components/clockpicker/index.min.js +2 -0
  100. package/dist/components/collapse/index.js +111 -0
  101. package/dist/components/collapse/index.min.js +2 -0
  102. package/dist/components/colorpicker/index.js +4251 -0
  103. package/dist/components/colorpicker/index.min.js +2 -0
  104. package/dist/components/datepicker/index.js +4110 -0
  105. package/dist/components/datepicker/index.min.js +2 -0
  106. package/dist/components/datetimepicker/index.js +5479 -0
  107. package/dist/components/datetimepicker/index.min.js +2 -0
  108. package/dist/components/dialog/index.js +1202 -0
  109. package/dist/components/dialog/index.min.js +2 -0
  110. package/dist/components/dropdown/index.js +680 -0
  111. package/dist/components/dropdown/index.min.js +2 -0
  112. package/dist/components/field/index.js +439 -0
  113. package/dist/components/field/index.min.js +2 -0
  114. package/dist/components/icon/index.js +212 -0
  115. package/dist/components/icon/index.min.js +2 -0
  116. package/dist/components/image/index.js +396 -0
  117. package/dist/components/image/index.min.js +2 -0
  118. package/dist/components/input/index.js +764 -0
  119. package/dist/components/input/index.min.js +2 -0
  120. package/dist/components/loading/index.js +280 -0
  121. package/dist/components/loading/index.min.js +2 -0
  122. package/dist/components/menu/index.js +586 -0
  123. package/dist/components/menu/index.min.js +2 -0
  124. package/dist/components/message/index.js +611 -0
  125. package/dist/components/message/index.min.js +2 -0
  126. package/dist/components/modal/index.js +516 -0
  127. package/dist/components/modal/index.min.js +2 -0
  128. package/dist/components/navbar/index.js +634 -0
  129. package/dist/components/navbar/index.min.js +2 -0
  130. package/dist/components/notification/index.js +976 -0
  131. package/dist/components/notification/index.min.js +2 -0
  132. package/dist/components/numberinput/index.js +1128 -0
  133. package/dist/components/numberinput/index.min.js +2 -0
  134. package/dist/components/pagination/index.js +764 -0
  135. package/dist/components/pagination/index.min.js +2 -0
  136. package/dist/components/progress/index.js +280 -0
  137. package/dist/components/progress/index.min.js +2 -0
  138. package/dist/components/radio/index.js +208 -0
  139. package/dist/components/radio/index.min.js +2 -0
  140. package/dist/components/rate/index.js +391 -0
  141. package/dist/components/rate/index.min.js +2 -0
  142. package/dist/components/select/index.js +560 -0
  143. package/dist/components/select/index.min.js +2 -0
  144. package/dist/components/sidebar/index.js +337 -0
  145. package/dist/components/sidebar/index.min.js +2 -0
  146. package/dist/components/skeleton/index.js +87 -0
  147. package/dist/components/skeleton/index.min.js +2 -0
  148. package/dist/components/slider/index.js +1171 -0
  149. package/dist/components/slider/index.min.js +2 -0
  150. package/dist/components/snackbar/index.js +439 -0
  151. package/dist/components/snackbar/index.min.js +2 -0
  152. package/dist/components/steps/index.js +925 -0
  153. package/dist/components/steps/index.min.js +2 -0
  154. package/dist/components/switch/index.js +182 -0
  155. package/dist/components/switch/index.min.js +2 -0
  156. package/dist/components/table/index.js +4208 -0
  157. package/dist/components/table/index.min.js +2 -0
  158. package/dist/components/tabs/index.js +837 -0
  159. package/dist/components/tabs/index.min.js +2 -0
  160. package/dist/components/tag/index.js +396 -0
  161. package/dist/components/tag/index.min.js +2 -0
  162. package/dist/components/taginput/index.js +2209 -0
  163. package/dist/components/taginput/index.min.js +2 -0
  164. package/dist/components/timepicker/index.js +2906 -0
  165. package/dist/components/timepicker/index.min.js +2 -0
  166. package/dist/components/toast/index.js +377 -0
  167. package/dist/components/toast/index.min.js +2 -0
  168. package/dist/components/tooltip/index.js +445 -0
  169. package/dist/components/tooltip/index.min.js +2 -0
  170. package/dist/components/upload/index.js +426 -0
  171. package/dist/components/upload/index.min.js +2 -0
  172. package/dist/esm/Autocomplete-CjbTh9D8.js +862 -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-Bikh6_Fg.js +664 -0
  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 +18 -0
  201. package/dist/esm/breadcrumb.js +101 -0
  202. package/dist/esm/button.js +15 -0
  203. package/dist/esm/carousel.js +818 -0
  204. package/dist/esm/checkbox.js +82 -0
  205. package/dist/esm/clockpicker.js +663 -0
  206. package/dist/esm/collapse.js +94 -0
  207. package/dist/esm/colorpicker.js +16 -0
  208. package/dist/esm/config-CKuo-p6e.js +100 -0
  209. package/dist/esm/config.js +14 -0
  210. package/dist/esm/datepicker.js +23 -0
  211. package/dist/esm/datetimepicker.js +478 -0
  212. package/dist/esm/dialog.js +500 -0
  213. package/dist/esm/dropdown.js +17 -0
  214. package/dist/esm/field.js +14 -0
  215. package/dist/esm/helpers.js +247 -0
  216. package/dist/esm/icon.js +14 -0
  217. package/dist/esm/image.js +14 -0
  218. package/dist/esm/index-CQegEsxK.js +1938 -0
  219. package/dist/esm/index.js +164 -0
  220. package/dist/esm/input.js +17 -0
  221. package/dist/esm/loading.js +81 -0
  222. package/dist/esm/menu.js +333 -0
  223. package/dist/esm/message.js +114 -0
  224. package/dist/esm/modal.js +97 -0
  225. package/dist/esm/navbar.js +565 -0
  226. package/dist/esm/notification.js +275 -0
  227. package/dist/esm/numberinput.js +381 -0
  228. package/dist/esm/pagination.js +16 -0
  229. package/dist/esm/plugins-B172kuKE.js +13 -0
  230. package/dist/esm/progress.js +85 -0
  231. package/dist/esm/radio.js +131 -0
  232. package/dist/esm/rate.js +192 -0
  233. package/dist/esm/select.js +17 -0
  234. package/dist/esm/sidebar.js +304 -0
  235. package/dist/esm/skeleton.js +73 -0
  236. package/dist/esm/slider.js +693 -0
  237. package/dist/esm/snackbar.js +218 -0
  238. package/dist/esm/ssr-C7yEpGLm.js +5 -0
  239. package/dist/esm/steps.js +341 -0
  240. package/dist/esm/switch.js +156 -0
  241. package/dist/esm/table.js +2385 -0
  242. package/dist/esm/tabs.js +252 -0
  243. package/dist/esm/tag.js +38 -0
  244. package/dist/esm/taginput.js +420 -0
  245. package/dist/esm/timepicker.js +24 -0
  246. package/dist/esm/toast.js +156 -0
  247. package/dist/esm/tooltip.js +14 -0
  248. package/dist/esm/trapFocus-KHP_kCNE.js +51 -0
  249. package/dist/esm/upload.js +190 -0
  250. package/dist/tsdoc-metadata.json +11 -0
  251. package/package.json +73 -6
  252. package/src/components/autocomplete/Autocomplete.spec.ts +783 -0
  253. package/src/components/autocomplete/Autocomplete.vue +966 -0
  254. package/src/components/autocomplete/__snapshots__/Autocomplete.spec.ts.snap +21 -0
  255. package/src/components/autocomplete/index.ts +16 -0
  256. package/src/components/breadcrumb/Breadcrumb.spec.ts +65 -0
  257. package/src/components/breadcrumb/Breadcrumb.vue +42 -0
  258. package/src/components/breadcrumb/BreadcrumbItem.spec.ts +74 -0
  259. package/src/components/breadcrumb/BreadcrumbItem.vue +34 -0
  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.ts +19 -0
  263. package/src/components/button/Button.spec.ts +117 -0
  264. package/src/components/button/Button.vue +112 -0
  265. package/src/components/button/__snapshots__/Button.spec.ts.snap +9 -0
  266. package/src/components/button/index.ts +16 -0
  267. package/src/components/carousel/Carousel.spec.ts +304 -0
  268. package/src/components/carousel/Carousel.vue +389 -0
  269. package/src/components/carousel/CarouselItem.spec.ts +105 -0
  270. package/src/components/carousel/CarouselItem.vue +38 -0
  271. package/src/components/carousel/CarouselList.spec.ts +172 -0
  272. package/src/components/carousel/CarouselList.vue +364 -0
  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.ts +23 -0
  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 +63 -0
  280. package/src/components/checkbox/CheckboxButton.spec.ts +46 -0
  281. package/src/components/checkbox/CheckboxButton.vue +59 -0
  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.ts +20 -0
  285. package/src/components/clockpicker/Clockpicker.spec.ts +161 -0
  286. package/src/components/clockpicker/Clockpicker.vue +311 -0
  287. package/src/components/clockpicker/ClockpickerFace.spec.ts +99 -0
  288. package/src/components/clockpicker/ClockpickerFace.vue +272 -0
  289. package/src/components/clockpicker/__snapshots__/Clockpicker.spec.ts.snap +36 -0
  290. package/src/components/clockpicker/__snapshots__/ClockpickerFace.spec.ts.snap +9 -0
  291. package/src/components/clockpicker/index.ts +16 -0
  292. package/src/components/collapse/Collapse.spec.ts +106 -0
  293. package/src/components/collapse/Collapse.vue +98 -0
  294. package/src/components/collapse/__snapshots__/Collapse.spec.ts.snap +10 -0
  295. package/src/components/collapse/index.ts +16 -0
  296. package/src/components/colorpicker/Colorpicker.spec.ts +22 -0
  297. package/src/components/colorpicker/Colorpicker.vue +416 -0
  298. package/src/components/colorpicker/ColorpickerAlphaSlider.spec.ts +17 -0
  299. package/src/components/colorpicker/ColorpickerAlphaSlider.vue +205 -0
  300. package/src/components/colorpicker/ColorpickerHSLRepresentationSquare.spec.ts +23 -0
  301. package/src/components/colorpicker/ColorpickerHSLRepresentationSquare.vue +380 -0
  302. package/src/components/colorpicker/ColorpickerHSLRepresentationTriangle.spec.ts +23 -0
  303. package/src/components/colorpicker/ColorpickerHSLRepresentationTriangle.vue +456 -0
  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.ts.snap +36 -0
  308. package/src/components/colorpicker/index.ts +16 -0
  309. package/src/components/datepicker/Datepicker.spec.ts +482 -0
  310. package/src/components/datepicker/Datepicker.vue +908 -0
  311. package/src/components/datepicker/DatepickerMonth.spec.ts +346 -0
  312. package/src/components/datepicker/DatepickerMonth.vue +444 -0
  313. package/src/components/datepicker/DatepickerTable.spec.ts +290 -0
  314. package/src/components/datepicker/DatepickerTable.vue +398 -0
  315. package/src/components/datepicker/DatepickerTableRow.spec.ts +300 -0
  316. package/src/components/datepicker/DatepickerTableRow.vue +416 -0
  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.ts.snap +16 -0
  320. package/src/components/datepicker/__snapshots__/DatepickerTableRow.spec.ts.snap +23 -0
  321. package/src/components/datepicker/index.ts +17 -0
  322. package/src/components/datepicker/types.ts +41 -0
  323. package/src/components/datetimepicker/Datetimepicker.spec.ts +132 -0
  324. package/src/components/datetimepicker/Datetimepicker.vue +491 -0
  325. package/src/components/datetimepicker/index.ts +16 -0
  326. package/src/components/dialog/Dialog.spec.ts +108 -0
  327. package/src/components/dialog/Dialog.vue +300 -0
  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 +491 -0
  331. package/src/components/dropdown/DropdownItem.spec.ts +78 -0
  332. package/src/components/dropdown/DropdownItem.vue +112 -0
  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.ts +20 -0
  336. package/src/components/field/Field.spec.ts +324 -0
  337. package/src/components/field/Field.vue +316 -0
  338. package/src/components/field/FieldBody.spec.ts +96 -0
  339. package/src/components/field/FieldBody.vue +74 -0
  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.ts +16 -0
  343. package/src/components/icon/Icon.spec.ts +142 -0
  344. package/src/components/icon/Icon.vue +120 -0
  345. package/src/components/icon/__snapshots__/Icon.spec.ts.snap +3 -0
  346. package/src/components/icon/index.ts +17 -0
  347. package/src/components/image/Image.spec.ts +218 -0
  348. package/src/components/image/Image.vue +358 -0
  349. package/src/components/image/__snapshots__/Image.spec.ts.snap +37 -0
  350. package/src/components/image/index.ts +16 -0
  351. package/src/components/index.ts +179 -0
  352. package/src/components/input/Input.spec.ts +396 -0
  353. package/src/components/input/Input.vue +335 -0
  354. package/src/components/input/__snapshots__/Input.spec.ts.snap +9 -0
  355. package/src/components/input/index.ts +17 -0
  356. package/src/components/loading/Loading.spec.ts +151 -0
  357. package/src/components/loading/Loading.vue +135 -0
  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 +31 -0
  362. package/src/components/menu/MenuItem.spec.ts +92 -0
  363. package/src/components/menu/MenuItem.vue +168 -0
  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 +47 -0
  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.ts +25 -0
  371. package/src/components/message/Message.spec.ts +30 -0
  372. package/src/components/message/Message.vue +73 -0
  373. package/src/components/message/__snapshots__/Message.spec.ts.snap +11 -0
  374. package/src/components/message/index.ts +15 -0
  375. package/src/components/modal/Modal.spec.ts +167 -0
  376. package/src/components/modal/Modal.vue +335 -0
  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.ts +78 -0
  380. package/src/components/navbar/NavBarBurger.spec.ts +30 -0
  381. package/src/components/navbar/NavBarItem.spec.ts +92 -0
  382. package/src/components/navbar/Navbar.vue +274 -0
  383. package/src/components/navbar/NavbarBurger.vue +29 -0
  384. package/src/components/navbar/NavbarDropdown.spec.ts +84 -0
  385. package/src/components/navbar/NavbarDropdown.vue +115 -0
  386. package/src/components/navbar/NavbarItem.vue +97 -0
  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.ts +22 -0
  392. package/src/components/notification/Notification.spec.ts +21 -0
  393. package/src/components/notification/Notification.vue +77 -0
  394. package/src/components/notification/NotificationNotice.vue +76 -0
  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.ts +445 -0
  398. package/src/components/numberinput/Numberinput.vue +372 -0
  399. package/src/components/numberinput/index.ts +16 -0
  400. package/src/components/pagination/Pagination.spec.ts +94 -0
  401. package/src/components/pagination/Pagination.vue +434 -0
  402. package/src/components/pagination/PaginationButton.spec.ts +42 -0
  403. package/src/components/pagination/PaginationButton.vue +59 -0
  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.ts +19 -0
  407. package/src/components/pagination/types.ts +11 -0
  408. package/src/components/progress/Progress.spec.ts +81 -0
  409. package/src/components/progress/Progress.vue +168 -0
  410. package/src/components/progress/ProgressBar.spec.ts +45 -0
  411. package/src/components/progress/ProgressBar.vue +74 -0
  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.ts +18 -0
  415. package/src/components/radio/Radio.spec.ts +40 -0
  416. package/src/components/radio/Radio.vue +35 -0
  417. package/src/components/radio/RadioButton.spec.ts +40 -0
  418. package/src/components/radio/RadioButton.vue +69 -0
  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.ts +18 -0
  422. package/src/components/rate/Rate.spec.ts +90 -0
  423. package/src/components/rate/Rate.vue +158 -0
  424. package/src/components/rate/index.ts +15 -0
  425. package/src/components/select/Select.spec.ts +74 -0
  426. package/src/components/select/Select.vue +118 -0
  427. package/src/components/select/__snapshots__/Select.spec.ts.snap +7 -0
  428. package/src/components/select/index.ts +16 -0
  429. package/src/components/sidebar/Sidebar.spec.ts +107 -0
  430. package/src/components/sidebar/Sidebar.vue +316 -0
  431. package/src/components/sidebar/__snapshots__/Sidebar.spec.ts.snap +25 -0
  432. package/src/components/sidebar/index.ts +16 -0
  433. package/src/components/skeleton/Skeleton.spec.ts +16 -0
  434. package/src/components/skeleton/Skeleton.vue +98 -0
  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 +374 -0
  439. package/src/components/slider/SliderThumb.spec.ts +176 -0
  440. package/src/components/slider/SliderThumb.vue +251 -0
  441. package/src/components/slider/SliderTick.spec.ts +33 -0
  442. package/src/components/slider/SliderTick.vue +50 -0
  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.ts +19 -0
  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 +88 -0
  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 +26 -0
  454. package/src/components/steps/Steps.spec.ts +125 -0
  455. package/src/components/steps/Steps.vue +273 -0
  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.ts +19 -0
  459. package/src/components/switch/Switch.spec.ts +74 -0
  460. package/src/components/switch/Switch.vue +146 -0
  461. package/src/components/switch/__snapshots__/Switch.spec.ts.snap +3 -0
  462. package/src/components/switch/index.ts +16 -0
  463. package/src/components/table/Table.spec.ts +622 -0
  464. package/src/components/table/Table.vue +1770 -0
  465. package/src/components/table/TableColumn.spec.ts +85 -0
  466. package/src/components/table/TableColumn.vue +140 -0
  467. package/src/components/table/TableMobileSort.spec.ts +47 -0
  468. package/src/components/table/TableMobileSort.vue +236 -0
  469. package/src/components/table/TablePagination.vue +86 -0
  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.ts +32 -0
  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 +19 -0
  477. package/src/components/tabs/Tabs.spec.ts +122 -0
  478. package/src/components/tabs/Tabs.vue +204 -0
  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.ts +19 -0
  482. package/src/components/tag/Tag.spec.ts +32 -0
  483. package/src/components/tag/Tag.vue +132 -0
  484. package/src/components/tag/Taglist.spec.ts +21 -0
  485. package/src/components/tag/Taglist.vue +16 -0
  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.ts +19 -0
  489. package/src/components/taginput/Taginput.spec.ts +132 -0
  490. package/src/components/taginput/Taginput.vue +415 -0
  491. package/src/components/taginput/__snapshots__/Taginput.spec.ts.snap +10 -0
  492. package/src/components/taginput/index.ts +16 -0
  493. package/src/components/timepicker/Timepicker.spec.ts +108 -0
  494. package/src/components/timepicker/Timepicker.vue +183 -0
  495. package/src/components/timepicker/__snapshots__/Timepicker.spec.ts.snap +41 -0
  496. package/src/components/timepicker/index.ts +17 -0
  497. package/src/components/toast/Toast.spec.ts +74 -0
  498. package/src/components/toast/Toast.vue +46 -0
  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 +393 -0
  503. package/src/components/tooltip/__snapshots__/Tooltip.spec.ts.snap +12 -0
  504. package/src/components/tooltip/index.ts +16 -0
  505. package/src/components/upload/Upload.spec.ts +62 -0
  506. package/src/components/upload/Upload.vue +188 -0
  507. package/src/components/upload/__snapshots__/Upload.spec.ts.snap +3 -0
  508. package/src/components/upload/index.ts +15 -0
  509. package/src/directives/clickOutside.ts +113 -0
  510. package/src/directives/trapFocus.ts +61 -0
  511. package/src/index.ts +43 -0
  512. package/src/scss/buefy-build.scss +6 -0
  513. package/src/scss/buefy.scss +39 -0
  514. package/src/scss/components/_autocomplete.scss +39 -0
  515. package/src/scss/components/_carousel.scss +204 -0
  516. package/src/scss/components/_checkbox.scss +106 -0
  517. package/src/scss/components/_clockpicker.scss +283 -0
  518. package/src/scss/components/_collapse.scss +9 -0
  519. package/src/scss/components/_colorpicker.scss +283 -0
  520. package/src/scss/components/_datepicker.scss +220 -0
  521. package/src/scss/components/_dialog.scss +54 -0
  522. package/src/scss/components/_dropdown.scss +143 -0
  523. package/src/scss/components/_form.scss +309 -0
  524. package/src/scss/components/_icon.scss +16 -0
  525. package/src/scss/components/_image.scss +20 -0
  526. package/src/scss/components/_loading.scss +45 -0
  527. package/src/scss/components/_menu.scss +11 -0
  528. package/src/scss/components/_message.scss +16 -0
  529. package/src/scss/components/_modal.scss +37 -0
  530. package/src/scss/components/_navbar.scss +22 -0
  531. package/src/scss/components/_notices.scss +144 -0
  532. package/src/scss/components/_notification.scss +8 -0
  533. package/src/scss/components/_numberinput.scss +33 -0
  534. package/src/scss/components/_pagination.scss +63 -0
  535. package/src/scss/components/_progress.scss +105 -0
  536. package/src/scss/components/_radio.scss +123 -0
  537. package/src/scss/components/_rate.scss +72 -0
  538. package/src/scss/components/_select.scss +38 -0
  539. package/src/scss/components/_sidebar.scss +107 -0
  540. package/src/scss/components/_skeleton.scss +66 -0
  541. package/src/scss/components/_slider.scss +162 -0
  542. package/src/scss/components/_steps.scss +491 -0
  543. package/src/scss/components/_switch.scss +214 -0
  544. package/src/scss/components/_table.scss +322 -0
  545. package/src/scss/components/_tabs.scss +197 -0
  546. package/src/scss/components/_tag.scss +36 -0
  547. package/src/scss/components/_taginput.scss +73 -0
  548. package/src/scss/components/_timepicker.scss +73 -0
  549. package/src/scss/components/_tooltip.scss +192 -0
  550. package/src/scss/components/_upload.scss +62 -0
  551. package/src/scss/utils/_all.scss +4 -0
  552. package/src/scss/utils/_animations.scss +183 -0
  553. package/src/scss/utils/_functions.scss +49 -0
  554. package/src/scss/utils/_helpers.scss +6 -0
  555. package/src/scss/utils/_variables-ext.scss +2 -0
  556. package/src/scss/utils/_variables.scss +16 -0
  557. package/src/utils/CheckRadioMixin.spec.ts +28 -0
  558. package/src/utils/CheckRadioMixin.ts +61 -0
  559. package/src/utils/CompatFallthroughMixin.ts +34 -0
  560. package/src/utils/ConfigComponent.ts +12 -0
  561. package/src/utils/FormElementMixin.spec.ts +41 -0
  562. package/src/utils/FormElementMixin.ts +206 -0
  563. package/src/utils/InjectedChildMixin.ts +139 -0
  564. package/src/utils/MessageMixin.spec.ts +51 -0
  565. package/src/utils/MessageMixin.ts +138 -0
  566. package/src/utils/NoticeMixin.spec.ts +55 -0
  567. package/src/utils/NoticeMixin.ts +181 -0
  568. package/src/utils/ProvideInjectTypes.ts +20 -0
  569. package/src/utils/ProviderParentMixin.ts +105 -0
  570. package/src/utils/SlotComponent.spec.ts +55 -0
  571. package/src/utils/SlotComponent.ts +38 -0
  572. package/src/utils/TabbedChildMixin.ts +96 -0
  573. package/src/utils/TabbedMixin.ts +166 -0
  574. package/src/utils/TabbedTypes.ts +33 -0
  575. package/src/utils/TimepickerMixin.spec.ts +75 -0
  576. package/src/utils/TimepickerMixin.ts +767 -0
  577. package/src/utils/color.spec.ts +55 -0
  578. package/src/utils/color.ts +507 -0
  579. package/src/utils/config.spec.ts +11 -0
  580. package/src/utils/config.ts +619 -0
  581. package/src/utils/debounce.spec.ts +52 -0
  582. package/src/utils/debounce.ts +20 -0
  583. package/src/utils/helpers.spec.ts +257 -0
  584. package/src/utils/helpers.ts +527 -0
  585. package/src/utils/icons.ts +73 -0
  586. package/src/utils/plugins.ts +20 -0
  587. package/src/utils/ssr.ts +6 -0
  588. package/src/utils/vue-augmentation.ts +35 -0
@@ -0,0 +1,2391 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var vue = require('vue');
6
+ var helpers = require('./helpers.js');
7
+ var Pagination = require('./Pagination-D1MVdiLp.js');
8
+ var CompatFallthroughMixin = require('./CompatFallthroughMixin-hhK0Gkhr.js');
9
+ var Checkbox = require('./Checkbox-GPzAMQqM.js');
10
+ var Icon = require('./Icon-lsDKE2wQ.js');
11
+ var Input = require('./Input-BcloGeZ3.js');
12
+ var Loading = require('./Loading-GqqqjipO.js');
13
+ var SlotComponent = require('./SlotComponent-BruGdRW3.js');
14
+ var Select = require('./Select-DayPKwCY.js');
15
+ var _pluginVue_exportHelper = require('./_plugin-vue_export-helper-Die8u8yB.js');
16
+ var plugins = require('./plugins-DbyYGVpp.js');
17
+ require('./config-DR826Ki2.js');
18
+ require('./CheckRadioMixin-CDu0SN3g.js');
19
+ require('./FormElementMixin-DavX4iOv.js');
20
+ require('./ssr-DVRFTu_P.js');
21
+
22
+ var _sfc_main$3 = vue.defineComponent({
23
+ name: "BTableMobileSort",
24
+ components: {
25
+ BSelect: Select.BSelect,
26
+ BIcon: Icon.BIcon
27
+ },
28
+ props: {
29
+ currentSortColumn: Object,
30
+ sortMultipleData: Array,
31
+ isAsc: Boolean,
32
+ columns: Array,
33
+ placeholder: String,
34
+ iconPack: String,
35
+ sortIcon: {
36
+ type: String,
37
+ default: "arrow-up"
38
+ },
39
+ sortIconSize: {
40
+ type: String,
41
+ default: "is-small"
42
+ },
43
+ sortMultiple: {
44
+ type: Boolean,
45
+ default: false
46
+ }
47
+ },
48
+ emits: {
49
+ /* eslint-disable @typescript-eslint/no-unused-vars */
50
+ removePriority: (_column) => true,
51
+ sort: (_column, _event) => true
52
+ /* eslint-enable @typescript-eslint/no-unused-vars */
53
+ },
54
+ data() {
55
+ return {
56
+ sortMultipleSelect: null,
57
+ sortMultipleSelectIndex: -1,
58
+ mobileSort: this.currentSortColumn,
59
+ mobileSortIndex: this.columns ? this.columns.indexOf(this.currentSortColumn) : -1,
60
+ defaultEvent: {
61
+ shiftKey: true,
62
+ altKey: true,
63
+ ctrlKey: true
64
+ },
65
+ ignoreSort: false
66
+ };
67
+ },
68
+ computed: {
69
+ showPlaceholder() {
70
+ return !this.columns || !this.columns.some((column) => column === this.mobileSort);
71
+ },
72
+ sortableColumns() {
73
+ return this.columns && this.columns.filter((column) => column.sortable);
74
+ }
75
+ },
76
+ watch: {
77
+ sortMultipleSelect(column) {
78
+ if (this.ignoreSort) {
79
+ this.ignoreSort = false;
80
+ } else {
81
+ this.$emit("sort", column, this.defaultEvent);
82
+ }
83
+ },
84
+ sortMultipleSelectIndex(index) {
85
+ if (index !== -1) {
86
+ this.sortMultipleSelect = this.columns[index];
87
+ } else {
88
+ this.sortMultipleSelect = null;
89
+ }
90
+ },
91
+ mobileSort(column) {
92
+ if (this.currentSortColumn === column) return;
93
+ this.$emit("sort", column, this.defaultEvent);
94
+ },
95
+ mobileSortIndex(index) {
96
+ if (index !== -1) {
97
+ this.mobileSort = this.columns[index];
98
+ }
99
+ },
100
+ currentSortColumn(column) {
101
+ this.mobileSort = column;
102
+ this.mobileSortIndex = this.columns ? this.columns.indexOf(column) : -1;
103
+ },
104
+ columns(newColumns) {
105
+ if (this.sortMultiple) {
106
+ this.sortMultipleSelectIndex = newColumns.indexOf(
107
+ this.sortMultipleSelect
108
+ );
109
+ } else {
110
+ this.mobileSortIndex = newColumns.indexOf(this.mobileSort);
111
+ }
112
+ }
113
+ },
114
+ methods: {
115
+ removePriority() {
116
+ this.$emit("removePriority", this.sortMultipleSelect);
117
+ this.ignoreSort = true;
118
+ const remainingFields = this.sortMultipleData.filter((data) => data.field !== this.sortMultipleSelect.field).map((data) => data.field);
119
+ this.sortMultipleSelectIndex = this.columns.findIndex((column) => remainingFields.includes(column.field));
120
+ },
121
+ getSortingObjectOfColumn(column) {
122
+ return this.sortMultipleData.filter((i) => i.field === column.field)[0];
123
+ },
124
+ columnIsDesc(column) {
125
+ const sortingObject = column && this.getSortingObjectOfColumn(column);
126
+ if (sortingObject) {
127
+ return !!(sortingObject.order && sortingObject.order === "desc");
128
+ }
129
+ return true;
130
+ },
131
+ getLabel(column) {
132
+ const sortingObject = this.getSortingObjectOfColumn(column);
133
+ if (sortingObject) {
134
+ return column.label + "(" + (this.sortMultipleData.indexOf(sortingObject) + 1) + ")";
135
+ }
136
+ return column.label;
137
+ },
138
+ sort() {
139
+ this.$emit("sort", this.sortMultiple ? this.sortMultipleSelect : this.mobileSort, this.defaultEvent);
140
+ }
141
+ }
142
+ });
143
+
144
+ const _hoisted_1$2 = { class: "field table-mobile-sort" };
145
+ const _hoisted_2$2 = { class: "field has-addons" };
146
+ const _hoisted_3$2 = ["value"];
147
+ const _hoisted_4$2 = ["value"];
148
+ const _hoisted_5$1 = { class: "control" };
149
+ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
150
+ const _component_b_select = vue.resolveComponent("b-select");
151
+ const _component_b_icon = vue.resolveComponent("b-icon");
152
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [
153
+ vue.createElementVNode("div", _hoisted_2$2, [
154
+ _ctx.sortMultiple ? (vue.openBlock(), vue.createBlock(_component_b_select, {
155
+ key: 0,
156
+ modelValue: _ctx.sortMultipleSelectIndex,
157
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.sortMultipleSelectIndex = $event),
158
+ expanded: ""
159
+ }, {
160
+ default: vue.withCtx(() => [
161
+ (vue.openBlock(true), vue.createElementBlock(
162
+ vue.Fragment,
163
+ null,
164
+ vue.renderList(_ctx.sortableColumns, (column, index) => {
165
+ return vue.openBlock(), vue.createElementBlock("option", {
166
+ key: index,
167
+ value: index
168
+ }, [
169
+ vue.createTextVNode(
170
+ vue.toDisplayString(_ctx.getLabel(column)) + " ",
171
+ 1
172
+ /* TEXT */
173
+ ),
174
+ _ctx.getSortingObjectOfColumn(column) ? (vue.openBlock(), vue.createElementBlock(
175
+ vue.Fragment,
176
+ { key: 0 },
177
+ [
178
+ _ctx.columnIsDesc(column) ? (vue.openBlock(), vue.createElementBlock(
179
+ vue.Fragment,
180
+ { key: 0 },
181
+ [
182
+ vue.createTextVNode(" ↓ ")
183
+ ],
184
+ 64
185
+ /* STABLE_FRAGMENT */
186
+ )) : (vue.openBlock(), vue.createElementBlock(
187
+ vue.Fragment,
188
+ { key: 1 },
189
+ [
190
+ vue.createTextVNode(" ↑ ")
191
+ ],
192
+ 64
193
+ /* STABLE_FRAGMENT */
194
+ ))
195
+ ],
196
+ 64
197
+ /* STABLE_FRAGMENT */
198
+ )) : vue.createCommentVNode("v-if", true)
199
+ ], 8, _hoisted_3$2);
200
+ }),
201
+ 128
202
+ /* KEYED_FRAGMENT */
203
+ ))
204
+ ]),
205
+ _: 1
206
+ /* STABLE */
207
+ }, 8, ["modelValue"])) : (vue.openBlock(), vue.createBlock(_component_b_select, {
208
+ key: 1,
209
+ modelValue: _ctx.mobileSortIndex,
210
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.mobileSortIndex = $event),
211
+ expanded: ""
212
+ }, {
213
+ default: vue.withCtx(() => [
214
+ _ctx.placeholder ? vue.withDirectives((vue.openBlock(), vue.createElementBlock(
215
+ "option",
216
+ {
217
+ key: 0,
218
+ value: {},
219
+ selected: "",
220
+ disabled: "",
221
+ hidden: ""
222
+ },
223
+ vue.toDisplayString(_ctx.placeholder),
224
+ 513
225
+ /* TEXT, NEED_PATCH */
226
+ )), [
227
+ [vue.vShow, _ctx.showPlaceholder]
228
+ ]) : vue.createCommentVNode("v-if", true),
229
+ (vue.openBlock(true), vue.createElementBlock(
230
+ vue.Fragment,
231
+ null,
232
+ vue.renderList(_ctx.sortableColumns, (column, index) => {
233
+ return vue.openBlock(), vue.createElementBlock("option", {
234
+ key: index,
235
+ value: index
236
+ }, vue.toDisplayString(column.label), 9, _hoisted_4$2);
237
+ }),
238
+ 128
239
+ /* KEYED_FRAGMENT */
240
+ ))
241
+ ]),
242
+ _: 1
243
+ /* STABLE */
244
+ }, 8, ["modelValue"])),
245
+ vue.createElementVNode("div", _hoisted_5$1, [
246
+ _ctx.sortMultiple && _ctx.sortMultipleData.length > 0 ? (vue.openBlock(), vue.createElementBlock(
247
+ vue.Fragment,
248
+ { key: 0 },
249
+ [
250
+ vue.createElementVNode("button", {
251
+ class: "button is-primary",
252
+ onClick: _cache[2] || (_cache[2] = (...args) => _ctx.sort && _ctx.sort(...args))
253
+ }, [
254
+ vue.createVNode(_component_b_icon, {
255
+ class: vue.normalizeClass({ "is-desc": _ctx.columnIsDesc(_ctx.sortMultipleSelect) }),
256
+ icon: _ctx.sortIcon,
257
+ pack: _ctx.iconPack,
258
+ size: _ctx.sortIconSize,
259
+ both: ""
260
+ }, null, 8, ["class", "icon", "pack", "size"])
261
+ ]),
262
+ vue.createElementVNode("button", {
263
+ class: "button is-primary",
264
+ onClick: _cache[3] || (_cache[3] = (...args) => _ctx.removePriority && _ctx.removePriority(...args))
265
+ }, [
266
+ vue.createVNode(_component_b_icon, {
267
+ icon: "delete",
268
+ size: _ctx.sortIconSize,
269
+ both: ""
270
+ }, null, 8, ["size"])
271
+ ])
272
+ ],
273
+ 64
274
+ /* STABLE_FRAGMENT */
275
+ )) : !_ctx.sortMultiple ? (vue.openBlock(), vue.createElementBlock("button", {
276
+ key: 1,
277
+ class: "button is-primary",
278
+ onClick: _cache[4] || (_cache[4] = (...args) => _ctx.sort && _ctx.sort(...args))
279
+ }, [
280
+ vue.withDirectives(vue.createVNode(_component_b_icon, {
281
+ class: vue.normalizeClass({ "is-desc": !_ctx.isAsc }),
282
+ icon: _ctx.sortIcon,
283
+ pack: _ctx.iconPack,
284
+ size: _ctx.sortIconSize,
285
+ both: ""
286
+ }, null, 8, ["class", "icon", "pack", "size"]), [
287
+ [vue.vShow, _ctx.currentSortColumn === _ctx.mobileSort]
288
+ ])
289
+ ])) : vue.createCommentVNode("v-if", true)
290
+ ])
291
+ ])
292
+ ]);
293
+ }
294
+ var BTableMobileSort = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main$3, [["render", _sfc_render$2]]);
295
+
296
+ var _sfc_main$2 = vue.defineComponent({
297
+ name: "BTablePagination",
298
+ components: {
299
+ BPagination: Pagination.BPagination
300
+ },
301
+ props: {
302
+ paginated: Boolean,
303
+ total: [Number, String],
304
+ perPage: [Number, String],
305
+ currentPage: [Number, String],
306
+ paginationSimple: Boolean,
307
+ paginationSize: String,
308
+ rounded: Boolean,
309
+ iconPack: String,
310
+ ariaNextLabel: String,
311
+ ariaPreviousLabel: String,
312
+ ariaPageLabel: String,
313
+ ariaCurrentLabel: String,
314
+ pageInput: Boolean,
315
+ paginationOrder: String,
316
+ pageInputPosition: String,
317
+ debouncePageInput: [Number, String]
318
+ },
319
+ emits: {
320
+ /* eslint-disable @typescript-eslint/no-unused-vars */
321
+ "page-change": (_page) => true,
322
+ "update:currentPage": (_page) => true
323
+ /* eslint-enable @typescript-eslint/no-unused-vars */
324
+ },
325
+ data() {
326
+ return {
327
+ newCurrentPage: this.currentPage
328
+ };
329
+ },
330
+ watch: {
331
+ currentPage(newVal) {
332
+ this.newCurrentPage = newVal;
333
+ }
334
+ },
335
+ methods: {
336
+ /*
337
+ * Paginator change listener.
338
+ */
339
+ pageChanged(page) {
340
+ this.newCurrentPage = page > 0 ? page : 1;
341
+ this.$emit("update:currentPage", this.newCurrentPage);
342
+ this.$emit("page-change", this.newCurrentPage);
343
+ }
344
+ }
345
+ });
346
+
347
+ const _hoisted_1$1 = { class: "top level" };
348
+ const _hoisted_2$1 = { class: "level-left" };
349
+ const _hoisted_3$1 = { class: "level-right" };
350
+ const _hoisted_4$1 = {
351
+ key: 0,
352
+ class: "level-item"
353
+ };
354
+ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
355
+ const _component_b_pagination = vue.resolveComponent("b-pagination");
356
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
357
+ vue.createElementVNode("div", _hoisted_2$1, [
358
+ vue.renderSlot(_ctx.$slots, "default")
359
+ ]),
360
+ vue.createElementVNode("div", _hoisted_3$1, [
361
+ _ctx.paginated ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$1, [
362
+ vue.createVNode(_component_b_pagination, {
363
+ "icon-pack": _ctx.iconPack,
364
+ total: _ctx.total,
365
+ "per-page": _ctx.perPage,
366
+ simple: _ctx.paginationSimple,
367
+ size: _ctx.paginationSize,
368
+ "model-value": _ctx.newCurrentPage,
369
+ rounded: _ctx.rounded,
370
+ onChange: _ctx.pageChanged,
371
+ "aria-next-label": _ctx.ariaNextLabel,
372
+ "aria-previous-label": _ctx.ariaPreviousLabel,
373
+ "aria-page-label": _ctx.ariaPageLabel,
374
+ "aria-current-label": _ctx.ariaCurrentLabel,
375
+ "page-input": _ctx.pageInput,
376
+ order: _ctx.paginationOrder,
377
+ "page-input-position": _ctx.pageInputPosition,
378
+ "debounce-page-input": _ctx.debouncePageInput
379
+ }, null, 8, ["icon-pack", "total", "per-page", "simple", "size", "model-value", "rounded", "onChange", "aria-next-label", "aria-previous-label", "aria-page-label", "aria-current-label", "page-input", "order", "page-input-position", "debounce-page-input"])
380
+ ])) : vue.createCommentVNode("v-if", true)
381
+ ])
382
+ ]);
383
+ }
384
+ var BTablePagination = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main$2, [["render", _sfc_render$1]]);
385
+
386
+ var __defProp = Object.defineProperty;
387
+ var __defProps = Object.defineProperties;
388
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
389
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
390
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
391
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
392
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
393
+ var __spreadValues = (a, b) => {
394
+ for (var prop in b || (b = {}))
395
+ if (__hasOwnProp.call(b, prop))
396
+ __defNormalProp(a, prop, b[prop]);
397
+ if (__getOwnPropSymbols)
398
+ for (var prop of __getOwnPropSymbols(b)) {
399
+ if (__propIsEnum.call(b, prop))
400
+ __defNormalProp(a, prop, b[prop]);
401
+ }
402
+ return a;
403
+ };
404
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
405
+ function mockTableColumn(table, column) {
406
+ const defaultProps = {
407
+ label: void 0,
408
+ customKey: void 0,
409
+ field: void 0,
410
+ meta: void 0,
411
+ width: void 0,
412
+ numeric: void 0,
413
+ centered: void 0,
414
+ searchable: void 0,
415
+ sortable: void 0,
416
+ visible: true,
417
+ subheading: void 0,
418
+ customSort: void 0,
419
+ customSearch: void 0,
420
+ sticky: void 0,
421
+ headerSelectable: void 0,
422
+ headerClass: void 0,
423
+ /* eslint-disable @typescript-eslint/no-explicit-any */
424
+ thAttrs: () => ({}),
425
+ tdAttrs: () => ({})
426
+ /* eslint-enable @typescript-eslint/no-explicit-any */
427
+ };
428
+ return __spreadProps(__spreadValues(__spreadValues({}, defaultProps), column), {
429
+ // data
430
+ newKey: column.customKey || column.label,
431
+ _isTableColumn: true,
432
+ // public computed
433
+ get thClasses() {
434
+ const attrs = this.thAttrs(this);
435
+ const classes = [this.headerClass, {
436
+ "is-sortable": this.sortable,
437
+ "is-sticky": this.sticky,
438
+ "is-unselectable": this.isHeaderUnSelectable
439
+ }];
440
+ if (attrs && attrs.class) {
441
+ classes.push(attrs.class);
442
+ }
443
+ return classes;
444
+ },
445
+ get thStyle() {
446
+ const attrs = this.thAttrs(this);
447
+ const style = [this.style];
448
+ if (attrs && attrs.style) {
449
+ style.push(attrs.style);
450
+ }
451
+ return style;
452
+ },
453
+ get thWrapStyle() {
454
+ return this.style;
455
+ },
456
+ get style() {
457
+ var _a;
458
+ return {
459
+ width: (_a = helpers.toCssWidth(this.width)) != null ? _a : void 0
460
+ // null → undefined to satisfy StyleValue
461
+ };
462
+ },
463
+ getRootClasses(row) {
464
+ const attrs = this.tdAttrs(row, this);
465
+ const classes = [this.rootClasses];
466
+ if (attrs && attrs.class) {
467
+ classes.push(attrs.class);
468
+ }
469
+ return classes;
470
+ },
471
+ getRootStyle(row) {
472
+ const attrs = this.tdAttrs(row, this);
473
+ const style = [];
474
+ if (attrs && attrs.style) {
475
+ style.push(attrs.style);
476
+ }
477
+ return style;
478
+ },
479
+ $slots: {
480
+ default: (props) => {
481
+ const vnode = vue.h("span", {
482
+ innerHTML: helpers.getValueByPath(props.row, column.field)
483
+ });
484
+ return [vnode];
485
+ }
486
+ },
487
+ // private properties
488
+ get rootClasses() {
489
+ return [this.cellClass, {
490
+ "has-text-right": this.numeric && !this.centered,
491
+ "has-text-centered": this.centered,
492
+ "is-sticky": this.sticky
493
+ }];
494
+ },
495
+ get isHeaderUnSelectable() {
496
+ return !this.headerSelectable && !!this.sortable;
497
+ }
498
+ });
499
+ }
500
+
501
+ const BLANK_COLUMN = {
502
+ thAttrs: () => ({}),
503
+ tdAttrs: () => ({}),
504
+ getRootClasses: () => [],
505
+ getRootStyle: () => void 0,
506
+ $slots: {}
507
+ };
508
+ var _sfc_main$1 = vue.defineComponent({
509
+ name: "BTable",
510
+ components: {
511
+ BCheckbox: Checkbox.BCheckbox,
512
+ BIcon: Icon.BIcon,
513
+ BInput: Input.BInput,
514
+ BLoading: Loading.BLoading,
515
+ BSlotComponent: SlotComponent.BSlotComponent,
516
+ BTableMobileSort,
517
+ BTablePagination
518
+ },
519
+ mixins: [CompatFallthroughMixin.CompatFallthroughMixin],
520
+ provide() {
521
+ return {
522
+ $table: this
523
+ };
524
+ },
525
+ props: {
526
+ data: {
527
+ type: Array,
528
+ default: () => []
529
+ },
530
+ columns: {
531
+ type: Array,
532
+ default: () => []
533
+ },
534
+ bordered: Boolean,
535
+ striped: Boolean,
536
+ narrowed: Boolean,
537
+ hoverable: Boolean,
538
+ loading: Boolean,
539
+ detailed: Boolean,
540
+ checkable: Boolean,
541
+ headerCheckable: {
542
+ type: Boolean,
543
+ default: true
544
+ },
545
+ checkboxType: {
546
+ type: String,
547
+ default: "is-primary"
548
+ },
549
+ checkboxPosition: {
550
+ type: String,
551
+ default: "left",
552
+ validator: (value) => {
553
+ return [
554
+ "left",
555
+ "right"
556
+ ].indexOf(value) >= 0;
557
+ }
558
+ },
559
+ stickyCheckbox: {
560
+ type: Boolean,
561
+ default: false
562
+ },
563
+ selected: Object,
564
+ isRowSelectable: {
565
+ type: Function,
566
+ default: () => true
567
+ },
568
+ focusable: Boolean,
569
+ customIsChecked: Function,
570
+ isRowCheckable: {
571
+ type: Function,
572
+ default: () => true
573
+ },
574
+ checkedRows: {
575
+ type: Array,
576
+ default: () => []
577
+ },
578
+ mobileCards: {
579
+ type: Boolean,
580
+ default: true
581
+ },
582
+ defaultSort: [String, Array],
583
+ defaultSortDirection: {
584
+ type: String,
585
+ default: "asc"
586
+ },
587
+ sortIcon: {
588
+ type: String,
589
+ default: "arrow-up"
590
+ },
591
+ sortIconSize: {
592
+ type: String,
593
+ default: "is-small"
594
+ },
595
+ sortMultiple: {
596
+ type: Boolean,
597
+ default: false
598
+ },
599
+ sortMultipleData: {
600
+ type: Array,
601
+ default: () => []
602
+ },
603
+ sortMultipleKey: {
604
+ type: String,
605
+ default: null
606
+ },
607
+ paginated: Boolean,
608
+ currentPage: {
609
+ type: Number,
610
+ default: 1
611
+ },
612
+ perPage: {
613
+ type: [Number, String],
614
+ default: 20
615
+ },
616
+ showDetailIcon: {
617
+ type: Boolean,
618
+ default: true
619
+ },
620
+ detailIcon: {
621
+ type: String,
622
+ default: "chevron-right"
623
+ },
624
+ paginationPosition: {
625
+ type: String,
626
+ default: "bottom",
627
+ validator: (value) => {
628
+ return [
629
+ "bottom",
630
+ "top",
631
+ "both"
632
+ ].indexOf(value) >= 0;
633
+ }
634
+ },
635
+ paginationRounded: Boolean,
636
+ backendSorting: Boolean,
637
+ backendFiltering: Boolean,
638
+ rowClass: {
639
+ type: Function,
640
+ default: () => ""
641
+ },
642
+ openedDetailed: {
643
+ type: Array,
644
+ default: () => []
645
+ },
646
+ hasDetailedVisible: {
647
+ type: Function,
648
+ default: () => true
649
+ },
650
+ detailKey: {
651
+ type: String,
652
+ default: ""
653
+ },
654
+ detailTransition: {
655
+ type: String,
656
+ default: ""
657
+ },
658
+ customDetailRow: {
659
+ type: Boolean,
660
+ default: false
661
+ },
662
+ backendPagination: Boolean,
663
+ total: {
664
+ type: [Number, String],
665
+ default: 0
666
+ },
667
+ iconPack: String,
668
+ mobileSortPlaceholder: String,
669
+ customRowKey: String,
670
+ draggable: {
671
+ type: Boolean,
672
+ default: false
673
+ },
674
+ draggableColumn: {
675
+ type: Boolean,
676
+ default: false
677
+ },
678
+ scrollable: Boolean,
679
+ ariaNextLabel: String,
680
+ ariaPreviousLabel: String,
681
+ ariaPageLabel: String,
682
+ ariaCurrentLabel: String,
683
+ stickyHeader: Boolean,
684
+ height: [Number, String],
685
+ filtersEvent: {
686
+ type: String,
687
+ default: ""
688
+ },
689
+ cardLayout: Boolean,
690
+ showHeader: {
691
+ type: Boolean,
692
+ default: true
693
+ },
694
+ debounceSearch: Number,
695
+ caption: String,
696
+ showCaption: {
697
+ type: Boolean,
698
+ default: true
699
+ },
700
+ pageInput: {
701
+ type: Boolean,
702
+ default: false
703
+ },
704
+ paginationOrder: String,
705
+ pageInputPosition: String,
706
+ debouncePageInput: [Number, String]
707
+ },
708
+ emits: {
709
+ /* eslint-disable @typescript-eslint/no-unused-vars */
710
+ cellclick: (_row, _column, _rowIndex, _colIndex) => true,
711
+ check: (_checkedRows, _row) => true,
712
+ "check-all": (_rows) => true,
713
+ click: (_row) => true,
714
+ columndragend: (_event) => true,
715
+ columndragleave: (_event) => true,
716
+ columndragover: (_event) => true,
717
+ columndragstart: (_event) => true,
718
+ columndrop: (_event) => true,
719
+ contextmenu: (_row, _event) => true,
720
+ dblclick: (_row) => true,
721
+ "details-close": (_row) => true,
722
+ "details-open": (_row) => true,
723
+ dragend: (_event) => true,
724
+ dragleave: (_event) => true,
725
+ dragover: (_event) => true,
726
+ dragstart: (_event) => true,
727
+ drop: (_event) => true,
728
+ "filters-change": (_value) => true,
729
+ "page-change": (_page) => true,
730
+ select: (_new, _old) => true,
731
+ sort: (_field, _order, _event) => true,
732
+ "sorting-priority-removed": (_field) => true,
733
+ "update:checkedRows": (_rows) => true,
734
+ "update:currentPage": (_page) => true,
735
+ "update:openedDetailed": (_rows) => true,
736
+ "update:selected": (_row) => true
737
+ /* eslint-enable @typescript-eslint/no-unused-vars */
738
+ },
739
+ data() {
740
+ return {
741
+ sortMultipleDataLocal: [],
742
+ getValueByPath: helpers.getValueByPath,
743
+ visibleDetailRows: this.openedDetailed,
744
+ newData: this.data,
745
+ newDataTotal: this.backendPagination ? this.total : this.data.length,
746
+ newCheckedRows: [...this.checkedRows],
747
+ lastCheckedRowIndex: null,
748
+ newCurrentPage: this.currentPage,
749
+ currentSortColumn: {},
750
+ isAsc: true,
751
+ filters: {},
752
+ defaultSlots: [],
753
+ firstTimeSort: true,
754
+ // Used by first time initSort
755
+ isDraggingRow: false,
756
+ isDraggingColumn: false,
757
+ debouncedHandleFiltersChange: void 0,
758
+ // for touch-enabled devices
759
+ _selectedRow: null,
760
+ mayBeTouchDragging: false,
761
+ touchDragoverTarget: null,
762
+ _draggedCellEl: void 0,
763
+ draggedCellContent: ""
764
+ };
765
+ },
766
+ computed: {
767
+ sortMultipleDataComputed() {
768
+ return this.backendSorting ? this.sortMultipleData : this.sortMultipleDataLocal;
769
+ },
770
+ tableClasses() {
771
+ return {
772
+ "is-bordered": this.bordered,
773
+ "is-striped": this.striped,
774
+ "is-narrow": this.narrowed,
775
+ "is-hoverable": (this.hoverable || this.focusable) && this.visibleData.length
776
+ };
777
+ },
778
+ tableWrapperClasses() {
779
+ return {
780
+ "has-mobile-cards": this.mobileCards,
781
+ "has-sticky-header": this.stickyHeader,
782
+ "is-card-list": this.cardLayout,
783
+ "table-container": this.isScrollable
784
+ };
785
+ },
786
+ tableStyle() {
787
+ return {
788
+ height: helpers.toCssWidth(this.height)
789
+ };
790
+ },
791
+ touchDraggedCellClasses() {
792
+ return {
793
+ "has-mobile-cards": this.mobileCards
794
+ };
795
+ },
796
+ /*
797
+ * Splitted data based on the pagination.
798
+ */
799
+ visibleData() {
800
+ if (!this.paginated) return this.newData;
801
+ const currentPage = this.newCurrentPage;
802
+ const perPage = +this.perPage;
803
+ if (this.newData.length <= perPage) {
804
+ return this.newData;
805
+ } else {
806
+ const start = (currentPage - 1) * perPage;
807
+ const end = parseInt(start + "", 10) + parseInt(perPage + "", 10);
808
+ return this.newData.slice(start, end);
809
+ }
810
+ },
811
+ visibleColumns() {
812
+ if (!this.newColumns) return this.newColumns;
813
+ return this.newColumns.filter((column) => {
814
+ return column.visible || column.visible === void 0;
815
+ });
816
+ },
817
+ /*
818
+ * Check if all rows in the page are checked.
819
+ */
820
+ isAllChecked() {
821
+ const validVisibleData = this.visibleData.filter(
822
+ (row) => this.isRowCheckable(row)
823
+ );
824
+ if (validVisibleData.length === 0) return false;
825
+ const isAllChecked = validVisibleData.some((currentVisibleRow) => {
826
+ return helpers.indexOf(this.newCheckedRows, currentVisibleRow, this.customIsChecked) < 0;
827
+ });
828
+ return !isAllChecked;
829
+ },
830
+ /*
831
+ * Check if all rows in the page are checkable.
832
+ */
833
+ isAllUncheckable() {
834
+ const validVisibleData = this.visibleData.filter(
835
+ (row) => this.isRowCheckable(row)
836
+ );
837
+ return validVisibleData.length === 0;
838
+ },
839
+ /*
840
+ * Check if has any sortable column.
841
+ */
842
+ hasSortablenewColumns() {
843
+ return this.newColumns.some((column) => {
844
+ return column.sortable;
845
+ });
846
+ },
847
+ /*
848
+ * Check if has any searchable column.
849
+ */
850
+ hasSearchablenewColumns() {
851
+ return this.newColumns.some((column) => {
852
+ return column.searchable;
853
+ });
854
+ },
855
+ /*
856
+ * Check if has any column using subheading.
857
+ */
858
+ hasCustomSubheadings() {
859
+ if (this.$slots && this.$slots.subheading) return true;
860
+ return this.newColumns.some((column) => {
861
+ return column.subheading || column.$slots.subheading;
862
+ });
863
+ },
864
+ /*
865
+ * Return total column count based if it's checkable or expanded
866
+ */
867
+ columnCount() {
868
+ let count = this.visibleColumns.length;
869
+ count += this.checkable ? 1 : 0;
870
+ count += this.detailed && this.showDetailIcon ? 1 : 0;
871
+ return count;
872
+ },
873
+ /*
874
+ * return if detailed row tabled
875
+ * will be with chevron column & icon or not
876
+ */
877
+ showDetailRowIcon() {
878
+ return this.detailed && this.showDetailIcon;
879
+ },
880
+ /*
881
+ * return if scrollable table
882
+ */
883
+ isScrollable() {
884
+ if (this.scrollable) return true;
885
+ if (!this.newColumns) return false;
886
+ return this.newColumns.some((column) => {
887
+ return column.sticky;
888
+ });
889
+ },
890
+ newColumns() {
891
+ if (this.columns && this.columns.length) {
892
+ return this.columns.map((column) => {
893
+ return mockTableColumn(this, column);
894
+ });
895
+ }
896
+ return this.defaultSlots;
897
+ },
898
+ canDragRow() {
899
+ return this.draggable && !this.isDraggingColumn;
900
+ },
901
+ canDragColumn() {
902
+ return this.draggableColumn && !this.isDraggingRow;
903
+ }
904
+ },
905
+ watch: {
906
+ /*
907
+ * When data prop change:
908
+ * 1. Update internal value.
909
+ * 2. Filter data if it's not backend-filtered.
910
+ * 3. Sort again if it's not backend-sorted.
911
+ * 4. Set new total if it's not backend-paginated.
912
+ */
913
+ data(value) {
914
+ this.newData = value;
915
+ if (!this.backendFiltering) {
916
+ this.newData = value.filter(
917
+ (row) => this.isRowFiltered(row)
918
+ );
919
+ }
920
+ if (!this.backendSorting) {
921
+ this.sort(this.currentSortColumn, true);
922
+ }
923
+ if (!this.backendPagination) {
924
+ this.newDataTotal = this.newData.length;
925
+ }
926
+ },
927
+ /*
928
+ * When Pagination total change, update internal total
929
+ * only if it's backend-paginated.
930
+ */
931
+ total(newTotal) {
932
+ if (!this.backendPagination) return;
933
+ this.newDataTotal = newTotal;
934
+ },
935
+ currentPage(newVal) {
936
+ this.newCurrentPage = newVal;
937
+ },
938
+ newCurrentPage(newVal) {
939
+ this.$emit("update:currentPage", newVal);
940
+ },
941
+ /*
942
+ * When checkedRows prop change, update internal value without
943
+ * mutating original data.
944
+ */
945
+ checkedRows(rows) {
946
+ this.newCheckedRows = [...rows];
947
+ },
948
+ debounceSearch: {
949
+ handler(value) {
950
+ this.debouncedHandleFiltersChange = Pagination.debounce(this.handleFiltersChange, value);
951
+ },
952
+ immediate: true
953
+ },
954
+ filters: {
955
+ handler(value) {
956
+ if (this.debounceSearch) {
957
+ this.debouncedHandleFiltersChange(value);
958
+ } else {
959
+ this.handleFiltersChange(value);
960
+ }
961
+ },
962
+ deep: true
963
+ },
964
+ /*
965
+ * When the user wants to control the detailed rows via props.
966
+ * Or wants to open the details of certain row with the router for example.
967
+ */
968
+ openedDetailed(expandedRows) {
969
+ this.visibleDetailRows = expandedRows;
970
+ }
971
+ },
972
+ methods: {
973
+ onFiltersEvent(event) {
974
+ this.$emit(`filters-event-${this.filtersEvent}`, { event, filters: this.filters });
975
+ },
976
+ handleFiltersChange(value) {
977
+ if (this.backendFiltering) {
978
+ this.$emit("filters-change", value);
979
+ } else {
980
+ this.newData = this.data.filter(
981
+ (row) => this.isRowFiltered(row)
982
+ );
983
+ if (!this.backendPagination) {
984
+ this.newDataTotal = this.newData.length;
985
+ }
986
+ if (!this.backendSorting) {
987
+ if (this.sortMultiple && this.sortMultipleDataLocal && this.sortMultipleDataLocal.length > 0) {
988
+ this.doSortMultiColumn();
989
+ } else if (Object.keys(this.currentSortColumn).length > 0) {
990
+ this.doSortSingleColumn(this.currentSortColumn);
991
+ }
992
+ }
993
+ }
994
+ },
995
+ findIndexOfSortData(column) {
996
+ const sortObj = this.sortMultipleDataComputed.filter((i) => i.field === column.field)[0];
997
+ return this.sortMultipleDataComputed.indexOf(sortObj) + 1;
998
+ },
999
+ removeSortingPriority(column) {
1000
+ if (this.backendSorting) {
1001
+ this.$emit("sorting-priority-removed", column.field);
1002
+ } else {
1003
+ this.sortMultipleDataLocal = this.sortMultipleDataLocal.filter(
1004
+ (priority) => priority.field !== column.field
1005
+ );
1006
+ if (this.sortMultipleDataLocal.length === 0) {
1007
+ this.resetMultiSorting();
1008
+ } else {
1009
+ this.newData = helpers.multiColumnSort(this.newData, this.sortMultipleDataLocal);
1010
+ }
1011
+ }
1012
+ },
1013
+ resetMultiSorting() {
1014
+ this.sortMultipleDataLocal = [];
1015
+ this.currentSortColumn = BLANK_COLUMN;
1016
+ this.newData = this.data;
1017
+ },
1018
+ /*
1019
+ * Sort an array by key without mutating original data.
1020
+ * Call the user sort function if it was passed.
1021
+ */
1022
+ sortBy(array, key, fn, isAsc) {
1023
+ let sorted = [];
1024
+ if (fn && typeof fn === "function") {
1025
+ sorted = [...array].sort((a, b) => fn(a, b, isAsc));
1026
+ } else {
1027
+ sorted = [...array].sort((a, b) => {
1028
+ let newA = helpers.getValueByPath(a, key);
1029
+ let newB = helpers.getValueByPath(b, key);
1030
+ if (typeof newA === "boolean" && typeof newB === "boolean") {
1031
+ return isAsc ? +newA - +newB : +newB - +newA;
1032
+ }
1033
+ if (!helpers.isNil(newB) && helpers.isNil(newA)) return isAsc ? 1 : -1;
1034
+ if (!helpers.isNil(newA) && helpers.isNil(newB)) return isAsc ? -1 : 1;
1035
+ if (newA === newB) return 0;
1036
+ newA = typeof newA === "string" ? newA.toUpperCase() : newA;
1037
+ newB = typeof newB === "string" ? newB.toUpperCase() : newB;
1038
+ return isAsc ? newA > newB ? 1 : -1 : newA > newB ? -1 : 1;
1039
+ });
1040
+ }
1041
+ return sorted;
1042
+ },
1043
+ sortMultiColumn(column) {
1044
+ this.currentSortColumn = BLANK_COLUMN;
1045
+ if (!this.backendSorting) {
1046
+ const existingPriority = this.sortMultipleDataLocal.filter((i) => i.field === column.field)[0];
1047
+ if (existingPriority) {
1048
+ existingPriority.order = existingPriority.order === "desc" ? "asc" : "desc";
1049
+ } else {
1050
+ this.sortMultipleDataLocal.push({
1051
+ field: column.field,
1052
+ order: this.isAsc ? "asc" : "desc",
1053
+ customSort: column.customSort
1054
+ });
1055
+ }
1056
+ this.doSortMultiColumn();
1057
+ }
1058
+ },
1059
+ doSortMultiColumn() {
1060
+ this.newData = helpers.multiColumnSort(this.newData, this.sortMultipleDataLocal);
1061
+ },
1062
+ /*
1063
+ * Sort the column.
1064
+ * Toggle current direction on column if it's sortable
1065
+ * and not just updating the prop.
1066
+ */
1067
+ sort(column, updatingData = false, event = null) {
1068
+ if (!column || !column.sortable) return;
1069
+ if (
1070
+ // if backend sorting is enabled, just emit the sort press like usual
1071
+ // if the correct key combination isnt pressed, sort like usual
1072
+ !this.backendSorting && this.sortMultiple && (this.sortMultipleKey && event[this.sortMultipleKey] || !this.sortMultipleKey)
1073
+ ) {
1074
+ if (updatingData) {
1075
+ this.doSortMultiColumn();
1076
+ } else {
1077
+ this.sortMultiColumn(column);
1078
+ }
1079
+ } else {
1080
+ if (this.sortMultiple) {
1081
+ this.sortMultipleDataLocal = [];
1082
+ }
1083
+ if (!updatingData) {
1084
+ this.isAsc = vue.toRaw(column) === vue.toRaw(this.currentSortColumn) ? !this.isAsc : this.defaultSortDirection.toLowerCase() !== "desc";
1085
+ }
1086
+ if (!this.firstTimeSort) {
1087
+ this.$emit("sort", column.field, this.isAsc ? "asc" : "desc", event);
1088
+ }
1089
+ if (!this.backendSorting) {
1090
+ this.doSortSingleColumn(column);
1091
+ }
1092
+ this.currentSortColumn = column;
1093
+ }
1094
+ },
1095
+ doSortSingleColumn(column) {
1096
+ this.newData = this.sortBy(
1097
+ this.newData,
1098
+ column.field,
1099
+ column.customSort,
1100
+ this.isAsc
1101
+ );
1102
+ },
1103
+ isRowSelected(row, selected) {
1104
+ if (!selected) {
1105
+ return false;
1106
+ }
1107
+ if (this.customRowKey) {
1108
+ return row[this.customRowKey] === selected[this.customRowKey];
1109
+ }
1110
+ return row === selected;
1111
+ },
1112
+ /*
1113
+ * Check if the row is checked (is added to the array).
1114
+ */
1115
+ isRowChecked(row) {
1116
+ return helpers.indexOf(this.newCheckedRows, row, this.customIsChecked) >= 0;
1117
+ },
1118
+ /*
1119
+ * Remove a checked row from the array.
1120
+ */
1121
+ removeCheckedRow(row) {
1122
+ const index = helpers.indexOf(this.newCheckedRows, row, this.customIsChecked);
1123
+ if (index >= 0) {
1124
+ this.newCheckedRows.splice(index, 1);
1125
+ }
1126
+ },
1127
+ /*
1128
+ * Header checkbox click listener.
1129
+ * Add or remove all rows in current page.
1130
+ */
1131
+ checkAll() {
1132
+ const isAllChecked = this.isAllChecked;
1133
+ this.visibleData.forEach((currentRow) => {
1134
+ if (this.isRowCheckable(currentRow)) {
1135
+ this.removeCheckedRow(currentRow);
1136
+ }
1137
+ if (!isAllChecked) {
1138
+ if (this.isRowCheckable(currentRow)) {
1139
+ this.newCheckedRows.push(currentRow);
1140
+ }
1141
+ }
1142
+ });
1143
+ this.$emit("check", this.newCheckedRows);
1144
+ this.$emit("check-all", this.newCheckedRows);
1145
+ this.$emit("update:checkedRows", this.newCheckedRows);
1146
+ },
1147
+ /*
1148
+ * Row checkbox click listener.
1149
+ */
1150
+ checkRow(row, index, event) {
1151
+ if (!this.isRowCheckable(row)) return;
1152
+ const lastIndex = this.lastCheckedRowIndex;
1153
+ this.lastCheckedRowIndex = index;
1154
+ if (event.shiftKey && lastIndex !== null && index !== lastIndex) {
1155
+ this.shiftCheckRow(row, index, lastIndex);
1156
+ } else if (!this.isRowChecked(row)) {
1157
+ this.newCheckedRows.push(row);
1158
+ } else {
1159
+ this.removeCheckedRow(row);
1160
+ }
1161
+ this.$emit("check", this.newCheckedRows, row);
1162
+ this.$emit("update:checkedRows", this.newCheckedRows);
1163
+ },
1164
+ /*
1165
+ * Check row when shift is pressed.
1166
+ */
1167
+ shiftCheckRow(row, index, lastCheckedRowIndex) {
1168
+ const subset = this.visibleData.slice(
1169
+ Math.min(index, lastCheckedRowIndex),
1170
+ Math.max(index, lastCheckedRowIndex) + 1
1171
+ );
1172
+ const shouldCheck = !this.isRowChecked(row);
1173
+ subset.forEach((item) => {
1174
+ this.removeCheckedRow(item);
1175
+ if (shouldCheck && this.isRowCheckable(item)) {
1176
+ this.newCheckedRows.push(item);
1177
+ }
1178
+ });
1179
+ },
1180
+ /*
1181
+ * Row click listener.
1182
+ * Emit all necessary events.
1183
+ */
1184
+ selectRow(row) {
1185
+ this.$emit("click", row);
1186
+ this._selectedRow = row;
1187
+ if (this.selected === row) return;
1188
+ if (!this.isRowSelectable(row)) return;
1189
+ this.$emit("select", row, this.selected);
1190
+ this.$emit("update:selected", row);
1191
+ },
1192
+ /*
1193
+ * Toggle to show/hide details slot
1194
+ */
1195
+ toggleDetails(obj) {
1196
+ const found = this.isVisibleDetailRow(obj);
1197
+ if (found) {
1198
+ this.closeDetailRow(obj);
1199
+ this.$emit("details-close", obj);
1200
+ } else {
1201
+ this.openDetailRow(obj);
1202
+ this.$emit("details-open", obj);
1203
+ }
1204
+ this.$emit("update:openedDetailed", this.visibleDetailRows);
1205
+ },
1206
+ openDetailRow(obj) {
1207
+ const index = this.handleDetailKey(obj);
1208
+ this.visibleDetailRows.push(index);
1209
+ },
1210
+ closeDetailRow(obj) {
1211
+ const index = this.handleDetailKey(obj);
1212
+ const i = this.visibleDetailRows.indexOf(index);
1213
+ if (i >= 0) {
1214
+ this.visibleDetailRows.splice(i, 1);
1215
+ }
1216
+ },
1217
+ isVisibleDetailRow(obj) {
1218
+ const index = this.handleDetailKey(obj);
1219
+ return this.visibleDetailRows.indexOf(index) >= 0;
1220
+ },
1221
+ isActiveDetailRow(row) {
1222
+ return this.detailed && !this.customDetailRow && this.isVisibleDetailRow(row);
1223
+ },
1224
+ isActiveCustomDetailRow(row) {
1225
+ return this.detailed && this.customDetailRow && this.isVisibleDetailRow(row);
1226
+ },
1227
+ isRowFiltered(row) {
1228
+ for (const key in this.filters) {
1229
+ if (!this.filters[key]) continue;
1230
+ const input = this.filters[key];
1231
+ const column = this.newColumns.filter((c) => c.field === key)[0];
1232
+ if (column && column.customSearch && typeof column.customSearch === "function") {
1233
+ if (!column.customSearch(row, input)) return false;
1234
+ } else {
1235
+ const value = this.getValueByPath(row, key);
1236
+ if (value == null) return false;
1237
+ if (Number.isInteger(value)) {
1238
+ if (value !== Number(input)) return false;
1239
+ } else {
1240
+ const re = new RegExp(helpers.escapeRegExpChars(input + ""), "i");
1241
+ if (Array.isArray(value)) {
1242
+ const valid = value.some(
1243
+ (val) => re.test(helpers.removeDiacriticsFromString(val)) || re.test(val)
1244
+ );
1245
+ if (!valid) return false;
1246
+ } else {
1247
+ if (!re.test(helpers.removeDiacriticsFromString(value)) && !re.test(value)) {
1248
+ return false;
1249
+ }
1250
+ }
1251
+ }
1252
+ }
1253
+ }
1254
+ return true;
1255
+ },
1256
+ /*
1257
+ * When the detailKey is defined we use the object[detailKey] as index.
1258
+ * If not, use the object reference by default.
1259
+ */
1260
+ handleDetailKey(index) {
1261
+ const key = this.detailKey;
1262
+ return !key.length || !index ? index : index[key];
1263
+ },
1264
+ checkPredefinedDetailedRows() {
1265
+ const defaultExpandedRowsDefined = this.openedDetailed.length > 0;
1266
+ if (defaultExpandedRowsDefined && !this.detailKey.length) {
1267
+ throw new Error('If you set a predefined opened-detailed, you must provide a unique key using the prop "detail-key"');
1268
+ }
1269
+ },
1270
+ /*
1271
+ * Call initSort only first time (For example async data).
1272
+ */
1273
+ checkSort() {
1274
+ if (this.newColumns.length && this.firstTimeSort) {
1275
+ this.initSort();
1276
+ this.firstTimeSort = false;
1277
+ } else if (this.newColumns.length) {
1278
+ if (vue.toRaw(this.currentSortColumn) !== BLANK_COLUMN) {
1279
+ for (let i = 0; i < this.newColumns.length; i++) {
1280
+ if (this.newColumns[i].field === this.currentSortColumn.field) {
1281
+ this.currentSortColumn = this.newColumns[i];
1282
+ break;
1283
+ }
1284
+ }
1285
+ }
1286
+ }
1287
+ },
1288
+ /*
1289
+ * Check if footer slot has custom content.
1290
+ *
1291
+ * Assumes that `$slots.footer` is specified.
1292
+ */
1293
+ hasCustomFooterSlot() {
1294
+ var _a;
1295
+ const footer = this.$slots.footer();
1296
+ if (footer.length > 1) return true;
1297
+ if (helpers.isFragment(footer[0])) return true;
1298
+ const tag = (_a = footer[0].el) == null ? void 0 : _a.tag;
1299
+ if (tag !== "th" && tag !== "td") return false;
1300
+ return true;
1301
+ },
1302
+ /*
1303
+ * Check if bottom-left slot exists.
1304
+ */
1305
+ hasBottomLeftSlot() {
1306
+ return typeof this.$slots["bottom-left"] !== "undefined";
1307
+ },
1308
+ /*
1309
+ * Table arrow keys listener, change selection.
1310
+ */
1311
+ pressedArrow(pos) {
1312
+ if (!this.visibleData.length) return;
1313
+ let index = this.visibleData.indexOf(this.selected) + pos;
1314
+ index = index < 0 ? 0 : index > this.visibleData.length - 1 ? this.visibleData.length - 1 : index;
1315
+ const row = this.visibleData[index];
1316
+ if (!this.isRowSelectable(row)) {
1317
+ let newIndex = null;
1318
+ if (pos > 0) {
1319
+ for (let i = index; i < this.visibleData.length && newIndex === null; i++) {
1320
+ if (this.isRowSelectable(this.visibleData[i])) newIndex = i;
1321
+ }
1322
+ } else {
1323
+ for (let i = index; i >= 0 && newIndex === null; i--) {
1324
+ if (this.isRowSelectable(this.visibleData[i])) newIndex = i;
1325
+ }
1326
+ }
1327
+ if (newIndex >= 0) {
1328
+ this.selectRow(this.visibleData[newIndex]);
1329
+ }
1330
+ } else {
1331
+ this.selectRow(row);
1332
+ }
1333
+ },
1334
+ /*
1335
+ * Focus table element if has selected prop.
1336
+ */
1337
+ focus() {
1338
+ if (!this.focusable) return;
1339
+ this.$el.querySelector("table").focus();
1340
+ },
1341
+ /*
1342
+ * Initial sorted column based on the default-sort prop.
1343
+ */
1344
+ initSort() {
1345
+ if (this.sortMultiple && this.sortMultipleData) {
1346
+ this.sortMultipleData.forEach((column) => {
1347
+ this.sortMultiColumn(column);
1348
+ });
1349
+ } else {
1350
+ if (!this.defaultSort) return;
1351
+ let sortField = "";
1352
+ let sortDirection = this.defaultSortDirection;
1353
+ if (Array.isArray(this.defaultSort)) {
1354
+ sortField = this.defaultSort[0];
1355
+ if (this.defaultSort[1]) {
1356
+ sortDirection = this.defaultSort[1];
1357
+ }
1358
+ } else {
1359
+ sortField = this.defaultSort;
1360
+ }
1361
+ const sortColumn = this.newColumns.filter(
1362
+ (column) => column.field === sortField
1363
+ )[0];
1364
+ if (sortColumn) {
1365
+ this.isAsc = sortDirection.toLowerCase() !== "desc";
1366
+ this.sort(sortColumn, true);
1367
+ }
1368
+ }
1369
+ },
1370
+ /*
1371
+ * Emits drag start event (row)
1372
+ */
1373
+ handleDragStart(event, row, index) {
1374
+ if (!this.canDragRow) return;
1375
+ this.isDraggingRow = true;
1376
+ this.$emit("dragstart", { event, row, index });
1377
+ },
1378
+ /*
1379
+ * Emits drag leave event (row)
1380
+ */
1381
+ handleDragEnd(event, row, index) {
1382
+ if (!this.canDragRow) return;
1383
+ this.isDraggingRow = false;
1384
+ this.$emit("dragend", { event, row, index });
1385
+ },
1386
+ /*
1387
+ * Emits drop event (row)
1388
+ */
1389
+ handleDrop(event, row, index) {
1390
+ if (!this.canDragRow) return;
1391
+ this.$emit("drop", { event, row, index });
1392
+ },
1393
+ /*
1394
+ * Emits drag over event (row)
1395
+ */
1396
+ handleDragOver(event, row, index) {
1397
+ if (!this.canDragRow) return;
1398
+ this.$emit("dragover", { event, row, index });
1399
+ },
1400
+ /*
1401
+ * Emits drag leave event (row)
1402
+ */
1403
+ handleDragLeave(event, row, index) {
1404
+ if (!this.canDragRow) return;
1405
+ this.$emit("dragleave", { event, row, index });
1406
+ },
1407
+ // FIXME: this method may emit events not listed in `emits`.
1408
+ // I decided not to list them to check if event listeners are actually
1409
+ // set in `$attrs`. The original idea of this method was to address
1410
+ // some performance issues and introduced at the commit:
1411
+ // https://github.com/ntohq/buefy-next/commit/e38726497785145195e9605840e33980fd4ae9e0
1412
+ // I am not sure whether the justification at https://github.com/buefy/buefy/pull/2150
1413
+ // is still relevant with Vue 3.
1414
+ emitEventForRow(eventName, event, row) {
1415
+ return this.$attrs[`on${eventName}`] ? this.$emit(eventName, row, event) : null;
1416
+ },
1417
+ /*
1418
+ * Emits drag start event (column)
1419
+ */
1420
+ handleColumnDragStart(event, column, index) {
1421
+ if (!this.canDragColumn) return;
1422
+ this.isDraggingColumn = true;
1423
+ this.$emit("columndragstart", { event, column, index });
1424
+ },
1425
+ /*
1426
+ * Emits drag leave event (column)
1427
+ */
1428
+ handleColumnDragEnd(event, column, index) {
1429
+ if (!this.canDragColumn) return;
1430
+ this.isDraggingColumn = false;
1431
+ this.$emit("columndragend", { event, column, index });
1432
+ },
1433
+ /*
1434
+ * Emits drop event (column)
1435
+ */
1436
+ handleColumnDrop(event, column, index) {
1437
+ if (!this.canDragColumn) return;
1438
+ this.$emit("columndrop", { event, column, index });
1439
+ },
1440
+ /*
1441
+ * Emits drag over event (column)
1442
+ */
1443
+ handleColumnDragOver(event, column, index) {
1444
+ if (!this.canDragColumn) return;
1445
+ this.$emit("columndragover", { event, column, index });
1446
+ },
1447
+ /*
1448
+ * Emits drag leave event (column)
1449
+ */
1450
+ handleColumnDragLeave(event, column, index) {
1451
+ if (!this.canDragColumn) return;
1452
+ this.$emit("columndragleave", { event, column, index });
1453
+ },
1454
+ /*
1455
+ * Starts monitoring drag-by-touch events (row on touch-enabled devices)
1456
+ */
1457
+ handleTouchStart(event, row) {
1458
+ if (!this.canDragRow) return;
1459
+ if (this.isDraggingColumn) return;
1460
+ if (this._selectedRow !== row) return;
1461
+ event.preventDefault();
1462
+ this.mayBeTouchDragging = true;
1463
+ },
1464
+ /*
1465
+ * Emits dragover and dragleave events (row on touch-enabled devices)
1466
+ *
1467
+ * Emits also dragstart if this is the first touchmove after touchstart.
1468
+ */
1469
+ handleTouchMove(event) {
1470
+ if (!this.canDragRow) return;
1471
+ if (!this.mayBeTouchDragging) return;
1472
+ if (!this.isDraggingRow) {
1473
+ const eventTarget = event.target;
1474
+ const tr = eventTarget.closest("tr");
1475
+ this.draggedCellContent = tr ? `<table class="table"><tr>${tr.innerHTML}</tr></table>` : eventTarget.innerHTML;
1476
+ this.$refs.draggedCell.style.width = tr ? `${tr.offsetWidth}px` : `${eventTarget.offsetWidth}px`;
1477
+ eventTarget.dispatchEvent(helpers.translateTouchAsDragEvent(event, {
1478
+ type: "dragstart"
1479
+ }));
1480
+ }
1481
+ const touch = event.touches[0];
1482
+ const target = document.elementFromPoint(touch.clientX, touch.clientY);
1483
+ if (target != null) {
1484
+ if (target !== this.touchDragoverTarget) {
1485
+ if (this.touchDragoverTarget != null) {
1486
+ this.touchDragoverTarget.dispatchEvent(
1487
+ helpers.translateTouchAsDragEvent(event, {
1488
+ type: "dragleave",
1489
+ target: this.touchDragoverTarget
1490
+ })
1491
+ );
1492
+ }
1493
+ this.touchDragoverTarget = target;
1494
+ target.dispatchEvent(
1495
+ helpers.translateTouchAsDragEvent(event, {
1496
+ type: "dragover",
1497
+ target
1498
+ })
1499
+ );
1500
+ }
1501
+ } else if (this.touchDragoverTarget != null) {
1502
+ this.touchDragoverTarget.dispatchEvent(
1503
+ helpers.translateTouchAsDragEvent(event, {
1504
+ type: "dragleave",
1505
+ target: this.touchDragoverTarget
1506
+ })
1507
+ );
1508
+ this.touchDragoverTarget = null;
1509
+ }
1510
+ this.updateDraggedCell(touch);
1511
+ },
1512
+ /*
1513
+ * Emits drop and dragend events (row on touch-enabled devices)
1514
+ */
1515
+ handleTouchEnd(event) {
1516
+ if (!this.canDragRow) return;
1517
+ if (this.isDraggingRow) {
1518
+ const touch = event.changedTouches[0];
1519
+ const target = document.elementFromPoint(touch.clientX, touch.clientY);
1520
+ if (target != null) {
1521
+ target.dispatchEvent(helpers.translateTouchAsDragEvent(event, {
1522
+ type: "drop",
1523
+ target
1524
+ }));
1525
+ }
1526
+ event.target.dispatchEvent(helpers.translateTouchAsDragEvent(event, {
1527
+ type: "dragend"
1528
+ }));
1529
+ this._selectedRow = null;
1530
+ }
1531
+ this.mayBeTouchDragging = false;
1532
+ },
1533
+ /*
1534
+ * Starts monitoring drag-by-touch events (column on touch-enabled devices)
1535
+ */
1536
+ handleColumnTouchStart(event) {
1537
+ if (!this.canDragColumn) return;
1538
+ if (this.isDraggingRow) return;
1539
+ event.preventDefault();
1540
+ this.mayBeTouchDragging = true;
1541
+ },
1542
+ /*
1543
+ * Emits dragover and dragleave events (column on touch-enabled devices)
1544
+ *
1545
+ * Also emits dragstart if this is the first touchmove after touchstart.
1546
+ */
1547
+ handleColumnTouchMove(event) {
1548
+ if (!this.canDragColumn) return;
1549
+ if (!this.mayBeTouchDragging) return;
1550
+ if (!this.isDraggingColumn) {
1551
+ const eventTarget = event.target;
1552
+ this.draggedCellContent = eventTarget.innerHTML;
1553
+ this.$refs.draggedCell.style.width = `${eventTarget.offsetWidth}px`;
1554
+ eventTarget.dispatchEvent(helpers.translateTouchAsDragEvent(event, {
1555
+ type: "dragstart"
1556
+ }));
1557
+ }
1558
+ const touch = event.touches[0];
1559
+ const target = document.elementFromPoint(touch.clientX, touch.clientY);
1560
+ if (target != null) {
1561
+ if (target !== this.touchDragoverTarget) {
1562
+ if (this.touchDragoverTarget != null) {
1563
+ this.touchDragoverTarget.dispatchEvent(
1564
+ helpers.translateTouchAsDragEvent(event, {
1565
+ type: "dragleave",
1566
+ target: this.touchDragoverTarget
1567
+ })
1568
+ );
1569
+ }
1570
+ this.touchDragoverTarget = target;
1571
+ target.dispatchEvent(
1572
+ helpers.translateTouchAsDragEvent(event, {
1573
+ type: "dragover",
1574
+ target
1575
+ })
1576
+ );
1577
+ }
1578
+ } else if (this.touchDragoverTarget != null) {
1579
+ this.touchDragoverTarget.dispatchEvent(
1580
+ helpers.translateTouchAsDragEvent(event, {
1581
+ type: "dragleave",
1582
+ target: this.touchDragoverTarget
1583
+ })
1584
+ );
1585
+ this.touchDragoverTarget = null;
1586
+ }
1587
+ this.updateDraggedCell(touch);
1588
+ },
1589
+ /*
1590
+ * Emits drop and dragend events (column on touch-enabled devices)
1591
+ */
1592
+ handleColumnTouchEnd(event) {
1593
+ if (!this.canDragColumn) return;
1594
+ if (this.isDraggingColumn) {
1595
+ const touch = event.changedTouches[0];
1596
+ const target = document.elementFromPoint(touch.clientX, touch.clientY);
1597
+ if (target != null) {
1598
+ target.dispatchEvent(helpers.translateTouchAsDragEvent(event, {
1599
+ type: "drop",
1600
+ target
1601
+ }));
1602
+ }
1603
+ event.target.dispatchEvent(helpers.translateTouchAsDragEvent(event, {
1604
+ type: "dragend"
1605
+ }));
1606
+ }
1607
+ this.mayBeTouchDragging = false;
1608
+ },
1609
+ updateDraggedCell({ clientX, clientY }) {
1610
+ const cellRect = this.$refs.draggedCell.getBoundingClientRect();
1611
+ const top = clientY + window.scrollY - cellRect.height / 2;
1612
+ const left = clientX + window.scrollX - cellRect.width / 2;
1613
+ this.$refs.draggedCell.style.top = `calc(${top}px)`;
1614
+ this.$refs.draggedCell.style.left = `calc(${left}px)`;
1615
+ },
1616
+ _registerTableColumn(column) {
1617
+ if (column._isTableColumn) {
1618
+ this.defaultSlots.push(column);
1619
+ }
1620
+ },
1621
+ _unregisterTableColumn(column) {
1622
+ const index = this.defaultSlots.indexOf(column);
1623
+ if (index !== -1) {
1624
+ this.defaultSlots.splice(index, 1);
1625
+ }
1626
+ }
1627
+ },
1628
+ mounted() {
1629
+ this.checkPredefinedDetailedRows();
1630
+ this.checkSort();
1631
+ const prepareDraggedCell = (isDraggable) => {
1632
+ if (isDraggable && this.$data._draggedCellEl == null) {
1633
+ this.$data._draggedCellEl = helpers.createAbsoluteElement(this.$refs.draggedCell);
1634
+ }
1635
+ };
1636
+ this.$watch("draggable", prepareDraggedCell, { immediate: true });
1637
+ this.$watch("draggableColumn", prepareDraggedCell, { immediate: true });
1638
+ },
1639
+ beforeUnmount() {
1640
+ if (this.$data._draggedCellEl) {
1641
+ helpers.removeElement(this.$data._draggedCellEl);
1642
+ }
1643
+ }
1644
+ });
1645
+
1646
+ const _hoisted_1 = ["tabindex"];
1647
+ const _hoisted_2 = { key: 1 };
1648
+ const _hoisted_3 = {
1649
+ key: 0,
1650
+ width: "40px"
1651
+ };
1652
+ const _hoisted_4 = ["onClick", "draggable", "onDragstart", "onDragend", "onDrop", "onDragover", "onDragleave"];
1653
+ const _hoisted_5 = {
1654
+ key: 0,
1655
+ class: "multi-sort-icons"
1656
+ };
1657
+ const _hoisted_6 = ["onClick"];
1658
+ const _hoisted_7 = {
1659
+ key: 0,
1660
+ class: "is-subheading"
1661
+ };
1662
+ const _hoisted_8 = {
1663
+ key: 0,
1664
+ width: "40px"
1665
+ };
1666
+ const _hoisted_9 = { key: 1 };
1667
+ const _hoisted_10 = { key: 2 };
1668
+ const _hoisted_11 = { key: 1 };
1669
+ const _hoisted_12 = {
1670
+ key: 0,
1671
+ width: "40px"
1672
+ };
1673
+ const _hoisted_13 = { key: 1 };
1674
+ const _hoisted_14 = { key: 2 };
1675
+ const _hoisted_15 = ["onClick", "onDblclick", "onMouseenter", "onMouseleave", "onContextmenu", "draggable", "onDragstart", "onDragend", "onDrop", "onDragover", "onDragleave", "onTouchstart"];
1676
+ const _hoisted_16 = {
1677
+ key: 0,
1678
+ class: "chevron-cell"
1679
+ };
1680
+ const _hoisted_17 = ["onClick"];
1681
+ const _hoisted_18 = {
1682
+ key: 0,
1683
+ class: "detail"
1684
+ };
1685
+ const _hoisted_19 = ["colspan"];
1686
+ const _hoisted_20 = { class: "detail-container" };
1687
+ const _hoisted_21 = {
1688
+ key: 0,
1689
+ class: "is-empty"
1690
+ };
1691
+ const _hoisted_22 = ["colspan"];
1692
+ const _hoisted_23 = { key: 2 };
1693
+ const _hoisted_24 = { class: "table-footer" };
1694
+ const _hoisted_25 = ["colspan"];
1695
+ const _hoisted_26 = ["innerHTML"];
1696
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
1697
+ const _component_b_table_mobile_sort = vue.resolveComponent("b-table-mobile-sort");
1698
+ const _component_b_table_pagination = vue.resolveComponent("b-table-pagination");
1699
+ const _component_b_checkbox = vue.resolveComponent("b-checkbox");
1700
+ const _component_b_slot_component = vue.resolveComponent("b-slot-component");
1701
+ const _component_b_icon = vue.resolveComponent("b-icon");
1702
+ const _component_b_input = vue.resolveComponent("b-input");
1703
+ const _component_b_loading = vue.resolveComponent("b-loading");
1704
+ return vue.openBlock(), vue.createElementBlock(
1705
+ "div",
1706
+ vue.mergeProps({ class: "b-table" }, _ctx.rootAttrs),
1707
+ [
1708
+ vue.renderSlot(_ctx.$slots, "default"),
1709
+ _ctx.mobileCards && _ctx.hasSortablenewColumns ? (vue.openBlock(), vue.createBlock(_component_b_table_mobile_sort, {
1710
+ key: 0,
1711
+ "current-sort-column": _ctx.currentSortColumn,
1712
+ "sort-multiple": _ctx.sortMultiple,
1713
+ "sort-multiple-data": _ctx.sortMultipleDataComputed,
1714
+ "is-asc": _ctx.isAsc,
1715
+ columns: _ctx.newColumns,
1716
+ placeholder: _ctx.mobileSortPlaceholder,
1717
+ "icon-pack": _ctx.iconPack,
1718
+ "sort-icon": _ctx.sortIcon,
1719
+ "sort-icon-size": _ctx.sortIconSize,
1720
+ onSort: _cache[0] || (_cache[0] = (column, event) => _ctx.sort(column, null, event)),
1721
+ onRemovePriority: _cache[1] || (_cache[1] = (column) => _ctx.removeSortingPriority(column))
1722
+ }, null, 8, ["current-sort-column", "sort-multiple", "sort-multiple-data", "is-asc", "columns", "placeholder", "icon-pack", "sort-icon", "sort-icon-size"])) : vue.createCommentVNode("v-if", true),
1723
+ _ctx.paginated && (_ctx.paginationPosition === "top" || _ctx.paginationPosition === "both") ? vue.renderSlot(_ctx.$slots, "pagination", { key: 1 }, () => [
1724
+ vue.createVNode(_component_b_table_pagination, vue.mergeProps(_ctx.fallthroughAttrs, {
1725
+ "per-page": _ctx.perPage,
1726
+ paginated: _ctx.paginated,
1727
+ rounded: _ctx.paginationRounded,
1728
+ "icon-pack": _ctx.iconPack,
1729
+ total: _ctx.newDataTotal,
1730
+ "current-page": _ctx.newCurrentPage,
1731
+ "onUpdate:currentPage": _cache[2] || (_cache[2] = ($event) => _ctx.newCurrentPage = $event),
1732
+ "aria-next-label": _ctx.ariaNextLabel,
1733
+ "aria-previous-label": _ctx.ariaPreviousLabel,
1734
+ "aria-page-label": _ctx.ariaPageLabel,
1735
+ "aria-current-label": _ctx.ariaCurrentLabel,
1736
+ onPageChange: _cache[3] || (_cache[3] = (event) => _ctx.$emit("page-change", event)),
1737
+ "page-input": _ctx.pageInput,
1738
+ "pagination-order": _ctx.paginationOrder,
1739
+ "page-input-position": _ctx.pageInputPosition,
1740
+ "debounce-page-input": _ctx.debouncePageInput
1741
+ }), {
1742
+ default: vue.withCtx(() => [
1743
+ vue.renderSlot(_ctx.$slots, "top-left")
1744
+ ]),
1745
+ _: 3
1746
+ /* FORWARDED */
1747
+ }, 16, ["per-page", "paginated", "rounded", "icon-pack", "total", "current-page", "aria-next-label", "aria-previous-label", "aria-page-label", "aria-current-label", "page-input", "pagination-order", "page-input-position", "debounce-page-input"])
1748
+ ]) : vue.createCommentVNode("v-if", true),
1749
+ vue.createElementVNode(
1750
+ "div",
1751
+ {
1752
+ class: vue.normalizeClass(["table-wrapper", _ctx.tableWrapperClasses]),
1753
+ style: vue.normalizeStyle(_ctx.tableStyle)
1754
+ },
1755
+ [
1756
+ vue.createElementVNode("table", {
1757
+ class: vue.normalizeClass(["table", _ctx.tableClasses]),
1758
+ tabindex: !_ctx.focusable ? void 0 : 0,
1759
+ onKeydown: [
1760
+ _cache[9] || (_cache[9] = vue.withKeys(vue.withModifiers(($event) => _ctx.pressedArrow(-1), ["self", "prevent"]), ["up"])),
1761
+ _cache[10] || (_cache[10] = vue.withKeys(vue.withModifiers(($event) => _ctx.pressedArrow(1), ["self", "prevent"]), ["down"]))
1762
+ ]
1763
+ }, [
1764
+ _ctx.caption ? vue.withDirectives((vue.openBlock(), vue.createElementBlock(
1765
+ "caption",
1766
+ { key: 0 },
1767
+ vue.toDisplayString(_ctx.caption),
1768
+ 513
1769
+ /* TEXT, NEED_PATCH */
1770
+ )), [
1771
+ [vue.vShow, _ctx.showCaption]
1772
+ ]) : vue.createCommentVNode("v-if", true),
1773
+ _ctx.newColumns.length && _ctx.showHeader ? (vue.openBlock(), vue.createElementBlock("thead", _hoisted_2, [
1774
+ vue.createElementVNode("tr", null, [
1775
+ _ctx.showDetailRowIcon ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_3)) : vue.createCommentVNode("v-if", true),
1776
+ _ctx.checkable && _ctx.checkboxPosition === "left" ? (vue.openBlock(), vue.createElementBlock(
1777
+ "th",
1778
+ {
1779
+ key: 1,
1780
+ class: vue.normalizeClass(["checkbox-cell", { "is-sticky": _ctx.stickyCheckbox }])
1781
+ },
1782
+ [
1783
+ _ctx.headerCheckable ? vue.renderSlot(_ctx.$slots, "check-all", {
1784
+ key: 0,
1785
+ isAllChecked: _ctx.isAllChecked,
1786
+ isAllUncheckable: _ctx.isAllUncheckable,
1787
+ checkAll: _ctx.checkAll
1788
+ }, () => [
1789
+ vue.createVNode(_component_b_checkbox, {
1790
+ autocomplete: "off",
1791
+ "model-value": _ctx.isAllChecked,
1792
+ type: _ctx.checkboxType,
1793
+ disabled: _ctx.isAllUncheckable,
1794
+ onChange: _ctx.checkAll
1795
+ }, null, 8, ["model-value", "type", "disabled", "onChange"])
1796
+ ]) : vue.createCommentVNode("v-if", true)
1797
+ ],
1798
+ 2
1799
+ /* CLASS */
1800
+ )) : vue.createCommentVNode("v-if", true),
1801
+ (vue.openBlock(true), vue.createElementBlock(
1802
+ vue.Fragment,
1803
+ null,
1804
+ vue.renderList(_ctx.visibleColumns, (column, index) => {
1805
+ return vue.openBlock(), vue.createElementBlock("th", vue.mergeProps({
1806
+ key: column.newKey + ":" + index + "header"
1807
+ }, column.thAttrs(column), {
1808
+ class: [column.thClasses, {
1809
+ "is-current-sort": !_ctx.sortMultiple && _ctx.currentSortColumn === column
1810
+ }],
1811
+ style: column.thStyle,
1812
+ onClick: vue.withModifiers(($event) => _ctx.sort(column, null, $event), ["stop"]),
1813
+ draggable: _ctx.canDragColumn,
1814
+ onDragstart: ($event) => _ctx.handleColumnDragStart($event, column, index),
1815
+ onDragend: ($event) => _ctx.handleColumnDragEnd($event, column, index),
1816
+ onDrop: ($event) => _ctx.handleColumnDrop($event, column, index),
1817
+ onDragover: ($event) => _ctx.handleColumnDragOver($event, column, index),
1818
+ onDragleave: ($event) => _ctx.handleColumnDragLeave($event, column, index),
1819
+ onTouchstart: _cache[4] || (_cache[4] = ($event) => _ctx.handleColumnTouchStart($event)),
1820
+ onTouchmove: _cache[5] || (_cache[5] = ($event) => _ctx.handleColumnTouchMove($event)),
1821
+ onTouchend: _cache[6] || (_cache[6] = ($event) => _ctx.handleColumnTouchEnd($event))
1822
+ }), [
1823
+ vue.createElementVNode(
1824
+ "div",
1825
+ {
1826
+ class: vue.normalizeClass(["th-wrap is-relative", {
1827
+ "is-numeric": column.numeric,
1828
+ "is-centered": column.centered
1829
+ }]),
1830
+ style: vue.normalizeStyle(column.thWrapStyle)
1831
+ },
1832
+ [
1833
+ column.$slots.header ? (vue.openBlock(), vue.createBlock(_component_b_slot_component, {
1834
+ key: 0,
1835
+ component: column,
1836
+ scoped: "",
1837
+ name: "header",
1838
+ tag: "span",
1839
+ props: { column, index }
1840
+ }, null, 8, ["component", "props"])) : (vue.openBlock(), vue.createElementBlock(
1841
+ vue.Fragment,
1842
+ { key: 1 },
1843
+ [
1844
+ vue.createTextVNode(
1845
+ vue.toDisplayString(column.label) + " ",
1846
+ 1
1847
+ /* TEXT */
1848
+ ),
1849
+ _ctx.sortMultiple && _ctx.sortMultipleDataComputed && _ctx.sortMultipleDataComputed.length > 0 && _ctx.sortMultipleDataComputed.filter((i) => i.field === column.field).length > 0 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_5, [
1850
+ vue.createVNode(_component_b_icon, {
1851
+ icon: _ctx.sortIcon,
1852
+ pack: _ctx.iconPack,
1853
+ both: "",
1854
+ size: _ctx.sortIconSize,
1855
+ class: vue.normalizeClass({
1856
+ "is-desc": _ctx.sortMultipleDataComputed.filter((i) => i.field === column.field)[0].order === "desc"
1857
+ })
1858
+ }, null, 8, ["icon", "pack", "size", "class"]),
1859
+ vue.createTextVNode(
1860
+ " " + vue.toDisplayString(_ctx.findIndexOfSortData(column)) + " ",
1861
+ 1
1862
+ /* TEXT */
1863
+ ),
1864
+ vue.createElementVNode("button", {
1865
+ class: "delete is-small multi-sort-cancel-icon",
1866
+ type: "button",
1867
+ onClick: vue.withModifiers(($event) => _ctx.removeSortingPriority(column), ["stop"])
1868
+ }, null, 8, _hoisted_6)
1869
+ ])) : (vue.openBlock(), vue.createBlock(_component_b_icon, {
1870
+ key: 1,
1871
+ icon: _ctx.sortIcon,
1872
+ pack: _ctx.iconPack,
1873
+ both: "",
1874
+ size: _ctx.sortIconSize,
1875
+ class: vue.normalizeClass(["sort-icon", {
1876
+ "is-desc": !_ctx.isAsc,
1877
+ "is-invisible": _ctx.currentSortColumn !== column
1878
+ }])
1879
+ }, null, 8, ["icon", "pack", "size", "class"]))
1880
+ ],
1881
+ 64
1882
+ /* STABLE_FRAGMENT */
1883
+ ))
1884
+ ],
1885
+ 6
1886
+ /* CLASS, STYLE */
1887
+ )
1888
+ ], 16, _hoisted_4);
1889
+ }),
1890
+ 128
1891
+ /* KEYED_FRAGMENT */
1892
+ )),
1893
+ _ctx.checkable && _ctx.checkboxPosition === "right" ? (vue.openBlock(), vue.createElementBlock(
1894
+ "th",
1895
+ {
1896
+ key: 2,
1897
+ class: vue.normalizeClass(["checkbox-cell", { "is-sticky": _ctx.stickyCheckbox }])
1898
+ },
1899
+ [
1900
+ _ctx.headerCheckable ? vue.renderSlot(_ctx.$slots, "check-all", {
1901
+ key: 0,
1902
+ isAllChecked: _ctx.isAllChecked,
1903
+ isAllUncheckable: _ctx.isAllUncheckable,
1904
+ checkAll: _ctx.checkAll
1905
+ }, () => [
1906
+ vue.createVNode(_component_b_checkbox, {
1907
+ autocomplete: "off",
1908
+ "model-value": _ctx.isAllChecked,
1909
+ type: _ctx.checkboxType,
1910
+ disabled: _ctx.isAllUncheckable,
1911
+ onChange: _ctx.checkAll
1912
+ }, null, 8, ["model-value", "type", "disabled", "onChange"])
1913
+ ]) : vue.createCommentVNode("v-if", true)
1914
+ ],
1915
+ 2
1916
+ /* CLASS */
1917
+ )) : vue.createCommentVNode("v-if", true)
1918
+ ]),
1919
+ _ctx.hasCustomSubheadings ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_7, [
1920
+ _ctx.showDetailRowIcon ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_8)) : vue.createCommentVNode("v-if", true),
1921
+ _ctx.checkable && _ctx.checkboxPosition === "left" ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_9)) : vue.createCommentVNode("v-if", true),
1922
+ (vue.openBlock(true), vue.createElementBlock(
1923
+ vue.Fragment,
1924
+ null,
1925
+ vue.renderList(_ctx.visibleColumns, (column, index) => {
1926
+ return vue.openBlock(), vue.createElementBlock(
1927
+ "th",
1928
+ {
1929
+ key: column.newKey + ":" + index + "subheading",
1930
+ style: vue.normalizeStyle(column.style)
1931
+ },
1932
+ [
1933
+ vue.createElementVNode(
1934
+ "div",
1935
+ {
1936
+ class: vue.normalizeClass(["th-wrap", {
1937
+ "is-numeric": column.numeric,
1938
+ "is-centered": column.centered
1939
+ }]),
1940
+ style: vue.normalizeStyle(column.thWrapStyle)
1941
+ },
1942
+ [
1943
+ column.$slots.subheading ? (vue.openBlock(), vue.createBlock(_component_b_slot_component, {
1944
+ key: 0,
1945
+ component: column,
1946
+ scoped: "",
1947
+ name: "subheading",
1948
+ tag: "span",
1949
+ props: { column, index }
1950
+ }, null, 8, ["component", "props"])) : (vue.openBlock(), vue.createElementBlock(
1951
+ vue.Fragment,
1952
+ { key: 1 },
1953
+ [
1954
+ vue.createTextVNode(
1955
+ vue.toDisplayString(column.subheading),
1956
+ 1
1957
+ /* TEXT */
1958
+ )
1959
+ ],
1960
+ 64
1961
+ /* STABLE_FRAGMENT */
1962
+ ))
1963
+ ],
1964
+ 6
1965
+ /* CLASS, STYLE */
1966
+ )
1967
+ ],
1968
+ 4
1969
+ /* STYLE */
1970
+ );
1971
+ }),
1972
+ 128
1973
+ /* KEYED_FRAGMENT */
1974
+ )),
1975
+ _ctx.checkable && _ctx.checkboxPosition === "right" ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_10)) : vue.createCommentVNode("v-if", true)
1976
+ ])) : vue.createCommentVNode("v-if", true),
1977
+ _ctx.hasSearchablenewColumns ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_11, [
1978
+ _ctx.showDetailRowIcon ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_12)) : vue.createCommentVNode("v-if", true),
1979
+ _ctx.checkable && _ctx.checkboxPosition === "left" ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_13)) : vue.createCommentVNode("v-if", true),
1980
+ (vue.openBlock(true), vue.createElementBlock(
1981
+ vue.Fragment,
1982
+ null,
1983
+ vue.renderList(_ctx.visibleColumns, (column, index) => {
1984
+ return vue.openBlock(), vue.createElementBlock(
1985
+ "th",
1986
+ vue.mergeProps({
1987
+ key: column.newKey + ":" + index + "searchable"
1988
+ }, column.thAttrs(column), {
1989
+ style: column.thStyle,
1990
+ class: { "is-sticky": column.sticky }
1991
+ }),
1992
+ [
1993
+ vue.createElementVNode(
1994
+ "div",
1995
+ {
1996
+ class: "th-wrap",
1997
+ style: vue.normalizeStyle(column.thWrapStyle)
1998
+ },
1999
+ [
2000
+ column.searchable ? (vue.openBlock(), vue.createElementBlock(
2001
+ vue.Fragment,
2002
+ { key: 0 },
2003
+ [
2004
+ column.$slots.searchable ? (vue.openBlock(), vue.createBlock(_component_b_slot_component, {
2005
+ key: 0,
2006
+ component: column,
2007
+ scoped: true,
2008
+ name: "searchable",
2009
+ tag: "span",
2010
+ props: { column, filters: _ctx.filters }
2011
+ }, null, 8, ["component", "props"])) : (vue.openBlock(), vue.createBlock(_component_b_input, vue.mergeProps({
2012
+ key: 1,
2013
+ [vue.toHandlerKey(_ctx.filtersEvent)]: _ctx.onFiltersEvent
2014
+ }, {
2015
+ modelValue: _ctx.filters[column.field],
2016
+ "onUpdate:modelValue": ($event) => _ctx.filters[column.field] = $event,
2017
+ type: column.numeric ? "number" : "text"
2018
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "type"]))
2019
+ ],
2020
+ 64
2021
+ /* STABLE_FRAGMENT */
2022
+ )) : vue.createCommentVNode("v-if", true)
2023
+ ],
2024
+ 4
2025
+ /* STYLE */
2026
+ )
2027
+ ],
2028
+ 16
2029
+ /* FULL_PROPS */
2030
+ );
2031
+ }),
2032
+ 128
2033
+ /* KEYED_FRAGMENT */
2034
+ )),
2035
+ _ctx.checkable && _ctx.checkboxPosition === "right" ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_14)) : vue.createCommentVNode("v-if", true)
2036
+ ])) : vue.createCommentVNode("v-if", true)
2037
+ ])) : vue.createCommentVNode("v-if", true),
2038
+ vue.createElementVNode("tbody", null, [
2039
+ (vue.openBlock(true), vue.createElementBlock(
2040
+ vue.Fragment,
2041
+ null,
2042
+ vue.renderList(_ctx.visibleData, (row, index) => {
2043
+ return vue.openBlock(), vue.createElementBlock(
2044
+ vue.Fragment,
2045
+ {
2046
+ key: _ctx.customRowKey ? row[_ctx.customRowKey] : index
2047
+ },
2048
+ [
2049
+ vue.createElementVNode("tr", {
2050
+ class: vue.normalizeClass([_ctx.rowClass(row, index), {
2051
+ "is-selected": _ctx.isRowSelected(row, _ctx.selected),
2052
+ "is-checked": _ctx.isRowChecked(row)
2053
+ }]),
2054
+ onClick: ($event) => _ctx.selectRow(row),
2055
+ onDblclick: ($event) => _ctx.$emit("dblclick", row),
2056
+ onMouseenter: ($event) => _ctx.emitEventForRow("mouseenter", $event, row),
2057
+ onMouseleave: ($event) => _ctx.emitEventForRow("mouseleave", $event, row),
2058
+ onContextmenu: ($event) => _ctx.$emit("contextmenu", row, $event),
2059
+ draggable: _ctx.canDragRow,
2060
+ onDragstart: ($event) => _ctx.handleDragStart($event, row, index),
2061
+ onDragend: ($event) => _ctx.handleDragEnd($event, row, index),
2062
+ onDrop: ($event) => _ctx.handleDrop($event, row, index),
2063
+ onDragover: ($event) => _ctx.handleDragOver($event, row, index),
2064
+ onDragleave: ($event) => _ctx.handleDragLeave($event, row, index),
2065
+ onTouchstart: ($event) => _ctx.handleTouchStart($event, row),
2066
+ onTouchmove: _cache[7] || (_cache[7] = ($event) => _ctx.handleTouchMove($event)),
2067
+ onTouchend: _cache[8] || (_cache[8] = ($event) => _ctx.handleTouchEnd($event))
2068
+ }, [
2069
+ _ctx.showDetailRowIcon ? (vue.openBlock(), vue.createElementBlock("td", _hoisted_16, [
2070
+ _ctx.hasDetailedVisible(row) ? (vue.openBlock(), vue.createElementBlock("a", {
2071
+ key: 0,
2072
+ role: "button",
2073
+ onClick: vue.withModifiers(($event) => _ctx.toggleDetails(row), ["stop"])
2074
+ }, [
2075
+ vue.createVNode(_component_b_icon, {
2076
+ icon: _ctx.detailIcon,
2077
+ pack: _ctx.iconPack,
2078
+ both: "",
2079
+ class: vue.normalizeClass({ "is-expanded": _ctx.isVisibleDetailRow(row) })
2080
+ }, null, 8, ["icon", "pack", "class"])
2081
+ ], 8, _hoisted_17)) : vue.createCommentVNode("v-if", true)
2082
+ ])) : vue.createCommentVNode("v-if", true),
2083
+ _ctx.checkable && _ctx.checkboxPosition === "left" ? (vue.openBlock(), vue.createElementBlock(
2084
+ "td",
2085
+ {
2086
+ key: 1,
2087
+ class: vue.normalizeClass(["checkbox-cell", { "is-sticky": _ctx.stickyCheckbox }])
2088
+ },
2089
+ [
2090
+ vue.createVNode(_component_b_checkbox, {
2091
+ autocomplete: "off",
2092
+ "model-value": _ctx.isRowChecked(row),
2093
+ type: _ctx.checkboxType,
2094
+ disabled: !_ctx.isRowCheckable(row),
2095
+ onClick: vue.withModifiers(($event) => _ctx.checkRow(row, index, $event), ["prevent", "stop"])
2096
+ }, null, 8, ["model-value", "type", "disabled", "onClick"])
2097
+ ],
2098
+ 2
2099
+ /* CLASS */
2100
+ )) : vue.createCommentVNode("v-if", true),
2101
+ (vue.openBlock(true), vue.createElementBlock(
2102
+ vue.Fragment,
2103
+ null,
2104
+ vue.renderList(_ctx.visibleColumns, (column, colindex) => {
2105
+ return vue.openBlock(), vue.createElementBlock(
2106
+ vue.Fragment,
2107
+ {
2108
+ key: column.newKey + ":" + index + ":" + colindex
2109
+ },
2110
+ [
2111
+ column.$slots.default ? (vue.openBlock(), vue.createBlock(_component_b_slot_component, vue.mergeProps({
2112
+ key: 0,
2113
+ component: column
2114
+ }, column.tdAttrs(row, column), {
2115
+ scoped: "",
2116
+ name: "default",
2117
+ tag: "td",
2118
+ class: column.getRootClasses(row),
2119
+ style: column.getRootStyle(row),
2120
+ "data-label": column.label,
2121
+ props: {
2122
+ row,
2123
+ column,
2124
+ index,
2125
+ colindex,
2126
+ toggleDetails: _ctx.toggleDetails,
2127
+ isActiveDetailRow: _ctx.isActiveDetailRow
2128
+ },
2129
+ onClick: ($event) => _ctx.$emit("cellclick", row, column, index, colindex)
2130
+ }), null, 16, ["component", "class", "style", "data-label", "props", "onClick"])) : vue.createCommentVNode("v-if", true)
2131
+ ],
2132
+ 64
2133
+ /* STABLE_FRAGMENT */
2134
+ );
2135
+ }),
2136
+ 128
2137
+ /* KEYED_FRAGMENT */
2138
+ )),
2139
+ _ctx.checkable && _ctx.checkboxPosition === "right" ? (vue.openBlock(), vue.createElementBlock(
2140
+ "td",
2141
+ {
2142
+ key: 2,
2143
+ class: vue.normalizeClass(["checkbox-cell", { "is-sticky": _ctx.stickyCheckbox }])
2144
+ },
2145
+ [
2146
+ vue.createVNode(_component_b_checkbox, {
2147
+ autocomplete: "off",
2148
+ "model-value": _ctx.isRowChecked(row),
2149
+ type: _ctx.checkboxType,
2150
+ disabled: !_ctx.isRowCheckable(row),
2151
+ onClick: vue.withModifiers(($event) => _ctx.checkRow(row, index, $event), ["prevent", "stop"])
2152
+ }, null, 8, ["model-value", "type", "disabled", "onClick"])
2153
+ ],
2154
+ 2
2155
+ /* CLASS */
2156
+ )) : vue.createCommentVNode("v-if", true)
2157
+ ], 42, _hoisted_15),
2158
+ vue.createVNode(vue.Transition, { name: _ctx.detailTransition }, {
2159
+ default: vue.withCtx(() => [
2160
+ _ctx.isActiveDetailRow(row) ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_18, [
2161
+ vue.createElementVNode("td", { colspan: _ctx.columnCount }, [
2162
+ vue.createElementVNode("div", _hoisted_20, [
2163
+ vue.renderSlot(_ctx.$slots, "detail", {
2164
+ row,
2165
+ index
2166
+ })
2167
+ ])
2168
+ ], 8, _hoisted_19)
2169
+ ])) : vue.createCommentVNode("v-if", true)
2170
+ ]),
2171
+ _: 2
2172
+ /* DYNAMIC */
2173
+ }, 1032, ["name"]),
2174
+ _ctx.isActiveCustomDetailRow(row) ? vue.renderSlot(_ctx.$slots, "detail", {
2175
+ key: 0,
2176
+ row,
2177
+ index
2178
+ }) : vue.createCommentVNode("v-if", true)
2179
+ ],
2180
+ 64
2181
+ /* STABLE_FRAGMENT */
2182
+ );
2183
+ }),
2184
+ 128
2185
+ /* KEYED_FRAGMENT */
2186
+ )),
2187
+ !_ctx.visibleData.length ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_21, [
2188
+ vue.createElementVNode("td", { colspan: _ctx.columnCount }, [
2189
+ vue.renderSlot(_ctx.$slots, "empty")
2190
+ ], 8, _hoisted_22)
2191
+ ])) : vue.createCommentVNode("v-if", true)
2192
+ ]),
2193
+ _ctx.$slots.footer !== void 0 ? (vue.openBlock(), vue.createElementBlock("tfoot", _hoisted_23, [
2194
+ vue.createElementVNode("tr", _hoisted_24, [
2195
+ _ctx.hasCustomFooterSlot() ? vue.renderSlot(_ctx.$slots, "footer", { key: 0 }) : (vue.openBlock(), vue.createElementBlock("th", {
2196
+ key: 1,
2197
+ colspan: _ctx.columnCount
2198
+ }, [
2199
+ vue.renderSlot(_ctx.$slots, "footer")
2200
+ ], 8, _hoisted_25))
2201
+ ])
2202
+ ])) : vue.createCommentVNode("v-if", true)
2203
+ ], 42, _hoisted_1),
2204
+ _ctx.loading ? vue.renderSlot(_ctx.$slots, "loading", { key: 0 }, () => [
2205
+ vue.createVNode(_component_b_loading, {
2206
+ "is-full-page": false,
2207
+ "model-value": _ctx.loading
2208
+ }, null, 8, ["model-value"])
2209
+ ]) : vue.createCommentVNode("v-if", true)
2210
+ ],
2211
+ 6
2212
+ /* CLASS, STYLE */
2213
+ ),
2214
+ _ctx.checkable && _ctx.hasBottomLeftSlot() || _ctx.paginated && (_ctx.paginationPosition === "bottom" || _ctx.paginationPosition === "both") ? vue.renderSlot(_ctx.$slots, "pagination", { key: 2 }, () => [
2215
+ vue.createVNode(_component_b_table_pagination, vue.mergeProps(_ctx.fallthroughAttrs, {
2216
+ "per-page": _ctx.perPage,
2217
+ paginated: _ctx.paginated,
2218
+ rounded: _ctx.paginationRounded,
2219
+ "icon-pack": _ctx.iconPack,
2220
+ total: _ctx.newDataTotal,
2221
+ "current-page": _ctx.newCurrentPage,
2222
+ "onUpdate:currentPage": _cache[11] || (_cache[11] = ($event) => _ctx.newCurrentPage = $event),
2223
+ "aria-next-label": _ctx.ariaNextLabel,
2224
+ "aria-previous-label": _ctx.ariaPreviousLabel,
2225
+ "aria-page-label": _ctx.ariaPageLabel,
2226
+ "aria-current-label": _ctx.ariaCurrentLabel,
2227
+ onPageChange: _cache[12] || (_cache[12] = (event) => _ctx.$emit("page-change", event)),
2228
+ "page-input": _ctx.pageInput,
2229
+ "pagination-order": _ctx.paginationOrder,
2230
+ "page-input-position": _ctx.pageInputPosition,
2231
+ "debounce-page-input": _ctx.debouncePageInput
2232
+ }), {
2233
+ default: vue.withCtx(() => [
2234
+ vue.renderSlot(_ctx.$slots, "bottom-left")
2235
+ ]),
2236
+ _: 3
2237
+ /* FORWARDED */
2238
+ }, 16, ["per-page", "paginated", "rounded", "icon-pack", "total", "current-page", "aria-next-label", "aria-previous-label", "aria-page-label", "aria-current-label", "page-input", "pagination-order", "page-input-position", "debounce-page-input"])
2239
+ ]) : vue.createCommentVNode("v-if", true),
2240
+ vue.createCommentVNode(" eslint-disable vue/no-v-html "),
2241
+ vue.withDirectives(vue.createElementVNode("div", {
2242
+ ref: "draggedCell",
2243
+ class: vue.normalizeClass(["touch-dragged-cell", _ctx.touchDraggedCellClasses]),
2244
+ innerHTML: _ctx.draggedCellContent
2245
+ }, null, 10, _hoisted_26), [
2246
+ [vue.vShow, _ctx.mayBeTouchDragging && (_ctx.isDraggingRow || _ctx.isDraggingColumn)]
2247
+ ]),
2248
+ vue.createCommentVNode(" eslint-enable vue/no-v-html ")
2249
+ ],
2250
+ 16
2251
+ /* FULL_PROPS */
2252
+ );
2253
+ }
2254
+ var Table = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main$1, [["render", _sfc_render]]);
2255
+
2256
+ var _sfc_main = vue.defineComponent({
2257
+ name: "BTableColumn",
2258
+ inject: {
2259
+ $table: { name: "$table", default: false }
2260
+ },
2261
+ props: {
2262
+ label: String,
2263
+ customKey: [String, Number],
2264
+ field: String,
2265
+ meta: [String, Number, Boolean, Function, Object, Array],
2266
+ width: [Number, String],
2267
+ numeric: Boolean,
2268
+ centered: Boolean,
2269
+ searchable: Boolean,
2270
+ sortable: Boolean,
2271
+ visible: {
2272
+ type: Boolean,
2273
+ default: true
2274
+ },
2275
+ subheading: [String, Number],
2276
+ customSort: Function,
2277
+ customSearch: Function,
2278
+ sticky: Boolean,
2279
+ headerSelectable: Boolean,
2280
+ headerClass: String,
2281
+ cellClass: String,
2282
+ thAttrs: {
2283
+ type: Function,
2284
+ default: () => ({})
2285
+ },
2286
+ tdAttrs: {
2287
+ type: Function,
2288
+ default: () => ({})
2289
+ }
2290
+ },
2291
+ data() {
2292
+ return {
2293
+ newKey: this.customKey || this.label,
2294
+ _isTableColumn: true
2295
+ };
2296
+ },
2297
+ computed: {
2298
+ thClasses() {
2299
+ const attrs = this.thAttrs(this);
2300
+ const classes = [this.headerClass, {
2301
+ "is-sortable": this.sortable,
2302
+ "is-sticky": this.sticky,
2303
+ "is-unselectable": this.isHeaderUnSelectable
2304
+ }];
2305
+ if (attrs && attrs.class) {
2306
+ classes.push(attrs.class);
2307
+ }
2308
+ return classes;
2309
+ },
2310
+ thStyle() {
2311
+ const attrs = this.thAttrs(this);
2312
+ const style = [this.style];
2313
+ if (attrs && attrs.style) {
2314
+ style.push(attrs.style);
2315
+ }
2316
+ return style;
2317
+ },
2318
+ thWrapStyle() {
2319
+ const width = helpers.toCssWidth(this.width);
2320
+ if (width != null && !width.trim().endsWith("%")) {
2321
+ return { width };
2322
+ } else {
2323
+ return {};
2324
+ }
2325
+ },
2326
+ rootClasses() {
2327
+ return [this.cellClass, {
2328
+ "has-text-right": this.numeric && !this.centered,
2329
+ "has-text-centered": this.centered,
2330
+ "is-sticky": this.sticky
2331
+ }];
2332
+ },
2333
+ style() {
2334
+ var _a;
2335
+ return {
2336
+ width: (_a = helpers.toCssWidth(this.width)) != null ? _a : void 0
2337
+ // null → undefined to satisfy StyleValue
2338
+ };
2339
+ },
2340
+ hasDefaultSlot() {
2341
+ return !!this.$slots.default;
2342
+ },
2343
+ /*
2344
+ * Return if column header is un-selectable
2345
+ */
2346
+ isHeaderUnSelectable() {
2347
+ return !this.headerSelectable && this.sortable;
2348
+ }
2349
+ },
2350
+ methods: {
2351
+ getRootClasses(row) {
2352
+ const attrs = this.tdAttrs(row, this);
2353
+ const classes = [this.rootClasses];
2354
+ if (attrs && attrs.class) {
2355
+ classes.push(attrs.class);
2356
+ }
2357
+ return classes;
2358
+ },
2359
+ getRootStyle(row) {
2360
+ const attrs = this.tdAttrs(row, this);
2361
+ const style = [];
2362
+ if (attrs && attrs.style) {
2363
+ style.push(attrs.style);
2364
+ }
2365
+ return style;
2366
+ }
2367
+ },
2368
+ created() {
2369
+ if (!this.$table) {
2370
+ throw new Error("You should wrap bTableColumn on a bTable");
2371
+ }
2372
+ this.$table._registerTableColumn(this);
2373
+ },
2374
+ beforeUnmount() {
2375
+ this.$table._unregisterTableColumn(this);
2376
+ },
2377
+ render() {
2378
+ return null;
2379
+ }
2380
+ });
2381
+
2382
+ const Plugin = {
2383
+ install(Vue) {
2384
+ plugins.registerComponent(Vue, Table);
2385
+ plugins.registerComponent(Vue, _sfc_main);
2386
+ }
2387
+ };
2388
+
2389
+ exports.BTable = Table;
2390
+ exports.BTableColumn = _sfc_main;
2391
+ exports.default = Plugin;