@gitlab/duo-ui 2.0.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (579) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/components/chat/components/duo_chat_context/duo_chat_context_item_details_modal/duo_chat_context_item_details_modal.js +3 -3
  3. package/dist/components/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu.js +10 -10
  4. package/dist/components/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_category_items.js +1 -1
  5. package/dist/components/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_search_item.js +5 -15
  6. package/dist/components/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_search_items.js +9 -9
  7. package/dist/components/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_search_items_loading.js +2 -2
  8. package/dist/components/chat/components/duo_chat_context/duo_chat_context_item_popover/duo_chat_context_item_popover.js +3 -29
  9. package/dist/components/chat/components/duo_chat_context/duo_chat_context_item_selections/duo_chat_context_item_selections.js +7 -8
  10. package/dist/components/chat/components/duo_chat_context/utils.js +1 -102
  11. package/dist/components/chat/components/duo_chat_conversation/duo_chat_conversation.js +5 -5
  12. package/dist/components/chat/components/duo_chat_loader/duo_chat_loader.js +9 -8
  13. package/dist/components/chat/components/duo_chat_message/duo_chat_message.js +19 -19
  14. package/dist/components/chat/components/duo_chat_message_sources/duo_chat_message_sources.js +2 -2
  15. package/dist/components/chat/components/duo_chat_predefined_prompts/duo_chat_predefined_prompts.js +1 -1
  16. package/dist/components/chat/duo_chat.js +30 -19
  17. package/dist/components.css +1 -1
  18. package/dist/components.css.map +1 -1
  19. package/dist/tailwind.css +1 -1
  20. package/dist/tailwind.css.map +1 -1
  21. package/package.json +4 -8
  22. package/src/components/chat/components/duo_chat_context/duo_chat_context_item_details_modal/duo_chat_context_item_details_modal.vue +3 -3
  23. package/src/components/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu.vue +12 -12
  24. package/src/components/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_category_items.vue +1 -1
  25. package/src/components/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_search_item.vue +17 -24
  26. package/src/components/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_search_items.vue +9 -9
  27. package/src/components/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_search_items_loading.vue +2 -2
  28. package/src/components/chat/components/duo_chat_context/duo_chat_context_item_popover/duo_chat_context_item_popover.vue +25 -55
  29. package/src/components/chat/components/duo_chat_context/duo_chat_context_item_selections/duo_chat_context_item_selections.vue +10 -11
  30. package/src/components/chat/components/duo_chat_context/utils.js +0 -114
  31. package/src/components/chat/components/duo_chat_conversation/duo_chat_conversation.md +1 -1
  32. package/src/components/chat/components/duo_chat_conversation/duo_chat_conversation.vue +5 -5
  33. package/src/components/chat/components/duo_chat_loader/duo_chat_loader.scss +6 -33
  34. package/src/components/chat/components/duo_chat_loader/duo_chat_loader.vue +11 -14
  35. package/src/components/chat/components/duo_chat_message/duo_chat_message.md +2 -2
  36. package/src/components/chat/components/duo_chat_message/duo_chat_message.scss +13 -10
  37. package/src/components/chat/components/duo_chat_message/duo_chat_message.vue +21 -21
  38. package/src/components/chat/components/duo_chat_message_sources/duo_chat_message_sources.vue +2 -2
  39. package/src/components/chat/components/duo_chat_predefined_prompts/duo_chat_predefined_prompts.vue +1 -1
  40. package/src/components/chat/duo_chat.md +4 -4
  41. package/src/components/chat/duo_chat.vue +38 -30
  42. package/translations.js +36 -43
  43. package/src/vendor/bootstrap/LICENSE +0 -22
  44. package/src/vendor/bootstrap/scss/_alert.scss +0 -52
  45. package/src/vendor/bootstrap/scss/_badge.scss +0 -54
  46. package/src/vendor/bootstrap/scss/_breadcrumb.scss +0 -42
  47. package/src/vendor/bootstrap/scss/_button-group.scss +0 -163
  48. package/src/vendor/bootstrap/scss/_buttons.scss +0 -142
  49. package/src/vendor/bootstrap/scss/_card.scss +0 -286
  50. package/src/vendor/bootstrap/scss/_carousel.scss +0 -200
  51. package/src/vendor/bootstrap/scss/_close.scss +0 -40
  52. package/src/vendor/bootstrap/scss/_code.scss +0 -48
  53. package/src/vendor/bootstrap/scss/_custom-forms.scss +0 -526
  54. package/src/vendor/bootstrap/scss/_dropdown.scss +0 -192
  55. package/src/vendor/bootstrap/scss/_forms.scss +0 -347
  56. package/src/vendor/bootstrap/scss/_functions.scss +0 -190
  57. package/src/vendor/bootstrap/scss/_grid.scss +0 -73
  58. package/src/vendor/bootstrap/scss/_images.scss +0 -42
  59. package/src/vendor/bootstrap/scss/_input-group.scss +0 -211
  60. package/src/vendor/bootstrap/scss/_jumbotron.scss +0 -17
  61. package/src/vendor/bootstrap/scss/_list-group.scss +0 -154
  62. package/src/vendor/bootstrap/scss/_media.scss +0 -8
  63. package/src/vendor/bootstrap/scss/_mixins.scss +0 -47
  64. package/src/vendor/bootstrap/scss/_modal.scss +0 -240
  65. package/src/vendor/bootstrap/scss/_nav.scss +0 -125
  66. package/src/vendor/bootstrap/scss/_navbar.scss +0 -332
  67. package/src/vendor/bootstrap/scss/_pagination.scss +0 -74
  68. package/src/vendor/bootstrap/scss/_popover.scss +0 -170
  69. package/src/vendor/bootstrap/scss/_print.scss +0 -132
  70. package/src/vendor/bootstrap/scss/_progress.scss +0 -47
  71. package/src/vendor/bootstrap/scss/_reboot.scss +0 -484
  72. package/src/vendor/bootstrap/scss/_root.scss +0 -19
  73. package/src/vendor/bootstrap/scss/_spinners.scss +0 -65
  74. package/src/vendor/bootstrap/scss/_tables.scss +0 -185
  75. package/src/vendor/bootstrap/scss/_toasts.scss +0 -46
  76. package/src/vendor/bootstrap/scss/_tooltip.scss +0 -115
  77. package/src/vendor/bootstrap/scss/_transitions.scss +0 -26
  78. package/src/vendor/bootstrap/scss/_type.scss +0 -125
  79. package/src/vendor/bootstrap/scss/_utilities.scss +0 -18
  80. package/src/vendor/bootstrap/scss/_variables.scss +0 -1149
  81. package/src/vendor/bootstrap/scss/bootstrap-grid.scss +0 -30
  82. package/src/vendor/bootstrap/scss/bootstrap-reboot.scss +0 -12
  83. package/src/vendor/bootstrap/scss/bootstrap.scss +0 -44
  84. package/src/vendor/bootstrap/scss/mixins/_alert.scss +0 -13
  85. package/src/vendor/bootstrap/scss/mixins/_background-variant.scss +0 -23
  86. package/src/vendor/bootstrap/scss/mixins/_badge.scss +0 -17
  87. package/src/vendor/bootstrap/scss/mixins/_border-radius.scss +0 -76
  88. package/src/vendor/bootstrap/scss/mixins/_box-shadow.scss +0 -20
  89. package/src/vendor/bootstrap/scss/mixins/_breakpoints.scss +0 -123
  90. package/src/vendor/bootstrap/scss/mixins/_buttons.scss +0 -110
  91. package/src/vendor/bootstrap/scss/mixins/_caret.scss +0 -62
  92. package/src/vendor/bootstrap/scss/mixins/_clearfix.scss +0 -7
  93. package/src/vendor/bootstrap/scss/mixins/_deprecate.scss +0 -10
  94. package/src/vendor/bootstrap/scss/mixins/_float.scss +0 -14
  95. package/src/vendor/bootstrap/scss/mixins/_forms.scss +0 -195
  96. package/src/vendor/bootstrap/scss/mixins/_gradients.scss +0 -45
  97. package/src/vendor/bootstrap/scss/mixins/_grid-framework.scss +0 -80
  98. package/src/vendor/bootstrap/scss/mixins/_grid.scss +0 -69
  99. package/src/vendor/bootstrap/scss/mixins/_hover.scss +0 -37
  100. package/src/vendor/bootstrap/scss/mixins/_image.scss +0 -36
  101. package/src/vendor/bootstrap/scss/mixins/_list-group.scss +0 -21
  102. package/src/vendor/bootstrap/scss/mixins/_lists.scss +0 -7
  103. package/src/vendor/bootstrap/scss/mixins/_nav-divider.scss +0 -11
  104. package/src/vendor/bootstrap/scss/mixins/_pagination.scss +0 -22
  105. package/src/vendor/bootstrap/scss/mixins/_reset-text.scss +0 -17
  106. package/src/vendor/bootstrap/scss/mixins/_resize.scss +0 -6
  107. package/src/vendor/bootstrap/scss/mixins/_screen-reader.scss +0 -34
  108. package/src/vendor/bootstrap/scss/mixins/_size.scss +0 -7
  109. package/src/vendor/bootstrap/scss/mixins/_table-row.scss +0 -39
  110. package/src/vendor/bootstrap/scss/mixins/_text-emphasis.scss +0 -17
  111. package/src/vendor/bootstrap/scss/mixins/_text-hide.scss +0 -11
  112. package/src/vendor/bootstrap/scss/mixins/_text-truncate.scss +0 -8
  113. package/src/vendor/bootstrap/scss/mixins/_transition.scss +0 -26
  114. package/src/vendor/bootstrap/scss/mixins/_visibility.scss +0 -8
  115. package/src/vendor/bootstrap/scss/utilities/_align.scss +0 -8
  116. package/src/vendor/bootstrap/scss/utilities/_background.scss +0 -19
  117. package/src/vendor/bootstrap/scss/utilities/_borders.scss +0 -75
  118. package/src/vendor/bootstrap/scss/utilities/_clearfix.scss +0 -3
  119. package/src/vendor/bootstrap/scss/utilities/_display.scss +0 -26
  120. package/src/vendor/bootstrap/scss/utilities/_embed.scss +0 -39
  121. package/src/vendor/bootstrap/scss/utilities/_flex.scss +0 -51
  122. package/src/vendor/bootstrap/scss/utilities/_float.scss +0 -11
  123. package/src/vendor/bootstrap/scss/utilities/_interactions.scss +0 -5
  124. package/src/vendor/bootstrap/scss/utilities/_overflow.scss +0 -5
  125. package/src/vendor/bootstrap/scss/utilities/_position.scss +0 -32
  126. package/src/vendor/bootstrap/scss/utilities/_screenreaders.scss +0 -11
  127. package/src/vendor/bootstrap/scss/utilities/_shadows.scss +0 -6
  128. package/src/vendor/bootstrap/scss/utilities/_sizing.scss +0 -20
  129. package/src/vendor/bootstrap/scss/utilities/_spacing.scss +0 -73
  130. package/src/vendor/bootstrap/scss/utilities/_stretched-link.scss +0 -19
  131. package/src/vendor/bootstrap/scss/utilities/_text.scss +0 -72
  132. package/src/vendor/bootstrap/scss/utilities/_visibility.scss +0 -13
  133. package/src/vendor/bootstrap/scss/vendor/_rfs.scss +0 -228
  134. package/src/vendor/bootstrap-vue/LICENSE +0 -21
  135. package/src/vendor/bootstrap-vue/nuxt/index.js +0 -164
  136. package/src/vendor/bootstrap-vue/nuxt/plugin.template.js +0 -29
  137. package/src/vendor/bootstrap-vue/package.json +0 -201
  138. package/src/vendor/bootstrap-vue/src/_utilities.scss +0 -13
  139. package/src/vendor/bootstrap-vue/src/_variables.scss +0 -111
  140. package/src/vendor/bootstrap-vue/src/browser.js +0 -9
  141. package/src/vendor/bootstrap-vue/src/bv-config.d.ts +0 -4
  142. package/src/vendor/bootstrap-vue/src/bv-config.js +0 -6
  143. package/src/vendor/bootstrap-vue/src/components/badge/README.md +0 -126
  144. package/src/vendor/bootstrap-vue/src/components/badge/badge.js +0 -55
  145. package/src/vendor/bootstrap-vue/src/components/badge/badge.spec.js +0 -141
  146. package/src/vendor/bootstrap-vue/src/components/badge/index.d.ts +0 -7
  147. package/src/vendor/bootstrap-vue/src/components/badge/index.js +0 -3
  148. package/src/vendor/bootstrap-vue/src/components/badge/package.json +0 -29
  149. package/src/vendor/bootstrap-vue/src/components/breadcrumb/README.md +0 -93
  150. package/src/vendor/bootstrap-vue/src/components/breadcrumb/breadcrumb-item.js +0 -27
  151. package/src/vendor/bootstrap-vue/src/components/breadcrumb/breadcrumb-item.spec.js +0 -123
  152. package/src/vendor/bootstrap-vue/src/components/breadcrumb/breadcrumb-link.js +0 -43
  153. package/src/vendor/bootstrap-vue/src/components/breadcrumb/breadcrumb-link.spec.js +0 -117
  154. package/src/vendor/bootstrap-vue/src/components/breadcrumb/breadcrumb.js +0 -52
  155. package/src/vendor/bootstrap-vue/src/components/breadcrumb/breadcrumb.spec.js +0 -183
  156. package/src/vendor/bootstrap-vue/src/components/breadcrumb/index.d.ts +0 -13
  157. package/src/vendor/bootstrap-vue/src/components/breadcrumb/index.js +0 -5
  158. package/src/vendor/bootstrap-vue/src/components/breadcrumb/package.json +0 -62
  159. package/src/vendor/bootstrap-vue/src/components/button/README.md +0 -281
  160. package/src/vendor/bootstrap-vue/src/components/button/button-close.js +0 -65
  161. package/src/vendor/bootstrap-vue/src/components/button/button-close.spec.js +0 -210
  162. package/src/vendor/bootstrap-vue/src/components/button/button.js +0 -179
  163. package/src/vendor/bootstrap-vue/src/components/button/button.spec.js +0 -385
  164. package/src/vendor/bootstrap-vue/src/components/button/index.d.ts +0 -10
  165. package/src/vendor/bootstrap-vue/src/components/button/index.js +0 -4
  166. package/src/vendor/bootstrap-vue/src/components/button/package.json +0 -105
  167. package/src/vendor/bootstrap-vue/src/components/button-group/README.md +0 -112
  168. package/src/vendor/bootstrap-vue/src/components/button-group/button-group.js +0 -42
  169. package/src/vendor/bootstrap-vue/src/components/button-group/button-group.spec.js +0 -98
  170. package/src/vendor/bootstrap-vue/src/components/button-group/index.d.ts +0 -7
  171. package/src/vendor/bootstrap-vue/src/components/button-group/index.js +0 -3
  172. package/src/vendor/bootstrap-vue/src/components/button-group/package.json +0 -29
  173. package/src/vendor/bootstrap-vue/src/components/collapse/README.md +0 -321
  174. package/src/vendor/bootstrap-vue/src/components/collapse/collapse.js +0 -272
  175. package/src/vendor/bootstrap-vue/src/components/collapse/collapse.spec.js +0 -558
  176. package/src/vendor/bootstrap-vue/src/components/collapse/helpers/bv-collapse.js +0 -88
  177. package/src/vendor/bootstrap-vue/src/components/collapse/index.d.ts +0 -9
  178. package/src/vendor/bootstrap-vue/src/components/collapse/index.js +0 -3
  179. package/src/vendor/bootstrap-vue/src/components/collapse/package.json +0 -111
  180. package/src/vendor/bootstrap-vue/src/components/dropdown/README.md +0 -730
  181. package/src/vendor/bootstrap-vue/src/components/dropdown/_dropdown-form.scss +0 -38
  182. package/src/vendor/bootstrap-vue/src/components/dropdown/_dropdown-text.scss +0 -17
  183. package/src/vendor/bootstrap-vue/src/components/dropdown/_dropdown.scss +0 -58
  184. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-divider.js +0 -36
  185. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-divider.spec.js +0 -58
  186. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-form.js +0 -47
  187. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-form.spec.js +0 -110
  188. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-group.js +0 -76
  189. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-group.spec.js +0 -94
  190. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-header.js +0 -46
  191. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-header.spec.js +0 -73
  192. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-item-button.js +0 -93
  193. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-item-button.spec.js +0 -117
  194. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-item.js +0 -87
  195. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-item.spec.js +0 -147
  196. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-text.js +0 -42
  197. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-text.spec.js +0 -59
  198. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown.js +0 -202
  199. package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown.spec.js +0 -1121
  200. package/src/vendor/bootstrap-vue/src/components/dropdown/index.d.ts +0 -32
  201. package/src/vendor/bootstrap-vue/src/components/dropdown/index.js +0 -19
  202. package/src/vendor/bootstrap-vue/src/components/dropdown/index.scss +0 -3
  203. package/src/vendor/bootstrap-vue/src/components/dropdown/package.json +0 -368
  204. package/src/vendor/bootstrap-vue/src/components/form/README.md +0 -370
  205. package/src/vendor/bootstrap-vue/src/components/form/form-invalid-feedback.js +0 -51
  206. package/src/vendor/bootstrap-vue/src/components/form/form-invalid-feedback.spec.js +0 -170
  207. package/src/vendor/bootstrap-vue/src/components/form/form-text.js +0 -40
  208. package/src/vendor/bootstrap-vue/src/components/form/form-text.spec.js +0 -93
  209. package/src/vendor/bootstrap-vue/src/components/form/form-valid-feedback.js +0 -51
  210. package/src/vendor/bootstrap-vue/src/components/form/form-valid-feedback.spec.js +0 -157
  211. package/src/vendor/bootstrap-vue/src/components/form/form.js +0 -41
  212. package/src/vendor/bootstrap-vue/src/components/form/form.spec.js +0 -97
  213. package/src/vendor/bootstrap-vue/src/components/form/index.d.ts +0 -16
  214. package/src/vendor/bootstrap-vue/src/components/form/index.js +0 -7
  215. package/src/vendor/bootstrap-vue/src/components/form/package.json +0 -112
  216. package/src/vendor/bootstrap-vue/src/components/form-checkbox/README.md +0 -862
  217. package/src/vendor/bootstrap-vue/src/components/form-checkbox/_form-checkbox-group.scss +0 -2
  218. package/src/vendor/bootstrap-vue/src/components/form-checkbox/_form-checkbox.scss +0 -125
  219. package/src/vendor/bootstrap-vue/src/components/form-checkbox/form-checkbox-group.js +0 -42
  220. package/src/vendor/bootstrap-vue/src/components/form-checkbox/form-checkbox-group.spec.js +0 -642
  221. package/src/vendor/bootstrap-vue/src/components/form-checkbox/form-checkbox.js +0 -132
  222. package/src/vendor/bootstrap-vue/src/components/form-checkbox/form-checkbox.spec.js +0 -1331
  223. package/src/vendor/bootstrap-vue/src/components/form-checkbox/index.d.ts +0 -10
  224. package/src/vendor/bootstrap-vue/src/components/form-checkbox/index.js +0 -4
  225. package/src/vendor/bootstrap-vue/src/components/form-checkbox/index.scss +0 -2
  226. package/src/vendor/bootstrap-vue/src/components/form-checkbox/package.json +0 -172
  227. package/src/vendor/bootstrap-vue/src/components/form-group/README.md +0 -337
  228. package/src/vendor/bootstrap-vue/src/components/form-group/form-group.js +0 -403
  229. package/src/vendor/bootstrap-vue/src/components/form-group/form-group.spec.js +0 -477
  230. package/src/vendor/bootstrap-vue/src/components/form-group/index.d.ts +0 -7
  231. package/src/vendor/bootstrap-vue/src/components/form-group/index.js +0 -3
  232. package/src/vendor/bootstrap-vue/src/components/form-group/package.json +0 -183
  233. package/src/vendor/bootstrap-vue/src/components/form-input/README.md +0 -612
  234. package/src/vendor/bootstrap-vue/src/components/form-input/_form-input.scss +0 -217
  235. package/src/vendor/bootstrap-vue/src/components/form-input/form-input.js +0 -168
  236. package/src/vendor/bootstrap-vue/src/components/form-input/form-input.spec.js +0 -986
  237. package/src/vendor/bootstrap-vue/src/components/form-input/index.d.ts +0 -9
  238. package/src/vendor/bootstrap-vue/src/components/form-input/index.js +0 -3
  239. package/src/vendor/bootstrap-vue/src/components/form-input/index.scss +0 -1
  240. package/src/vendor/bootstrap-vue/src/components/form-input/package.json +0 -135
  241. package/src/vendor/bootstrap-vue/src/components/form-radio/README.md +0 -566
  242. package/src/vendor/bootstrap-vue/src/components/form-radio/_form-radio-group.scss +0 -3
  243. package/src/vendor/bootstrap-vue/src/components/form-radio/_form-radio.scss +0 -47
  244. package/src/vendor/bootstrap-vue/src/components/form-radio/form-radio-group.js +0 -30
  245. package/src/vendor/bootstrap-vue/src/components/form-radio/form-radio-group.spec.js +0 -469
  246. package/src/vendor/bootstrap-vue/src/components/form-radio/form-radio.js +0 -28
  247. package/src/vendor/bootstrap-vue/src/components/form-radio/form-radio.spec.js +0 -952
  248. package/src/vendor/bootstrap-vue/src/components/form-radio/index.d.ts +0 -10
  249. package/src/vendor/bootstrap-vue/src/components/form-radio/index.js +0 -4
  250. package/src/vendor/bootstrap-vue/src/components/form-radio/index.scss +0 -2
  251. package/src/vendor/bootstrap-vue/src/components/form-radio/package.json +0 -162
  252. package/src/vendor/bootstrap-vue/src/components/form-select/README.md +0 -504
  253. package/src/vendor/bootstrap-vue/src/components/form-select/form-select-option-group.js +0 -48
  254. package/src/vendor/bootstrap-vue/src/components/form-select/form-select-option-group.spec.js +0 -138
  255. package/src/vendor/bootstrap-vue/src/components/form-select/form-select-option.js +0 -35
  256. package/src/vendor/bootstrap-vue/src/components/form-select/form-select-option.spec.js +0 -75
  257. package/src/vendor/bootstrap-vue/src/components/form-select/form-select.js +0 -153
  258. package/src/vendor/bootstrap-vue/src/components/form-select/form-select.spec.js +0 -723
  259. package/src/vendor/bootstrap-vue/src/components/form-select/helpers/mixin-options.js +0 -56
  260. package/src/vendor/bootstrap-vue/src/components/form-select/index.d.ts +0 -13
  261. package/src/vendor/bootstrap-vue/src/components/form-select/index.js +0 -5
  262. package/src/vendor/bootstrap-vue/src/components/form-select/package.json +0 -132
  263. package/src/vendor/bootstrap-vue/src/components/form-textarea/README.md +0 -453
  264. package/src/vendor/bootstrap-vue/src/components/form-textarea/form-textarea.js +0 -226
  265. package/src/vendor/bootstrap-vue/src/components/form-textarea/form-textarea.spec.js +0 -1000
  266. package/src/vendor/bootstrap-vue/src/components/form-textarea/index.d.ts +0 -9
  267. package/src/vendor/bootstrap-vue/src/components/form-textarea/index.js +0 -3
  268. package/src/vendor/bootstrap-vue/src/components/form-textarea/package.json +0 -122
  269. package/src/vendor/bootstrap-vue/src/components/index.d.ts +0 -31
  270. package/src/vendor/bootstrap-vue/src/components/index.js +0 -11
  271. package/src/vendor/bootstrap-vue/src/components/index.scss +0 -12
  272. package/src/vendor/bootstrap-vue/src/components/input-group/README.md +0 -334
  273. package/src/vendor/bootstrap-vue/src/components/input-group/_input-group.scss +0 -29
  274. package/src/vendor/bootstrap-vue/src/components/input-group/index.d.ts +0 -19
  275. package/src/vendor/bootstrap-vue/src/components/input-group/index.js +0 -7
  276. package/src/vendor/bootstrap-vue/src/components/input-group/index.scss +0 -1
  277. package/src/vendor/bootstrap-vue/src/components/input-group/input-group-addon.js +0 -43
  278. package/src/vendor/bootstrap-vue/src/components/input-group/input-group-append.js +0 -31
  279. package/src/vendor/bootstrap-vue/src/components/input-group/input-group-append.spec.js +0 -84
  280. package/src/vendor/bootstrap-vue/src/components/input-group/input-group-prepend.js +0 -31
  281. package/src/vendor/bootstrap-vue/src/components/input-group/input-group-prepend.spec.js +0 -84
  282. package/src/vendor/bootstrap-vue/src/components/input-group/input-group-text.js +0 -31
  283. package/src/vendor/bootstrap-vue/src/components/input-group/input-group-text.spec.js +0 -45
  284. package/src/vendor/bootstrap-vue/src/components/input-group/input-group.js +0 -73
  285. package/src/vendor/bootstrap-vue/src/components/input-group/input-group.spec.js +0 -153
  286. package/src/vendor/bootstrap-vue/src/components/input-group/package.json +0 -109
  287. package/src/vendor/bootstrap-vue/src/components/layout/README.md +0 -791
  288. package/src/vendor/bootstrap-vue/src/components/layout/col.js +0 -154
  289. package/src/vendor/bootstrap-vue/src/components/layout/col.spec.js +0 -192
  290. package/src/vendor/bootstrap-vue/src/components/layout/form-row.js +0 -31
  291. package/src/vendor/bootstrap-vue/src/components/layout/form-row.spec.js +0 -45
  292. package/src/vendor/bootstrap-vue/src/components/layout/index.d.ts +0 -10
  293. package/src/vendor/bootstrap-vue/src/components/layout/index.js +0 -4
  294. package/src/vendor/bootstrap-vue/src/components/layout/package.json +0 -99
  295. package/src/vendor/bootstrap-vue/src/components/link/README.md +0 -76
  296. package/src/vendor/bootstrap-vue/src/components/link/index.d.ts +0 -10
  297. package/src/vendor/bootstrap-vue/src/components/link/index.js +0 -3
  298. package/src/vendor/bootstrap-vue/src/components/link/link.js +0 -212
  299. package/src/vendor/bootstrap-vue/src/components/link/link.spec.js +0 -434
  300. package/src/vendor/bootstrap-vue/src/components/link/package.json +0 -57
  301. package/src/vendor/bootstrap-vue/src/components/modal/MODIFICATIONS.md +0 -27
  302. package/src/vendor/bootstrap-vue/src/components/modal/README.md +0 -1068
  303. package/src/vendor/bootstrap-vue/src/components/modal/_modal.scss +0 -5
  304. package/src/vendor/bootstrap-vue/src/components/modal/helpers/bv-modal-event.class.js +0 -22
  305. package/src/vendor/bootstrap-vue/src/components/modal/helpers/bv-modal-event.class.spec.js +0 -82
  306. package/src/vendor/bootstrap-vue/src/components/modal/helpers/modal-manager.js +0 -219
  307. package/src/vendor/bootstrap-vue/src/components/modal/index.d.ts +0 -82
  308. package/src/vendor/bootstrap-vue/src/components/modal/index.js +0 -3
  309. package/src/vendor/bootstrap-vue/src/components/modal/index.scss +0 -1
  310. package/src/vendor/bootstrap-vue/src/components/modal/modal.js +0 -981
  311. package/src/vendor/bootstrap-vue/src/components/modal/modal.spec.js +0 -1418
  312. package/src/vendor/bootstrap-vue/src/components/modal/package.json +0 -548
  313. package/src/vendor/bootstrap-vue/src/components/nav/README.md +0 -480
  314. package/src/vendor/bootstrap-vue/src/components/nav/_nav-item-dropdown.scss +0 -1
  315. package/src/vendor/bootstrap-vue/src/components/nav/index.d.ts +0 -17
  316. package/src/vendor/bootstrap-vue/src/components/nav/index.js +0 -5
  317. package/src/vendor/bootstrap-vue/src/components/nav/index.scss +0 -1
  318. package/src/vendor/bootstrap-vue/src/components/nav/nav-item-dropdown.js +0 -123
  319. package/src/vendor/bootstrap-vue/src/components/nav/nav-item-dropdown.spec.js +0 -268
  320. package/src/vendor/bootstrap-vue/src/components/nav/nav-item.js +0 -49
  321. package/src/vendor/bootstrap-vue/src/components/nav/nav-item.spec.js +0 -127
  322. package/src/vendor/bootstrap-vue/src/components/nav/nav.js +0 -60
  323. package/src/vendor/bootstrap-vue/src/components/nav/nav.spec.js +0 -244
  324. package/src/vendor/bootstrap-vue/src/components/nav/package.json +0 -190
  325. package/src/vendor/bootstrap-vue/src/components/navbar/README.md +0 -333
  326. package/src/vendor/bootstrap-vue/src/components/navbar/_navbar.scss +0 -1
  327. package/src/vendor/bootstrap-vue/src/components/navbar/index.d.ts +0 -10
  328. package/src/vendor/bootstrap-vue/src/components/navbar/index.js +0 -4
  329. package/src/vendor/bootstrap-vue/src/components/navbar/index.scss +0 -1
  330. package/src/vendor/bootstrap-vue/src/components/navbar/navbar-brand.js +0 -42
  331. package/src/vendor/bootstrap-vue/src/components/navbar/navbar-brand.spec.js +0 -50
  332. package/src/vendor/bootstrap-vue/src/components/navbar/navbar.js +0 -78
  333. package/src/vendor/bootstrap-vue/src/components/navbar/navbar.spec.js +0 -130
  334. package/src/vendor/bootstrap-vue/src/components/navbar/package.json +0 -54
  335. package/src/vendor/bootstrap-vue/src/components/popover/README.md +0 -919
  336. package/src/vendor/bootstrap-vue/src/components/popover/_popover.scss +0 -113
  337. package/src/vendor/bootstrap-vue/src/components/popover/helpers/bv-popover-template.js +0 -50
  338. package/src/vendor/bootstrap-vue/src/components/popover/helpers/bv-popover.js +0 -28
  339. package/src/vendor/bootstrap-vue/src/components/popover/index.d.ts +0 -7
  340. package/src/vendor/bootstrap-vue/src/components/popover/index.js +0 -3
  341. package/src/vendor/bootstrap-vue/src/components/popover/index.scss +0 -1
  342. package/src/vendor/bootstrap-vue/src/components/popover/package.json +0 -261
  343. package/src/vendor/bootstrap-vue/src/components/popover/popover.js +0 -46
  344. package/src/vendor/bootstrap-vue/src/components/popover/popover.spec.js +0 -199
  345. package/src/vendor/bootstrap-vue/src/components/progress/MODIFICATIONS.md +0 -23
  346. package/src/vendor/bootstrap-vue/src/components/progress/README.md +0 -363
  347. package/src/vendor/bootstrap-vue/src/components/progress/index.d.ts +0 -10
  348. package/src/vendor/bootstrap-vue/src/components/progress/index.js +0 -4
  349. package/src/vendor/bootstrap-vue/src/components/progress/package.json +0 -109
  350. package/src/vendor/bootstrap-vue/src/components/progress/progress-bar.js +0 -133
  351. package/src/vendor/bootstrap-vue/src/components/progress/progress-bar.spec.js +0 -270
  352. package/src/vendor/bootstrap-vue/src/components/progress/progress.js +0 -57
  353. package/src/vendor/bootstrap-vue/src/components/progress/progress.spec.js +0 -71
  354. package/src/vendor/bootstrap-vue/src/components/table/README.md +0 -3157
  355. package/src/vendor/bootstrap-vue/src/components/table/_table.scss +0 -474
  356. package/src/vendor/bootstrap-vue/src/components/table/helpers/constants.js +0 -30
  357. package/src/vendor/bootstrap-vue/src/components/table/helpers/default-sort-compare.js +0 -60
  358. package/src/vendor/bootstrap-vue/src/components/table/helpers/default-sort-compare.spec.js +0 -112
  359. package/src/vendor/bootstrap-vue/src/components/table/helpers/filter-event.js +0 -38
  360. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-bottom-row.js +0 -44
  361. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-busy.js +0 -88
  362. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-caption.js +0 -49
  363. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-colgroup.js +0 -27
  364. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-empty.js +0 -105
  365. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-filtering.js +0 -271
  366. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-items.js +0 -146
  367. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-pagination.js +0 -38
  368. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-provider.js +0 -188
  369. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-selectable.js +0 -241
  370. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-sorting.js +0 -299
  371. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-stacked.js +0 -33
  372. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-table-renderer.js +0 -209
  373. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody-row.js +0 -360
  374. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody.js +0 -258
  375. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-tfoot.js +0 -55
  376. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-thead.js +0 -238
  377. package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-top-row.js +0 -37
  378. package/src/vendor/bootstrap-vue/src/components/table/helpers/normalize-fields.js +0 -71
  379. package/src/vendor/bootstrap-vue/src/components/table/helpers/normalize-fields.spec.js +0 -93
  380. package/src/vendor/bootstrap-vue/src/components/table/helpers/sanitize-row.js +0 -39
  381. package/src/vendor/bootstrap-vue/src/components/table/helpers/stringify-record-values.js +0 -11
  382. package/src/vendor/bootstrap-vue/src/components/table/helpers/text-selection-active.js +0 -13
  383. package/src/vendor/bootstrap-vue/src/components/table/index.d.ts +0 -237
  384. package/src/vendor/bootstrap-vue/src/components/table/index.js +0 -23
  385. package/src/vendor/bootstrap-vue/src/components/table/index.scss +0 -1
  386. package/src/vendor/bootstrap-vue/src/components/table/package.json +0 -1763
  387. package/src/vendor/bootstrap-vue/src/components/table/table-busy.spec.js +0 -150
  388. package/src/vendor/bootstrap-vue/src/components/table/table-caption.spec.js +0 -176
  389. package/src/vendor/bootstrap-vue/src/components/table/table-colgroup.spec.js +0 -81
  390. package/src/vendor/bootstrap-vue/src/components/table/table-filtering.spec.js +0 -409
  391. package/src/vendor/bootstrap-vue/src/components/table/table-item-formatter.spec.js +0 -56
  392. package/src/vendor/bootstrap-vue/src/components/table/table-lite.js +0 -63
  393. package/src/vendor/bootstrap-vue/src/components/table/table-lite.spec.js +0 -682
  394. package/src/vendor/bootstrap-vue/src/components/table/table-pagination.spec.js +0 -133
  395. package/src/vendor/bootstrap-vue/src/components/table/table-primarykey.spec.js +0 -83
  396. package/src/vendor/bootstrap-vue/src/components/table/table-provider.spec.js +0 -411
  397. package/src/vendor/bootstrap-vue/src/components/table/table-row-details.spec.js +0 -459
  398. package/src/vendor/bootstrap-vue/src/components/table/table-selectable.spec.js +0 -1182
  399. package/src/vendor/bootstrap-vue/src/components/table/table-simple.js +0 -50
  400. package/src/vendor/bootstrap-vue/src/components/table/table-simple.spec.js +0 -206
  401. package/src/vendor/bootstrap-vue/src/components/table/table-sorting.spec.js +0 -858
  402. package/src/vendor/bootstrap-vue/src/components/table/table-sticky-column.spec.js +0 -377
  403. package/src/vendor/bootstrap-vue/src/components/table/table-tbody-bottom-row.spec.js +0 -94
  404. package/src/vendor/bootstrap-vue/src/components/table/table-tbody-row-events.spec.js +0 -529
  405. package/src/vendor/bootstrap-vue/src/components/table/table-tbody-top-row.spec.js +0 -88
  406. package/src/vendor/bootstrap-vue/src/components/table/table-tbody-transition.spec.js +0 -83
  407. package/src/vendor/bootstrap-vue/src/components/table/table-tfoot-custom.spec.js +0 -91
  408. package/src/vendor/bootstrap-vue/src/components/table/table-tfoot-events.spec.js +0 -137
  409. package/src/vendor/bootstrap-vue/src/components/table/table-thead-events.spec.js +0 -155
  410. package/src/vendor/bootstrap-vue/src/components/table/table-thead-top.spec.js +0 -96
  411. package/src/vendor/bootstrap-vue/src/components/table/table.js +0 -89
  412. package/src/vendor/bootstrap-vue/src/components/table/table.spec.js +0 -692
  413. package/src/vendor/bootstrap-vue/src/components/table/tbody.js +0 -103
  414. package/src/vendor/bootstrap-vue/src/components/table/td.js +0 -195
  415. package/src/vendor/bootstrap-vue/src/components/table/tfoot.js +0 -95
  416. package/src/vendor/bootstrap-vue/src/components/table/th.js +0 -25
  417. package/src/vendor/bootstrap-vue/src/components/table/thead.js +0 -98
  418. package/src/vendor/bootstrap-vue/src/components/table/tr.js +0 -122
  419. package/src/vendor/bootstrap-vue/src/components/tabs/README.md +0 -575
  420. package/src/vendor/bootstrap-vue/src/components/tabs/index.d.ts +0 -13
  421. package/src/vendor/bootstrap-vue/src/components/tabs/index.js +0 -4
  422. package/src/vendor/bootstrap-vue/src/components/tabs/package.json +0 -205
  423. package/src/vendor/bootstrap-vue/src/components/tabs/tab.js +0 -197
  424. package/src/vendor/bootstrap-vue/src/components/tabs/tab.spec.js +0 -330
  425. package/src/vendor/bootstrap-vue/src/components/tabs/tabs.js +0 -688
  426. package/src/vendor/bootstrap-vue/src/components/tabs/tabs.spec.js +0 -836
  427. package/src/vendor/bootstrap-vue/src/components/toast/README.md +0 -656
  428. package/src/vendor/bootstrap-vue/src/components/toast/_toast.scss +0 -79
  429. package/src/vendor/bootstrap-vue/src/components/toast/_toaster-transition.scss +0 -45
  430. package/src/vendor/bootstrap-vue/src/components/toast/_toaster.scss +0 -108
  431. package/src/vendor/bootstrap-vue/src/components/toast/helpers/bv-toast.js +0 -208
  432. package/src/vendor/bootstrap-vue/src/components/toast/helpers/bv-toast.spec.js +0 -131
  433. package/src/vendor/bootstrap-vue/src/components/toast/index.d.ts +0 -70
  434. package/src/vendor/bootstrap-vue/src/components/toast/index.js +0 -12
  435. package/src/vendor/bootstrap-vue/src/components/toast/index.scss +0 -3
  436. package/src/vendor/bootstrap-vue/src/components/toast/package.json +0 -188
  437. package/src/vendor/bootstrap-vue/src/components/toast/toast.js +0 -454
  438. package/src/vendor/bootstrap-vue/src/components/toast/toast.spec.js +0 -346
  439. package/src/vendor/bootstrap-vue/src/components/toast/toaster.js +0 -139
  440. package/src/vendor/bootstrap-vue/src/components/toast/toaster.spec.js +0 -77
  441. package/src/vendor/bootstrap-vue/src/components/tooltip/README.md +0 -559
  442. package/src/vendor/bootstrap-vue/src/components/tooltip/_tooltip.scss +0 -86
  443. package/src/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-popper.js +0 -248
  444. package/src/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip-template.js +0 -130
  445. package/src/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip.js +0 -977
  446. package/src/vendor/bootstrap-vue/src/components/tooltip/index.d.ts +0 -7
  447. package/src/vendor/bootstrap-vue/src/components/tooltip/index.js +0 -3
  448. package/src/vendor/bootstrap-vue/src/components/tooltip/index.scss +0 -1
  449. package/src/vendor/bootstrap-vue/src/components/tooltip/package.json +0 -258
  450. package/src/vendor/bootstrap-vue/src/components/tooltip/tooltip.js +0 -316
  451. package/src/vendor/bootstrap-vue/src/components/tooltip/tooltip.spec.js +0 -1529
  452. package/src/vendor/bootstrap-vue/src/components/transition/bv-transition.js +0 -83
  453. package/src/vendor/bootstrap-vue/src/components/transition/package.json +0 -5
  454. package/src/vendor/bootstrap-vue/src/components/transporter/package.json +0 -5
  455. package/src/vendor/bootstrap-vue/src/components/transporter/transporter.js +0 -202
  456. package/src/vendor/bootstrap-vue/src/components/transporter/transporter.spec.js +0 -85
  457. package/src/vendor/bootstrap-vue/src/constants/classes.js +0 -1
  458. package/src/vendor/bootstrap-vue/src/constants/components.js +0 -77
  459. package/src/vendor/bootstrap-vue/src/constants/config.js +0 -4
  460. package/src/vendor/bootstrap-vue/src/constants/env.js +0 -57
  461. package/src/vendor/bootstrap-vue/src/constants/events.js +0 -57
  462. package/src/vendor/bootstrap-vue/src/constants/key-codes.js +0 -10
  463. package/src/vendor/bootstrap-vue/src/constants/popper.js +0 -8
  464. package/src/vendor/bootstrap-vue/src/constants/props.js +0 -26
  465. package/src/vendor/bootstrap-vue/src/constants/regex.js +0 -33
  466. package/src/vendor/bootstrap-vue/src/constants/safe-types.js +0 -17
  467. package/src/vendor/bootstrap-vue/src/constants/slots.js +0 -32
  468. package/src/vendor/bootstrap-vue/src/directives/modal/index.d.ts +0 -8
  469. package/src/vendor/bootstrap-vue/src/directives/modal/index.js +0 -3
  470. package/src/vendor/bootstrap-vue/src/directives/modal/modal.js +0 -115
  471. package/src/vendor/bootstrap-vue/src/directives/modal/modal.spec.js +0 -191
  472. package/src/vendor/bootstrap-vue/src/directives/toggle/README.md +0 -146
  473. package/src/vendor/bootstrap-vue/src/directives/toggle/index.d.ts +0 -7
  474. package/src/vendor/bootstrap-vue/src/directives/toggle/index.js +0 -3
  475. package/src/vendor/bootstrap-vue/src/directives/toggle/package.json +0 -26
  476. package/src/vendor/bootstrap-vue/src/directives/toggle/toggle.js +0 -274
  477. package/src/vendor/bootstrap-vue/src/directives/toggle/toggle.spec.js +0 -452
  478. package/src/vendor/bootstrap-vue/src/directives/tooltip/README.md +0 -521
  479. package/src/vendor/bootstrap-vue/src/directives/tooltip/index.d.ts +0 -7
  480. package/src/vendor/bootstrap-vue/src/directives/tooltip/index.js +0 -3
  481. package/src/vendor/bootstrap-vue/src/directives/tooltip/package.json +0 -131
  482. package/src/vendor/bootstrap-vue/src/directives/tooltip/tooltip.js +0 -270
  483. package/src/vendor/bootstrap-vue/src/directives/tooltip/tooltip.spec.js +0 -223
  484. package/src/vendor/bootstrap-vue/src/directives/visible/README.md +0 -244
  485. package/src/vendor/bootstrap-vue/src/directives/visible/index.d.ts +0 -7
  486. package/src/vendor/bootstrap-vue/src/directives/visible/index.js +0 -3
  487. package/src/vendor/bootstrap-vue/src/directives/visible/package.json +0 -24
  488. package/src/vendor/bootstrap-vue/src/directives/visible/visible.js +0 -184
  489. package/src/vendor/bootstrap-vue/src/index.d.ts +0 -61
  490. package/src/vendor/bootstrap-vue/src/index.js +0 -187
  491. package/src/vendor/bootstrap-vue/src/index.scss +0 -11
  492. package/src/vendor/bootstrap-vue/src/mixins/attrs.js +0 -19
  493. package/src/vendor/bootstrap-vue/src/mixins/attrs.spec.js +0 -194
  494. package/src/vendor/bootstrap-vue/src/mixins/click-out.js +0 -72
  495. package/src/vendor/bootstrap-vue/src/mixins/click-out.spec.js +0 -52
  496. package/src/vendor/bootstrap-vue/src/mixins/dropdown.js +0 -460
  497. package/src/vendor/bootstrap-vue/src/mixins/focus-in.js +0 -44
  498. package/src/vendor/bootstrap-vue/src/mixins/focus-in.spec.js +0 -53
  499. package/src/vendor/bootstrap-vue/src/mixins/form-control.js +0 -51
  500. package/src/vendor/bootstrap-vue/src/mixins/form-custom.js +0 -24
  501. package/src/vendor/bootstrap-vue/src/mixins/form-options.js +0 -73
  502. package/src/vendor/bootstrap-vue/src/mixins/form-radio-check-group.js +0 -162
  503. package/src/vendor/bootstrap-vue/src/mixins/form-radio-check.js +0 -332
  504. package/src/vendor/bootstrap-vue/src/mixins/form-selection.js +0 -60
  505. package/src/vendor/bootstrap-vue/src/mixins/form-size.js +0 -24
  506. package/src/vendor/bootstrap-vue/src/mixins/form-state.js +0 -47
  507. package/src/vendor/bootstrap-vue/src/mixins/form-text.js +0 -250
  508. package/src/vendor/bootstrap-vue/src/mixins/form-validity.js +0 -48
  509. package/src/vendor/bootstrap-vue/src/mixins/has-listener.js +0 -26
  510. package/src/vendor/bootstrap-vue/src/mixins/id.js +0 -51
  511. package/src/vendor/bootstrap-vue/src/mixins/listen-on-document.js +0 -64
  512. package/src/vendor/bootstrap-vue/src/mixins/listen-on-document.spec.js +0 -117
  513. package/src/vendor/bootstrap-vue/src/mixins/listen-on-root.js +0 -121
  514. package/src/vendor/bootstrap-vue/src/mixins/listen-on-root.spec.js +0 -77
  515. package/src/vendor/bootstrap-vue/src/mixins/listen-on-window.js +0 -64
  516. package/src/vendor/bootstrap-vue/src/mixins/listen-on-window.spec.js +0 -115
  517. package/src/vendor/bootstrap-vue/src/mixins/listeners.js +0 -24
  518. package/src/vendor/bootstrap-vue/src/mixins/listeners.spec.js +0 -245
  519. package/src/vendor/bootstrap-vue/src/mixins/model.js +0 -5
  520. package/src/vendor/bootstrap-vue/src/mixins/normalize-slot.js +0 -30
  521. package/src/vendor/bootstrap-vue/src/mixins/scoped-style.js +0 -14
  522. package/src/vendor/bootstrap-vue/src/mixins/use-parent.js +0 -12
  523. package/src/vendor/bootstrap-vue/src/utils/array.js +0 -17
  524. package/src/vendor/bootstrap-vue/src/utils/bv-event.class.js +0 -60
  525. package/src/vendor/bootstrap-vue/src/utils/bv-event.class.spec.js +0 -66
  526. package/src/vendor/bootstrap-vue/src/utils/cache.js +0 -37
  527. package/src/vendor/bootstrap-vue/src/utils/clone-deep.js +0 -15
  528. package/src/vendor/bootstrap-vue/src/utils/clone-deep.spec.js +0 -70
  529. package/src/vendor/bootstrap-vue/src/utils/config-set.js +0 -80
  530. package/src/vendor/bootstrap-vue/src/utils/config.js +0 -72
  531. package/src/vendor/bootstrap-vue/src/utils/config.spec.js +0 -169
  532. package/src/vendor/bootstrap-vue/src/utils/create-new-child-component.js +0 -10
  533. package/src/vendor/bootstrap-vue/src/utils/css-escape.js +0 -73
  534. package/src/vendor/bootstrap-vue/src/utils/css-escape.spec.js +0 -82
  535. package/src/vendor/bootstrap-vue/src/utils/dom.js +0 -308
  536. package/src/vendor/bootstrap-vue/src/utils/dom.spec.js +0 -291
  537. package/src/vendor/bootstrap-vue/src/utils/element-to-vue-instance-registry.js +0 -40
  538. package/src/vendor/bootstrap-vue/src/utils/env.js +0 -15
  539. package/src/vendor/bootstrap-vue/src/utils/events.js +0 -71
  540. package/src/vendor/bootstrap-vue/src/utils/events.spec.js +0 -41
  541. package/src/vendor/bootstrap-vue/src/utils/get-event-root.js +0 -3
  542. package/src/vendor/bootstrap-vue/src/utils/get-instance-from-directive.js +0 -4
  543. package/src/vendor/bootstrap-vue/src/utils/get-scope-id.js +0 -6
  544. package/src/vendor/bootstrap-vue/src/utils/get.js +0 -64
  545. package/src/vendor/bootstrap-vue/src/utils/get.spec.js +0 -109
  546. package/src/vendor/bootstrap-vue/src/utils/html.js +0 -8
  547. package/src/vendor/bootstrap-vue/src/utils/identity.js +0 -1
  548. package/src/vendor/bootstrap-vue/src/utils/inspect.js +0 -51
  549. package/src/vendor/bootstrap-vue/src/utils/inspect.spec.js +0 -251
  550. package/src/vendor/bootstrap-vue/src/utils/locale.js +0 -34
  551. package/src/vendor/bootstrap-vue/src/utils/loose-equal.js +0 -57
  552. package/src/vendor/bootstrap-vue/src/utils/loose-equal.spec.js +0 -203
  553. package/src/vendor/bootstrap-vue/src/utils/loose-index-of.js +0 -11
  554. package/src/vendor/bootstrap-vue/src/utils/math.js +0 -11
  555. package/src/vendor/bootstrap-vue/src/utils/memoize.js +0 -10
  556. package/src/vendor/bootstrap-vue/src/utils/model.js +0 -29
  557. package/src/vendor/bootstrap-vue/src/utils/noop.js +0 -1
  558. package/src/vendor/bootstrap-vue/src/utils/normalize-slot.js +0 -44
  559. package/src/vendor/bootstrap-vue/src/utils/normalize-slot.spec.js +0 -63
  560. package/src/vendor/bootstrap-vue/src/utils/number.js +0 -19
  561. package/src/vendor/bootstrap-vue/src/utils/number.spec.js +0 -72
  562. package/src/vendor/bootstrap-vue/src/utils/object.js +0 -61
  563. package/src/vendor/bootstrap-vue/src/utils/object.spec.js +0 -61
  564. package/src/vendor/bootstrap-vue/src/utils/observe-dom.js +0 -77
  565. package/src/vendor/bootstrap-vue/src/utils/plugins.js +0 -169
  566. package/src/vendor/bootstrap-vue/src/utils/props.js +0 -92
  567. package/src/vendor/bootstrap-vue/src/utils/props.spec.js +0 -112
  568. package/src/vendor/bootstrap-vue/src/utils/router.js +0 -145
  569. package/src/vendor/bootstrap-vue/src/utils/router.spec.js +0 -248
  570. package/src/vendor/bootstrap-vue/src/utils/safe-vue-instance.js +0 -13
  571. package/src/vendor/bootstrap-vue/src/utils/stable-sort.js +0 -31
  572. package/src/vendor/bootstrap-vue/src/utils/string.js +0 -59
  573. package/src/vendor/bootstrap-vue/src/utils/string.spec.js +0 -65
  574. package/src/vendor/bootstrap-vue/src/utils/stringify-object-values.js +0 -31
  575. package/src/vendor/bootstrap-vue/src/utils/stringify-object-values.spec.js +0 -47
  576. package/src/vendor/bootstrap-vue/src/utils/warn.js +0 -42
  577. package/src/vendor/bootstrap-vue/src/utils/warn.spec.js +0 -54
  578. package/src/vendor/bootstrap-vue/src/vue-injections.d.ts +0 -13
  579. package/src/vendor/bootstrap-vue/src/vue.js +0 -126
@@ -1,3157 +0,0 @@
1
- # Table
2
-
3
- > For displaying tabular data, `<b-table>` supports pagination, filtering, sorting, custom
4
- > rendering, various style options, events, and asynchronous data. For simple display of tabular
5
- > data without all the fancy features, BootstrapVue provides two lightweight alternative components
6
- > [`<b-table-lite>`](#light-weight-tables) and [`<b-table-simple>`](#simple-tables).
7
-
8
- **Example: Basic usage**
9
-
10
- ```html
11
- <template>
12
- <div>
13
- <b-table striped hover :items="items"></b-table>
14
- </div>
15
- </template>
16
-
17
- <script>
18
- export default {
19
- data() {
20
- return {
21
- items: [
22
- { age: 40, first_name: 'Dickerson', last_name: 'Macdonald' },
23
- { age: 21, first_name: 'Larsen', last_name: 'Shaw' },
24
- { age: 89, first_name: 'Geneva', last_name: 'Wilson' },
25
- { age: 38, first_name: 'Jami', last_name: 'Carney' }
26
- ]
27
- }
28
- }
29
- }
30
- </script>
31
-
32
- <!-- b-table.vue -->
33
- ```
34
-
35
- ## Items (record data)
36
-
37
- `items` is the table data in array format, where each record (row) data are keyed objects. Example
38
- format:
39
-
40
- <!-- eslint-disable no-unused-vars -->
41
-
42
- ```js
43
- const items = [
44
- { age: 32, first_name: 'Cyndi' },
45
- { age: 27, first_name: 'Havij' },
46
- { age: 42, first_name: 'Robert' }
47
- ]
48
- ```
49
-
50
- `<b-table>` automatically samples the first row to extract field names (the keys in the record
51
- data). Field names are automatically "humanized" by converting `kebab-case`, `snake_case`, and
52
- `camelCase` to individual words and capitalizes each word. Example conversions:
53
-
54
- - `first_name` becomes `First Name`
55
- - `last-name` becomes `Last Name`
56
- - `age` becomes `Age`
57
- - `YEAR` remains `YEAR`
58
- - `isActive` becomes `Is Active`
59
-
60
- These titles will be displayed in the table header, in the order they appear in the **first** record
61
- of data. See the [Fields](#fields-column-definitions) section below for customizing how field
62
- headings appear.
63
-
64
- **Note:** Field order is not guaranteed. Fields will typically appear in the order they were defined
65
- in the first row, but this may not always be the case depending on the version of browser in use.
66
- See section [Fields (column definitions)](#fields-column-definitions) below to see how to guarantee
67
- the order of fields, and to override the headings generated.
68
-
69
- Record data may also have additional special reserved name keys for colorizing rows and individual
70
- cells (variants), and for triggering additional row detail. The supported optional item record
71
- modifier properties (make sure your field keys do not conflict with these names):
72
-
73
- | Property | Type | Description |
74
- | --------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
75
- | `_cellVariants` | Object | Bootstrap contextual state applied to individual cells. Keyed by field (See the [Color Variants](/docs/reference/color-variants) for supported values). These variants map to classes `table-${variant}` or `bg-${variant}` (when the `dark` prop is set). |
76
- | `_rowVariant` | String | Bootstrap contextual state applied to the entire row (See the [Color Variants](/docs/reference/color-variants) for supported values). These variants map to classes `table-${variant}` or `bg-${variant}` (when the `dark` prop is set) |
77
- | `_showDetails` | Boolean | Used to trigger the display of the `row-details` scoped slot. See section [Row details support](#row-details-support) below for additional information |
78
-
79
- **Example: Using variants for table cells**
80
-
81
- ```html
82
- <template>
83
- <div>
84
- <b-table hover :items="items"></b-table>
85
- </div>
86
- </template>
87
-
88
- <script>
89
- export default {
90
- data() {
91
- return {
92
- items: [
93
- { age: 40, first_name: 'Dickerson', last_name: 'Macdonald' },
94
- { age: 21, first_name: 'Larsen', last_name: 'Shaw' },
95
- {
96
- age: 89,
97
- first_name: 'Geneva',
98
- last_name: 'Wilson',
99
- _rowVariant: 'danger'
100
- },
101
- {
102
- age: 40,
103
- first_name: 'Thor',
104
- last_name: 'MacDonald',
105
- _cellVariants: { age: 'info', first_name: 'warning' }
106
- },
107
- { age: 29, first_name: 'Dick', last_name: 'Dunlap' }
108
- ]
109
- }
110
- }
111
- }
112
- </script>
113
-
114
- <!-- b-table-variants.vue -->
115
- ```
116
-
117
- `items` can also be a reference to a _provider_ function, which returns an `Array` of items data.
118
- Provider functions can also be asynchronous:
119
-
120
- - By returning `null` (or `undefined`) and calling a callback, when the data is ready, with the data
121
- array as the only argument to the callback,
122
- - By returning a `Promise` that resolves to an array.
123
-
124
- See the ["Using Items Provider functions"](#using-items-provider-functions) section below for more
125
- details.
126
-
127
- ### Table item notes and warnings
128
-
129
- - Avoid manipulating record data in place, as changes to the underlying items data will cause either
130
- the row or entire table to be re-rendered. See [Primary Key](#primary-key), below, for ways to
131
- minimize Vue's re-rendering of rows.
132
- - `items` array records should be a simple object and **must** avoid placing data that may have
133
- circular references in the values within a row. `<b-table>` serializes the row data into strings
134
- for sorting and filtering, and circular references will cause stack overflows to occur and your
135
- app to crash!
136
-
137
- ## Fields (column definitions)
138
-
139
- The `fields` prop is used to customize the table columns headings, and in which order the columns of
140
- data are displayed. The field object keys (i.e. `age` or `first_name` as shown below) are used to
141
- extract the value from each item (record) row, and to provide additional features such as enabling
142
- [sorting](#sorting) on the column, etc.
143
-
144
- Fields can be provided as a _simple array_ or an _array of objects_. **Internally the fields data
145
- will be normalized into the _array of objects_ format**. Events or slots that include the column
146
- `field` data will be in the normalized field object format (array of objects for `fields`, or an
147
- object for an individual `field`).
148
-
149
- ### Fields as a simple array
150
-
151
- Fields can be a simple array, for defining the order of the columns, and which columns to display:
152
-
153
- **Example: Using `array` fields definition**
154
-
155
- ```html
156
- <template>
157
- <div>
158
- <b-table striped hover :items="items" :fields="fields"></b-table>
159
- </div>
160
- </template>
161
-
162
- <script>
163
- export default {
164
- data() {
165
- return {
166
- // Note `isActive` is left out and will not appear in the rendered table
167
- fields: ['first_name', 'last_name', 'age'],
168
- items: [
169
- { isActive: true, age: 40, first_name: 'Dickerson', last_name: 'Macdonald' },
170
- { isActive: false, age: 21, first_name: 'Larsen', last_name: 'Shaw' },
171
- { isActive: false, age: 89, first_name: 'Geneva', last_name: 'Wilson' },
172
- { isActive: true, age: 38, first_name: 'Jami', last_name: 'Carney' }
173
- ]
174
- }
175
- }
176
- }
177
- </script>
178
-
179
- <!-- b-table-fields-array.vue -->
180
- ```
181
-
182
- ### Fields as an array of objects
183
-
184
- Fields can be a an array of objects, providing additional control over the fields (such as sorting,
185
- formatting, etc.). Only columns (keys) that appear in the fields array will be shown:
186
-
187
- **Example: Using array of objects fields definition**
188
-
189
- ```html
190
- <template>
191
- <div>
192
- <b-table striped hover :items="items" :fields="fields"></b-table>
193
- </div>
194
- </template>
195
-
196
- <script>
197
- export default {
198
- data() {
199
- return {
200
- // Note 'isActive' is left out and will not appear in the rendered table
201
- fields: [
202
- {
203
- key: 'last_name',
204
- sortable: true
205
- },
206
- {
207
- key: 'first_name',
208
- sortable: false
209
- },
210
- {
211
- key: 'age',
212
- label: 'Person age',
213
- sortable: true,
214
- // Variant applies to the whole column, including the header and footer
215
- variant: 'danger'
216
- }
217
- ],
218
- items: [
219
- { isActive: true, age: 40, first_name: 'Dickerson', last_name: 'Macdonald' },
220
- { isActive: false, age: 21, first_name: 'Larsen', last_name: 'Shaw' },
221
- { isActive: false, age: 89, first_name: 'Geneva', last_name: 'Wilson' },
222
- { isActive: true, age: 38, first_name: 'Jami', last_name: 'Carney' }
223
- ]
224
- }
225
- }
226
- }
227
- </script>
228
-
229
- <!-- b-table-fields-array-of-objects.vue -->
230
- ```
231
-
232
- ### Field definition reference
233
-
234
- The following field properties are recognized:
235
-
236
- | Property | Type | Description |
237
- | ------------------- | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
238
- | `key` | String | The key for selecting data from the record in the items array. Required when setting the `fields` via an array of objects. The `key` is also used for generating the [custom data rendering](#custom-data-rendering) and [custom header and footer](#header-and-footer-custom-rendering-via-scoped-slots) slot names. |
239
- | `label` | String | Appears in the columns table header (and footer if `foot-clone` is set). Defaults to the field's key (in humanized format) if not provided. It's possible to use empty labels by assigning an empty string `""` but be sure you also set `headerTitle` to provide non-sighted users a hint about the column contents. |
240
- | `headerTitle` | String | Text to place on the fields header `<th>` attribute `title`. Defaults to no `title` attribute. |
241
- | `headerAbbr` | String | Text to place on the fields header `<th>` attribute `abbr`. Set this to the unabbreviated version of the label (or title) if label (or title) is an abbreviation. Defaults to no `abbr` attribute. |
242
- | `class` | String or Array | Class name (or array of class names) to add to `<th>` **and** `<td>` in the column. |
243
- | `formatter` | String or Function | A formatter callback function or name of a method in your component, can be used instead of (or in conjunction with) scoped field slots. The formatter will be called with the syntax `formatter(value, key, item)`. Refer to [Custom Data Rendering](#custom-data-rendering) for more details. |
244
- | `sortable` | Boolean | Enable sorting on this column. Refer to the [Sorting](#sorting) Section for more details. |
245
- | `sortKey` | String | <span class="badge badge-secondary">v2.17.0+</span> Set the value of `sortBy` for the column in the emitted context when `no-local-sorting` is `true`. |
246
- | `sortDirection` | String | Set the initial sort direction on this column when it becomes sorted. Refer to the [Change initial sort direction](#change-initial-sort-direction) Section for more details. |
247
- | `sortByFormatted` | Boolean or Function | Sort the column by the result of the field's `formatter` callback function when set to `true`. Default is `false`. Boolean has no effect if the field does not have a `formatter`. Optionally accepts a formatter function _reference_ to format the value for sorting purposes only. Refer to the [Sorting](#sorting) Section for more details. |
248
- | `filterByFormatted` | Boolean or Function | Filter the column by the result of the field's `formatter` callback function when set to `true`. Default is `false`. Boolean has no effect if the field does not have a `formatter`. Optionally accepts a formatter function _reference_ to format the value for filtering purposes only. Refer to the [Filtering](#filtering) section for more details. |
249
- | `tdClass` | String or Array or Function | Class name (or array of class names) to add to `<tbody>` data `<td>` cells in the column. If custom classes per cell are required, a callback function can be specified instead. The function will be called as `tdClass(value, key, item)` and it must return an `Array` or `String`. |
250
- | `thClass` | String or Array | Class name (or array of class names) to add to this field's `<thead>`/`<tfoot>` heading `<th>` cell. |
251
- | `thStyle` | Object | JavaScript object representing CSS styles you would like to apply to the table `<thead>`/`<tfoot>` field `<th>`. |
252
- | `variant` | String | Apply contextual class to all the `<th>` **and** `<td>` in the column - `active`, `success`, `info`, `warning`, `danger`. These variants map to classes `thead-${variant}` (in the header), `table-${variant}` (in the body), or `bg-${variant}` (when the prop `dark` is set). |
253
- | `tdAttr` | Object or Function | JavaScript object representing additional attributes to apply to the `<tbody>` field `<td>` cell. If custom attributes per cell are required, a callback function can be specified instead. The function will be called as `tdAttr(value, key, item)` and it must return an `Object`. |
254
- | `thAttr` | Object or Function | JavaScript object representing additional attributes to apply to the field's `<thead>`/`<tfoot>` heading `<th>` cell. If the field's `isRowHeader` is set to `true`, the attributes will also apply to the `<tbody>` field `<th>` cell. If custom attributes per cell are required, a callback function can be specified instead. The function will be called as `thAttr(value, key, item, type)` and it must return an `Object`. |
255
- | `isRowHeader` | Boolean | When set to `true`, the field's item data cell will be rendered with `<th>` rather than the default of `<td>`. |
256
- | `stickyColumn` | Boolean | When set to `true`, and the table in [responsive](#responsive-tables) mode or has [sticky headers](#sticky-headers), will cause the column to become fixed to the left when the table's horizontal scrollbar is scrolled. See [Sticky columns](#sticky-columns) for more details |
257
-
258
- **Notes:**
259
-
260
- - Field properties, if not present, default to `null` (falsey) unless otherwise stated above.
261
- - `class`, `thClass`, `tdClass` etc. will not work with classes that are defined in scoped CSS,
262
- unless you are using VueLoader's
263
- [Deep selector](https://vue-loader.vuejs.org/guide/scoped-css.html#child-component-root-elements).
264
- - For information on the syntax supported by `thStyle`, see
265
- [Class and Style Bindings](https://vuejs.org/v2/guide/class-and-style.html#Binding-Inline-Styles)
266
- in the Vue.js guide.
267
- - Any additional properties added to the field definition objects will be left intact - so you can
268
- access them via the named scoped slots for custom data, header, and footer rendering.
269
-
270
- For information and usage about scoped slots and formatters, refer to the
271
- [Custom Data Rendering](#custom-data-rendering) section below.
272
-
273
- Feel free to mix and match simple array and object array together:
274
-
275
- <!-- eslint-disable no-unused-vars -->
276
-
277
- ```js
278
- const fields = [
279
- { key: 'first_name', label: 'First' },
280
- { key: 'last_name', label: 'Last' },
281
- 'age',
282
- 'sex'
283
- ]
284
- ```
285
-
286
- ## Primary key
287
-
288
- `<b-table>` provides an additional prop `primary-key`, which you can use to identify the _name_ of
289
- the field key that _uniquely_ identifies the row.
290
-
291
- The value specified by the primary column key **must be** either a `string` or `number`, and **must
292
- be unique** across all rows in the table.
293
-
294
- The primary key column does not need to appear in the displayed fields.
295
-
296
- ### Table row ID generation
297
-
298
- When provided, the `primary-key` will generate a unique ID for each item row `<tr>` element. The ID
299
- will be in the format of `{table-id}__row_{primary-key-value}`, where `{table-id}` is the unique ID
300
- of the `<b-table>` and `{primary-key-value}` is the value of the item's field value for the field
301
- specified by `primary-key`.
302
-
303
- ### Table render and transition optimization
304
-
305
- The `primary-key` is also used by `<b-table>` to help Vue optimize the rendering of table rows.
306
- Internally, the value of the field key specified by the `primary-key` prop is used as the Vue `:key`
307
- value for each rendered item row `<tr>` element.
308
-
309
- If you are seeing rendering issue (i.e. tooltips hiding or unexpected subcomponent re-usage when
310
- item data changes or data is sorted/filtered/edited) or table row transitions are not working,
311
- setting the `primary-key` prop (if you have a unique identifier per row) can alleviate these issues.
312
-
313
- Specifying the `primary-key` column is handy if you are using 3rd party table transitions or drag
314
- and drop plugins, as they rely on having a consistent and unique per row `:key` value.
315
-
316
- If `primary-key` is not provided, `<b-table>` will auto-generate keys based on the displayed row's
317
- index number (i.e. position in the _displayed_ table rows). This may cause GUI issues such as sub
318
- components/elements that are rendering with previous results (i.e. being re-used by Vue's render
319
- patch optimization routines). Specifying a `primary-key` column can alleviate this issue (or you can
320
- place a unique `:key` on your element/components in your custom formatted field slots).
321
-
322
- Refer to the [Table body transition support](#table-body-transition-support) section for additional
323
- details.
324
-
325
- ## Table style options
326
-
327
- ### Table styling
328
-
329
- `<b-table>` provides several props to alter the style of the table:
330
-
331
- | prop | Type | Description |
332
- | -------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
333
- | `striped` | Boolean | Add zebra-striping to the table rows within the `<tbody>` |
334
- | `bordered` | Boolean | For borders on all sides of the table and cells. |
335
- | `borderless` | Boolean | removes inner borders from table. |
336
- | `outlined` | Boolean | For a thin border on all sides of the table. Has no effect if `bordered` is set. |
337
- | `small` | Boolean | To make tables more compact by cutting cell padding in half. |
338
- | `hover` | Boolean | To enable a hover highlighting state on table rows within a `<tbody>` |
339
- | `dark` | Boolean | Invert the colors — with light text on dark backgrounds (equivalent to Bootstrap v4 class `.table-dark`) |
340
- | `fixed` | Boolean | Generate a table with equal fixed-width columns (`table-layout: fixed;`) |
341
- | `responsive` | Boolean or String | Generate a responsive table to make it scroll horizontally. Set to `true` for an always responsive table, or set it to one of the breakpoints `'sm'`, `'md'`, `'lg'`, or `'xl'` to make the table responsive (horizontally scroll) only on screens smaller than the breakpoint. See [Responsive tables](#responsive-tables) below for details. |
342
- | `sticky-header` | Boolean or String | Generates a vertically scrollable table with sticky headers. Set to `true` to enable sticky headers (default table max-height of `300px`), or set it to a string containing a height (with CSS units) to specify a maximum height other than `300px`. See the [Sticky header](#sticky-headers) section below for details. |
343
- | `stacked` | Boolean or String | Generate a responsive stacked table. Set to `true` for an always stacked table, or set it to one of the breakpoints `'sm'`, `'md'`, `'lg'`, or `'xl'` to make the table visually stacked only on screens smaller than the breakpoint. See [Stacked tables](#stacked-tables) below for details. |
344
- | `caption-top` | Boolean | If the table has a caption, and this prop is set to `true`, the caption will be visually placed above the table. If `false` (the default), the caption will be visually placed below the table. |
345
- | `table-variant` | String | Give the table an overall theme color variant. |
346
- | `head-variant` | String | Use `'light'` or `'dark'` to make table header appear light or dark gray, respectively |
347
- | `foot-variant` | String | Use `'light'` or `'dark'` to make table footer appear light or dark gray, respectively. If not set, `head-variant` will be used. Has no effect if `foot-clone` is not set |
348
- | `foot-clone` | Boolean | Turns on the table footer, and defaults with the same contents a the table header |
349
- | `no-footer-sorting` | Boolean | When `foot-clone` is true and the table is sortable, disables the sorting icons and click behaviour on the footer heading cells. Refer to the [Sorting](#sorting) section below for more details. |
350
- | `no-border-collapse` | Boolean | Disables the default of collapsing of the table borders. Mainly for use with [sticky headers](#sticky-headers) and/or [sticky columns](#sticky-columns). Will cause the appearance of double borders in some situations. |
351
-
352
- **Note:** The table style options `fixed`, `stacked`, `caption-top`, `no-border-collapse`, sticky
353
- headers, sticky columns and the table sorting feature, all require BootstrapVue's custom CSS.
354
-
355
- **Example: Basic table styles**
356
-
357
- ```html
358
- <template>
359
- <div>
360
- <b-form-group label="Table Options" label-cols-lg="2" v-slot="{ ariaDescribedby }">
361
- <b-form-checkbox v-model="striped" :aria-describedby="ariaDescribedby" inline>Striped</b-form-checkbox>
362
- <b-form-checkbox v-model="bordered" :aria-describedby="ariaDescribedby" inline>Bordered</b-form-checkbox>
363
- <b-form-checkbox v-model="borderless" :aria-describedby="ariaDescribedby" inline>Borderless</b-form-checkbox>
364
- <b-form-checkbox v-model="outlined" :aria-describedby="ariaDescribedby" inline>Outlined</b-form-checkbox>
365
- <b-form-checkbox v-model="small" :aria-describedby="ariaDescribedby" inline>Small</b-form-checkbox>
366
- <b-form-checkbox v-model="hover" :aria-describedby="ariaDescribedby" inline>Hover</b-form-checkbox>
367
- <b-form-checkbox v-model="dark" :aria-describedby="ariaDescribedby" inline>Dark</b-form-checkbox>
368
- <b-form-checkbox v-model="fixed" :aria-describedby="ariaDescribedby" inline>Fixed</b-form-checkbox>
369
- <b-form-checkbox v-model="footClone" :aria-describedby="ariaDescribedby" inline>Foot Clone</b-form-checkbox>
370
- <b-form-checkbox v-model="noCollapse" :aria-describedby="ariaDescribedby" inline>No border collapse</b-form-checkbox>
371
- </b-form-group>
372
-
373
- <b-form-group label="Head Variant" label-cols-lg="2" v-slot="{ ariaDescribedby }">
374
- <b-form-radio-group
375
- v-model="headVariant"
376
- :aria-describedby="ariaDescribedby"
377
- class="mt-lg-2"
378
- >
379
- <b-form-radio :value="null" inline>None</b-form-radio>
380
- <b-form-radio value="light" inline>Light</b-form-radio>
381
- <b-form-radio value="dark" inline>Dark</b-form-radio>
382
- </b-form-radio-group>
383
- </b-form-group>
384
-
385
- <b-form-group label="Table Variant" label-for="table-style-variant" label-cols-lg="2">
386
- <b-form-select
387
- id="table-style-variant"
388
- v-model="tableVariant"
389
- :options="tableVariants"
390
- >
391
- <template #first>
392
- <option value="">-- None --</option>
393
- </template>
394
- </b-form-select>
395
- </b-form-group>
396
-
397
- <b-table
398
- :striped="striped"
399
- :bordered="bordered"
400
- :borderless="borderless"
401
- :outlined="outlined"
402
- :small="small"
403
- :hover="hover"
404
- :dark="dark"
405
- :fixed="fixed"
406
- :foot-clone="footClone"
407
- :no-border-collapse="noCollapse"
408
- :items="items"
409
- :fields="fields"
410
- :head-variant="headVariant"
411
- :table-variant="tableVariant"
412
- ></b-table>
413
- </div>
414
- </template>
415
-
416
- <script>
417
- export default {
418
- data() {
419
- return {
420
- fields: ['first_name', 'last_name', 'age'],
421
- items: [
422
- { age: 40, first_name: 'Dickerson', last_name: 'Macdonald' },
423
- { age: 21, first_name: 'Larsen', last_name: 'Shaw' },
424
- { age: 89, first_name: 'Geneva', last_name: 'Wilson' }
425
- ],
426
- tableVariants: [
427
- 'primary',
428
- 'secondary',
429
- 'info',
430
- 'danger',
431
- 'warning',
432
- 'success',
433
- 'light',
434
- 'dark'
435
- ],
436
- striped: false,
437
- bordered: false,
438
- borderless: false,
439
- outlined: false,
440
- small: false,
441
- hover: false,
442
- dark: false,
443
- fixed: false,
444
- footClone: false,
445
- headVariant: null,
446
- tableVariant: '',
447
- noCollapse: false
448
- }
449
- }
450
- }
451
- </script>
452
-
453
- <!-- b-table-bordered.vue -->
454
- ```
455
-
456
- ### Row styling and attributes
457
-
458
- You can also style every row using the `tbody-tr-class` prop, and optionally supply additional
459
- attributes via the `tbody-tr-attr` prop:
460
-
461
- | Property | Type | Description |
462
- | ---------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
463
- | `tbody-tr-class` | String, Array or Function | Classes to be applied to every row on the table. If a function is given, it will be called as `tbodyTrClass( item, type )` and it may return an `Array`, `Object` or `String`. |
464
- | `tbody-tr-attr` | Object or Function | Attributes to be applied to every row on the table. If a function is given, it will be called as `tbodyTrAttr( item, type )` and it must return an `Object`. |
465
-
466
- When passing a function reference to `tbody-tr-class` or `tbody-tr-attr`, the function's arguments
467
- will be as follows:
468
-
469
- - `item` - The item record data associated with the row. For rows that are not associated with an
470
- item record, this value will be `null` or `undefined`
471
- - `type` - The type of row being rendered. `'row'` for an item row, `'row-details'` for an item
472
- details row, `'row-top'` for the fixed row top slot, `'row-bottom'` for the fixed row bottom slot,
473
- or `'table-busy'` for the table busy slot.
474
-
475
- **Example: Basic row styles**
476
-
477
- ```html
478
- <template>
479
- <div>
480
- <b-table :items="items" :fields="fields" :tbody-tr-class="rowClass"></b-table>
481
- </div>
482
- </template>
483
-
484
- <script>
485
- export default {
486
- data() {
487
- return {
488
- fields: ['first_name', 'last_name', 'age'],
489
- items: [
490
- { age: 40, first_name: 'Dickerson', last_name: 'Macdonald', status: 'awesome' },
491
- { age: 21, first_name: 'Larsen', last_name: 'Shaw' },
492
- { age: 89, first_name: 'Geneva', last_name: 'Wilson' }
493
- ]
494
- }
495
- },
496
- methods: {
497
- rowClass(item, type) {
498
- if (!item || type !== 'row') return
499
- if (item.status === 'awesome') return 'table-success'
500
- }
501
- }
502
- }
503
- </script>
504
-
505
- <!-- b-table-styled-row.vue -->
506
- ```
507
-
508
- ### Responsive tables
509
-
510
- Responsive tables allow tables to be scrolled horizontally with ease. Make any table responsive
511
- across all viewports by setting the prop `responsive` to `true`. Or, pick a maximum breakpoint with
512
- which to have a responsive table up to by setting the prop `responsive` to one of the breakpoint
513
- values: `sm`, `md`, `lg`, or `xl`.
514
-
515
- **Example: Always responsive table**
516
-
517
- ```html
518
- <template>
519
- <div>
520
- <b-table responsive :items="items"></b-table>
521
- </div>
522
- </template>
523
-
524
- <script>
525
- export default {
526
- data() {
527
- return {
528
- items: [
529
- {
530
- heading1: 'table cell',
531
- heading2: 'table cell',
532
- heading3: 'table cell',
533
- heading4: 'table cell',
534
- heading5: 'table cell',
535
- heading6: 'table cell',
536
- heading7: 'table cell',
537
- heading8: 'table cell',
538
- heading9: 'table cell',
539
- heading10: 'table cell',
540
- heading11: 'table cell',
541
- heading12: 'table cell'
542
- },
543
- {
544
- heading1: 'table cell',
545
- heading2: 'table cell',
546
- heading3: 'table cell',
547
- heading4: 'table cell',
548
- heading5: 'table cell',
549
- heading6: 'table cell',
550
- heading7: 'table cell',
551
- heading8: 'table cell',
552
- heading9: 'table cell',
553
- heading10: 'table cell',
554
- heading11: 'table cell',
555
- heading12: 'table cell'
556
- },
557
- {
558
- heading1: 'table cell',
559
- heading2: 'table cell',
560
- heading3: 'table cell',
561
- heading4: 'table cell',
562
- heading5: 'table cell',
563
- heading6: 'table cell',
564
- heading7: 'table cell',
565
- heading8: 'table cell',
566
- heading9: 'table cell',
567
- heading10: 'table cell',
568
- heading11: 'table cell',
569
- heading12: 'table cell'
570
- }
571
- ]
572
- }
573
- }
574
- }
575
- </script>
576
-
577
- <!-- b-table-responsive.vue -->
578
- ```
579
-
580
- **Responsive table notes:**
581
-
582
- - _Possible vertical clipping/truncation_. Responsive tables make use of `overflow-y: hidden`, which
583
- clips off any content that goes beyond the bottom or top edges of the table. In particular, this
584
- may clip off dropdown menus and other third-party widgets.
585
- - Using props `responsive` and `fixed` together will **not** work as expected. Fixed table layout
586
- uses the first row (table header in this case) to compute the width required by each column (and
587
- the overall table width) to fit within the width of the parent container &mdash; without taking
588
- cells in the `<tbody>` into consideration &mdash; resulting in table that may not be responsive.
589
- To get around this limitation, you would need to specify widths for the columns (or certain
590
- columns) via one of the following methods:
591
- - Use `<col>` elements within the [`table-colgroup` slot](#table-colgroup) that have widths set
592
- (e.g. `<col style="width: 20rem">`), or
593
- - Wrap header cells in `<div>` elements, via the use of
594
- [custom header rendering](#header-and-footer-custom-rendering-via-scoped-slots), which have a
595
- minimum width set on them, or
596
- - Use the `thStyle` property of the [field definition object](#field-definition-reference) to set
597
- a width for the column(s), or
598
- - Use custom CSS to define classes to apply to the columns to set widths, via the `thClass` or
599
- `class` properties of the [field definition object](#field-definition-reference).
600
-
601
- ### Stacked tables
602
-
603
- An alternative to responsive tables, BootstrapVue includes the stacked table option (using custom
604
- SCSS/CSS), which allow tables to be rendered in a visually stacked format. Make any table stacked
605
- across _all viewports_ by setting the prop `stacked` to `true`. Or, alternatively, set a breakpoint
606
- at which the table will return to normal table format by setting the prop `stacked` to one of the
607
- breakpoint values `'sm'`, `'md'`, `'lg'`, or `'xl'`.
608
-
609
- Column header labels will be rendered to the left of each field value using a CSS `::before` pseudo
610
- element, with a width of 40%.
611
-
612
- The `stacked` prop takes precedence over the [`sticky-header`](#sticky-headers) prop and the
613
- [`stickyColumn`](#sticky-columns) field definition property.
614
-
615
- **Example: Always stacked table**
616
-
617
- ```html
618
- <template>
619
- <div>
620
- <b-table stacked :items="items"></b-table>
621
- </div>
622
- </template>
623
-
624
- <script>
625
- export default {
626
- data() {
627
- return {
628
- items: [
629
- { age: 40, first_name: 'Dickerson', last_name: 'Macdonald' },
630
- { age: 21, first_name: 'Larsen', last_name: 'Shaw' },
631
- { age: 89, first_name: 'Geneva', last_name: 'Wilson' }
632
- ]
633
- }
634
- }
635
- }
636
- </script>
637
-
638
- <!-- b-table-stacked.vue -->
639
- ```
640
-
641
- **Note: When the table is visually stacked:**
642
-
643
- - The table header (and table footer) will be hidden.
644
- - Custom rendered header slots will not be shown, rather, the fields' `label` will be used.
645
- - The table **cannot** be sorted by clicking the rendered field labels. You will need to provide an
646
- external control to select the field to sort by and the sort direction. See the
647
- [Sorting](#sorting) section below for sorting control information, as well as the
648
- [complete example](#complete-example) at the bottom of this page for an example of controlling
649
- sorting via the use of form controls.
650
- - The slots `top-row` and `bottom-row` will be hidden when visually stacked.
651
- - The table caption, if provided, will always appear at the top of the table when visually stacked.
652
- - In an always stacked table, the table header and footer, and the fixed top and bottom row slots
653
- will not be rendered.
654
-
655
- BootstrapVue's custom CSS is required in order to support stacked tables.
656
-
657
- ### Table caption
658
-
659
- Add an optional caption to your table via the prop `caption` or the named slot `table-caption` (the
660
- slot takes precedence over the prop). The default Bootstrap v4 styling places the caption at the
661
- bottom of the table:
662
-
663
- ```html
664
- <template>
665
- <div>
666
- <b-table :items="items" :fields="fields">
667
- <template #table-caption>This is a table caption.</template>
668
- </b-table>
669
- </div>
670
- </template>
671
-
672
- <script>
673
- export default {
674
- data() {
675
- return {
676
- fields: ['first_name', 'last_name', 'age'],
677
- items: [
678
- { age: 40, first_name: 'Dickerson', last_name: 'Macdonald' },
679
- { age: 21, first_name: 'Larsen', last_name: 'Shaw' },
680
- { age: 89, first_name: 'Geneva', last_name: 'Wilson' }
681
- ]
682
- }
683
- }
684
- }
685
- </script>
686
-
687
- <!-- b-table-caption.vue -->
688
- ```
689
-
690
- You can have the caption placed at the top of the table by setting the `caption-top` prop to `true`:
691
-
692
- ```html
693
- <template>
694
- <div>
695
- <b-table :items="items" :fields="fields" caption-top>
696
- <template #table-caption>This is a table caption at the top.</template>
697
- </b-table>
698
- </div>
699
- </template>
700
-
701
- <script>
702
- export default {
703
- data() {
704
- return {
705
- fields: ['first_name', 'last_name', 'age'],
706
- items: [
707
- { age: 40, first_name: 'Dickerson', last_name: 'Macdonald' },
708
- { age: 21, first_name: 'Larsen', last_name: 'Shaw' },
709
- { age: 89, first_name: 'Geneva', last_name: 'Wilson' }
710
- ]
711
- }
712
- }
713
- }
714
- </script>
715
-
716
- <!-- b-table-caption-top.vue -->
717
- ```
718
-
719
- You can also use [custom CSS](https://developer.mozilla.org/en-US/docs/Web/CSS/caption-side) to
720
- control the caption positioning.
721
-
722
- ### Table colgroup
723
-
724
- Use the named slot `table-colgroup` to specify `<colgroup>` and `<col>` elements for optional
725
- grouping and styling of table columns. Note the styles available via `<col>` elements are limited.
726
- Refer to [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/colgroup) for details and
727
- usage of `<colgroup>`
728
-
729
- Slot `table-colgroup` can be optionally scoped, receiving an object with the following properties:
730
-
731
- | Property | Type | Description |
732
- | --------- | ------ | --------------------------------------------------------------------------------------------------------------- |
733
- | `columns` | Number | The number of columns in the rendered table |
734
- | `fields` | Array | Array of field definition objects (normalized to the [array of objects](#fields-as-an-array-of-objects) format) |
735
-
736
- When provided, the content of the `table-colgroup` slot will be placed _inside_ of a `<colgroup>`
737
- element. there is no need to provide your own outer `<colgroup>` element. When a series of table
738
- columns should be grouped for assistive technology reasons (for conveying logical column
739
- associations, use a `<col span="#">` element (with `#` replaced with the number of grouped columns)
740
- to group the series of columns.
741
-
742
- **Tip:** In some situations when trying to set column widths via `style` or `class` on the `<col>`
743
- element, you may find that placing the table in `fixed` header width (table fixed layout mode) mode,
744
- combined with `responsive` (horizontal scrolling) mode will help, although you will need to have
745
- explicit widths, or minimum widths, via a style or a class for each column's respective `<col>`
746
- element. For example:
747
-
748
- ```html
749
- <b-table fixed responsive :items="items" :fields="fields" ... >
750
- <template #table-colgroup="scope">
751
- <col
752
- v-for="field in scope.fields"
753
- :key="field.key"
754
- :style="{ width: field.key === 'foo' ? '120px' : '180px' }"
755
- >
756
- </template>
757
- <!-- additional table slots here if needed -->
758
- </b-table>
759
- ```
760
-
761
- ### Table busy state
762
-
763
- `<b-table>` provides a `busy` prop that will flag the table as busy, which you can set to `true`
764
- just before you update your items, and then set it to `false` once you have your items. When in the
765
- busy state, the table will have the attribute `aria-busy="true"`.
766
-
767
- During the busy state, the table will be rendered in a "muted" look (`opacity: 0.6`), using the
768
- following custom CSS:
769
-
770
- ```css
771
- /* Busy table styling */
772
- table.b-table[aria-busy='true'] {
773
- opacity: 0.6;
774
- }
775
- ```
776
-
777
- You can override this styling using your own CSS.
778
-
779
- You may optionally provide a `table-busy` slot to show a custom loading message whenever the table's
780
- busy state is `true`. The slot will be placed in a `<tr>` element with class `b-table-busy-slot`,
781
- which has one single `<td>` with a `colspan` set to the number of fields.
782
-
783
- **Example of `table-busy` slot usage:**
784
-
785
- ```html
786
- <template>
787
- <div>
788
- <b-button @click="toggleBusy">Toggle Busy State</b-button>
789
-
790
- <b-table :items="items" :busy="isBusy" class="mt-3" outlined>
791
- <template #table-busy>
792
- <div class="text-center text-danger my-2">
793
- <strong>Loading...</strong>
794
- </div>
795
- </template>
796
- </b-table>
797
- </div>
798
- </template>
799
-
800
- <script>
801
- export default {
802
- data() {
803
- return {
804
- isBusy: false,
805
- items: [
806
- { first_name: 'Dickerson', last_name: 'MacDonald', age: 40 },
807
- { first_name: 'Larsen', last_name: 'Shaw', age: 21 },
808
- { first_name: 'Geneva', last_name: 'Wilson', age: 89 },
809
- { first_name: 'Jami', last_name: 'Carney', age: 38 }
810
- ]
811
- }
812
- },
813
- methods: {
814
- toggleBusy() {
815
- this.isBusy = !this.isBusy
816
- }
817
- }
818
- }
819
- </script>
820
-
821
- <!-- b-table-busy-slot.vue -->
822
- ```
823
-
824
- Also see the [Using Items Provider Functions](#using-items-provider-functions) below for additional
825
- information on the `busy` state.
826
-
827
- **Notes:**
828
-
829
- - All click related and hover events, and sort-changed events will **not** be emitted when the table
830
- is in the `busy` state.
831
- - Busy styling and slot are not available in the `<b-table-lite>` component.
832
-
833
- ## Custom data rendering
834
-
835
- Custom rendering for each data field in a row is possible using either
836
- [scoped slots](https://vuejs.org/v2/guide/components.html#Scoped-Slots) or a formatter callback
837
- function, or a combination of both.
838
-
839
- ### Scoped field slots
840
-
841
- Scoped field slots give you greater control over how the record data appears. You can use scoped
842
- slots to provided custom rendering for a particular field. If you want to add an extra field which
843
- does not exist in the records, just add it to the [`fields`](#fields-column-definitions) array, and
844
- then reference the field(s) in the scoped slot(s). Scoped field slots use the following naming
845
- syntax: `'cell(' + field key + ')'`.
846
-
847
- You can use the default _fall-back_ scoped slot `'cell()'` to format any cells that do not have an
848
- explicit scoped slot provided.
849
-
850
- **Example: Custom data rendering with scoped slots**
851
-
852
- ```html
853
- <template>
854
- <div>
855
- <b-table small :fields="fields" :items="items" responsive="sm">
856
- <!-- A virtual column -->
857
- <template #cell(index)="data">
858
- {{ data.index + 1 }}
859
- </template>
860
-
861
- <!-- A custom formatted column -->
862
- <template #cell(name)="data">
863
- <b class="text-info">{{ data.value.last.toUpperCase() }}</b>, <b>{{ data.value.first }}</b>
864
- </template>
865
-
866
- <!-- A virtual composite column -->
867
- <template #cell(nameage)="data">
868
- {{ data.item.name.first }} is {{ data.item.age }} years old
869
- </template>
870
-
871
- <!-- Optional default data cell scoped slot -->
872
- <template #cell()="data">
873
- <i>{{ data.value }}</i>
874
- </template>
875
- </b-table>
876
- </div>
877
- </template>
878
-
879
- <script>
880
- export default {
881
- data() {
882
- return {
883
- fields: [
884
- // A virtual column that doesn't exist in items
885
- 'index',
886
- // A column that needs custom formatting
887
- { key: 'name', label: 'Full Name' },
888
- // A regular column
889
- 'age',
890
- // A regular column
891
- 'sex',
892
- // A virtual column made up from two fields
893
- { key: 'nameage', label: 'First name and age' }
894
- ],
895
- items: [
896
- { name: { first: 'John', last: 'Doe' }, sex: 'Male', age: 42 },
897
- { name: { first: 'Jane', last: 'Doe' }, sex: 'Female', age: 36 },
898
- { name: { first: 'Rubin', last: 'Kincade' }, sex: 'Male', age: 73 },
899
- { name: { first: 'Shirley', last: 'Partridge' }, sex: 'Female', age: 62 }
900
- ]
901
- }
902
- }
903
- }
904
- </script>
905
-
906
- <!-- b-table-data-slots.vue -->
907
- ```
908
-
909
- The slot's scope variable (`data` in the above sample) will have the following properties:
910
-
911
- | Property | Type | Description |
912
- | ---------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
913
- | `index` | Number | The row number (indexed from zero) relative to the _displayed_ rows |
914
- | `item` | Object | The entire raw record data (i.e. `items[index]`) for this row (before any formatter is applied) |
915
- | `value` | Any | The value for this key in the record (`null` or `undefined` if a virtual column), or the output of the field's [`formatter` function](#formatter-callback) |
916
- | `unformatted` | Any | The raw value for this key in the item record (`null` or `undefined` if a virtual column), before being passed to the field's [`formatter` function](#formatter-callback) |
917
- | `field` | Object | The field's normalized field definition object |
918
- | `detailsShowing` | Boolean | Will be `true` if the row's `row-details` scoped slot is visible. See section [Row details support](#row-details-support) below for additional information |
919
- | `toggleDetails` | Function | Can be called to toggle the visibility of the rows `row-details` scoped slot. See section [Row details support](#row-details-support) below for additional information |
920
- | `rowSelected` | Boolean | Will be `true` if the row has been selected. See section [Row select support](#row-select-support) for additional information |
921
- | `selectRow` | Function | When called, selects the current row. See section [Row select support](#row-select-support) for additional information |
922
- | `unselectRow` | Function | When called, unselects the current row. See section [Row select support](#row-select-support) for additional information |
923
-
924
- **Notes:**
925
-
926
- - `index` will not always be the actual row's index number, as it is computed after filtering,
927
- sorting and pagination have been applied to the original table data. The `index` value will refer
928
- to the **displayed row number**. This number will align with the indexes from the optional
929
- [`v-model` bound](#v-model-binding) variable.
930
- - When using the new Vue 2.6 `v-slot` syntax, note that slot names **cannot** contain spaces, and
931
- when using in-browser DOM templates the slot names will _always_ be lower cased. To get around
932
- this, you can pass the slot name using Vue's
933
- [dynamic slot names](https://vuejs.org/v2/guide/components-slots.html#Dynamic-Slot-Names)
934
-
935
- #### Displaying raw HTML
936
-
937
- By default `b-table` escapes HTML tags in items data and results of formatter functions, if you need
938
- to display raw HTML code in `b-table`, you should use `v-html` directive on an element in a in
939
- scoped field slot.
940
-
941
- ```html
942
- <template>
943
- <div>
944
- <b-table :items="items">
945
- <template #cell(html)="data">
946
- <span v-html="data.value"></span>
947
- </template>
948
- </b-table>
949
- </div>
950
- </template>
951
-
952
- <script>
953
- export default {
954
- data() {
955
- return {
956
- items: [
957
- {
958
- text: 'This is <i>escaped</i> content',
959
- html: 'This is <i>raw <strong>HTML</strong></i> <span style="color:red">content</span>'
960
- }
961
- ]
962
- }
963
- }
964
- }
965
- </script>
966
-
967
- <!-- b-table-html-data-slots.vue -->
968
- ```
969
-
970
- <p class="alert alert-danger">
971
- <strong>Warning:</strong> Be cautious of using the <code>v-html</code> method to display user
972
- supplied content, as it may make your application vulnerable to
973
- <a class="alert-link" href="https://en.wikipedia.org/wiki/Cross-site_scripting">
974
- <abbr title="Cross Site Scripting Attacks">XSS attacks</abbr></a>, if you do not first
975
- <a class="alert-link" href="https://en.wikipedia.org/wiki/HTML_sanitization">sanitize</a> the
976
- user supplied string.
977
- </p>
978
-
979
- ### Formatter callback
980
-
981
- Optionally, you can customize field output by using a formatter callback function. To enable this,
982
- the field's `formatter` property is used. The value of this property may be String or function
983
- reference. In case of a String value, the function must be defined at the parent component's
984
- methods. When providing `formatter` as a `Function`, it must be declared at global scope (window or
985
- as global mixin at Vue, or as an anonymous function), unless it has been bound to a `this` context.
986
-
987
- The callback function accepts three arguments - `value`, `key`, and `item`, and should return the
988
- formatted value as a string (HTML strings are not supported)
989
-
990
- **Example: Custom data rendering with formatter callback function**
991
-
992
- ```html
993
- <template>
994
- <div>
995
- <b-table :fields="fields" :items="items">
996
- <template #cell(name)="data">
997
- <!-- `data.value` is the value after formatted by the Formatter -->
998
- <a :href="`#${data.value.replace(/[^a-z]+/i,'-').toLowerCase()}`">{{ data.value }}</a>
999
- </template>
1000
- </b-table>
1001
- </div>
1002
- </template>
1003
-
1004
- <script>
1005
- export default {
1006
- data() {
1007
- return {
1008
- fields: [
1009
- {
1010
- // A column that needs custom formatting,
1011
- // calling formatter 'fullName' in this app
1012
- key: 'name',
1013
- label: 'Full Name',
1014
- formatter: 'fullName'
1015
- },
1016
- // A regular column
1017
- 'age',
1018
- {
1019
- // A regular column with custom formatter
1020
- key: 'sex',
1021
- formatter: value => {
1022
- return value.charAt(0).toUpperCase()
1023
- }
1024
- },
1025
- {
1026
- // A virtual column with custom formatter
1027
- key: 'birthYear',
1028
- label: 'Calculated Birth Year',
1029
- formatter: (value, key, item) => {
1030
- return new Date().getFullYear() - item.age
1031
- }
1032
- }
1033
- ],
1034
- items: [
1035
- { name: { first: 'John', last: 'Doe' }, sex: 'Male', age: 42 },
1036
- { name: { first: 'Jane', last: 'Doe' }, sex: 'Female', age: 36 },
1037
- { name: { first: 'Rubin', last: 'Kincade' }, sex: 'male', age: 73 },
1038
- { name: { first: 'Shirley', last: 'Partridge' }, sex: 'female', age: 62 }
1039
- ]
1040
- }
1041
- },
1042
- methods: {
1043
- fullName(value) {
1044
- return `${value.first} ${value.last}`
1045
- }
1046
- }
1047
- }
1048
- </script>
1049
-
1050
- <!-- b-table-data-formatter.vue -->
1051
- ```
1052
-
1053
- ## Header and Footer custom rendering via scoped slots
1054
-
1055
- It is also possible to provide custom rendering for the tables `thead` and `tfoot` elements. Note by
1056
- default the table footer is not rendered unless `foot-clone` is set to `true`.
1057
-
1058
- Scoped slots for the header and footer cells uses a special naming convention of
1059
- `'head(<fieldkey>)'` and `'foot(<fieldkey>)'` respectively. if a `'foot(...)'` slot for a field is
1060
- not provided, but a `'head(...)'` slot is provided, then the footer will use the `'head(...)'` slot
1061
- content.
1062
-
1063
- You can use a default _fall-back_ scoped slot `'head()'` or `'foot()'` to format any header or
1064
- footer cells that do not have an explicit scoped slot provided.
1065
-
1066
- ```html
1067
- <template>
1068
- <div>
1069
- <b-table :fields="fields" :items="items" foot-clone>
1070
- <!-- A custom formatted data column cell -->
1071
- <template #cell(name)="data">
1072
- {{ data.value.first }} {{ data.value.last }}
1073
- </template>
1074
-
1075
- <!-- A custom formatted header cell for field 'name' -->
1076
- <template #head(name)="data">
1077
- <span class="text-info">{{ data.label.toUpperCase() }}</span>
1078
- </template>
1079
-
1080
- <!-- A custom formatted footer cell for field 'name' -->
1081
- <template #foot(name)="data">
1082
- <span class="text-danger">{{ data.label }}</span>
1083
- </template>
1084
-
1085
- <!-- Default fall-back custom formatted footer cell -->
1086
- <template #foot()="data">
1087
- <i>{{ data.label }}</i>
1088
- </template>
1089
- </b-table>
1090
- </div>
1091
- </template>
1092
-
1093
- <script>
1094
- export default {
1095
- data() {
1096
- return {
1097
- fields: [
1098
- // A column that needs custom formatting
1099
- { key: 'name', label: 'Full Name' },
1100
- // A regular column
1101
- 'age',
1102
- // A regular column
1103
- 'sex'
1104
- ],
1105
- items: [
1106
- { name: { first: 'John', last: 'Doe' }, sex: 'Male', age: 42 },
1107
- { name: { first: 'Jane', last: 'Doe' }, sex: 'Female', age: 36 },
1108
- { name: { first: 'Rubin', last: 'Kincade' }, sex: 'Male', age: 73 },
1109
- { name: { first: 'Shirley', last: 'Partridge' }, sex: 'Female', age: 62 }
1110
- ]
1111
- }
1112
- }
1113
- }
1114
- </script>
1115
-
1116
- <!-- b-table-head-foot-slots.vue -->
1117
- ```
1118
-
1119
- The slots can be optionally scoped (`data` in the above example), and will have the following
1120
- properties:
1121
-
1122
- | Property | Type | Description |
1123
- | --------------- | ------ | ----------------------------------------------------------------------------------------- |
1124
- | `column` | String | The fields's `key` value |
1125
- | `field` | Object | the field's object (from the `fields` prop) |
1126
- | `label` | String | The fields label value (also available as `data.field.label`) |
1127
- | `selectAllRows` | Method | Select all rows (applicable if the table is in [`selectable`](#row-select-support) mode |
1128
- | `clearSelected` | Method | Unselect all rows (applicable if the table is in [`selectable`](#row-select-support) mode |
1129
-
1130
- When placing inputs, buttons, selects or links within a `head(...)` or `foot(...)` slot, note that
1131
- `head-clicked` event will not be emitted when the input, select, textarea is clicked (unless they
1132
- are disabled). `head-clicked` will never be emitted when clicking on links or buttons inside the
1133
- scoped slots (even when disabled)
1134
-
1135
- **Notes:**
1136
-
1137
- - When using the new Vue 2.6 `v-slot` syntax, note that slot names **cannot** contain spaces, and
1138
- when using in-browser DOM templates the slot names will _always_ be lower cased. To get around
1139
- this, you can pass the slot name using Vue's
1140
- [dynamic slot names](https://vuejs.org/v2/guide/components-slots.html#Dynamic-Slot-Names)
1141
-
1142
- ### Adding additional rows to the header
1143
-
1144
- If you wish to add additional rows to the header you may do so via the `thead-top` slot. This slot
1145
- is inserted before the header cells row, and is not automatically encapsulated by `<tr>..</tr>`
1146
- tags. It is recommended to use the BootstrapVue [table helper components](#table-helper-components),
1147
- rather than native browser table child elements.
1148
-
1149
- ```html
1150
- <template>
1151
- <div>
1152
- <b-table
1153
- :items="items"
1154
- :fields="fields"
1155
- responsive="sm"
1156
- >
1157
- <template #thead-top="data">
1158
- <b-tr>
1159
- <b-th colspan="2"><span class="sr-only">Name and ID</span></b-th>
1160
- <b-th variant="secondary">Type 1</b-th>
1161
- <b-th variant="primary" colspan="3">Type 2</b-th>
1162
- <b-th variant="danger">Type 3</b-th>
1163
- </b-tr>
1164
- </template>
1165
- </b-table>
1166
- </div>
1167
- </template>
1168
-
1169
- <script>
1170
- export default {
1171
- data() {
1172
- return {
1173
- items: [
1174
- { name: 'Stephen Hawking', id: 1, type1: false, type2a: true, type2b: false, type2c: false, type3: false },
1175
- { name: 'Johnny Appleseed', id: 2, type1: false, type2a: true, type2b: true, type2c: false, type3: false },
1176
- { name: 'George Washington', id: 3, type1: false, type2a: false, type2b: false, type2c: false, type3: true },
1177
- { name: 'Albert Einstein', id: 4, type1: true, type2a: false, type2b: false, type2c: true, type3: false },
1178
- { name: 'Isaac Newton', id: 5, type1: true, type2a: true, type2b: false, type2c: true, type3: false },
1179
- ],
1180
- fields: [
1181
- 'name',
1182
- { key: 'id', label: 'ID' },
1183
- { key: 'type1', label: 'Type 1' },
1184
- { key: 'type2a', label: 'Type 2A' },
1185
- { key: 'type2b', label: 'Type 2B' },
1186
- { key: 'type2c', label: 'Type 2C' },
1187
- { key: 'type3', label: 'Type 3' }
1188
- ]
1189
- }
1190
- }
1191
- }
1192
- </script>
1193
-
1194
- <!-- b-table-thead-top-slot.vue -->
1195
- ```
1196
-
1197
- Slot `thead-top` can be optionally scoped, receiving an object with the following properties:
1198
-
1199
- | Property | Type | Description |
1200
- | --------------- | ------ | ----------------------------------------------------------------------------------------- |
1201
- | `columns` | Number | The number of columns in the rendered table |
1202
- | `fields` | Array | Array of field definition objects (normalized to the array of objects format) |
1203
- | `selectAllRows` | Method | Select all rows (applicable if the table is in [`selectable`](#row-select-support) mode |
1204
- | `clearSelected` | Method | Unselect all rows (applicable if the table is in [`selectable`](#row-select-support) mode |
1205
-
1206
- ### Creating a custom footer
1207
-
1208
- If you need greater layout control of the content of the `<tfoot>`, you can use the optionally
1209
- scoped slot `custom-foot` to provide your own rows and cells. Use BootstrapVue's
1210
- [table helper sub-components](#table-helper-components) `<b-tr>`, `<b-th>`, and `<b-td>` to generate
1211
- your custom footer layout.
1212
-
1213
- Slot `custom-foot` can be optionally scoped, receiving an object with the following properties:
1214
-
1215
- | Property | Type | Description |
1216
- | --------- | ------ | ------------------------------------------------------------------------------------------ |
1217
- | `columns` | Number | The number of columns in the rendered table |
1218
- | `fields` | Array | Array of field definition objects (normalized to the array of objects format) |
1219
- | `items` | Array | Array of the currently _displayed_ items records - after filtering, sorting and pagination |
1220
-
1221
- **Notes:**
1222
-
1223
- - The `custom-foot` slot will **not** be rendered if the `foot-clone` prop has been set.
1224
- - `head-clicked` events are not be emitted when clicking on `custom-foot` cells.
1225
- - Sorting and sorting icons are not available for cells in the `custom-foot` slot.
1226
- - The custom footer will not be shown when the table is in visually stacked mode.
1227
-
1228
- ## Custom empty and emptyfiltered rendering via slots
1229
-
1230
- Aside from using `empty-text`, `empty-filtered-text`, `empty-html`, and `empty-filtered-html`, it is
1231
- also possible to provide custom rendering for tables that have no data to display using named slots.
1232
-
1233
- In order for these slots to be shown, the `show-empty` attribute must be set and `items` must be
1234
- either falsy or an array of length 0.
1235
-
1236
- ```html
1237
- <div>
1238
- <b-table :fields="fields" :items="items" show-empty>
1239
- <template #empty="scope">
1240
- <h4>{{ scope.emptyText }}</h4>
1241
- </template>
1242
- <template #emptyfiltered="scope">
1243
- <h4>{{ scope.emptyFilteredText }}</h4>
1244
- </template>
1245
- </b-table>
1246
- </div>
1247
- ```
1248
-
1249
- The slot can optionally be scoped. The slot's scope (`scope` in the above example) will have the
1250
- following properties:
1251
-
1252
- | Property | Type | Description |
1253
- | ------------------- | ------ | -------------------------------------------------- |
1254
- | `emptyHtml` | String | The `empty-html` prop |
1255
- | `emptyText` | String | The `empty-text` prop |
1256
- | `emptyFilteredHtml` | String | The `empty-filtered-html` prop |
1257
- | `emptyFilteredText` | String | The `empty-filtered-text` prop |
1258
- | `fields` | Array | The `fields` prop |
1259
- | `items` | Array | The `items` prop. Exposed here to check null vs [] |
1260
-
1261
- ## Advanced features
1262
-
1263
- ### Sticky headers
1264
-
1265
- Use the `sticky-header` prop to enable a vertically scrolling table with headers that remain fixed
1266
- (sticky) as the table body scrolls. Setting the prop to `true` (or no explicit value) will generate
1267
- a table that has a maximum height of `300px`. To specify a maximum height other than `300px`, set
1268
- the `sticky-header` prop to a valid CSS height (including units), i.e. `sticky-header="200px"`.
1269
- Tables with `sticky-header` enabled will also automatically become always responsive horizontally,
1270
- regardless of the [`responsive`](#responsive-tables) prop setting, if the table is wider than the
1271
- available horizontal space.
1272
-
1273
- ```html
1274
- <template>
1275
- <div>
1276
- <b-table sticky-header :items="items" head-variant="light"></b-table>
1277
- </div>
1278
- </template>
1279
-
1280
- <script>
1281
- export default {
1282
- data() {
1283
- return {
1284
- items: [
1285
- { heading1: 'table cell', heading2: 'table cell', heading3: 'table cell' },
1286
- { heading1: 'table cell', heading2: 'table cell', heading3: 'table cell' },
1287
- { heading1: 'table cell', heading2: 'table cell', heading3: 'table cell' },
1288
- { heading1: 'table cell', heading2: 'table cell', heading3: 'table cell' },
1289
- { heading1: 'table cell', heading2: 'table cell', heading3: 'table cell' },
1290
- { heading1: 'table cell', heading2: 'table cell', heading3: 'table cell' },
1291
- { heading1: 'table cell', heading2: 'table cell', heading3: 'table cell' },
1292
- { heading1: 'table cell', heading2: 'table cell', heading3: 'table cell' },
1293
- { heading1: 'table cell', heading2: 'table cell', heading3: 'table cell' },
1294
- { heading1: 'table cell', heading2: 'table cell', heading3: 'table cell' },
1295
- { heading1: 'table cell', heading2: 'table cell', heading3: 'table cell' },
1296
- { heading1: 'table cell', heading2: 'table cell', heading3: 'table cell' }
1297
- ]
1298
- }
1299
- }
1300
- }
1301
- </script>
1302
-
1303
- <!-- b-table-sticky-header.vue -->
1304
- ```
1305
-
1306
- **Sticky header notes:**
1307
-
1308
- - The `sticky-header` prop has no effect if the table has the [`stacked`](#stacked-tables) prop set.
1309
- - Sticky header tables are wrapped inside a vertically scrollable `<div>` with a maximum height set.
1310
- - BootstrapVue's custom CSS is required in order to support `sticky-header`.
1311
- - Bootstrap v4 uses the CSS style `border-collapse: collapsed` on table elements. This prevents the
1312
- borders on the sticky header from "sticking" to the header, and hence the borders will scroll when
1313
- the body scrolls. To get around this issue, set the prop `no-border-collapse` on the table (note
1314
- that this may cause double width borders when using features such as `bordered`, etc.).
1315
- - The sticky header feature uses CSS style `position: sticky` to position the headings. Internet
1316
- Explorer does not support `position: sticky`, hence for IE 11 the table headings will scroll with
1317
- the table body.
1318
-
1319
- ### Sticky columns
1320
-
1321
- Columns can be made sticky, where they stick to the left of the table when the table has a
1322
- horizontal scrollbar. To make a column a sticky column, set the `stickyColumn` prop in the
1323
- [field's header definition](#field-definition-reference). Sticky columns will only work when the
1324
- table has either the `sticky-header` prop set and/or the [`responsive`](#responsive-tables) prop is
1325
- set.
1326
-
1327
- **Example: Sticky columns and headers**
1328
-
1329
- ```html
1330
- <template>
1331
- <div>
1332
- <div class="mb-2">
1333
- <b-form-checkbox v-model="stickyHeader" inline>Sticky header</b-form-checkbox>
1334
- <b-form-checkbox v-model="noCollapse" inline>No border collapse</b-form-checkbox>
1335
- </div>
1336
- <b-table
1337
- :sticky-header="stickyHeader"
1338
- :no-border-collapse="noCollapse"
1339
- responsive
1340
- :items="items"
1341
- :fields="fields"
1342
- >
1343
- <!-- We are using utility class `text-nowrap` to help illustrate horizontal scrolling -->
1344
- <template #head(id)="scope">
1345
- <div class="text-nowrap">Row ID</div>
1346
- </template>
1347
- <template #head()="scope">
1348
- <div class="text-nowrap">
1349
- Heading {{ scope.label }}
1350
- </div>
1351
- </template>
1352
- </b-table>
1353
- </div>
1354
- </template>
1355
-
1356
- <script>
1357
- export default {
1358
- data() {
1359
- return {
1360
- stickyHeader: true,
1361
- noCollapse: false,
1362
- fields: [
1363
- { key: 'id', stickyColumn: true, isRowHeader: true, variant: 'primary' },
1364
- 'a',
1365
- 'b',
1366
- { key: 'c', stickyColumn: true, variant: 'info' },
1367
- 'd',
1368
- 'e',
1369
- 'f',
1370
- 'g',
1371
- 'h',
1372
- 'i',
1373
- 'j',
1374
- 'k',
1375
- 'l'
1376
- ],
1377
- items: [
1378
- { id: 1, a: 0, b: 1, c: 2, d: 3, e: 4, f: 5, g: 6, h: 7, i: 8, j: 9, k: 10, l: 11 },
1379
- { id: 2, a: 0, b: 1, c: 2, d: 3, e: 4, f: 5, g: 6, h: 7, i: 8, j: 9, k: 10, l: 11 },
1380
- { id: 3, a: 0, b: 1, c: 2, d: 3, e: 4, f: 5, g: 6, h: 7, i: 8, j: 9, k: 10, l: 11 },
1381
- { id: 4, a: 0, b: 1, c: 2, d: 3, e: 4, f: 5, g: 6, h: 7, i: 8, j: 9, k: 10, l: 11 },
1382
- { id: 5, a: 0, b: 1, c: 2, d: 3, e: 4, f: 5, g: 6, h: 7, i: 8, j: 9, k: 10, l: 11 },
1383
- { id: 6, a: 0, b: 1, c: 2, d: 3, e: 4, f: 5, g: 6, h: 7, i: 8, j: 9, k: 10, l: 11 },
1384
- { id: 7, a: 0, b: 1, c: 2, d: 3, e: 4, f: 5, g: 6, h: 7, i: 8, j: 9, k: 10, l: 11 },
1385
- { id: 8, a: 0, b: 1, c: 2, d: 3, e: 4, f: 5, g: 6, h: 7, i: 8, j: 9, k: 10, l: 11 },
1386
- { id: 9, a: 0, b: 1, c: 2, d: 3, e: 4, f: 5, g: 6, h: 7, i: 8, j: 9, k: 10, l: 11 },
1387
- { id: 10, a: 0, b: 1, c: 2, d: 3, e: 4, f: 5, g: 6, h: 7, i: 8, j: 9, k: 10, l: 11 }
1388
- ]
1389
- }
1390
- }
1391
- }
1392
- </script>
1393
-
1394
- <!-- table-sticky-columns.vue -->
1395
- ```
1396
-
1397
- **Sticky column notes:**
1398
-
1399
- - Sticky columns has no effect if the table has the [`stacked`](#stacked-tables) prop set.
1400
- - Sticky columns tables require either the `sticky-header` and/or `responsive` modes, and are
1401
- wrapped inside a horizontally scrollable `<div>`.
1402
- - When you have multiple columns that are set as `stickyColumn`, the columns will stack over each
1403
- other visually, and the left-most sticky columns may "peek" out from under the next sticky column.
1404
- To get around this behaviour, make sure your latter sticky columns are the same width or wider
1405
- than previous sticky columns.
1406
- - Bootstrap v4 uses the CSS style `border-collapse: collapsed` on table elements. This prevents any
1407
- borders on the sticky columns from "sticking" to the column, and hence those borders will scroll
1408
- when the body scrolls. To get around this issue, set the prop `no-border-collapse` on the table
1409
- (note that this may cause double width borders when using features such as `bordered`, etc.).
1410
- - BootstrapVue's custom CSS is required in order to support sticky columns.
1411
- - The sticky column feature uses CSS style `position: sticky` to position the column cells. Internet
1412
- Explorer does not support `position: sticky`, hence for IE 11 the sticky column will scroll with
1413
- the table body.
1414
-
1415
- ### Row details support
1416
-
1417
- If you would optionally like to display additional record information (such as columns not specified
1418
- in the fields definition array), you can use the scoped slot `row-details`, in combination with the
1419
- special item record Boolean property `_showDetails`.
1420
-
1421
- If the record has its `_showDetails` property set to `true`, **and** a `row-details` scoped slot
1422
- exists, a new row will be shown just below the item, with the rendered contents of the `row-details`
1423
- scoped slot.
1424
-
1425
- In the scoped field slot, you can toggle the visibility of the row's `row-details` scoped slot by
1426
- calling the `toggleDetails` function passed to the field's scoped slot variable. You can use the
1427
- scoped fields slot variable `detailsShowing` to determine the visibility of the `row-details` slot.
1428
-
1429
- **Note:** If manipulating the `_showDetails` property directly on the item data (i.e. not via the
1430
- `toggleDetails` function reference), the `_showDetails` properly **must** exist in the items data
1431
- for proper reactive detection of changes to its value. Read more about
1432
- [Vue's reactivity limitations](https://vuejs.org/v2/guide/reactivity.html#Change-Detection-Caveats).
1433
-
1434
- **Available `row-details` scoped variable properties:**
1435
-
1436
- | Property | Type | Description |
1437
- | --------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------- |
1438
- | `item` | Object | The entire row record data object |
1439
- | `index` | Number | The current visible row number |
1440
- | `fields` | Array | The normalized fields definition array (in the _array of objects_ format) |
1441
- | `toggleDetails` | Function | Function to toggle visibility of the row's details slot |
1442
- | `rowSelected` | Boolean | Will be `true` if the row has been selected. See section [Row select support](#row-select-support) for additional information |
1443
- | `selectRow` | Function | When called, selects the current row. See section [Row select support](#row-select-support) for additional information |
1444
- | `unselectRow` | Function | When called, unselects the current row. See section [Row select support](#row-select-support) for additional information |
1445
-
1446
- Note: the row select related scope properties are only available in `<b-table>`.
1447
-
1448
- In the following example, we show two methods of toggling the visibility of the details: one via a
1449
- button, and one via a checkbox. We also have the third row details defaulting to have details
1450
- initially showing.
1451
-
1452
- ```html
1453
- <template>
1454
- <div>
1455
- <b-table :items="items" :fields="fields" striped responsive="sm">
1456
- <template #cell(show_details)="row">
1457
- <b-button size="sm" @click="row.toggleDetails" class="mr-2">
1458
- {{ row.detailsShowing ? 'Hide' : 'Show'}} Details
1459
- </b-button>
1460
-
1461
- <!-- As `row.showDetails` is one-way, we call the toggleDetails function on @change -->
1462
- <b-form-checkbox v-model="row.detailsShowing" @change="row.toggleDetails">
1463
- Details via check
1464
- </b-form-checkbox>
1465
- </template>
1466
-
1467
- <template #row-details="row">
1468
- <b-card>
1469
- <b-row class="mb-2">
1470
- <b-col sm="3" class="text-sm-right"><b>Age:</b></b-col>
1471
- <b-col>{{ row.item.age }}</b-col>
1472
- </b-row>
1473
-
1474
- <b-row class="mb-2">
1475
- <b-col sm="3" class="text-sm-right"><b>Is Active:</b></b-col>
1476
- <b-col>{{ row.item.isActive }}</b-col>
1477
- </b-row>
1478
-
1479
- <b-button size="sm" @click="row.toggleDetails">Hide Details</b-button>
1480
- </b-card>
1481
- </template>
1482
- </b-table>
1483
- </div>
1484
- </template>
1485
-
1486
- <script>
1487
- export default {
1488
- data() {
1489
- return {
1490
- fields: ['first_name', 'last_name', 'show_details'],
1491
- items: [
1492
- { isActive: true, age: 40, first_name: 'Dickerson', last_name: 'Macdonald' },
1493
- { isActive: false, age: 21, first_name: 'Larsen', last_name: 'Shaw' },
1494
- {
1495
- isActive: false,
1496
- age: 89,
1497
- first_name: 'Geneva',
1498
- last_name: 'Wilson',
1499
- _showDetails: true
1500
- },
1501
- { isActive: true, age: 38, first_name: 'Jami', last_name: 'Carney' }
1502
- ]
1503
- }
1504
- }
1505
- }
1506
- </script>
1507
-
1508
- <!-- b-table-details.vue -->
1509
- ```
1510
-
1511
- ### Row select support
1512
-
1513
- You can make rows selectable, by using the `<b-table>` prop `selectable`.
1514
-
1515
- Users can easily change the selecting mode by setting the `select-mode` prop.
1516
-
1517
- - `'multi'`: Each click will select/deselect the row (default mode)
1518
- - `'single'`: Only a single row can be selected at one time
1519
- - `'range'`: Any row clicked is selected, any other deselected. <kbd>Shift</kbd> + click selects a
1520
- range of rows, and <kbd>Ctrl</kbd> (or <kbd>Cmd</kbd>) + click will toggle the selected row.
1521
-
1522
- When a table is `selectable` and the user clicks on a row, `<b-table>` will emit the `row-selected`
1523
- event, passing a single argument which is the complete list of selected items. **Treat this argument
1524
- as read-only.**
1525
-
1526
- Rows can also be programmatically selected and unselected via the following exposed methods on the
1527
- `<b-table>` instance (i.e. via a reference to the table instance via `this.$refs`):
1528
-
1529
- | Method | Description |
1530
- | ---------------------- | ---------------------------------------------------------------------------------------------------- |
1531
- | `selectRow(index)` | Selects a row with the given `index` number. |
1532
- | `unselectRow(index)` | Unselects a row with the given `index` number. |
1533
- | `selectAllRows()` | Selects all rows in the table, except in `single` mode in which case only the first row is selected. |
1534
- | `clearSelected()` | Unselects all rows. |
1535
- | `isRowSelected(index)` | Returns `true` if the row with the given `index` is selected, otherwise it returns `false`. |
1536
-
1537
- **Programmatic row selection notes:**
1538
-
1539
- - `index` is the zero-based index of the table's **visible rows**, after filtering, sorting, and
1540
- pagination have been applied.
1541
- - In `single` mode, `selectRow(index)` will unselect any previous selected row.
1542
- - Attempting to `selectRow(index)` or `unselectRow(index)` on a non-existent row will be ignored.
1543
- - The table must be `selectable` for any of these methods to have effect.
1544
- - You can disable selection of rows via click events by setting the `no-select-on-click` prop. Rows
1545
- will then only be selectable programmatically.
1546
-
1547
- **Row select notes:**
1548
-
1549
- - [Sorting](#sorting), [filtering](#filtering), or [paginating](#pagination) the table will **clear
1550
- the active selection**. The `row-selected` event will be emitted with an empty array (`[]`) if
1551
- needed.
1552
- - When the table is in `selectable` mode, all data item `<tr>` elements will be in the document tab
1553
- sequence (`tabindex="0"`) for [accessibility](#accessibility) reasons, and will have the attribute
1554
- `aria-selected` set to either `'true'` or `'false'` depending on the selected state of the row.
1555
- - When a table is `selectable`, the table will have the attribute `aria-multiselect` set to either
1556
- `'false'` for `single` mode, and `'true'` for either `multi` or `range` modes.
1557
-
1558
- When a `<b-table>` is selectable, it will have class `b-table-selectable` and one of the following
1559
- three classes (depending on which mode is in use) on the `<table>` element:
1560
-
1561
- - `b-table-select-single`
1562
- - `b-table-select-multi`
1563
- - `b-table-select-range`
1564
-
1565
- When at least one row is selected, the class `b-table-selecting` will be active on the `<table>`
1566
- element. Rows that are selected rows will have a class of `b-table-row-selected` applied to the
1567
- `<tr>` element.
1568
-
1569
- Use the prop `selected-variant` to apply a Bootstrap theme color to the selected row(s). Note, due
1570
- to the order that the table variants are defined in Bootstrap's CSS, any row-variant _might_ take
1571
- precedence over the `selected-variant`. You can set `selected-variant` to an empty string if you
1572
- will be using other means to convey that a row is selected (such as a scoped field slot in the below
1573
- example).
1574
-
1575
- The `selected-variant` can be any of the
1576
- [standard (or custom) Bootstrap base color variants](/docs/reference/color-variants), or the special
1577
- [table `active` variant](/docs/reference/color-variants#table-variants) (the default) which takes
1578
- precedence over any specific row or cell variants.
1579
-
1580
- For accessibility reasons (specifically for color blind users, or users with color contrast issues),
1581
- it is highly recommended to always provide some other visual means of conveying that a row is
1582
- selected, such as a virtual column as shown in the example below.
1583
-
1584
- ```html
1585
- <template>
1586
- <div>
1587
- <b-form-group
1588
- label="Selection mode:"
1589
- label-for="table-select-mode-select"
1590
- label-cols-md="4"
1591
- >
1592
- <b-form-select
1593
- id="table-select-mode-select"
1594
- v-model="selectMode"
1595
- :options="modes"
1596
- class="mb-3"
1597
- ></b-form-select>
1598
- </b-form-group>
1599
-
1600
- <b-table
1601
- :items="items"
1602
- :fields="fields"
1603
- :select-mode="selectMode"
1604
- responsive="sm"
1605
- ref="selectableTable"
1606
- selectable
1607
- @row-selected="onRowSelected"
1608
- >
1609
- <!-- Example scoped slot for select state illustrative purposes -->
1610
- <template #cell(selected)="{ rowSelected }">
1611
- <template v-if="rowSelected">
1612
- <span aria-hidden="true">&check;</span>
1613
- <span class="sr-only">Selected</span>
1614
- </template>
1615
- <template v-else>
1616
- <span aria-hidden="true">&nbsp;</span>
1617
- <span class="sr-only">Not selected</span>
1618
- </template>
1619
- </template>
1620
- </b-table>
1621
- <p>
1622
- <b-button size="sm" @click="selectAllRows">Select all</b-button>
1623
- <b-button size="sm" @click="clearSelected">Clear selected</b-button>
1624
- <b-button size="sm" @click="selectThirdRow">Select 3rd row</b-button>
1625
- <b-button size="sm" @click="unselectThirdRow">Unselect 3rd row</b-button>
1626
- </p>
1627
- <p>
1628
- Selected Rows:<br>
1629
- {{ selected }}
1630
- </p>
1631
- </div>
1632
- </template>
1633
-
1634
- <script>
1635
- export default {
1636
- data() {
1637
- return {
1638
- modes: ['multi', 'single', 'range'],
1639
- fields: ['selected', 'isActive', 'age', 'first_name', 'last_name'],
1640
- items: [
1641
- { isActive: true, age: 40, first_name: 'Dickerson', last_name: 'Macdonald' },
1642
- { isActive: false, age: 21, first_name: 'Larsen', last_name: 'Shaw' },
1643
- { isActive: false, age: 89, first_name: 'Geneva', last_name: 'Wilson' },
1644
- { isActive: true, age: 38, first_name: 'Jami', last_name: 'Carney' }
1645
- ],
1646
- selectMode: 'multi',
1647
- selected: []
1648
- }
1649
- },
1650
- methods: {
1651
- onRowSelected(items) {
1652
- this.selected = items
1653
- },
1654
- selectAllRows() {
1655
- this.$refs.selectableTable.selectAllRows()
1656
- },
1657
- clearSelected() {
1658
- this.$refs.selectableTable.clearSelected()
1659
- },
1660
- selectThirdRow() {
1661
- // Rows are indexed from 0, so the third row is index 2
1662
- this.$refs.selectableTable.selectRow(2)
1663
- },
1664
- unselectThirdRow() {
1665
- // Rows are indexed from 0, so the third row is index 2
1666
- this.$refs.selectableTable.unselectRow(2)
1667
- }
1668
- }
1669
- }
1670
- </script>
1671
-
1672
- <!-- b-table-selectable.vue -->
1673
- ```
1674
-
1675
- ### Table body transition support
1676
-
1677
- Vue transitions and animations are optionally supported on the `<tbody>` element via the use of
1678
- Vue's `<transition-group>` component internally. Three props are available for transitions support
1679
- (all three default to undefined):
1680
-
1681
- | Prop | Type | Description |
1682
- | --------------------------- | ------ | ----------------------------------------------------------------- |
1683
- | `tbody-transition-props` | Object | Object of transition-group properties |
1684
- | `tbody-transition-handlers` | Object | Object of transition-group event handlers |
1685
- | `primary-key` | String | String specifying the field to use as a unique row key (required) |
1686
-
1687
- To enable transitions you need to specify `tbody-transition-props` and/or
1688
- `tbody-transition-handlers`, and must specify which field key to use as a unique key via the
1689
- `primary-key` prop. Your data **must have** a column (specified by setting the `primary-key` prop to
1690
- the _name_ of the field) that has a **unique value per row** in order for transitions to work
1691
- properly. The `primary-key` field's _value_ can either be a unique string or number. The field
1692
- specified does not need to appear in the rendered table output, but it **must** exist in each row of
1693
- your items data.
1694
-
1695
- You must also provide CSS to handle your transitions (if using CSS transitions) in your project.
1696
-
1697
- For more information of Vue's list rendering transitions, see the
1698
- [Vue JS official docs](https://vuejs.org/v2/guide/transitions.html#List-Move-Transitions).
1699
-
1700
- In the example below, we have used the following custom CSS:
1701
-
1702
- ```css
1703
- table#table-transition-example .flip-list-move {
1704
- transition: transform 1s;
1705
- }
1706
- ```
1707
-
1708
- ```html
1709
- <template>
1710
- <div>
1711
- <b-table
1712
- id="table-transition-example"
1713
- :items="items"
1714
- :fields="fields"
1715
- striped
1716
- small
1717
- primary-key="a"
1718
- :tbody-transition-props="transProps"
1719
- ></b-table>
1720
- </div>
1721
- </template>
1722
-
1723
- <script>
1724
- export default {
1725
- data() {
1726
- return {
1727
- transProps: {
1728
- // Transition name
1729
- name: 'flip-list'
1730
- },
1731
- items: [
1732
- { a: 2, b: 'Two', c: 'Moose' },
1733
- { a: 1, b: 'Three', c: 'Dog' },
1734
- { a: 3, b: 'Four', c: 'Cat' },
1735
- { a: 4, b: 'One', c: 'Mouse' }
1736
- ],
1737
- fields: [
1738
- { key: 'a', sortable: true },
1739
- { key: 'b', sortable: true },
1740
- { key: 'c', sortable: true }
1741
- ]
1742
- }
1743
- }
1744
- }
1745
- </script>
1746
-
1747
- <!-- b-table-transitions.vue -->
1748
- ```
1749
-
1750
- ### `v-model` binding
1751
-
1752
- If you bind a variable to the `v-model` prop, the contents of this variable will be the currently
1753
- displayed item records (zero based index, up to `page-size` - 1). This variable (the `value` prop)
1754
- should usually be treated as _readonly_.
1755
-
1756
- The records within the `v-model` are a filtered/paginated _shallow copy_ of `items`, and hence any
1757
- changes to a record's properties in the `v-model` will be reflected in the original `items` array
1758
- (except when `items` is set to a provider function). Deleting a record from the `v-model` array will
1759
- **not** remove the record from the original items array nor will it remove it from the displayed
1760
- rows.
1761
-
1762
- **Note:** Do not bind any value directly to the `value` prop. Use the `v-model` binding.
1763
-
1764
- ## Sorting
1765
-
1766
- As mentioned in the [Fields](#fields-column-definitions) section above, you can make columns
1767
- sortable in `<b-table>`. Clicking on a sortable column header will sort the column in ascending
1768
- direction (smallest first), while clicking on it again will switch the direction of sorting to
1769
- descending (largest first). Clicking on a non-sortable column will clear the sorting (the prop
1770
- `no-sort-reset` can be used to disable this feature).
1771
-
1772
- You can control which column is pre-sorted and the order of sorting (ascending or descending). To
1773
- pre-specify the column to be sorted, set the `sort-by` prop to the field's key. Set the sort
1774
- direction by setting `sort-desc` to either `true` (for descending) or `false` (for ascending, the
1775
- default).
1776
-
1777
- - **Ascending**: Items are sorted lowest to highest (i.e. `A` to `Z`) and will be displayed with the
1778
- lowest value in the first row with progressively higher values in the following rows.
1779
- - **Descending**: Items are sorted highest to lowest (i.e. `Z` to `A`) and will be displayed with
1780
- the highest value in the first row with progressively lower values in the following rows.
1781
-
1782
- The props `sort-by` and `sort-desc` can be turned into _two-way_ (syncable) props by adding the
1783
- `.sync` modifier. Your bound variables will then be updated accordingly based on the current sort
1784
- criteria. See the [Vue docs](https://vuejs.org/v2/guide/components.html#sync-Modifier) for details
1785
- on the `.sync` prop modifier.
1786
-
1787
- Setting `sort-by` to a column that is not defined in the fields as `sortable` will result in the
1788
- table not being sorted.
1789
-
1790
- When the prop `foot-clone` is set, the footer headings will also allow sorting by clicking, even if
1791
- you have custom formatted footer field headers. To disable the sort icons and sorting via heading
1792
- clicks in the footer, set the `no-footer-sorting` prop to true.
1793
-
1794
- ```html
1795
- <template>
1796
- <div>
1797
- <b-table
1798
- :items="items"
1799
- :fields="fields"
1800
- :sort-by.sync="sortBy"
1801
- :sort-desc.sync="sortDesc"
1802
- responsive="sm"
1803
- ></b-table>
1804
-
1805
- <div>
1806
- Sorting By: <b>{{ sortBy }}</b>, Sort Direction:
1807
- <b>{{ sortDesc ? 'Descending' : 'Ascending' }}</b>
1808
- </div>
1809
- </div>
1810
- </template>
1811
-
1812
- <script>
1813
- export default {
1814
- data() {
1815
- return {
1816
- sortBy: 'age',
1817
- sortDesc: false,
1818
- fields: [
1819
- { key: 'last_name', sortable: true },
1820
- { key: 'first_name', sortable: true },
1821
- { key: 'age', sortable: true },
1822
- { key: 'isActive', sortable: false }
1823
- ],
1824
- items: [
1825
- { isActive: true, age: 40, first_name: 'Dickerson', last_name: 'Macdonald' },
1826
- { isActive: false, age: 21, first_name: 'Larsen', last_name: 'Shaw' },
1827
- { isActive: false, age: 89, first_name: 'Geneva', last_name: 'Wilson' },
1828
- { isActive: true, age: 38, first_name: 'Jami', last_name: 'Carney' }
1829
- ]
1830
- }
1831
- }
1832
- }
1833
- </script>
1834
-
1835
- <!-- b-table-sorting.vue -->
1836
- ```
1837
-
1838
- ### Sort icon alignment
1839
-
1840
- By default the sorting icons appear right aligned in the header cell. You can change the icons to be
1841
- left aligned by setting the prop `sort-icon-left` on `<b-table>`.
1842
-
1843
- ```html
1844
- <template>
1845
- <div>
1846
- <b-table
1847
- :items="items"
1848
- :fields="fields"
1849
- :sort-by.sync="sortBy"
1850
- :sort-desc.sync="sortDesc"
1851
- sort-icon-left
1852
- responsive="sm"
1853
- ></b-table>
1854
-
1855
- <div>
1856
- Sorting By: <b>{{ sortBy }}</b>, Sort Direction:
1857
- <b>{{ sortDesc ? 'Descending' : 'Ascending' }}</b>
1858
- </div>
1859
- </div>
1860
- </template>
1861
-
1862
- <script>
1863
- export default {
1864
- data() {
1865
- return {
1866
- sortBy: 'age',
1867
- sortDesc: false,
1868
- fields: [
1869
- { key: 'last_name', sortable: true },
1870
- { key: 'first_name', sortable: true },
1871
- { key: 'age', sortable: true },
1872
- { key: 'isActive', sortable: false }
1873
- ],
1874
- items: [
1875
- { isActive: true, age: 40, first_name: 'Dickerson', last_name: 'Macdonald' },
1876
- { isActive: false, age: 21, first_name: 'Larsen', last_name: 'Shaw' },
1877
- { isActive: false, age: 89, first_name: 'Geneva', last_name: 'Wilson' },
1878
- { isActive: true, age: 38, first_name: 'Jami', last_name: 'Carney' }
1879
- ]
1880
- }
1881
- }
1882
- }
1883
- </script>
1884
-
1885
- <!-- b-table-sorting-left.vue -->
1886
- ```
1887
-
1888
- ### Customizing the sort icons
1889
-
1890
- The sorting icons are generated via the use of SVG background images. The icons can be altered by
1891
- updating BootstrapVue's SASS/SCSS variables and recompiling the SCSS source code. Refer to the
1892
- [theming](/docs/reference/theming) section for details on customizing Bootstrap and BootstrapVue's
1893
- generated CSS.
1894
-
1895
- ### Sort-compare routine
1896
-
1897
- The internal built-in default `sort-compare` function sorts the specified field `key` based on the
1898
- data in the underlying record object (or by formatted value if a field has a formatter function, and
1899
- the field has its `sortByFormatted` property is set to `true`). The field value is first stringified
1900
- if it is an object and then sorted.
1901
-
1902
- **Notes:**
1903
-
1904
- - The built-in `sort-compare` routine **cannot** sort based on the custom rendering of the field
1905
- data: scoped slots are used only for _presentation only_, and do not affect the underlying data.
1906
- - Fields that have a [`formatter` function](#formatter-callback) (virtual field or regular field)
1907
- can be sorted by the value returned via the formatter function if the
1908
- [field](#field-definition-reference) property `sortByFormatted` is set to `true`. Optionally you
1909
- can pass a formatter function reference to `sortByFormatted` to format the value before sorting.
1910
- The default is `false` which will sort by the original field value. This is only applicable for
1911
- the built-in sort-compare routine.
1912
- - By default, the internal sorting routine will sort `null`, `undefined`, or empty string values
1913
- first (less than any other values). To sort so that `null`, `undefined` or empty string values
1914
- appear last (greater than any other value), set the `sort-null-last` prop to `true`.
1915
-
1916
- For customizing the sort-compare handling, refer to the
1917
- [Custom sort-compare routine](#custom-sort-compare-routine) section below.
1918
-
1919
- ### Internal sorting and locale handling
1920
-
1921
- The internal sort-compare routine uses
1922
- [`String.prototype.localeCompare()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare)
1923
- for comparing the stringified column value (if values being compared are not both `Number` or both
1924
- `Date` types). The browser native `localeCompare()` method accepts a `locale` string (or array of
1925
- locale strings) and an `options` object for controlling how strings are sorted. The default options
1926
- are `{ numeric: true }`, and the locale is `undefined` (which uses the browser default locale).
1927
-
1928
- You can change the locale (or locales) via the `sort-compare-locale` prop to set the locale(s) for
1929
- sorting, as well as pass sort options via the `sort-compare-options` prop.
1930
-
1931
- The `sort-compare-locale` prop defaults to `undefined`, which uses the browser (or Node.js runtime)
1932
- default locale. The prop `sort-compare-locale` can either accept a
1933
- [BCP 47 language tag](https://tools.ietf.org/html/rfc5646) string or an _array_ of such tags. For
1934
- more details on locales, please see
1935
- [Locale identification and negotiation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_identification_and_negotiation)
1936
- on MDN.
1937
-
1938
- The `sort-compare-options` prop accepts an object containing any of the following properties:
1939
-
1940
- - `localeMatcher`: The locale matching algorithm to use. Possible values are `'lookup'` and
1941
- `'best fit'`. The default is `'best fit'`. For information about this option, see the
1942
- [MDN Intl page](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation)
1943
- for details.
1944
- - `sensitivity`: Which differences in the strings should lead to _non-zero_ compare result values.
1945
- Possible values are:
1946
- - `'base'`: Only strings that differ in base letters compare as unequal. Examples: `a ≠ b`,
1947
- `a = á`, `a = A`.
1948
- - `'accent'`: Only strings that differ in base letters or accents and other diacritic marks
1949
- compare as unequal. Examples: `a ≠ b`, `a ≠ á`, `a = A`.
1950
- - `'case'`: Only strings that differ in base letters or case compare as unequal. Examples:
1951
- `a ≠ b`, `a = á`, `a ≠ A`.
1952
- - `'variant'`: **(default)** Strings that differ in base letters, accents and other diacritic
1953
- marks, or case compare as unequal. Other differences _may also_ be taken into consideration.
1954
- Examples: `a ≠ b`, `a ≠ á`, `a ≠ A`.
1955
- - `ignorePunctuation`: Whether punctuation should be ignored. Possible values are `true` and
1956
- `false`. The default is `false`.
1957
- - `numeric`: Whether numeric collation should be used, such that `'1' < '2' < '10'`. Possible values
1958
- are `true` and `false`. The default is `false`. Note that implementations (browsers, runtimes) are
1959
- not required to support this property, and therefore it might be ignored.
1960
- - `caseFirst`: Whether upper case or lower case should sort first. Possible values are `'upper'`,
1961
- `'lower'`, or `'false'` (use the locale's default). The default is `'false'`. Implementations are
1962
- not required to support this property.
1963
- - `'usage'`: **Always** set to `'sort'` by `<b-table>`
1964
-
1965
- **Example 1:** If you want to sort German words, set `sort-compare-locale="de"` (in German, `ä`
1966
- sorts _before_ `z`) or Swedish set `sort-compare-locale="sv"` (in Swedish, `ä` sorts _after_ `z`)
1967
-
1968
- **Example 2:** To compare numbers that are strings numerically, and to ignore case and accents:
1969
-
1970
- ```html
1971
- <b-table :sort-compare-options="{ numeric: true, sensitivity: 'base' }" ...>
1972
- ```
1973
-
1974
- **Notes:**
1975
-
1976
- - Refer to
1977
- [MDN `String.prototype.localeCompare()` documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare)
1978
- for details on the options object property values.
1979
- - Refer to
1980
- [MDN locales documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument)
1981
- for details on locale values.
1982
- - Not all browsers (or Node.js) support the `locale` and `options` with
1983
- `String.prototype.localeCompare()`. Refer to [Can I use](https://caniuse.com/localecompare) for
1984
- browser support. For Node.js, you may need to add in
1985
- [Intl support](https://nodejs.org/api/intl.html) for handling locales, other than the default, to
1986
- prevent [SSR hydration mismatch errors](https://ssr.vuejs.org/guide/hydration.html).
1987
-
1988
- ### Custom sort-compare routine
1989
-
1990
- You can provide your own custom sort compare routine by passing a function reference to the prop
1991
- `sort-compare`. The `sort-compare` routine is passed seven (7) arguments, of which the last 4 are
1992
- optional:
1993
-
1994
- - the first two arguments (`a` and `b`) are the _record objects_ for the rows being compared
1995
- - the third argument is the field `key` being sorted on (`sortBy`)
1996
- - the fourth argument (`sortDesc`) is the order `<b-table>` will be displaying the records (`true`
1997
- for descending, `false` for ascending)
1998
- - the fifth argument is a reference to the field's [formatter function](#formatter-callback) or the
1999
- field's `filterByFormatted` value if it is a function reference. If not formatter is found this
2000
- value will be `undefined`. You will need to call this method to get the formatted field value:
2001
- `valA = formatter(a[key], key, a)` and `valB = formatter(b[key], key, b)`, if you need to sort by
2002
- the formatted value. This will be `undefined` if the field's `sortByFormatted` property is not
2003
- `true` or is not a formatter function _reference_, or the fields formatter function cannot be
2004
- found.
2005
- - the sixth argument is the value of the `sort-compare-options` prop (default is
2006
- `{ numeric: true }`)
2007
- - the seventh argument is the value of the `sort-compare-locale` prop (default is `undefined`)
2008
-
2009
- The sixth and seventh arguments can be used if you are using the
2010
- [`String.prototype.localeCompare()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare)
2011
- method to compare strings.
2012
-
2013
- In most typical situations, you only need to use the first three arguments. The fourth argument -
2014
- sorting direction - should not normally be used, as `b-table` will handle the direction, and this
2015
- value is typically only needed when special handling of how `null` and/or `undefined` values are
2016
- sorted (i.e. sorting `null`/`undefined` first or last).
2017
-
2018
- The routine should return either `-1` (or a negative value) for `a[key] < b[key]` , `0` for
2019
- `a[key] === b[key]`, or `1` (or a positive value) for `a[key] > b[key]`.
2020
-
2021
- Your custom sort-compare routine can also return `null` or `false`, to fall back to the _built-in
2022
- sort-compare routine_ for the particular `key`. You can use this feature (i.e. by returning `null`)
2023
- to have your custom sort-compare routine handle _only_ certain fields (keys) such as the special
2024
- case of virtual (scoped slot) columns, and have the internal (built in) sort-compare handle all
2025
- _other_ fields.
2026
-
2027
- The default sort-compare routine works similar to the following. Note the fourth argument (sorting
2028
- direction) is **not** used in the sort comparison:
2029
-
2030
- <!-- eslint-disable no-unused-vars, no-undef -->
2031
-
2032
- ```js
2033
- function sortCompare(aRow, bRow, key, sortDesc, formatter, compareOptions, compareLocale) {
2034
- const a = aRow[key] // or use Lodash `_.get()`
2035
- const b = bRow[key]
2036
- if (
2037
- (typeof a === 'number' && typeof b === 'number') ||
2038
- (a instanceof Date && b instanceof Date)
2039
- ) {
2040
- // If both compared fields are native numbers or both are native dates
2041
- return a < b ? -1 : a > b ? 1 : 0
2042
- } else {
2043
- // Otherwise stringify the field data and use String.prototype.localeCompare
2044
- return toString(a).localeCompare(toString(b), compareLocale, compareOptions)
2045
- }
2046
- }
2047
-
2048
- // Helper function to stringify the values of an Object
2049
- function toString(value) {
2050
- if (value === null || typeof value === 'undefined') {
2051
- return ''
2052
- } else if (value instanceof Object) {
2053
- return Object.keys(value)
2054
- .sort()
2055
- .map(key => toString(value[key]))
2056
- .join(' ')
2057
- } else {
2058
- return String(value)
2059
- }
2060
- }
2061
- ```
2062
-
2063
- ### Disable local sorting
2064
-
2065
- If you want to handle sorting entirely in your app, you can disable the local sorting in `<b-table>`
2066
- by setting the prop `no-local-sorting` to `true`, while still maintaining the sortable header
2067
- functionality (via `sort-changed` or `context-changed` events as well as syncable props).
2068
-
2069
- You can use the syncable props `sort-by.sync` and `sort-desc.sync` to detect changes in sorting
2070
- column and direction.
2071
-
2072
- Also, When a sortable column header (or footer) is clicked, the event `sort-changed` will be emitted
2073
- with a single argument containing the context object of `<b-table>`. See the
2074
- [Detection of sorting change](#detection-of-sorting-change) section below for details about the
2075
- sort-changed event and the context object.
2076
-
2077
- When `no-local-sorting` is `true`, the `sort-compare` prop has no effect.
2078
-
2079
- ### Change initial sort direction
2080
-
2081
- Control the order in which ascending and descending sorting is applied when a sortable column header
2082
- is clicked, by using the `sort-direction` prop. The default value `'asc'` applies ascending sort
2083
- first (when a column is not currently sorted). To reverse the behavior and sort in descending
2084
- direction first, set it to `'desc'`.
2085
-
2086
- If you don't want the current sorting direction to change when clicking another sortable column
2087
- header, set `sort-direction` to `'last'`. This will maintain the sorting direction of the previously
2088
- sorted column.
2089
-
2090
- For individual column initial sort direction (which applies when the column transitions from
2091
- unsorted to sorted), specify the property `sortDirection` in `fields`. See the
2092
- [Complete Example](#complete-example) below for an example of using this feature.
2093
-
2094
- ## Filtering
2095
-
2096
- Filtering, when used, is applied by default to the **original items** array data. `b-table` provides
2097
- several options for how data is filtered.
2098
-
2099
- It is currently not possible to filter based on result of formatting via
2100
- [scoped field slots](#scoped-field-slots).
2101
-
2102
- ### Built in filtering
2103
-
2104
- The item's row data values are stringified (see the sorting section above for how stringification is
2105
- done) and the filter searches that stringified data (excluding any of the special properties that
2106
- begin with an underscore `'_'`). The stringification also, by default, includes any data not shown
2107
- in the presented columns.
2108
-
2109
- With the default built-in filter function, the `filter` prop value can either be a string or a
2110
- `RegExp` object (regular expressions should _not_ have the `/g` global flag set).
2111
-
2112
- If the stringified row contains the provided string value or matches the RegExp expression then it
2113
- is included in the displayed results.
2114
-
2115
- Set the `filter` prop to `null` or an empty string to clear the current filter.
2116
-
2117
- ### Built in filtering options
2118
-
2119
- There are several options for controlling what data the filter is applied against.
2120
-
2121
- - The `filter-ignored-fields` prop accepts an array of _top-level_ (immediate properties of the row
2122
- data) field keys that should be ignored when filtering.
2123
- - The `filter-included-fields` prop accepts an array of _top-level_ (immediate properties of the row
2124
- data) field keys that should used when filtering. All other field keys not included in this array
2125
- will be ignored. This feature can be handy when you want to filter on specific columns. If the
2126
- specified array is empty, then _all_ fields are included, except those specified via the prop
2127
- `filter-ignored-fields`. If a field key is specified in both `filter-ignored-fields` and
2128
- `filter-included-fields`, then `filter-included-fields` takes precedence.
2129
- - Normally, `<b-table>` filters based on the stringified record data. If the field has a `formatter`
2130
- function specified, you can optionally filter based on the result of the formatter by setting the
2131
- [field definition property](#field-definition-reference) `filterByFormatted` to `true`. If the
2132
- field does not have a formatter function, this option is ignored. You can optionally pass a
2133
- formatter function _reference_, to be used for filtering only, to the field definition property
2134
- `filterByFormatted`.
2135
-
2136
- The props `filter-ignored-fields` and `filter-included-fields`, and the field definition property
2137
- `filterByFormatted` have no effect when using a [custom filter function](#custom-filter-function),
2138
- or [items provider](#using-items-provider-functions) based filtering.
2139
-
2140
- ### Custom filter function
2141
-
2142
- You can also use a custom filter function, by setting the prop `filter-function` to a reference of
2143
- custom filter test function. The filter function will be passed two arguments:
2144
-
2145
- - the original item row record data object. **Treat this argument as read-only.**
2146
- - the content of the `filter` prop (could be a string, RegExp, array, or object)
2147
-
2148
- The function should return `true` if the record matches your criteria or `false` if the record is to
2149
- be filtered out.
2150
-
2151
- For proper reactive updates to the displayed data, when not filtering you should set the `filter`
2152
- prop to `null` or an empty string (and not an empty object or array). The filter function will not
2153
- be called when the `filter` prop is a falsey value.
2154
-
2155
- The display of the `empty-filter-text` relies on the truthiness of the `filter` prop.
2156
-
2157
- ### Filter events
2158
-
2159
- When local filtering is applied, and the resultant number of items change, `<b-table>` will emit the
2160
- `filtered` event with a two arguments:
2161
-
2162
- - an array reference which is the complete list of items passing the filter routine. **Treat this
2163
- argument as read-only.**
2164
- - the number of records that passed the filter test (the length of the first argument)
2165
-
2166
- Setting the prop `filter` to null or an empty string will clear local items filtering.
2167
-
2168
- ### Debouncing filter criteria changes
2169
-
2170
- <span class="badge badge-warning small">deprecated in v2.1.0</span> Use the `debounce` feature of
2171
- [`<b-form-input>`](/docs/components/form-input#debounce-support) instead.
2172
-
2173
- If you have a text input tied to the `filter` prop of `<b-table>`, the filtering process will occur
2174
- for each character typed by the user. With large items datasets, this process can take a while and
2175
- may cause the text input to appear sluggish.
2176
-
2177
- To help alleviate this type of situation, `<b-table>` accepts a debounce timeout value (in
2178
- milliseconds) via the `filter-debounce` prop. The default is `0` (milliseconds). When a value
2179
- greater than `0` is provided, the filter will wait for that time before updating the table results.
2180
- If the value of the `filter` prop changes before this timeout expires, the filtering will be once
2181
- again delayed until the debounce timeout expires.
2182
-
2183
- When used, the suggested value of `filter-debounce` should be in the range of `100` to `200`
2184
- milliseconds, but other values may be more suitable for your use case.
2185
-
2186
- The use of this prop can be beneficial when using provider filtering with
2187
- [items provider functions](#using-items-provider-functions), to help reduce the number of calls to
2188
- your back end API.
2189
-
2190
- ### Filtering notes
2191
-
2192
- See the [Complete Example](#complete-example) below for an example of using the `filter` feature.
2193
-
2194
- ## Pagination
2195
-
2196
- `<b-table>` supports built in pagination of item data. You can control how many rows are displayed
2197
- at a time by setting the `per-page` prop to the maximum number of rows you would like displayed, and
2198
- use the `current-page` prop to specify which page to display (starting from page `1`). If you set
2199
- `current-page` to a value larger than the computed number of pages, then no rows will be shown.
2200
-
2201
- You can use the [`<b-pagination>`](/docs/components/pagination) component in conjunction with
2202
- `<b-table>` for providing control over pagination.
2203
-
2204
- Setting `per-page` to `0` (default) will disable the local items pagination feature.
2205
-
2206
- ## Using items provider functions
2207
-
2208
- As mentioned under the [Items](#items-record-data) prop section, it is possible to use a function to
2209
- provide the row data (items), by specifying a function reference via the `items` prop.
2210
-
2211
- The provider function is called with the following signature:
2212
-
2213
- <!-- eslint-disable no-undef -->
2214
-
2215
- ```js
2216
- provider(ctx, [callback])
2217
- ```
2218
-
2219
- The `ctx` is the context object associated with the table state, and contains the following
2220
- properties:
2221
-
2222
- | Property | Type | Description |
2223
- | ------------- | -------------------------- | --------------------------------------------------------------------------------- |
2224
- | `currentPage` | Number | The current page number (starting from 1, the value of the `current-page` prop) |
2225
- | `perPage` | Number | The maximum number of rows per page to display (the value of the `per-page` prop) |
2226
- | `filter` | String or RegExp or Object | The value of the `filter` prop |
2227
- | `sortBy` | String | The current column key being sorted, or an empty string if not sorting |
2228
- | `sortDesc` | Boolean | The current sort direction (`true` for descending, `false` for ascending) |
2229
- | `apiUrl` | String | The value provided to the `api-url` prop. `null` if none provided. |
2230
-
2231
- The second argument `callback` is an optional parameter for when using the callback asynchronous
2232
- method.
2233
-
2234
- **Example: returning an array of data (synchronous):**
2235
-
2236
- <!-- eslint-disable no-unused-vars, prefer-const -->
2237
-
2238
- ```js
2239
- function myProvider() {
2240
- let items = []
2241
-
2242
- // Perform any items processing needed
2243
-
2244
- // Must return an array
2245
- return items || []
2246
- }
2247
- ```
2248
-
2249
- **Example: Using callback to return data (asynchronous):**
2250
-
2251
- <!-- eslint-disable no-unused-vars, node/no-callback-literal -->
2252
-
2253
- ```js
2254
- function myProvider(ctx, callback) {
2255
- const params = '?page=' + ctx.currentPage + '&size=' + ctx.perPage
2256
-
2257
- this.fetchData('/some/url' + params)
2258
- .then(data => {
2259
- // Pluck the array of items off our axios response
2260
- const items = data.items
2261
- // Provide the array of items to the callback
2262
- callback(items)
2263
- })
2264
- .catch(() => {
2265
- callback([])
2266
- })
2267
-
2268
- // Must return null or undefined to signal b-table that callback is being used
2269
- return null
2270
- }
2271
- ```
2272
-
2273
- **Example: Using a Promise to return data (asynchronous):**
2274
-
2275
- <!-- eslint-disable no-unused-vars, no-undef -->
2276
-
2277
- ```js
2278
- function myProvider(ctx) {
2279
- const promise = axios.get('/some/url?page=' + ctx.currentPage + '&size=' + ctx.perPage)
2280
-
2281
- // Must return a promise that resolves to an array of items
2282
- return promise.then(data => {
2283
- // Pluck the array of items off our axios response
2284
- const items = data.items
2285
- // Must return an array of items or an empty array if an error occurred
2286
- return items || []
2287
- })
2288
- }
2289
- ```
2290
-
2291
- **Example: Using an async function (semi-synchronous):**
2292
-
2293
- Using an async method to return an items array is possible:
2294
-
2295
- <!-- eslint-disable no-unused-vars, no-undef -->
2296
-
2297
- ```js
2298
- async function myProvider(ctx) {
2299
- try {
2300
- const response = await axios.get(`/some/url?page=${ctx.currentPage}&size=${ctx.perPage}`)
2301
- return response.items
2302
- } catch (error) {
2303
- return []
2304
- }
2305
- }
2306
- ```
2307
-
2308
- Note that not all browsers support `async/await` natively. For browsers that do not support `async`
2309
- methods, you will need to transpile your code.
2310
-
2311
- ### Automated table busy state
2312
-
2313
- `<b-table>` automatically tracks/controls its `busy` state when items provider functions are used,
2314
- however it also provides a `busy` prop that can be used either to override the inner `busy` state,
2315
- or to monitor `<b-pagination>`'s current busy state in your application using the 2-way `.sync`
2316
- modifier.
2317
-
2318
- **Note:** in order to allow `<b-table>` fully track its `busy` state, the custom items provider
2319
- function should handle errors from data sources and return an empty array to `<b-table>`.
2320
-
2321
- **Example: usage of busy state**
2322
-
2323
- ```html
2324
- <template>
2325
- <div>
2326
- <b-table
2327
- id="my-table"
2328
- :busy.sync="isBusy"
2329
- :items="myProvider"
2330
- :fields="fields"
2331
- ...
2332
- ></b-table>
2333
- </div>
2334
- </template>
2335
-
2336
- <script>
2337
- export default {
2338
- data () {
2339
- return {
2340
- isBusy: false
2341
- }
2342
- }
2343
- methods: {
2344
- myProvider () {
2345
- // Here we don't set isBusy prop, so busy state will be
2346
- // handled by table itself
2347
- // this.isBusy = true
2348
- let promise = axios.get('/some/url')
2349
-
2350
- return promise.then((data) => {
2351
- const items = data.items
2352
- // Here we could override the busy state, setting isBusy to false
2353
- // this.isBusy = false
2354
- return(items)
2355
- }).catch(error => {
2356
- // Here we could override the busy state, setting isBusy to false
2357
- // this.isBusy = false
2358
- // Returning an empty array, allows table to correctly handle
2359
- // internal busy state in case of error
2360
- return []
2361
- })
2362
- }
2363
- }
2364
- }
2365
- </script>
2366
- ```
2367
-
2368
- If using an `async/await` provider:
2369
-
2370
- <!-- eslint-disable no-unused-vars, no-undef -->
2371
-
2372
- ```js
2373
- async function myProvider(ctx) {
2374
- this.isBusy = true
2375
- try {
2376
- const response = await axios.get(`/some/url?page=${ctx.currentPage}&size=${ctx.perPage}`)
2377
- this.isBusy = false
2378
- return response.items
2379
- } catch (error) {
2380
- this.isBusy = false
2381
- return []
2382
- }
2383
- }
2384
- ```
2385
-
2386
- **Notes:**
2387
-
2388
- - If you manually place the table in the `busy` state, the items provider will **not** be
2389
- called/refreshed until the `busy` state has been set to `false`.
2390
- - All click related and hover events, and sort-changed events will **not** be emitted when in the
2391
- `busy` state (either set automatically during provider update, or when manually set).
2392
-
2393
- ### Provider paging, filtering, and sorting
2394
-
2395
- By default, the items provider function is responsible for **all paging, filtering, and sorting** of
2396
- the data, before passing it to `b-table` for display.
2397
-
2398
- You can disable provider paging, filtering, and sorting (individually) by setting the following
2399
- `b-table` prop(s) to `true`:
2400
-
2401
- | Prop | Type | Default | Description |
2402
- | ----------------------- | ------- | ------- | -------------------------------------------------------------- |
2403
- | `no-provider-paging` | Boolean | `false` | When `true` enables the use of `b-table` local data pagination |
2404
- | `no-provider-sorting` | Boolean | `false` | When `true` enables the use of `b-table` local sorting |
2405
- | `no-provider-filtering` | Boolean | `false` | When `true` enables the use of `b-table` local filtering |
2406
-
2407
- When `no-provider-paging` is `false` (default), you should only return at maximum, `perPage` number
2408
- of records.
2409
-
2410
- **Notes:**
2411
-
2412
- - `<b-table>` needs reference to your pagination and filtering values in order to trigger the
2413
- calling of the provider function. So be sure to bind to the `per-page`, `current-page` and
2414
- `filter` props on `b-table` to trigger the provider update function call (unless you have the
2415
- respective `no-provider-*` prop set to `true`).
2416
- - The `no-local-sorting` prop has no effect when `items` is a provider function.
2417
- - When using provider filtering, you may find that setting the
2418
- [`debounce` prop on `<b-form-input>`](/docs/components/form-input#debounce-support) to a value
2419
- greater than `100` ms will help minimize the number of calls to your back end API as the user
2420
- types in the criteria.
2421
-
2422
- ### Force refreshing of table data
2423
-
2424
- You may also trigger the refresh of the provider function by emitting the event `refresh::table` on
2425
- `$root` with the single argument being the `id` of your `b-table`. You must have a unique ID on your
2426
- table for this to work.
2427
-
2428
- ```js
2429
- this.$root.$emit('bv::refresh::table', 'my-table')
2430
- ```
2431
-
2432
- Or by calling the `refresh()` method on the table reference
2433
-
2434
- ```html
2435
- <div>
2436
- <b-table ref="table" ... ></b-table>
2437
- </div>
2438
- ```
2439
-
2440
- ```js
2441
- this.$refs.table.refresh()
2442
- ```
2443
-
2444
- **Note:** If the table is in the `busy` state (i.e. a provider update is currently running), the
2445
- refresh will wait until the current update is completed. If there is currently a refresh pending and
2446
- a new refresh is requested, then only one refresh will occur.
2447
-
2448
- ### Detection of sorting change
2449
-
2450
- By listening on `<b-table>` `sort-changed` event, you can detect when the sorting key and direction
2451
- have changed.
2452
-
2453
- ```html
2454
- <div>
2455
- <b-table @sort-changed="sortingChanged" ... ></b-table>
2456
- </div>
2457
- ```
2458
-
2459
- The `sort-changed` event provides a single argument of the table's current state context object.
2460
- This context object has the same format as used by items provider functions.
2461
-
2462
- <!-- eslint-disable no-unused-vars -->
2463
-
2464
- ```js
2465
- export default {
2466
- methods: {
2467
- sortingChanged(ctx) {
2468
- // ctx.sortBy ==> Field key for sorting by (or null for no sorting)
2469
- // ctx.sortDesc ==> true if sorting descending, false otherwise
2470
- }
2471
- }
2472
- }
2473
- ```
2474
-
2475
- You can also obtain the current sortBy and sortDesc values by using the `:sort-by.sync` and
2476
- `:sort-desc.sync` two-way props respectively (see section [Sorting](#sorting) above for details).
2477
-
2478
- ```html
2479
- <div>
2480
- <b-table :sort-by.sync="mySortBy" :sort-desc.sync="mySortDesc" ... ></b-table>
2481
- </div>
2482
- ```
2483
-
2484
- ### Server side rendering
2485
-
2486
- Special care must be taken when using server side rendering (SSR) and an `items` provider function.
2487
- Make sure you handle any special situations that may be needed server side when fetching your data!
2488
-
2489
- When `<b-table>` is mounted in the document, it will automatically trigger a provider update call.
2490
-
2491
- ## Light-weight tables
2492
-
2493
- `<b-table-lite>` provides a great alternative to `<b-table>` if you just need simple display of
2494
- tabular data. The `<b-table-lite>` component provides all of the styling and formatting features of
2495
- `<b-table>` (including row details and stacked support), while **excluding** the following features:
2496
-
2497
- - Filtering
2498
- - Sorting
2499
- - Pagination
2500
- - Items provider support
2501
- - Selectable rows
2502
- - Busy table state and styling
2503
- - Fixed top and bottom rows
2504
- - Empty row support
2505
-
2506
- ## Simple tables
2507
-
2508
- The `<b-table-simple>` component gives the user complete control over the rendering of the table
2509
- content, while providing basic Bootstrap v4 table styling. `<b-table-simple>` is a wrapper component
2510
- around the `<table>` element. Inside the component, via the `default` slot, you can use any or all
2511
- of the BootstrapVue [table helper components](#table-helper-components): `<b-thead>`, `<b-tfoot>`,
2512
- `<b-tbody>`, `<b-tr>`, `<b-th>`, `<b-td>`, and the HTML5 elements `<caption>`, `<colgroup>` and
2513
- `<col>`. Contrary to the component's name, one can create simple or complex table layouts with
2514
- `<b-table-simple>`.
2515
-
2516
- `<b-table-simple>` provides basic styling options via props: `striped`, `bordered`, `borderless`,
2517
- `outlined`, `small`, `hover`, `dark`, `fixed`, `responsive` and `sticky-header`. Note that `stacked`
2518
- mode is available but requires some additional markup to generate the cell headings, as described in
2519
- the [Simple tables and stacked mode](#simple-tables-and-stacked-mode) section below. Sticky columns
2520
- are also supported, but also require a bit of additional markup to specify which columns are to be
2521
- sticky. See below for more information on using [sticky columns](#simple-tables-and-sticky-columns).
2522
-
2523
- Since `b-table-simple` is just a wrapper component, of which you will need to render content inside,
2524
- it does not provide any of the advanced features of `<b-table>` (i.e. row events, head events,
2525
- sorting, pagination, filtering, foot-clone, items, fields, etc.).
2526
-
2527
- ```html
2528
- <div>
2529
- <b-table-simple hover small caption-top responsive>
2530
- <caption>Items sold in August, grouped by Country and City:</caption>
2531
- <colgroup><col><col></colgroup>
2532
- <colgroup><col><col><col></colgroup>
2533
- <colgroup><col><col></colgroup>
2534
- <b-thead head-variant="dark">
2535
- <b-tr>
2536
- <b-th colspan="2">Region</b-th>
2537
- <b-th colspan="3">Clothes</b-th>
2538
- <b-th colspan="2">Accessories</b-th>
2539
- </b-tr>
2540
- <b-tr>
2541
- <b-th>Country</b-th>
2542
- <b-th>City</b-th>
2543
- <b-th>Trousers</b-th>
2544
- <b-th>Skirts</b-th>
2545
- <b-th>Dresses</b-th>
2546
- <b-th>Bracelets</b-th>
2547
- <b-th>Rings</b-th>
2548
- </b-tr>
2549
- </b-thead>
2550
- <b-tbody>
2551
- <b-tr>
2552
- <b-th rowspan="3">Belgium</b-th>
2553
- <b-th class="text-right">Antwerp</b-th>
2554
- <b-td>56</b-td>
2555
- <b-td>22</b-td>
2556
- <b-td>43</b-td>
2557
- <b-td variant="success">72</b-td>
2558
- <b-td>23</b-td>
2559
- </b-tr>
2560
- <b-tr>
2561
- <b-th class="text-right">Gent</b-th>
2562
- <b-td>46</b-td>
2563
- <b-td variant="warning">18</b-td>
2564
- <b-td>50</b-td>
2565
- <b-td>61</b-td>
2566
- <b-td variant="danger">15</b-td>
2567
- </b-tr>
2568
- <b-tr>
2569
- <b-th class="text-right">Brussels</b-th>
2570
- <b-td>51</b-td>
2571
- <b-td>27</b-td>
2572
- <b-td>38</b-td>
2573
- <b-td>69</b-td>
2574
- <b-td>28</b-td>
2575
- </b-tr>
2576
- <b-tr>
2577
- <b-th rowspan="2">The Netherlands</b-th>
2578
- <b-th class="text-right">Amsterdam</b-th>
2579
- <b-td variant="success">89</b-td>
2580
- <b-td>34</b-td>
2581
- <b-td>69</b-td>
2582
- <b-td>85</b-td>
2583
- <b-td>38</b-td>
2584
- </b-tr>
2585
- <b-tr>
2586
- <b-th class="text-right">Utrecht</b-th>
2587
- <b-td>80</b-td>
2588
- <b-td variant="danger">12</b-td>
2589
- <b-td>43</b-td>
2590
- <b-td>36</b-td>
2591
- <b-td variant="warning">19</b-td>
2592
- </b-tr>
2593
- </b-tbody>
2594
- <b-tfoot>
2595
- <b-tr>
2596
- <b-td colspan="7" variant="secondary" class="text-right">
2597
- Total Rows: <b>5</b>
2598
- </b-td>
2599
- </b-tr>
2600
- </b-tfoot>
2601
- </b-table-simple>
2602
- </div>
2603
-
2604
- <!-- b-table-simple.vue -->
2605
- ```
2606
-
2607
- When in `responsive` or `sticky-header` mode, the `<table>` element is wrapped inside a `<div>`
2608
- element. If you need to apply additional classes to the `<table>` element, use the `table-class`
2609
- prop.
2610
-
2611
- Any additional attributes given to `<b-table-simple>` will always be applied to the `<table>`
2612
- element.
2613
-
2614
- ### Simple tables and stacked mode
2615
-
2616
- A bit of additional markup is required on your `<b-table-simple>` body cells when the table is in
2617
- stacked mode. Specifically, BootstrapVue uses a special data attribute to create the cell's heading,
2618
- of which you can supply to `<b-td>` or `<b-th>` via the `stacked-heading` prop. Only plain strings
2619
- are supported (not HTML markup), as we use the pseudo element `::before` and css `content` property.
2620
-
2621
- Here is the same table as above, set to be always stacked, which has the extra markup to handle
2622
- stacked mode (specifically for generating the cell headings):
2623
-
2624
- ```html
2625
- <div>
2626
- <b-table-simple hover small caption-top stacked>
2627
- <caption>Items sold in August, grouped by Country and City:</caption>
2628
- <colgroup><col><col></colgroup>
2629
- <colgroup><col><col><col></colgroup>
2630
- <colgroup><col><col></colgroup>
2631
- <b-thead head-variant="dark">
2632
- <b-tr>
2633
- <b-th colspan="2">Region</b-th>
2634
- <b-th colspan="3">Clothes</b-th>
2635
- <b-th colspan="2">Accessories</b-th>
2636
- </b-tr>
2637
- <b-tr>
2638
- <b-th>Country</b-th>
2639
- <b-th>City</b-th>
2640
- <b-th>Trousers</b-th>
2641
- <b-th>Skirts</b-th>
2642
- <b-th>Dresses</b-th>
2643
- <b-th>Bracelets</b-th>
2644
- <b-th>Rings</b-th>
2645
- </b-tr>
2646
- </b-thead>
2647
- <b-tbody>
2648
- <b-tr>
2649
- <b-th rowspan="3" class="text-center">Belgium (3 Cities)</b-th>
2650
- <b-th stacked-heading="City" class="text-left">Antwerp</b-th>
2651
- <b-td stacked-heading="Clothes: Trousers">56</b-td>
2652
- <b-td stacked-heading="Clothes: Skirts">22</b-td>
2653
- <b-td stacked-heading="Clothes: Dresses">43</b-td>
2654
- <b-td stacked-heading="Accessories: Bracelets" variant="success">72</b-td>
2655
- <b-td stacked-heading="Accessories: Rings">23</b-td>
2656
- </b-tr>
2657
- <b-tr>
2658
- <b-th stacked-heading="City">Gent</b-th>
2659
- <b-td stacked-heading="Clothes: Trousers">46</b-td>
2660
- <b-td stacked-heading="Clothes: Skirts" variant="warning">18</b-td>
2661
- <b-td stacked-heading="Clothes: Dresses">50</b-td>
2662
- <b-td stacked-heading="Accessories: Bracelets">61</b-td>
2663
- <b-td stacked-heading="Accessories: Rings" variant="danger">15</b-td>
2664
- </b-tr>
2665
- <b-tr>
2666
- <b-th stacked-heading="City">Brussels</b-th>
2667
- <b-td stacked-heading="Clothes: Trousers">51</b-td>
2668
- <b-td stacked-heading="Clothes: Skirts">27</b-td>
2669
- <b-td stacked-heading="Clothes: Dresses">38</b-td>
2670
- <b-td stacked-heading="Accessories: Bracelets">69</b-td>
2671
- <b-td stacked-heading="Accessories: Rings">28</b-td>
2672
- </b-tr>
2673
- <b-tr>
2674
- <b-th rowspan="2" class="text-center">The Netherlands (2 Cities)</b-th>
2675
- <b-th stacked-heading="City">Amsterdam</b-th>
2676
- <b-td stacked-heading="Clothes: Trousers" variant="success">89</b-td>
2677
- <b-td stacked-heading="Clothes: Skirts">34</b-td>
2678
- <b-td stacked-heading="Clothes: Dresses">69</b-td>
2679
- <b-td stacked-heading="Accessories: Bracelets">85</b-td>
2680
- <b-td stacked-heading="Accessories: Rings">38</b-td>
2681
- </b-tr>
2682
- <b-tr>
2683
- <b-th stacked-heading="City">Utrecht</b-th>
2684
- <b-td stacked-heading="Clothes: Trousers">80</b-td>
2685
- <b-td stacked-heading="Clothes: Skirts" variant="danger">12</b-td>
2686
- <b-td stacked-heading="Clothes: Dresses">43</b-td>
2687
- <b-td stacked-heading="Accessories: Bracelets">36</b-td>
2688
- <b-td stacked-heading="Accessories: Rings" variant="warning">19</b-td>
2689
- </b-tr>
2690
- </b-tbody>
2691
- <b-tfoot>
2692
- <b-tr>
2693
- <b-td colspan="7" variant="secondary" class="text-right">
2694
- Total Rows: <b>5</b>
2695
- </b-td>
2696
- </b-tr>
2697
- </b-tfoot>
2698
- </b-table-simple>
2699
- </div>
2700
-
2701
- <!-- b-table-simple-stacked.vue -->
2702
- ```
2703
-
2704
- Like `<b-table>` and `<b-table-lite>`, table headers (`<thead>`) and footers (`<tfoot>`) are
2705
- visually hidden when the table is visually stacked. If you need a header or footer, you can do so by
2706
- creating an extra `<b-tr>` inside of the `<b-tbody>` component (or in a second `<b-tbody>`
2707
- component), and set a role of `columnheader` on the child `<b-th>` cells, and use Bootstrap v4
2708
- [responsive display utility classes](/docs/reference/utility-classes) to hide the extra row (or
2709
- `<b-tbody>`) above a certain breakpoint when the table is no longer visually stacked (the breakpoint
2710
- should match the stacked table breakpoint you have set), i.e. `<b-tr class="d-md-none">` would hide
2711
- the row on medium and wider screens, while `<b-tbody class="d-md-none">` would hide the row group on
2712
- medium and wider screens.
2713
-
2714
- **Note:** stacked mode with `<b-table-simple>` requires that you use the BootstrapVue
2715
- [table helper components](#table-helper-components). Use of the regular `<tbody>`, `<tr>`, `<td>`
2716
- and `<th>` element tags will not work as expected, nor will they automatically apply any of the
2717
- required accessibility attributes.
2718
-
2719
- ### Simple tables and sticky columns
2720
-
2721
- Sticky columns are supported with `<b-table-simple>`, but you will need to set the `sticky-column`
2722
- prop on each table cell (in the `thead`, `tbody`, and `tfoot` row groups) in the column that is to
2723
- be sticky. For example:
2724
-
2725
- ```html
2726
- <b-table-simple responsive>
2727
- <b-thead>
2728
- <b-tr>
2729
- <b-th sticky-column>Sticky Column Header</b-th>
2730
- <b-th>Heading 1</b-th>
2731
- <b-th>Heading 2</b-th>
2732
- <b-th>Heading 3</b-th>
2733
- <b-th>Heading 4</b-th>
2734
- </b-tr>
2735
- </b-thead>
2736
- <b-tbody>
2737
- <b-tr>
2738
- <b-th sticky-column>Sticky Column Row Header</b-th>
2739
- <b-td>Cell</b-td>
2740
- <b-td>Cell</b-td>
2741
- <b-td>Cell</b-td>
2742
- <b-td>Cell</b-td>
2743
- </b-tr>
2744
- <b-tr>
2745
- <b-th sticky-column>Sticky Column Row Header</b-th>
2746
- <b-td>Cell</b-td>
2747
- <b-td>Cell</b-td>
2748
- <b-td>Cell</b-td>
2749
- <b-td>Cell</b-td>
2750
- </b-tr>
2751
- </b-tbody>
2752
- <b-tfoot>
2753
- <b-tr>
2754
- <b-th sticky-column>Sticky Column Footer</b-th>
2755
- <b-th>Heading 1</b-th>
2756
- <b-th>Heading 2</b-th>
2757
- <b-th>Heading 3</b-th>
2758
- <b-th>Heading 4</b-th>
2759
- </b-tr>
2760
- </b-tfoot>
2761
- </b-table-simple>
2762
- ```
2763
-
2764
- As with `<b-table>` and `<b-table-lite>`, sticky columns are not supported when the `stacked` prop
2765
- is set on `<b-table-simple>`.
2766
-
2767
- ## Table helper components
2768
-
2769
- BootstrapVue provides additional helper child components when using `<b-table-simple>`, or the named
2770
- slots `top-row`, `bottom-row`, `thead-top`, and `custom-foot` (all of which accept table child
2771
- elements). The helper components are as follows:
2772
-
2773
- - `b-tbody` (`<b-table-simple>` only)
2774
- - `b-thead` (`<b-table-simple>` only)
2775
- - `b-tfoot` (`<b-table-simple>` only)
2776
- - `b-tr`
2777
- - `b-td`
2778
- - `b-th`
2779
-
2780
- These components are optimized to handle converting variants to the appropriate classes (such as
2781
- handling table `dark` mode), and automatically applying certain accessibility attributes (i.e.
2782
- `role`s and `scope`s). They also can generate the stacked table, and sticky header and column,
2783
- markup. Components `<b-table>` and `<b-table-lite>` use these helper components internally.
2784
-
2785
- In the [Simple tables](#simple-tables) example, we are using the helper components `<b-thead>`,
2786
- `<b-tbody>`, `<b-tr>`, `<b-th>`, `<b-td>` and `<b-tfoot>`. While you can use regular table child
2787
- elements (i.e. `<tbody>`, `<tr>`, `<td>`, etc.) within `<b-table-simple>`, and the named slots
2788
- `top-row`, `bottom-row`, and `thead-top`, it is recommended to use these BootstrapVue table `<b-t*>`
2789
- helper components. Note that there are no helper components for `<caption>`, `<colgroup>` or
2790
- `<col>`, so you may use these three HTML5 elements directly in `<b-table-simple>`.
2791
-
2792
- - Table helper components `<b-tr>`, `<b-td>` and `<b-th>` all accept a `variant` prop, which will
2793
- apply one of the Bootstrap theme colors (custom theme colors are supported via
2794
- [theming](/docs/reference/theming).) and will automatically adjust to use the correct variant
2795
- class based on the table's `dark` mode.
2796
- - The helper components `<b-thead>`, `<b-tfoot>` accept a `head-variant` and `foot-variant` prop
2797
- respectively. Supported values are `'dark'`, `'light'` or `null` (`null` uses the default table
2798
- background). These variants also control the text color (light text for `'dark'` variant, and dark
2799
- text for the `'light'` variant).
2800
- - Accessibility attributes `role` and `scope` are automatically set on `<b-th>` and `<b-td>`
2801
- components based on their location (thead, tbody, or tfoot) and their `rowspan` or `colspan`
2802
- props. You can override the automatic `scope` and `role` values by setting the appropriate
2803
- attribute on the helper component.
2804
- - For `<b-tbody>`, `<b-thead>`, and `<b-tfoot>` helper components, the appropriate default `role` of
2805
- `'rowgroup'` will be applied, unless you override the role by supplying a `role` attribute.
2806
- - For the `<b-tr>` helper component, the appropriate default `role` of `'row'` will be applied,
2807
- unless you override the role by supplying a `role` attribute. `<b-tr>` does not add a `scope`.
2808
- - The `<b-tbody>` element supports rendering a Vue `<transition-group>` when either, or both, of the
2809
- `tbody-transition-props` and `tbody-transition-handlers` props are used. See the
2810
- [Table body transition support](#table-body-transition-support) section for more details.
2811
-
2812
- ## Accessibility
2813
-
2814
- The `<b-table>` and `<b-table-lite>` components, when using specific features, will attempt to
2815
- provide the best accessibility markup possible.
2816
-
2817
- When using `<b-table-simple>` with the helper table components, elements will have the appropriate
2818
- roles applied by default, of which you can optionally override. When using click handlers on the
2819
- `<b-table-simple>` helper components, you will need to apply appropriate `aria-*` attributes, and
2820
- set `tabindex="0"` to make the click actions accessible to screen reader and keyboard-only users.
2821
- You should also listen for `@keydown.enter.prevent` to handle users pressing <kbd>Enter</kbd> to
2822
- trigger your click on cells or rows (required for accessibility for keyboard-only users).
2823
-
2824
- ### Heading accessibility
2825
-
2826
- When a column (field) is sortable (`<b-table>` only) or there is a `head-clicked` listener
2827
- registered (`<b-table>` and `<b-table-lite>`), the header (and footer) `<th>` cells will be placed
2828
- into the document tab sequence (via `tabindex="0"`) for accessibility by keyboard-only and screen
2829
- reader users, so that the user may trigger a click (by pressing <kbd>Enter</kbd> on the header
2830
- cells.
2831
-
2832
- ### Data row accessibility
2833
-
2834
- When the table is in `selectable` mode (`<b-table>` only, and prop `no-select-on-click` is not set),
2835
- or if there is a `row-clicked` event listener registered (`<b-table>` and `<b-table-lite>`), all
2836
- data item rows (`<tr>` elements) will be placed into the document tab sequence (via `tabindex="0"`)
2837
- to allow keyboard-only and screen reader users the ability to click the rows by pressing
2838
- <kbd>Enter</kbd> or <kbd>Space</kbd>.
2839
-
2840
- When the table items rows are placed in the document tab sequence (`<b-table>` and
2841
- `<b-table-lite>`), they will also support basic keyboard navigation when focused:
2842
-
2843
- - <kbd>Down</kbd> will move to the next row
2844
- - <kbd>Up</kbd> will move to the previous row
2845
- - <kbd>End</kbd> or <kbd>Down</kbd>+<kbd>Shift</kbd> will move to the last row
2846
- - <kbd>Home</kbd> or <kbd>Up</kbd>+<kbd>Shift</kbd> will move to the first row
2847
- - <kbd>Enter</kbd> or <kbd>Space</kbd> to click the row.
2848
-
2849
- ### Row event accessibility
2850
-
2851
- Note the following row based events/actions (available with `<b-table>` and `<b-table-lite>`) are
2852
- not considered accessible, and should only be used if the functionality is non critical or can be
2853
- provided via other means:
2854
-
2855
- - `row-dblclicked`
2856
- - `row-contextmenu`
2857
- - `row-hovered`
2858
- - `row-unhovered`
2859
- - `row-middle-clicked`
2860
-
2861
- Note that the `row-middle-clicked` event is not supported in all browsers (i.e. IE, Safari and most
2862
- mobile browsers). When listening for `row-middle-clicked` events originating on elements that do not
2863
- support input or navigation, you will often want to explicitly prevent other default actions mapped
2864
- to the down action of the middle mouse button. On Windows this is usually autoscroll, and on macOS
2865
- and Linux this is usually clipboard paste. This can be done by preventing the default behaviour of
2866
- the `mousedown` or `pointerdown` event.
2867
-
2868
- Additionally, you may need to avoid opening a default system or browser context menu after a right
2869
- click. Due to timing differences between operating systems, this too is not a preventable default
2870
- behaviour of `row-middle-clicked`. Instead, this can be done by preventing the default behaviour of
2871
- the `row-contextmenu` event.
2872
-
2873
- It is recommended you test your app in as many browser and device variants as possible to ensure
2874
- your app handles the various inconsistencies with events.
2875
-
2876
- ## Complete example
2877
-
2878
- ```html
2879
- <template>
2880
- <b-container fluid>
2881
- <!-- User Interface controls -->
2882
- <b-row>
2883
- <b-col lg="6" class="my-1">
2884
- <b-form-group
2885
- label="Sort"
2886
- label-for="sort-by-select"
2887
- label-cols-sm="3"
2888
- label-align-sm="right"
2889
- label-size="sm"
2890
- class="mb-0"
2891
- v-slot="{ ariaDescribedby }"
2892
- >
2893
- <b-input-group size="sm">
2894
- <b-form-select
2895
- id="sort-by-select"
2896
- v-model="sortBy"
2897
- :options="sortOptions"
2898
- :aria-describedby="ariaDescribedby"
2899
- class="w-75"
2900
- >
2901
- <template #first>
2902
- <option value="">-- none --</option>
2903
- </template>
2904
- </b-form-select>
2905
-
2906
- <b-form-select
2907
- v-model="sortDesc"
2908
- :disabled="!sortBy"
2909
- :aria-describedby="ariaDescribedby"
2910
- size="sm"
2911
- class="w-25"
2912
- >
2913
- <option :value="false">Asc</option>
2914
- <option :value="true">Desc</option>
2915
- </b-form-select>
2916
- </b-input-group>
2917
- </b-form-group>
2918
- </b-col>
2919
-
2920
- <b-col lg="6" class="my-1">
2921
- <b-form-group
2922
- label="Initial sort"
2923
- label-for="initial-sort-select"
2924
- label-cols-sm="3"
2925
- label-align-sm="right"
2926
- label-size="sm"
2927
- class="mb-0"
2928
- >
2929
- <b-form-select
2930
- id="initial-sort-select"
2931
- v-model="sortDirection"
2932
- :options="['asc', 'desc', 'last']"
2933
- size="sm"
2934
- ></b-form-select>
2935
- </b-form-group>
2936
- </b-col>
2937
-
2938
- <b-col lg="6" class="my-1">
2939
- <b-form-group
2940
- label="Filter"
2941
- label-for="filter-input"
2942
- label-cols-sm="3"
2943
- label-align-sm="right"
2944
- label-size="sm"
2945
- class="mb-0"
2946
- >
2947
- <b-input-group size="sm">
2948
- <b-form-input
2949
- id="filter-input"
2950
- v-model="filter"
2951
- type="search"
2952
- placeholder="Type to Search"
2953
- ></b-form-input>
2954
-
2955
- <b-input-group-append>
2956
- <b-button :disabled="!filter" @click="filter = ''">Clear</b-button>
2957
- </b-input-group-append>
2958
- </b-input-group>
2959
- </b-form-group>
2960
- </b-col>
2961
-
2962
- <b-col lg="6" class="my-1">
2963
- <b-form-group
2964
- v-model="sortDirection"
2965
- label="Filter On"
2966
- description="Leave all unchecked to filter on all data"
2967
- label-cols-sm="3"
2968
- label-align-sm="right"
2969
- label-size="sm"
2970
- class="mb-0"
2971
- v-slot="{ ariaDescribedby }"
2972
- >
2973
- <b-form-checkbox-group
2974
- v-model="filterOn"
2975
- :aria-describedby="ariaDescribedby"
2976
- class="mt-1"
2977
- >
2978
- <b-form-checkbox value="name">Name</b-form-checkbox>
2979
- <b-form-checkbox value="age">Age</b-form-checkbox>
2980
- <b-form-checkbox value="isActive">Active</b-form-checkbox>
2981
- </b-form-checkbox-group>
2982
- </b-form-group>
2983
- </b-col>
2984
-
2985
- <b-col sm="5" md="6" class="my-1">
2986
- <b-form-group
2987
- label="Per page"
2988
- label-for="per-page-select"
2989
- label-cols-sm="6"
2990
- label-cols-md="4"
2991
- label-cols-lg="3"
2992
- label-align-sm="right"
2993
- label-size="sm"
2994
- class="mb-0"
2995
- >
2996
- <b-form-select
2997
- id="per-page-select"
2998
- v-model="perPage"
2999
- :options="pageOptions"
3000
- size="sm"
3001
- ></b-form-select>
3002
- </b-form-group>
3003
- </b-col>
3004
-
3005
- <b-col sm="7" md="6" class="my-1">
3006
- <b-pagination
3007
- v-model="currentPage"
3008
- :total-rows="totalRows"
3009
- :per-page="perPage"
3010
- align="fill"
3011
- size="sm"
3012
- class="my-0"
3013
- ></b-pagination>
3014
- </b-col>
3015
- </b-row>
3016
-
3017
- <!-- Main table element -->
3018
- <b-table
3019
- :items="items"
3020
- :fields="fields"
3021
- :current-page="currentPage"
3022
- :per-page="perPage"
3023
- :filter="filter"
3024
- :filter-included-fields="filterOn"
3025
- :sort-by.sync="sortBy"
3026
- :sort-desc.sync="sortDesc"
3027
- :sort-direction="sortDirection"
3028
- stacked="md"
3029
- show-empty
3030
- small
3031
- @filtered="onFiltered"
3032
- >
3033
- <template #cell(name)="row">
3034
- {{ row.value.first }} {{ row.value.last }}
3035
- </template>
3036
-
3037
- <template #cell(actions)="row">
3038
- <b-button size="sm" @click="info(row.item, row.index, $event.target)" class="mr-1">
3039
- Info modal
3040
- </b-button>
3041
- <b-button size="sm" @click="row.toggleDetails">
3042
- {{ row.detailsShowing ? 'Hide' : 'Show' }} Details
3043
- </b-button>
3044
- </template>
3045
-
3046
- <template #row-details="row">
3047
- <b-card>
3048
- <ul>
3049
- <li v-for="(value, key) in row.item" :key="key">{{ key }}: {{ value }}</li>
3050
- </ul>
3051
- </b-card>
3052
- </template>
3053
- </b-table>
3054
-
3055
- <!-- Info modal -->
3056
- <b-modal :id="infoModal.id" :title="infoModal.title" ok-only @hide="resetInfoModal">
3057
- <pre>{{ infoModal.content }}</pre>
3058
- </b-modal>
3059
- </b-container>
3060
- </template>
3061
-
3062
- <script>
3063
- export default {
3064
- data() {
3065
- return {
3066
- items: [
3067
- { isActive: true, age: 40, name: { first: 'Dickerson', last: 'Macdonald' } },
3068
- { isActive: false, age: 21, name: { first: 'Larsen', last: 'Shaw' } },
3069
- {
3070
- isActive: false,
3071
- age: 9,
3072
- name: { first: 'Mini', last: 'Navarro' },
3073
- _rowVariant: 'success'
3074
- },
3075
- { isActive: false, age: 89, name: { first: 'Geneva', last: 'Wilson' } },
3076
- { isActive: true, age: 38, name: { first: 'Jami', last: 'Carney' } },
3077
- { isActive: false, age: 27, name: { first: 'Essie', last: 'Dunlap' } },
3078
- { isActive: true, age: 40, name: { first: 'Thor', last: 'Macdonald' } },
3079
- {
3080
- isActive: true,
3081
- age: 87,
3082
- name: { first: 'Larsen', last: 'Shaw' },
3083
- _cellVariants: { age: 'danger', isActive: 'warning' }
3084
- },
3085
- { isActive: false, age: 26, name: { first: 'Mitzi', last: 'Navarro' } },
3086
- { isActive: false, age: 22, name: { first: 'Genevieve', last: 'Wilson' } },
3087
- { isActive: true, age: 38, name: { first: 'John', last: 'Carney' } },
3088
- { isActive: false, age: 29, name: { first: 'Dick', last: 'Dunlap' } }
3089
- ],
3090
- fields: [
3091
- { key: 'name', label: 'Person full name', sortable: true, sortDirection: 'desc' },
3092
- { key: 'age', label: 'Person age', sortable: true, class: 'text-center' },
3093
- {
3094
- key: 'isActive',
3095
- label: 'Is Active',
3096
- formatter: (value, key, item) => {
3097
- return value ? 'Yes' : 'No'
3098
- },
3099
- sortable: true,
3100
- sortByFormatted: true,
3101
- filterByFormatted: true
3102
- },
3103
- { key: 'actions', label: 'Actions' }
3104
- ],
3105
- totalRows: 1,
3106
- currentPage: 1,
3107
- perPage: 5,
3108
- pageOptions: [5, 10, 15, { value: 100, text: "Show a lot" }],
3109
- sortBy: '',
3110
- sortDesc: false,
3111
- sortDirection: 'asc',
3112
- filter: null,
3113
- filterOn: [],
3114
- infoModal: {
3115
- id: 'info-modal',
3116
- title: '',
3117
- content: ''
3118
- }
3119
- }
3120
- },
3121
- computed: {
3122
- sortOptions() {
3123
- // Create an options list from our fields
3124
- return this.fields
3125
- .filter(f => f.sortable)
3126
- .map(f => {
3127
- return { text: f.label, value: f.key }
3128
- })
3129
- }
3130
- },
3131
- mounted() {
3132
- // Set the initial number of items
3133
- this.totalRows = this.items.length
3134
- },
3135
- methods: {
3136
- info(item, index, button) {
3137
- this.infoModal.title = `Row index: ${index}`
3138
- this.infoModal.content = JSON.stringify(item, null, 2)
3139
- this.$root.$emit('bv::show::modal', this.infoModal.id, button)
3140
- },
3141
- resetInfoModal() {
3142
- this.infoModal.title = ''
3143
- this.infoModal.content = ''
3144
- },
3145
- onFiltered(filteredItems) {
3146
- // Trigger pagination to update the number of buttons/pages due to filtering
3147
- this.totalRows = filteredItems.length
3148
- this.currentPage = 1
3149
- }
3150
- }
3151
- }
3152
- </script>
3153
-
3154
- <!-- b-table-complete.vue -->
3155
- ```
3156
-
3157
- <!-- Component reference added automatically from component package.json -->