@gitlab/ui 92.2.0 → 92.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (440) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/bin/migrate_custom_utils_to_tw.bundled.mjs +11 -3
  3. package/dist/index.css +4 -2
  4. package/dist/index.css.map +1 -1
  5. package/dist/tailwind.css +1 -1
  6. package/dist/tailwind.css.map +1 -1
  7. package/dist/vendor/bootstrap-vue/src/components/form/index.js +0 -4
  8. package/dist/vendor/bootstrap-vue/src/components/index.js +0 -48
  9. package/dist/vendor/bootstrap-vue/src/components/layout/index.js +0 -6
  10. package/dist/vendor/bootstrap-vue/src/components/nav/index.js +0 -6
  11. package/dist/vendor/bootstrap-vue/src/components/navbar/index.js +1 -8
  12. package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip.js +2 -6
  13. package/dist/vendor/bootstrap-vue/src/constants/classes.js +1 -2
  14. package/dist/vendor/bootstrap-vue/src/constants/components.js +1 -51
  15. package/dist/vendor/bootstrap-vue/src/constants/events.js +1 -12
  16. package/dist/vendor/bootstrap-vue/src/constants/key-codes.js +1 -5
  17. package/dist/vendor/bootstrap-vue/src/constants/props.js +1 -4
  18. package/dist/vendor/bootstrap-vue/src/constants/regex.js +1 -20
  19. package/dist/vendor/bootstrap-vue/src/constants/slots.js +1 -33
  20. package/dist/vendor/bootstrap-vue/src/directives/toggle/toggle.js +1 -1
  21. package/dist/vendor/bootstrap-vue/src/index.js +0 -74
  22. package/dist/vendor/bootstrap-vue/src/utils/array.js +1 -3
  23. package/dist/vendor/bootstrap-vue/src/utils/inspect.js +1 -3
  24. package/dist/vendor/bootstrap-vue/src/utils/math.js +1 -3
  25. package/dist/vendor/bootstrap-vue/src/utils/object.js +1 -6
  26. package/dist/vendor/bootstrap-vue/src/utils/props.js +2 -8
  27. package/dist/vendor/bootstrap-vue/src/utils/string.js +1 -10
  28. package/package.json +1 -1
  29. package/src/components/base/accordion/accordion_item.scss +3 -3
  30. package/src/components/base/alert/alert.scss +3 -3
  31. package/src/components/base/avatar_labeled/avatar_labeled.scss +2 -2
  32. package/src/components/base/avatars_inline/avatars_inline.scss +1 -1
  33. package/src/components/base/badge/badge.scss +2 -2
  34. package/src/components/base/banner/banner.scss +2 -2
  35. package/src/components/base/breadcrumb/breadcrumb.scss +3 -3
  36. package/src/components/base/broadcast_message/broadcast_message.scss +3 -3
  37. package/src/components/base/button/button.scss +14 -14
  38. package/src/components/base/card/card.scss +1 -1
  39. package/src/components/base/datepicker/datepicker.scss +10 -10
  40. package/src/components/base/drawer/drawer.scss +5 -5
  41. package/src/components/base/dropdown/dropdown.scss +28 -28
  42. package/src/components/base/dropdown/dropdown_divider.scss +3 -3
  43. package/src/components/base/dropdown/dropdown_item.scss +9 -9
  44. package/src/components/base/dropdown/dropdown_section_header.scss +2 -2
  45. package/src/components/base/dropdown/dropdown_text.scss +1 -1
  46. package/src/components/base/filtered_search/filtered_search.scss +7 -7
  47. package/src/components/base/filtered_search/filtered_search_suggestion.scss +1 -1
  48. package/src/components/base/filtered_search/filtered_search_suggestion_list.scss +3 -3
  49. package/src/components/base/filtered_search/filtered_search_term.scss +2 -2
  50. package/src/components/base/filtered_search/filtered_search_token.scss +4 -4
  51. package/src/components/base/filtered_search/filtered_search_token_segment.scss +2 -2
  52. package/src/components/base/form/form_checkbox/form_checkbox.scss +10 -10
  53. package/src/components/base/form/form_group/form_group.scss +5 -5
  54. package/src/components/base/form/form_input/form_input.scss +2 -2
  55. package/src/components/base/form/form_select/form_select.scss +2 -2
  56. package/src/components/base/keyset_pagination/keyset_pagination.scss +1 -1
  57. package/src/components/base/label/label.scss +1 -1
  58. package/src/components/base/loading_icon/loading_icon.scss +1 -1
  59. package/src/components/base/markdown/markdown.scss +33 -33
  60. package/src/components/base/modal/modal.scss +11 -11
  61. package/src/components/base/new_dropdowns/dropdown.scss +14 -14
  62. package/src/components/base/new_dropdowns/dropdown_item.scss +9 -9
  63. package/src/components/base/new_dropdowns/listbox/listbox.scss +1 -1
  64. package/src/components/base/pagination/pagination.scss +3 -3
  65. package/src/components/base/path/path.scss +5 -5
  66. package/src/components/base/popover/popover.scss +5 -5
  67. package/src/components/base/search_box_by_click/search_box_by_click.scss +2 -2
  68. package/src/components/base/search_box_by_type/search_box_by_type.scss +4 -4
  69. package/src/components/base/table/table.scss +4 -4
  70. package/src/components/base/tabs/tabs/tabs.scss +10 -10
  71. package/src/components/base/toast/toast.scss +7 -7
  72. package/src/components/base/toggle/toggle.scss +6 -6
  73. package/src/components/base/token/token.scss +5 -5
  74. package/src/components/base/tooltip/tooltip.scss +3 -3
  75. package/src/components/charts/legend/legend.scss +4 -4
  76. package/src/components/charts/series_label/series_label.scss +1 -1
  77. package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.scss +1 -1
  78. package/src/components/experimental/duo/chat/duo_chat.scss +4 -4
  79. package/src/components/shared_components/charts/tooltip_default_format.scss +1 -1
  80. package/src/scss/bootstrap_vue.scss +0 -18
  81. package/src/scss/typescale/_index.scss +9 -9
  82. package/src/vendor/bootstrap-vue/nuxt/index.js +0 -8
  83. package/src/vendor/bootstrap-vue/src/_utilities.scss +0 -9
  84. package/src/vendor/bootstrap-vue/src/_variables.scss +0 -52
  85. package/src/vendor/bootstrap-vue/src/components/form/index.d.ts +0 -3
  86. package/src/vendor/bootstrap-vue/src/components/form/index.js +1 -4
  87. package/src/vendor/bootstrap-vue/src/components/form/package.json +0 -12
  88. package/src/vendor/bootstrap-vue/src/components/index.d.ts +0 -24
  89. package/src/vendor/bootstrap-vue/src/components/index.js +0 -48
  90. package/src/vendor/bootstrap-vue/src/components/index.scss +0 -15
  91. package/src/vendor/bootstrap-vue/src/components/layout/index.d.ts +0 -6
  92. package/src/vendor/bootstrap-vue/src/components/layout/index.js +1 -5
  93. package/src/vendor/bootstrap-vue/src/components/layout/package.json +0 -67
  94. package/src/vendor/bootstrap-vue/src/components/modal/README.md +0 -1
  95. package/src/vendor/bootstrap-vue/src/components/nav/index.d.ts +0 -6
  96. package/src/vendor/bootstrap-vue/src/components/nav/index.js +1 -5
  97. package/src/vendor/bootstrap-vue/src/components/nav/package.json +0 -45
  98. package/src/vendor/bootstrap-vue/src/components/navbar/README.md +0 -5
  99. package/src/vendor/bootstrap-vue/src/components/navbar/index.d.ts +1 -7
  100. package/src/vendor/bootstrap-vue/src/components/navbar/index.js +2 -7
  101. package/src/vendor/bootstrap-vue/src/components/navbar/package.json +0 -75
  102. package/src/vendor/bootstrap-vue/src/components/table/README.md +1 -2
  103. package/src/vendor/bootstrap-vue/src/components/tabs/README.md +2 -2
  104. package/src/vendor/bootstrap-vue/src/components/toast/README.md +1 -3
  105. package/src/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip.js +2 -6
  106. package/src/vendor/bootstrap-vue/src/constants/classes.js +0 -1
  107. package/src/vendor/bootstrap-vue/src/constants/components.js +0 -50
  108. package/src/vendor/bootstrap-vue/src/constants/events.js +0 -11
  109. package/src/vendor/bootstrap-vue/src/constants/key-codes.js +0 -4
  110. package/src/vendor/bootstrap-vue/src/constants/props.js +0 -3
  111. package/src/vendor/bootstrap-vue/src/constants/regex.js +0 -19
  112. package/src/vendor/bootstrap-vue/src/constants/slots.js +0 -32
  113. package/src/vendor/bootstrap-vue/src/directives/toggle/README.md +5 -23
  114. package/src/vendor/bootstrap-vue/src/directives/toggle/package.json +1 -1
  115. package/src/vendor/bootstrap-vue/src/directives/toggle/toggle.js +1 -1
  116. package/src/vendor/bootstrap-vue/src/index.js +0 -122
  117. package/src/vendor/bootstrap-vue/src/index.scss +0 -3
  118. package/src/vendor/bootstrap-vue/src/utils/array.js +0 -5
  119. package/src/vendor/bootstrap-vue/src/utils/config.spec.js +15 -15
  120. package/src/vendor/bootstrap-vue/src/utils/inspect.js +0 -4
  121. package/src/vendor/bootstrap-vue/src/utils/math.js +0 -4
  122. package/src/vendor/bootstrap-vue/src/utils/object.js +0 -5
  123. package/src/vendor/bootstrap-vue/src/utils/props.js +1 -7
  124. package/src/vendor/bootstrap-vue/src/utils/string.js +0 -9
  125. package/src/vendor/bootstrap-vue/src/utils/string.spec.js +1 -20
  126. package/dist/vendor/bootstrap-vue/src/components/alert/alert.js +0 -179
  127. package/dist/vendor/bootstrap-vue/src/components/alert/index.js +0 -11
  128. package/dist/vendor/bootstrap-vue/src/components/aspect/aspect.js +0 -67
  129. package/dist/vendor/bootstrap-vue/src/components/aspect/index.js +0 -11
  130. package/dist/vendor/bootstrap-vue/src/components/avatar/avatar-group.js +0 -67
  131. package/dist/vendor/bootstrap-vue/src/components/avatar/avatar.js +0 -266
  132. package/dist/vendor/bootstrap-vue/src/components/avatar/index.js +0 -14
  133. package/dist/vendor/bootstrap-vue/src/components/button-toolbar/button-toolbar.js +0 -112
  134. package/dist/vendor/bootstrap-vue/src/components/button-toolbar/index.js +0 -12
  135. package/dist/vendor/bootstrap-vue/src/components/calendar/calendar.js +0 -1010
  136. package/dist/vendor/bootstrap-vue/src/components/calendar/index.js +0 -11
  137. package/dist/vendor/bootstrap-vue/src/components/card/card-body.js +0 -63
  138. package/dist/vendor/bootstrap-vue/src/components/card/card-footer.js +0 -48
  139. package/dist/vendor/bootstrap-vue/src/components/card/card-group.js +0 -33
  140. package/dist/vendor/bootstrap-vue/src/components/card/card-header.js +0 -48
  141. package/dist/vendor/bootstrap-vue/src/components/card/card-img-lazy.js +0 -46
  142. package/dist/vendor/bootstrap-vue/src/components/card/card-img.js +0 -58
  143. package/dist/vendor/bootstrap-vue/src/components/card/card-sub-title.js +0 -35
  144. package/dist/vendor/bootstrap-vue/src/components/card/card-text.js +0 -31
  145. package/dist/vendor/bootstrap-vue/src/components/card/card-title.js +0 -33
  146. package/dist/vendor/bootstrap-vue/src/components/card/card.js +0 -123
  147. package/dist/vendor/bootstrap-vue/src/components/card/index.js +0 -38
  148. package/dist/vendor/bootstrap-vue/src/components/embed/embed.js +0 -50
  149. package/dist/vendor/bootstrap-vue/src/components/embed/index.js +0 -11
  150. package/dist/vendor/bootstrap-vue/src/components/form/form-datalist.js +0 -52
  151. package/dist/vendor/bootstrap-vue/src/components/form-btn-label-control/bv-form-btn-label-control.js +0 -261
  152. package/dist/vendor/bootstrap-vue/src/components/form-datepicker/form-datepicker.js +0 -310
  153. package/dist/vendor/bootstrap-vue/src/components/form-datepicker/index.js +0 -12
  154. package/dist/vendor/bootstrap-vue/src/components/form-file/form-file.js +0 -561
  155. package/dist/vendor/bootstrap-vue/src/components/form-file/index.js +0 -12
  156. package/dist/vendor/bootstrap-vue/src/components/form-rating/form-rating.js +0 -402
  157. package/dist/vendor/bootstrap-vue/src/components/form-rating/index.js +0 -12
  158. package/dist/vendor/bootstrap-vue/src/components/form-spinbutton/form-spinbutton.js +0 -555
  159. package/dist/vendor/bootstrap-vue/src/components/form-spinbutton/index.js +0 -12
  160. package/dist/vendor/bootstrap-vue/src/components/form-tags/form-tag.js +0 -97
  161. package/dist/vendor/bootstrap-vue/src/components/form-tags/form-tags.js +0 -806
  162. package/dist/vendor/bootstrap-vue/src/components/form-tags/index.js +0 -16
  163. package/dist/vendor/bootstrap-vue/src/components/form-timepicker/form-timepicker.js +0 -281
  164. package/dist/vendor/bootstrap-vue/src/components/form-timepicker/index.js +0 -12
  165. package/dist/vendor/bootstrap-vue/src/components/image/img-lazy.js +0 -157
  166. package/dist/vendor/bootstrap-vue/src/components/image/img.js +0 -124
  167. package/dist/vendor/bootstrap-vue/src/components/image/index.js +0 -14
  168. package/dist/vendor/bootstrap-vue/src/components/jumbotron/index.js +0 -11
  169. package/dist/vendor/bootstrap-vue/src/components/jumbotron/jumbotron.js +0 -98
  170. package/dist/vendor/bootstrap-vue/src/components/layout/container.js +0 -41
  171. package/dist/vendor/bootstrap-vue/src/components/layout/row.js +0 -113
  172. package/dist/vendor/bootstrap-vue/src/components/list-group/index.js +0 -14
  173. package/dist/vendor/bootstrap-vue/src/components/list-group/list-group-item.js +0 -78
  174. package/dist/vendor/bootstrap-vue/src/components/list-group/list-group.js +0 -42
  175. package/dist/vendor/bootstrap-vue/src/components/media/index.js +0 -17
  176. package/dist/vendor/bootstrap-vue/src/components/media/media-aside.js +0 -41
  177. package/dist/vendor/bootstrap-vue/src/components/media/media-body.js +0 -31
  178. package/dist/vendor/bootstrap-vue/src/components/media/media.js +0 -61
  179. package/dist/vendor/bootstrap-vue/src/components/nav/nav-form.js +0 -45
  180. package/dist/vendor/bootstrap-vue/src/components/nav/nav-text.js +0 -26
  181. package/dist/vendor/bootstrap-vue/src/components/navbar/navbar-nav.js +0 -46
  182. package/dist/vendor/bootstrap-vue/src/components/navbar/navbar-toggle.js +0 -89
  183. package/dist/vendor/bootstrap-vue/src/components/overlay/index.js +0 -11
  184. package/dist/vendor/bootstrap-vue/src/components/overlay/overlay.js +0 -163
  185. package/dist/vendor/bootstrap-vue/src/components/pagination/index.js +0 -11
  186. package/dist/vendor/bootstrap-vue/src/components/pagination/pagination.js +0 -135
  187. package/dist/vendor/bootstrap-vue/src/components/pagination-nav/index.js +0 -11
  188. package/dist/vendor/bootstrap-vue/src/components/pagination-nav/pagination-nav.js +0 -299
  189. package/dist/vendor/bootstrap-vue/src/components/sidebar/index.js +0 -15
  190. package/dist/vendor/bootstrap-vue/src/components/sidebar/sidebar.js +0 -432
  191. package/dist/vendor/bootstrap-vue/src/components/skeleton/index.js +0 -23
  192. package/dist/vendor/bootstrap-vue/src/components/skeleton/skeleton-icon.js +0 -47
  193. package/dist/vendor/bootstrap-vue/src/components/skeleton/skeleton-img.js +0 -60
  194. package/dist/vendor/bootstrap-vue/src/components/skeleton/skeleton-table.js +0 -64
  195. package/dist/vendor/bootstrap-vue/src/components/skeleton/skeleton-wrapper.js +0 -46
  196. package/dist/vendor/bootstrap-vue/src/components/skeleton/skeleton.js +0 -49
  197. package/dist/vendor/bootstrap-vue/src/components/spinner/index.js +0 -11
  198. package/dist/vendor/bootstrap-vue/src/components/spinner/spinner.js +0 -55
  199. package/dist/vendor/bootstrap-vue/src/components/time/index.js +0 -11
  200. package/dist/vendor/bootstrap-vue/src/components/time/time.js +0 -600
  201. package/dist/vendor/bootstrap-vue/src/constants/date.js +0 -8
  202. package/dist/vendor/bootstrap-vue/src/mixins/card.js +0 -22
  203. package/dist/vendor/bootstrap-vue/src/mixins/pagination.js +0 -598
  204. package/dist/vendor/bootstrap-vue/src/utils/date.js +0 -135
  205. package/src/vendor/bootstrap-vue/src/_custom-controls.scss +0 -30
  206. package/src/vendor/bootstrap-vue/src/components/alert/README.md +0 -280
  207. package/src/vendor/bootstrap-vue/src/components/alert/alert.js +0 -185
  208. package/src/vendor/bootstrap-vue/src/components/alert/alert.spec.js +0 -442
  209. package/src/vendor/bootstrap-vue/src/components/alert/index.d.ts +0 -13
  210. package/src/vendor/bootstrap-vue/src/components/alert/index.js +0 -8
  211. package/src/vendor/bootstrap-vue/src/components/alert/package.json +0 -72
  212. package/src/vendor/bootstrap-vue/src/components/aspect/README.md +0 -65
  213. package/src/vendor/bootstrap-vue/src/components/aspect/aspect.js +0 -65
  214. package/src/vendor/bootstrap-vue/src/components/aspect/aspect.spec.js +0 -121
  215. package/src/vendor/bootstrap-vue/src/components/aspect/index.d.ts +0 -11
  216. package/src/vendor/bootstrap-vue/src/components/aspect/index.js +0 -8
  217. package/src/vendor/bootstrap-vue/src/components/aspect/package.json +0 -26
  218. package/src/vendor/bootstrap-vue/src/components/avatar/README.md +0 -567
  219. package/src/vendor/bootstrap-vue/src/components/avatar/_avatar.scss +0 -148
  220. package/src/vendor/bootstrap-vue/src/components/avatar/avatar-group.js +0 -75
  221. package/src/vendor/bootstrap-vue/src/components/avatar/avatar-group.spec.js +0 -74
  222. package/src/vendor/bootstrap-vue/src/components/avatar/avatar.js +0 -228
  223. package/src/vendor/bootstrap-vue/src/components/avatar/avatar.spec.js +0 -355
  224. package/src/vendor/bootstrap-vue/src/components/avatar/index.d.ts +0 -14
  225. package/src/vendor/bootstrap-vue/src/components/avatar/index.js +0 -9
  226. package/src/vendor/bootstrap-vue/src/components/avatar/index.scss +0 -1
  227. package/src/vendor/bootstrap-vue/src/components/avatar/package.json +0 -149
  228. package/src/vendor/bootstrap-vue/src/components/button-toolbar/README.md +0 -109
  229. package/src/vendor/bootstrap-vue/src/components/button-toolbar/button-toolbar.js +0 -117
  230. package/src/vendor/bootstrap-vue/src/components/button-toolbar/button-toolbar.spec.js +0 -185
  231. package/src/vendor/bootstrap-vue/src/components/button-toolbar/index.d.ts +0 -11
  232. package/src/vendor/bootstrap-vue/src/components/button-toolbar/index.js +0 -11
  233. package/src/vendor/bootstrap-vue/src/components/button-toolbar/package.json +0 -32
  234. package/src/vendor/bootstrap-vue/src/components/calendar/README.md +0 -735
  235. package/src/vendor/bootstrap-vue/src/components/calendar/_calendar.scss +0 -78
  236. package/src/vendor/bootstrap-vue/src/components/calendar/calendar.js +0 -1146
  237. package/src/vendor/bootstrap-vue/src/components/calendar/calendar.spec.js +0 -466
  238. package/src/vendor/bootstrap-vue/src/components/calendar/index.d.ts +0 -28
  239. package/src/vendor/bootstrap-vue/src/components/calendar/index.js +0 -8
  240. package/src/vendor/bootstrap-vue/src/components/calendar/index.scss +0 -1
  241. package/src/vendor/bootstrap-vue/src/components/calendar/package.json +0 -317
  242. package/src/vendor/bootstrap-vue/src/components/card/README.md +0 -729
  243. package/src/vendor/bootstrap-vue/src/components/card/_card-img.scss +0 -7
  244. package/src/vendor/bootstrap-vue/src/components/card/card-body.js +0 -69
  245. package/src/vendor/bootstrap-vue/src/components/card/card-body.spec.js +0 -142
  246. package/src/vendor/bootstrap-vue/src/components/card/card-footer.js +0 -48
  247. package/src/vendor/bootstrap-vue/src/components/card/card-footer.spec.js +0 -98
  248. package/src/vendor/bootstrap-vue/src/components/card/card-group.js +0 -33
  249. package/src/vendor/bootstrap-vue/src/components/card/card-group.spec.js +0 -75
  250. package/src/vendor/bootstrap-vue/src/components/card/card-header.js +0 -48
  251. package/src/vendor/bootstrap-vue/src/components/card/card-header.spec.js +0 -98
  252. package/src/vendor/bootstrap-vue/src/components/card/card-img-lazy.js +0 -47
  253. package/src/vendor/bootstrap-vue/src/components/card/card-img-lazy.spec.js +0 -204
  254. package/src/vendor/bootstrap-vue/src/components/card/card-img.js +0 -50
  255. package/src/vendor/bootstrap-vue/src/components/card/card-img.spec.js +0 -208
  256. package/src/vendor/bootstrap-vue/src/components/card/card-sub-title.js +0 -35
  257. package/src/vendor/bootstrap-vue/src/components/card/card-sub-title.spec.js +0 -60
  258. package/src/vendor/bootstrap-vue/src/components/card/card-text.js +0 -25
  259. package/src/vendor/bootstrap-vue/src/components/card/card-text.spec.js +0 -48
  260. package/src/vendor/bootstrap-vue/src/components/card/card-title.js +0 -33
  261. package/src/vendor/bootstrap-vue/src/components/card/card-title.spec.js +0 -45
  262. package/src/vendor/bootstrap-vue/src/components/card/card.js +0 -140
  263. package/src/vendor/bootstrap-vue/src/components/card/card.spec.js +0 -296
  264. package/src/vendor/bootstrap-vue/src/components/card/index.d.ts +0 -38
  265. package/src/vendor/bootstrap-vue/src/components/card/index.js +0 -40
  266. package/src/vendor/bootstrap-vue/src/components/card/index.scss +0 -1
  267. package/src/vendor/bootstrap-vue/src/components/card/package.json +0 -262
  268. package/src/vendor/bootstrap-vue/src/components/embed/README.md +0 -63
  269. package/src/vendor/bootstrap-vue/src/components/embed/embed.js +0 -51
  270. package/src/vendor/bootstrap-vue/src/components/embed/embed.spec.js +0 -110
  271. package/src/vendor/bootstrap-vue/src/components/embed/index.d.ts +0 -11
  272. package/src/vendor/bootstrap-vue/src/components/embed/index.js +0 -8
  273. package/src/vendor/bootstrap-vue/src/components/embed/package.json +0 -29
  274. package/src/vendor/bootstrap-vue/src/components/form/form-datalist.js +0 -42
  275. package/src/vendor/bootstrap-vue/src/components/form/form-datalist.spec.js +0 -57
  276. package/src/vendor/bootstrap-vue/src/components/form-btn-label-control/_form-btn-label-control.scss +0 -125
  277. package/src/vendor/bootstrap-vue/src/components/form-btn-label-control/bv-form-btn-label-control.js +0 -278
  278. package/src/vendor/bootstrap-vue/src/components/form-btn-label-control/index.scss +0 -1
  279. package/src/vendor/bootstrap-vue/src/components/form-btn-label-control/package.json +0 -5
  280. package/src/vendor/bootstrap-vue/src/components/form-datepicker/README.md +0 -694
  281. package/src/vendor/bootstrap-vue/src/components/form-datepicker/_form-datepicker.scss +0 -1
  282. package/src/vendor/bootstrap-vue/src/components/form-datepicker/form-datepicker.js +0 -342
  283. package/src/vendor/bootstrap-vue/src/components/form-datepicker/form-datepicker.spec.js +0 -562
  284. package/src/vendor/bootstrap-vue/src/components/form-datepicker/index.d.ts +0 -12
  285. package/src/vendor/bootstrap-vue/src/components/form-datepicker/index.js +0 -11
  286. package/src/vendor/bootstrap-vue/src/components/form-datepicker/index.scss +0 -1
  287. package/src/vendor/bootstrap-vue/src/components/form-datepicker/package.json +0 -420
  288. package/src/vendor/bootstrap-vue/src/components/form-file/README.md +0 -357
  289. package/src/vendor/bootstrap-vue/src/components/form-file/_form-file.scss +0 -61
  290. package/src/vendor/bootstrap-vue/src/components/form-file/form-file.js +0 -575
  291. package/src/vendor/bootstrap-vue/src/components/form-file/form-file.spec.js +0 -885
  292. package/src/vendor/bootstrap-vue/src/components/form-file/index.d.ts +0 -13
  293. package/src/vendor/bootstrap-vue/src/components/form-file/index.js +0 -11
  294. package/src/vendor/bootstrap-vue/src/components/form-file/index.scss +0 -1
  295. package/src/vendor/bootstrap-vue/src/components/form-file/package.json +0 -131
  296. package/src/vendor/bootstrap-vue/src/components/form-rating/README.md +0 -526
  297. package/src/vendor/bootstrap-vue/src/components/form-rating/_form-rating.scss +0 -57
  298. package/src/vendor/bootstrap-vue/src/components/form-rating/form-rating.js +0 -411
  299. package/src/vendor/bootstrap-vue/src/components/form-rating/form-rating.spec.js +0 -544
  300. package/src/vendor/bootstrap-vue/src/components/form-rating/index.d.ts +0 -14
  301. package/src/vendor/bootstrap-vue/src/components/form-rating/index.js +0 -8
  302. package/src/vendor/bootstrap-vue/src/components/form-rating/index.scss +0 -1
  303. package/src/vendor/bootstrap-vue/src/components/form-rating/package.json +0 -166
  304. package/src/vendor/bootstrap-vue/src/components/form-spinbutton/README.md +0 -411
  305. package/src/vendor/bootstrap-vue/src/components/form-spinbutton/_spinbutton.scss +0 -76
  306. package/src/vendor/bootstrap-vue/src/components/form-spinbutton/form-spinbutton.js +0 -572
  307. package/src/vendor/bootstrap-vue/src/components/form-spinbutton/form-spinbutton.spec.js +0 -731
  308. package/src/vendor/bootstrap-vue/src/components/form-spinbutton/index.d.ts +0 -12
  309. package/src/vendor/bootstrap-vue/src/components/form-spinbutton/index.js +0 -11
  310. package/src/vendor/bootstrap-vue/src/components/form-spinbutton/index.scss +0 -1
  311. package/src/vendor/bootstrap-vue/src/components/form-spinbutton/package.json +0 -150
  312. package/src/vendor/bootstrap-vue/src/components/form-tags/README.md +0 -880
  313. package/src/vendor/bootstrap-vue/src/components/form-tags/_form-tags.scss +0 -70
  314. package/src/vendor/bootstrap-vue/src/components/form-tags/form-tag.js +0 -94
  315. package/src/vendor/bootstrap-vue/src/components/form-tags/form-tag.spec.js +0 -166
  316. package/src/vendor/bootstrap-vue/src/components/form-tags/form-tags.js +0 -891
  317. package/src/vendor/bootstrap-vue/src/components/form-tags/form-tags.spec.js +0 -920
  318. package/src/vendor/bootstrap-vue/src/components/form-tags/index.d.ts +0 -16
  319. package/src/vendor/bootstrap-vue/src/components/form-tags/index.js +0 -14
  320. package/src/vendor/bootstrap-vue/src/components/form-tags/index.scss +0 -1
  321. package/src/vendor/bootstrap-vue/src/components/form-tags/package.json +0 -440
  322. package/src/vendor/bootstrap-vue/src/components/form-timepicker/README.md +0 -450
  323. package/src/vendor/bootstrap-vue/src/components/form-timepicker/_form-timepicker.scss +0 -1
  324. package/src/vendor/bootstrap-vue/src/components/form-timepicker/form-timepicker.js +0 -308
  325. package/src/vendor/bootstrap-vue/src/components/form-timepicker/form-timepicker.spec.js +0 -440
  326. package/src/vendor/bootstrap-vue/src/components/form-timepicker/index.d.ts +0 -12
  327. package/src/vendor/bootstrap-vue/src/components/form-timepicker/index.js +0 -11
  328. package/src/vendor/bootstrap-vue/src/components/form-timepicker/index.scss +0 -1
  329. package/src/vendor/bootstrap-vue/src/components/form-timepicker/package.json +0 -255
  330. package/src/vendor/bootstrap-vue/src/components/image/README.md +0 -322
  331. package/src/vendor/bootstrap-vue/src/components/image/img-lazy.js +0 -161
  332. package/src/vendor/bootstrap-vue/src/components/image/img-lazy.spec.js +0 -96
  333. package/src/vendor/bootstrap-vue/src/components/image/img.js +0 -139
  334. package/src/vendor/bootstrap-vue/src/components/image/img.spec.js +0 -255
  335. package/src/vendor/bootstrap-vue/src/components/image/index.d.ts +0 -14
  336. package/src/vendor/bootstrap-vue/src/components/image/index.js +0 -12
  337. package/src/vendor/bootstrap-vue/src/components/image/package.json +0 -152
  338. package/src/vendor/bootstrap-vue/src/components/jumbotron/README.md +0 -109
  339. package/src/vendor/bootstrap-vue/src/components/jumbotron/index.d.ts +0 -11
  340. package/src/vendor/bootstrap-vue/src/components/jumbotron/index.js +0 -8
  341. package/src/vendor/bootstrap-vue/src/components/jumbotron/jumbotron.js +0 -103
  342. package/src/vendor/bootstrap-vue/src/components/jumbotron/jumbotron.spec.js +0 -254
  343. package/src/vendor/bootstrap-vue/src/components/jumbotron/package.json +0 -66
  344. package/src/vendor/bootstrap-vue/src/components/layout/container.js +0 -40
  345. package/src/vendor/bootstrap-vue/src/components/layout/container.spec.js +0 -75
  346. package/src/vendor/bootstrap-vue/src/components/layout/row.js +0 -111
  347. package/src/vendor/bootstrap-vue/src/components/layout/row.spec.js +0 -138
  348. package/src/vendor/bootstrap-vue/src/components/list-group/README.md +0 -291
  349. package/src/vendor/bootstrap-vue/src/components/list-group/index.d.ts +0 -14
  350. package/src/vendor/bootstrap-vue/src/components/list-group/index.js +0 -12
  351. package/src/vendor/bootstrap-vue/src/components/list-group/list-group-item.js +0 -76
  352. package/src/vendor/bootstrap-vue/src/components/list-group/list-group-item.spec.js +0 -286
  353. package/src/vendor/bootstrap-vue/src/components/list-group/list-group.js +0 -42
  354. package/src/vendor/bootstrap-vue/src/components/list-group/list-group.spec.js +0 -132
  355. package/src/vendor/bootstrap-vue/src/components/list-group/package.json +0 -52
  356. package/src/vendor/bootstrap-vue/src/components/media/README.md +0 -183
  357. package/src/vendor/bootstrap-vue/src/components/media/_media.scss +0 -9
  358. package/src/vendor/bootstrap-vue/src/components/media/index.d.ts +0 -17
  359. package/src/vendor/bootstrap-vue/src/components/media/index.js +0 -14
  360. package/src/vendor/bootstrap-vue/src/components/media/index.scss +0 -1
  361. package/src/vendor/bootstrap-vue/src/components/media/media-aside.js +0 -45
  362. package/src/vendor/bootstrap-vue/src/components/media/media-aside.spec.js +0 -79
  363. package/src/vendor/bootstrap-vue/src/components/media/media-body.js +0 -25
  364. package/src/vendor/bootstrap-vue/src/components/media/media-body.spec.js +0 -47
  365. package/src/vendor/bootstrap-vue/src/components/media/media.js +0 -52
  366. package/src/vendor/bootstrap-vue/src/components/media/media.spec.js +0 -149
  367. package/src/vendor/bootstrap-vue/src/components/media/package.json +0 -65
  368. package/src/vendor/bootstrap-vue/src/components/nav/nav-form.js +0 -50
  369. package/src/vendor/bootstrap-vue/src/components/nav/nav-form.spec.js +0 -93
  370. package/src/vendor/bootstrap-vue/src/components/nav/nav-text.js +0 -18
  371. package/src/vendor/bootstrap-vue/src/components/nav/nav-text.spec.js +0 -30
  372. package/src/vendor/bootstrap-vue/src/components/navbar/navbar-nav.js +0 -45
  373. package/src/vendor/bootstrap-vue/src/components/navbar/navbar-nav.spec.js +0 -105
  374. package/src/vendor/bootstrap-vue/src/components/navbar/navbar-toggle.js +0 -84
  375. package/src/vendor/bootstrap-vue/src/components/navbar/navbar-toggle.spec.js +0 -189
  376. package/src/vendor/bootstrap-vue/src/components/overlay/README.md +0 -815
  377. package/src/vendor/bootstrap-vue/src/components/overlay/index.d.ts +0 -11
  378. package/src/vendor/bootstrap-vue/src/components/overlay/index.js +0 -8
  379. package/src/vendor/bootstrap-vue/src/components/overlay/overlay.js +0 -162
  380. package/src/vendor/bootstrap-vue/src/components/overlay/overlay.spec.js +0 -257
  381. package/src/vendor/bootstrap-vue/src/components/overlay/package.json +0 -130
  382. package/src/vendor/bootstrap-vue/src/components/pagination/README.md +0 -430
  383. package/src/vendor/bootstrap-vue/src/components/pagination/_pagination.scss +0 -26
  384. package/src/vendor/bootstrap-vue/src/components/pagination/index.d.ts +0 -11
  385. package/src/vendor/bootstrap-vue/src/components/pagination/index.js +0 -8
  386. package/src/vendor/bootstrap-vue/src/components/pagination/index.scss +0 -1
  387. package/src/vendor/bootstrap-vue/src/components/pagination/package.json +0 -295
  388. package/src/vendor/bootstrap-vue/src/components/pagination/pagination.js +0 -138
  389. package/src/vendor/bootstrap-vue/src/components/pagination/pagination.spec.js +0 -1198
  390. package/src/vendor/bootstrap-vue/src/components/pagination-nav/README.md +0 -544
  391. package/src/vendor/bootstrap-vue/src/components/pagination-nav/_pagination-nav.scss +0 -2
  392. package/src/vendor/bootstrap-vue/src/components/pagination-nav/index.d.ts +0 -11
  393. package/src/vendor/bootstrap-vue/src/components/pagination-nav/index.js +0 -8
  394. package/src/vendor/bootstrap-vue/src/components/pagination-nav/index.scss +0 -1
  395. package/src/vendor/bootstrap-vue/src/components/pagination-nav/package.json +0 -315
  396. package/src/vendor/bootstrap-vue/src/components/pagination-nav/pagination-nav.js +0 -281
  397. package/src/vendor/bootstrap-vue/src/components/pagination-nav/pagination-nav.spec.js +0 -671
  398. package/src/vendor/bootstrap-vue/src/components/sidebar/README.md +0 -406
  399. package/src/vendor/bootstrap-vue/src/components/sidebar/_sidebar.scss +0 -97
  400. package/src/vendor/bootstrap-vue/src/components/sidebar/index.d.ts +0 -11
  401. package/src/vendor/bootstrap-vue/src/components/sidebar/index.js +0 -10
  402. package/src/vendor/bootstrap-vue/src/components/sidebar/index.scss +0 -1
  403. package/src/vendor/bootstrap-vue/src/components/sidebar/package.json +0 -239
  404. package/src/vendor/bootstrap-vue/src/components/sidebar/sidebar.js +0 -438
  405. package/src/vendor/bootstrap-vue/src/components/sidebar/sidebar.spec.js +0 -404
  406. package/src/vendor/bootstrap-vue/src/components/skeleton/README.md +0 -275
  407. package/src/vendor/bootstrap-vue/src/components/skeleton/_skeleton.scss +0 -141
  408. package/src/vendor/bootstrap-vue/src/components/skeleton/index.d.ts +0 -23
  409. package/src/vendor/bootstrap-vue/src/components/skeleton/index.js +0 -18
  410. package/src/vendor/bootstrap-vue/src/components/skeleton/index.scss +0 -1
  411. package/src/vendor/bootstrap-vue/src/components/skeleton/package.json +0 -136
  412. package/src/vendor/bootstrap-vue/src/components/skeleton/skeleton-icon.js +0 -45
  413. package/src/vendor/bootstrap-vue/src/components/skeleton/skeleton-icon.spec.js +0 -86
  414. package/src/vendor/bootstrap-vue/src/components/skeleton/skeleton-img.js +0 -49
  415. package/src/vendor/bootstrap-vue/src/components/skeleton/skeleton-img.spec.js +0 -139
  416. package/src/vendor/bootstrap-vue/src/components/skeleton/skeleton-table.js +0 -58
  417. package/src/vendor/bootstrap-vue/src/components/skeleton/skeleton-table.spec.js +0 -119
  418. package/src/vendor/bootstrap-vue/src/components/skeleton/skeleton-wrapper.js +0 -47
  419. package/src/vendor/bootstrap-vue/src/components/skeleton/skeleton-wrapper.spec.js +0 -48
  420. package/src/vendor/bootstrap-vue/src/components/skeleton/skeleton.js +0 -46
  421. package/src/vendor/bootstrap-vue/src/components/skeleton/skeleton.spec.js +0 -126
  422. package/src/vendor/bootstrap-vue/src/components/spinner/README.md +0 -229
  423. package/src/vendor/bootstrap-vue/src/components/spinner/index.d.ts +0 -11
  424. package/src/vendor/bootstrap-vue/src/components/spinner/index.js +0 -8
  425. package/src/vendor/bootstrap-vue/src/components/spinner/package.json +0 -38
  426. package/src/vendor/bootstrap-vue/src/components/spinner/spinner.js +0 -54
  427. package/src/vendor/bootstrap-vue/src/components/spinner/spinner.spec.js +0 -305
  428. package/src/vendor/bootstrap-vue/src/components/time/README.md +0 -431
  429. package/src/vendor/bootstrap-vue/src/components/time/_time.scss +0 -41
  430. package/src/vendor/bootstrap-vue/src/components/time/index.d.ts +0 -27
  431. package/src/vendor/bootstrap-vue/src/components/time/index.js +0 -8
  432. package/src/vendor/bootstrap-vue/src/components/time/index.scss +0 -1
  433. package/src/vendor/bootstrap-vue/src/components/time/package.json +0 -123
  434. package/src/vendor/bootstrap-vue/src/components/time/time.js +0 -601
  435. package/src/vendor/bootstrap-vue/src/components/time/time.spec.js +0 -330
  436. package/src/vendor/bootstrap-vue/src/constants/date.js +0 -7
  437. package/src/vendor/bootstrap-vue/src/mixins/card.js +0 -23
  438. package/src/vendor/bootstrap-vue/src/mixins/pagination.js +0 -670
  439. package/src/vendor/bootstrap-vue/src/utils/date.js +0 -130
  440. package/src/vendor/bootstrap-vue/src/utils/date.spec.js +0 -159
@@ -1,1146 +0,0 @@
1
- import { extend } from '../../vue'
2
- import { NAME_CALENDAR } from '../../constants/components'
3
- import {
4
- CALENDAR_GREGORY,
5
- CALENDAR_LONG,
6
- CALENDAR_NARROW,
7
- CALENDAR_SHORT,
8
- DATE_FORMAT_2_DIGIT,
9
- DATE_FORMAT_NUMERIC
10
- } from '../../constants/date'
11
- import { EVENT_NAME_CONTEXT, EVENT_NAME_SELECTED } from '../../constants/events'
12
- import {
13
- CODE_DOWN,
14
- CODE_END,
15
- CODE_ENTER,
16
- CODE_HOME,
17
- CODE_LEFT,
18
- CODE_PAGEDOWN,
19
- CODE_PAGEUP,
20
- CODE_RIGHT,
21
- CODE_SPACE,
22
- CODE_UP
23
- } from '../../constants/key-codes'
24
- import {
25
- PROP_TYPE_ARRAY_STRING,
26
- PROP_TYPE_BOOLEAN,
27
- PROP_TYPE_DATE_STRING,
28
- PROP_TYPE_FUNCTION,
29
- PROP_TYPE_NUMBER_STRING,
30
- PROP_TYPE_OBJECT,
31
- PROP_TYPE_STRING
32
- } from '../../constants/props'
33
- import {
34
- SLOT_NAME_NAV_NEXT_DECADE,
35
- SLOT_NAME_NAV_NEXT_MONTH,
36
- SLOT_NAME_NAV_NEXT_YEAR,
37
- SLOT_NAME_NAV_PEV_DECADE,
38
- SLOT_NAME_NAV_PEV_MONTH,
39
- SLOT_NAME_NAV_PEV_YEAR,
40
- SLOT_NAME_NAV_THIS_MONTH
41
- } from '../../constants/slots'
42
- import { arrayIncludes, concat } from '../../utils/array'
43
- import {
44
- createDate,
45
- createDateFormatter,
46
- constrainDate,
47
- datesEqual,
48
- firstDateOfMonth,
49
- formatYMD,
50
- lastDateOfMonth,
51
- oneMonthAgo,
52
- oneMonthAhead,
53
- oneYearAgo,
54
- oneYearAhead,
55
- oneDecadeAgo,
56
- oneDecadeAhead,
57
- parseYMD,
58
- resolveLocale
59
- } from '../../utils/date'
60
- import { attemptBlur, attemptFocus, requestAF } from '../../utils/dom'
61
- import { stopEvent } from '../../utils/events'
62
- import { identity } from '../../utils/identity'
63
- import { isArray, isPlainObject, isString } from '../../utils/inspect'
64
- import { isLocaleRTL } from '../../utils/locale'
65
- import { looseEqual } from '../../utils/loose-equal'
66
- import { mathMax } from '../../utils/math'
67
- import { makeModelMixin } from '../../utils/model'
68
- import { toInteger } from '../../utils/number'
69
- import { sortKeys } from '../../utils/object'
70
- import { hasPropFunction, makeProp, makePropsConfigurable } from '../../utils/props'
71
- import { toString } from '../../utils/string'
72
- import { attrsMixin } from '../../mixins/attrs'
73
- import { idMixin, props as idProps } from '../../mixins/id'
74
- import { normalizeSlotMixin } from '../../mixins/normalize-slot'
75
- import {
76
- BIconChevronLeft,
77
- BIconChevronDoubleLeft,
78
- BIconChevronBarLeft,
79
- BIconCircleFill
80
- } from '../../icons/icons'
81
-
82
- // --- Constants ---
83
-
84
- const {
85
- mixin: modelMixin,
86
- props: modelProps,
87
- prop: MODEL_PROP_NAME,
88
- event: MODEL_EVENT_NAME
89
- } = makeModelMixin('value', { type: PROP_TYPE_DATE_STRING })
90
-
91
- // --- Props ---
92
-
93
- export const props = makePropsConfigurable(
94
- sortKeys({
95
- ...idProps,
96
- ...modelProps,
97
- ariaControls: makeProp(PROP_TYPE_STRING),
98
- // Makes calendar the full width of its parent container
99
- block: makeProp(PROP_TYPE_BOOLEAN, false),
100
- dateDisabledFn: makeProp(PROP_TYPE_FUNCTION),
101
- // `Intl.DateTimeFormat` object
102
- dateFormatOptions: makeProp(PROP_TYPE_OBJECT, {
103
- year: DATE_FORMAT_NUMERIC,
104
- month: CALENDAR_LONG,
105
- day: DATE_FORMAT_NUMERIC,
106
- weekday: CALENDAR_LONG
107
- }),
108
- // Function to set a class of (classes) on the date cell
109
- // if passed a string or an array
110
- // TODO:
111
- // If the function returns an object, look for class prop for classes,
112
- // and other props for handling events/details/descriptions
113
- dateInfoFn: makeProp(PROP_TYPE_FUNCTION),
114
- // 'ltr', 'rtl', or `null` (for auto detect)
115
- direction: makeProp(PROP_TYPE_STRING),
116
- disabled: makeProp(PROP_TYPE_BOOLEAN, false),
117
- headerTag: makeProp(PROP_TYPE_STRING, 'header'),
118
- // When `true`, renders a comment node, but keeps the component instance active
119
- // Mainly for <b-form-date>, so that we can get the component's value and locale
120
- // But we might just use separate date formatters, using the resolved locale
121
- // (adjusted for the gregorian calendar)
122
- hidden: makeProp(PROP_TYPE_BOOLEAN, false),
123
- // When `true` makes the selected date header `sr-only`
124
- hideHeader: makeProp(PROP_TYPE_BOOLEAN, false),
125
- // This specifies the calendar year/month/day that will be shown when
126
- // first opening the datepicker if no v-model value is provided
127
- // Default is the current date (or `min`/`max`)
128
- initialDate: makeProp(PROP_TYPE_DATE_STRING),
129
- // Labels for buttons and keyboard shortcuts
130
- labelCalendar: makeProp(PROP_TYPE_STRING, 'Calendar'),
131
- labelCurrentMonth: makeProp(PROP_TYPE_STRING, 'Current month'),
132
- labelHelp: makeProp(PROP_TYPE_STRING, 'Use cursor keys to navigate calendar dates'),
133
- labelNav: makeProp(PROP_TYPE_STRING, 'Calendar navigation'),
134
- labelNextDecade: makeProp(PROP_TYPE_STRING, 'Next decade'),
135
- labelNextMonth: makeProp(PROP_TYPE_STRING, 'Next month'),
136
- labelNextYear: makeProp(PROP_TYPE_STRING, 'Next year'),
137
- labelNoDateSelected: makeProp(PROP_TYPE_STRING, 'No date selected'),
138
- labelPrevDecade: makeProp(PROP_TYPE_STRING, 'Previous decade'),
139
- labelPrevMonth: makeProp(PROP_TYPE_STRING, 'Previous month'),
140
- labelPrevYear: makeProp(PROP_TYPE_STRING, 'Previous year'),
141
- labelSelected: makeProp(PROP_TYPE_STRING, 'Selected date'),
142
- labelToday: makeProp(PROP_TYPE_STRING, 'Today'),
143
- // Locale(s) to use
144
- // Default is to use page/browser default setting
145
- locale: makeProp(PROP_TYPE_ARRAY_STRING),
146
- max: makeProp(PROP_TYPE_DATE_STRING),
147
- min: makeProp(PROP_TYPE_DATE_STRING),
148
- // Variant color to use for the navigation buttons
149
- navButtonVariant: makeProp(PROP_TYPE_STRING, 'secondary'),
150
- // Disable highlighting today's date
151
- noHighlightToday: makeProp(PROP_TYPE_BOOLEAN, false),
152
- noKeyNav: makeProp(PROP_TYPE_BOOLEAN, false),
153
- readonly: makeProp(PROP_TYPE_BOOLEAN, false),
154
- roleDescription: makeProp(PROP_TYPE_STRING),
155
- // Variant color to use for the selected date
156
- selectedVariant: makeProp(PROP_TYPE_STRING, 'primary'),
157
- // When `true` enables the decade navigation buttons
158
- showDecadeNav: makeProp(PROP_TYPE_BOOLEAN, false),
159
- // Day of week to start calendar on
160
- // `0` (Sunday), `1` (Monday), ... `6` (Saturday)
161
- startWeekday: makeProp(PROP_TYPE_NUMBER_STRING, 0),
162
- // Variant color to use for today's date (defaults to `selectedVariant`)
163
- todayVariant: makeProp(PROP_TYPE_STRING),
164
- // Always return the `v-model` value as a date object
165
- valueAsDate: makeProp(PROP_TYPE_BOOLEAN, false),
166
- // Format of the weekday names at the top of the calendar
167
- // `short` is typically a 3 letter abbreviation,
168
- // `narrow` is typically a single letter
169
- // `long` is the full week day name
170
- // Although some locales may override this (i.e `ar`, etc.)
171
- weekdayHeaderFormat: makeProp(PROP_TYPE_STRING, CALENDAR_SHORT, value => {
172
- return arrayIncludes([CALENDAR_LONG, CALENDAR_SHORT, CALENDAR_NARROW], value)
173
- }),
174
- // Has no effect if prop `block` is set
175
- width: makeProp(PROP_TYPE_STRING, '270px')
176
- }),
177
- NAME_CALENDAR
178
- )
179
-
180
- // --- Main component ---
181
-
182
- // @vue/component
183
- export const BCalendar = extend({
184
- name: NAME_CALENDAR,
185
- // Mixin order is important!
186
- mixins: [attrsMixin, idMixin, modelMixin, normalizeSlotMixin],
187
- props,
188
- data() {
189
- const selected = formatYMD(this[MODEL_PROP_NAME]) || ''
190
- return {
191
- // Selected date
192
- selectedYMD: selected,
193
- // Date in calendar grid that has `tabindex` of `0`
194
- activeYMD:
195
- selected ||
196
- formatYMD(constrainDate(this.initialDate || this.getToday()), this.min, this.max),
197
- // Will be true if the calendar grid has/contains focus
198
- gridHasFocus: false,
199
- // Flag to enable the `aria-live` region(s) after mount
200
- // to prevent screen reader "outbursts" when mounting
201
- isLive: false
202
- }
203
- },
204
- computed: {
205
- valueId() {
206
- return this.safeId()
207
- },
208
- widgetId() {
209
- return this.safeId('_calendar-wrapper_')
210
- },
211
- navId() {
212
- return this.safeId('_calendar-nav_')
213
- },
214
- gridId() {
215
- return this.safeId('_calendar-grid_')
216
- },
217
- gridCaptionId() {
218
- return this.safeId('_calendar-grid-caption_')
219
- },
220
- gridHelpId() {
221
- return this.safeId('_calendar-grid-help_')
222
- },
223
- activeId() {
224
- return this.activeYMD ? this.safeId(`_cell-${this.activeYMD}_`) : null
225
- },
226
- // TODO: Use computed props to convert `YYYY-MM-DD` to `Date` object
227
- selectedDate() {
228
- // Selected as a `Date` object
229
- return parseYMD(this.selectedYMD)
230
- },
231
- activeDate() {
232
- // Active as a `Date` object
233
- return parseYMD(this.activeYMD)
234
- },
235
- computedMin() {
236
- return parseYMD(this.min)
237
- },
238
- computedMax() {
239
- return parseYMD(this.max)
240
- },
241
- computedWeekStarts() {
242
- // `startWeekday` is a prop (constrained to `0` through `6`)
243
- return mathMax(toInteger(this.startWeekday, 0), 0) % 7
244
- },
245
- computedLocale() {
246
- // Returns the resolved locale used by the calendar
247
- return resolveLocale(concat(this.locale).filter(identity), CALENDAR_GREGORY)
248
- },
249
- computedDateDisabledFn() {
250
- const { dateDisabledFn } = this
251
- return hasPropFunction(dateDisabledFn) ? dateDisabledFn : () => false
252
- },
253
- // TODO: Change `dateInfoFn` to handle events and notes as well as classes
254
- computedDateInfoFn() {
255
- const { dateInfoFn } = this
256
- return hasPropFunction(dateInfoFn) ? dateInfoFn : () => ({})
257
- },
258
- calendarLocale() {
259
- // This locale enforces the gregorian calendar (for use in formatter functions)
260
- // Needed because IE 11 resolves `ar-IR` as islamic-civil calendar
261
- // and IE 11 (and some other browsers) do not support the `calendar` option
262
- // And we currently only support the gregorian calendar
263
- const fmt = new Intl.DateTimeFormat(this.computedLocale, { calendar: CALENDAR_GREGORY })
264
- const calendar = fmt.resolvedOptions().calendar
265
- let locale = fmt.resolvedOptions().locale
266
- /* istanbul ignore if: mainly for IE 11 and a few other browsers, hard to test in JSDOM */
267
- if (calendar !== CALENDAR_GREGORY) {
268
- // Ensure the locale requests the gregorian calendar
269
- // Mainly for IE 11, and currently we can't handle non-gregorian calendars
270
- // TODO: Should we always return this value?
271
- locale = locale.replace(/-u-.+$/i, '').concat('-u-ca-gregory')
272
- }
273
- return locale
274
- },
275
- calendarYear() {
276
- return this.activeDate.getFullYear()
277
- },
278
- calendarMonth() {
279
- return this.activeDate.getMonth()
280
- },
281
- calendarFirstDay() {
282
- // We set the time for this date to 12pm to work around
283
- // date formatting issues in Firefox and Safari
284
- // See: https://github.com/bootstrap-vue/bootstrap-vue/issues/5818
285
- return createDate(this.calendarYear, this.calendarMonth, 1, 12)
286
- },
287
- calendarDaysInMonth() {
288
- // We create a new date as to not mutate the original
289
- const date = createDate(this.calendarFirstDay)
290
- date.setMonth(date.getMonth() + 1, 0)
291
- return date.getDate()
292
- },
293
- computedVariant() {
294
- return `btn-${this.selectedVariant || 'primary'}`
295
- },
296
- computedTodayVariant() {
297
- return `btn-outline-${this.todayVariant || this.selectedVariant || 'primary'}`
298
- },
299
- computedNavButtonVariant() {
300
- return `btn-outline-${this.navButtonVariant || 'primary'}`
301
- },
302
- isRTL() {
303
- // `true` if the language requested is RTL
304
- const dir = toString(this.direction).toLowerCase()
305
- if (dir === 'rtl') {
306
- /* istanbul ignore next */
307
- return true
308
- } else if (dir === 'ltr') {
309
- /* istanbul ignore next */
310
- return false
311
- }
312
- return isLocaleRTL(this.computedLocale)
313
- },
314
- context() {
315
- const { selectedYMD, activeYMD } = this
316
- const selectedDate = parseYMD(selectedYMD)
317
- const activeDate = parseYMD(activeYMD)
318
- return {
319
- // The current value of the `v-model`
320
- selectedYMD,
321
- selectedDate,
322
- selectedFormatted: selectedDate
323
- ? this.formatDateString(selectedDate)
324
- : this.labelNoDateSelected,
325
- // Which date cell is considered active due to navigation
326
- activeYMD,
327
- activeDate,
328
- activeFormatted: activeDate ? this.formatDateString(activeDate) : '',
329
- // `true` if the date is disabled (when using keyboard navigation)
330
- disabled: this.dateDisabled(activeDate),
331
- // Locales used in formatting dates
332
- locale: this.computedLocale,
333
- calendarLocale: this.calendarLocale,
334
- rtl: this.isRTL
335
- }
336
- },
337
- // Computed props that return a function reference
338
- dateOutOfRange() {
339
- // Check whether a date is within the min/max range
340
- // Returns a new function ref if the pops change
341
- // We do this as we need to trigger the calendar computed prop
342
- // to update when these props update
343
- const { computedMin: min, computedMax: max } = this
344
- return date => {
345
- // Handle both `YYYY-MM-DD` and `Date` objects
346
- date = parseYMD(date)
347
- return (min && date < min) || (max && date > max)
348
- }
349
- },
350
- dateDisabled() {
351
- // Returns a function for validating if a date is within range
352
- // We grab this variables first to ensure a new function ref
353
- // is generated when the props value changes
354
- // We do this as we need to trigger the calendar computed prop
355
- // to update when these props update
356
- const rangeFn = this.dateOutOfRange
357
- // Return the function ref
358
- return date => {
359
- // Handle both `YYYY-MM-DD` and `Date` objects
360
- date = parseYMD(date)
361
- const ymd = formatYMD(date)
362
- return !!(rangeFn(date) || this.computedDateDisabledFn(ymd, date))
363
- }
364
- },
365
- // Computed props that return date formatter functions
366
- formatDateString() {
367
- // Returns a date formatter function
368
- return createDateFormatter(this.calendarLocale, {
369
- // Ensure we have year, month, day shown for screen readers/ARIA
370
- // If users really want to leave one of these out, they can
371
- // pass `undefined` for the property value
372
- year: DATE_FORMAT_NUMERIC,
373
- month: DATE_FORMAT_2_DIGIT,
374
- day: DATE_FORMAT_2_DIGIT,
375
- // Merge in user supplied options
376
- ...this.dateFormatOptions,
377
- // Ensure hours/minutes/seconds are not shown
378
- // As we do not support the time portion (yet)
379
- hour: undefined,
380
- minute: undefined,
381
- second: undefined,
382
- // Ensure calendar is gregorian
383
- calendar: CALENDAR_GREGORY
384
- })
385
- },
386
- formatYearMonth() {
387
- // Returns a date formatter function
388
- return createDateFormatter(this.calendarLocale, {
389
- year: DATE_FORMAT_NUMERIC,
390
- month: CALENDAR_LONG,
391
- calendar: CALENDAR_GREGORY
392
- })
393
- },
394
- formatWeekdayName() {
395
- // Long weekday name for weekday header aria-label
396
- return createDateFormatter(this.calendarLocale, {
397
- weekday: CALENDAR_LONG,
398
- calendar: CALENDAR_GREGORY
399
- })
400
- },
401
- formatWeekdayNameShort() {
402
- // Weekday header cell format
403
- // defaults to 'short' 3 letter days, where possible
404
- return createDateFormatter(this.calendarLocale, {
405
- weekday: this.weekdayHeaderFormat || CALENDAR_SHORT,
406
- calendar: CALENDAR_GREGORY
407
- })
408
- },
409
- formatDay() {
410
- // Calendar grid day number formatter
411
- // We don't use DateTimeFormatter here as it can place extra
412
- // character(s) after the number (i.e the `zh` locale)
413
- const nf = new Intl.NumberFormat([this.computedLocale], {
414
- style: 'decimal',
415
- minimumIntegerDigits: 1,
416
- minimumFractionDigits: 0,
417
- maximumFractionDigits: 0,
418
- notation: 'standard'
419
- })
420
- // Return a formatter function instance
421
- return date => nf.format(date.getDate())
422
- },
423
- // Disabled states for the nav buttons
424
- prevDecadeDisabled() {
425
- const min = this.computedMin
426
- return this.disabled || (min && lastDateOfMonth(oneDecadeAgo(this.activeDate)) < min)
427
- },
428
- prevYearDisabled() {
429
- const min = this.computedMin
430
- return this.disabled || (min && lastDateOfMonth(oneYearAgo(this.activeDate)) < min)
431
- },
432
- prevMonthDisabled() {
433
- const min = this.computedMin
434
- return this.disabled || (min && lastDateOfMonth(oneMonthAgo(this.activeDate)) < min)
435
- },
436
- thisMonthDisabled() {
437
- // TODO: We could/should check if today is out of range
438
- return this.disabled
439
- },
440
- nextMonthDisabled() {
441
- const max = this.computedMax
442
- return this.disabled || (max && firstDateOfMonth(oneMonthAhead(this.activeDate)) > max)
443
- },
444
- nextYearDisabled() {
445
- const max = this.computedMax
446
- return this.disabled || (max && firstDateOfMonth(oneYearAhead(this.activeDate)) > max)
447
- },
448
- nextDecadeDisabled() {
449
- const max = this.computedMax
450
- return this.disabled || (max && firstDateOfMonth(oneDecadeAhead(this.activeDate)) > max)
451
- },
452
- // Calendar dates generation
453
- calendar() {
454
- const matrix = []
455
- const firstDay = this.calendarFirstDay
456
- const calendarYear = firstDay.getFullYear()
457
- const calendarMonth = firstDay.getMonth()
458
- const daysInMonth = this.calendarDaysInMonth
459
- const startIndex = firstDay.getDay() // `0`..`6`
460
- const weekOffset = (this.computedWeekStarts > startIndex ? 7 : 0) - this.computedWeekStarts
461
- // Build the calendar matrix
462
- let currentDay = 0 - weekOffset - startIndex
463
- for (let week = 0; week < 6 && currentDay < daysInMonth; week++) {
464
- // For each week
465
- matrix[week] = []
466
- // The following could be a map function
467
- for (let j = 0; j < 7; j++) {
468
- // For each day in week
469
- currentDay++
470
- const date = createDate(calendarYear, calendarMonth, currentDay)
471
- const month = date.getMonth()
472
- const dayYMD = formatYMD(date)
473
- const dayDisabled = this.dateDisabled(date)
474
- // TODO: This could be a normalizer method
475
- let dateInfo = this.computedDateInfoFn(dayYMD, parseYMD(dayYMD))
476
- dateInfo =
477
- isString(dateInfo) || isArray(dateInfo)
478
- ? /* istanbul ignore next */ { class: dateInfo }
479
- : isPlainObject(dateInfo)
480
- ? { class: '', ...dateInfo }
481
- : /* istanbul ignore next */ { class: '' }
482
- matrix[week].push({
483
- ymd: dayYMD,
484
- // Cell content
485
- day: this.formatDay(date),
486
- label: this.formatDateString(date),
487
- // Flags for styling
488
- isThisMonth: month === calendarMonth,
489
- isDisabled: dayDisabled,
490
- // TODO: Handle other dateInfo properties such as notes/events
491
- info: dateInfo
492
- })
493
- }
494
- }
495
- return matrix
496
- },
497
- calendarHeadings() {
498
- return this.calendar[0].map(d => {
499
- return {
500
- text: this.formatWeekdayNameShort(parseYMD(d.ymd)),
501
- label: this.formatWeekdayName(parseYMD(d.ymd))
502
- }
503
- })
504
- }
505
- },
506
- watch: {
507
- [MODEL_PROP_NAME](newValue, oldValue) {
508
- const selected = formatYMD(newValue) || ''
509
- const old = formatYMD(oldValue) || ''
510
- if (!datesEqual(selected, old)) {
511
- this.activeYMD = selected || this.activeYMD
512
- this.selectedYMD = selected
513
- }
514
- },
515
- selectedYMD(newYMD, oldYMD) {
516
- // TODO:
517
- // Should we compare to `formatYMD(this.value)` and emit
518
- // only if they are different?
519
- if (newYMD !== oldYMD) {
520
- this.$emit(MODEL_EVENT_NAME, this.valueAsDate ? parseYMD(newYMD) || null : newYMD || '')
521
- }
522
- },
523
- context(newValue, oldValue) {
524
- if (!looseEqual(newValue, oldValue)) {
525
- this.$emit(EVENT_NAME_CONTEXT, newValue)
526
- }
527
- },
528
- hidden(newValue) {
529
- // Reset the active focused day when hidden
530
- this.activeYMD =
531
- this.selectedYMD ||
532
- formatYMD(this[MODEL_PROP_NAME] || this.constrainDate(this.initialDate || this.getToday()))
533
- // Enable/disable the live regions
534
- this.setLive(!newValue)
535
- }
536
- },
537
- created() {
538
- this.$nextTick(() => {
539
- this.$emit(EVENT_NAME_CONTEXT, this.context)
540
- })
541
- },
542
- mounted() {
543
- this.setLive(true)
544
- },
545
- /* istanbul ignore next */
546
- activated() {
547
- this.setLive(true)
548
- },
549
- /* istanbul ignore next */
550
- deactivated() {
551
- this.setLive(false)
552
- },
553
- beforeDestroy() {
554
- this.setLive(false)
555
- },
556
- methods: {
557
- // Public method(s)
558
- focus() {
559
- if (!this.disabled) {
560
- attemptFocus(this.$refs.grid)
561
- }
562
- },
563
- blur() {
564
- if (!this.disabled) {
565
- attemptBlur(this.$refs.grid)
566
- }
567
- },
568
- // Private methods
569
- setLive(on) {
570
- if (on) {
571
- this.$nextTick(() => {
572
- requestAF(() => {
573
- this.isLive = true
574
- })
575
- })
576
- } else {
577
- this.isLive = false
578
- }
579
- },
580
- getToday() {
581
- return parseYMD(createDate())
582
- },
583
- constrainDate(date) {
584
- // Constrains a date between min and max
585
- // returns a new `Date` object instance
586
- return constrainDate(date, this.computedMin, this.computedMax)
587
- },
588
- emitSelected(date) {
589
- // Performed in a `$nextTick()` to (probably) ensure
590
- // the input event has emitted first
591
- this.$nextTick(() => {
592
- this.$emit(EVENT_NAME_SELECTED, formatYMD(date) || '', parseYMD(date) || null)
593
- })
594
- },
595
- // Event handlers
596
- setGridFocusFlag(event) {
597
- // Sets the gridHasFocus flag to make date "button" look focused
598
- this.gridHasFocus = !this.disabled && event.type === 'focus'
599
- },
600
- onKeydownWrapper(event) {
601
- // Calendar keyboard navigation
602
- // Handles PAGEUP/PAGEDOWN/END/HOME/LEFT/UP/RIGHT/DOWN
603
- // Focuses grid after updating
604
- if (this.noKeyNav) {
605
- /* istanbul ignore next */
606
- return
607
- }
608
- const { altKey, ctrlKey, keyCode } = event
609
- if (
610
- !arrayIncludes(
611
- [
612
- CODE_PAGEUP,
613
- CODE_PAGEDOWN,
614
- CODE_END,
615
- CODE_HOME,
616
- CODE_LEFT,
617
- CODE_UP,
618
- CODE_RIGHT,
619
- CODE_DOWN
620
- ],
621
- keyCode
622
- )
623
- ) {
624
- /* istanbul ignore next */
625
- return
626
- }
627
- stopEvent(event)
628
- let activeDate = createDate(this.activeDate)
629
- let checkDate = createDate(this.activeDate)
630
- const day = activeDate.getDate()
631
- const constrainedToday = this.constrainDate(this.getToday())
632
- const isRTL = this.isRTL
633
- if (keyCode === CODE_PAGEUP) {
634
- // PAGEUP - Previous month/year
635
- activeDate = (altKey ? (ctrlKey ? oneDecadeAgo : oneYearAgo) : oneMonthAgo)(activeDate)
636
- // We check the first day of month to be in rage
637
- checkDate = createDate(activeDate)
638
- checkDate.setDate(1)
639
- } else if (keyCode === CODE_PAGEDOWN) {
640
- // PAGEDOWN - Next month/year
641
- activeDate = (altKey ? (ctrlKey ? oneDecadeAhead : oneYearAhead) : oneMonthAhead)(
642
- activeDate
643
- )
644
- // We check the last day of month to be in rage
645
- checkDate = createDate(activeDate)
646
- checkDate.setMonth(checkDate.getMonth() + 1)
647
- checkDate.setDate(0)
648
- } else if (keyCode === CODE_LEFT) {
649
- // LEFT - Previous day (or next day for RTL)
650
- activeDate.setDate(day + (isRTL ? 1 : -1))
651
- activeDate = this.constrainDate(activeDate)
652
- checkDate = activeDate
653
- } else if (keyCode === CODE_RIGHT) {
654
- // RIGHT - Next day (or previous day for RTL)
655
- activeDate.setDate(day + (isRTL ? -1 : 1))
656
- activeDate = this.constrainDate(activeDate)
657
- checkDate = activeDate
658
- } else if (keyCode === CODE_UP) {
659
- // UP - Previous week
660
- activeDate.setDate(day - 7)
661
- activeDate = this.constrainDate(activeDate)
662
- checkDate = activeDate
663
- } else if (keyCode === CODE_DOWN) {
664
- // DOWN - Next week
665
- activeDate.setDate(day + 7)
666
- activeDate = this.constrainDate(activeDate)
667
- checkDate = activeDate
668
- } else if (keyCode === CODE_HOME) {
669
- // HOME - Today
670
- activeDate = constrainedToday
671
- checkDate = activeDate
672
- } else if (keyCode === CODE_END) {
673
- // END - Selected date, or today if no selected date
674
- activeDate = parseYMD(this.selectedDate) || constrainedToday
675
- checkDate = activeDate
676
- }
677
- if (!this.dateOutOfRange(checkDate) && !datesEqual(activeDate, this.activeDate)) {
678
- // We only jump to date if within min/max
679
- // We don't check for individual disabled dates though (via user function)
680
- this.activeYMD = formatYMD(activeDate)
681
- }
682
- // Ensure grid is focused
683
- this.focus()
684
- },
685
- onKeydownGrid(event) {
686
- // Pressing enter/space on grid to select active date
687
- const keyCode = event.keyCode
688
- const activeDate = this.activeDate
689
- if (keyCode === CODE_ENTER || keyCode === CODE_SPACE) {
690
- stopEvent(event)
691
- if (!this.disabled && !this.readonly && !this.dateDisabled(activeDate)) {
692
- this.selectedYMD = formatYMD(activeDate)
693
- this.emitSelected(activeDate)
694
- }
695
- // Ensure grid is focused
696
- this.focus()
697
- }
698
- },
699
- onClickDay(day) {
700
- // Clicking on a date "button" to select it
701
- const { selectedDate, activeDate } = this
702
- const clickedDate = parseYMD(day.ymd)
703
- if (!this.disabled && !day.isDisabled && !this.dateDisabled(clickedDate)) {
704
- if (!this.readonly) {
705
- // If readonly mode, we don't set the selected date, just the active date
706
- // If the clicked date is equal to the already selected date, we don't update the model
707
- this.selectedYMD = formatYMD(
708
- datesEqual(clickedDate, selectedDate) ? selectedDate : clickedDate
709
- )
710
- this.emitSelected(clickedDate)
711
- }
712
- this.activeYMD = formatYMD(
713
- datesEqual(clickedDate, activeDate) ? activeDate : createDate(clickedDate)
714
- )
715
- // Ensure grid is focused
716
- this.focus()
717
- }
718
- },
719
- gotoPrevDecade() {
720
- this.activeYMD = formatYMD(this.constrainDate(oneDecadeAgo(this.activeDate)))
721
- },
722
- gotoPrevYear() {
723
- this.activeYMD = formatYMD(this.constrainDate(oneYearAgo(this.activeDate)))
724
- },
725
- gotoPrevMonth() {
726
- this.activeYMD = formatYMD(this.constrainDate(oneMonthAgo(this.activeDate)))
727
- },
728
- gotoCurrentMonth() {
729
- // TODO: Maybe this goto date should be configurable?
730
- this.activeYMD = formatYMD(this.constrainDate(this.getToday()))
731
- },
732
- gotoNextMonth() {
733
- this.activeYMD = formatYMD(this.constrainDate(oneMonthAhead(this.activeDate)))
734
- },
735
- gotoNextYear() {
736
- this.activeYMD = formatYMD(this.constrainDate(oneYearAhead(this.activeDate)))
737
- },
738
- gotoNextDecade() {
739
- this.activeYMD = formatYMD(this.constrainDate(oneDecadeAhead(this.activeDate)))
740
- },
741
- onHeaderClick() {
742
- if (!this.disabled) {
743
- this.activeYMD = this.selectedYMD || formatYMD(this.getToday())
744
- this.focus()
745
- }
746
- }
747
- },
748
- render(h) {
749
- // If `hidden` prop is set, render just a placeholder node
750
- if (this.hidden) {
751
- return h()
752
- }
753
-
754
- const {
755
- valueId,
756
- widgetId,
757
- navId,
758
- gridId,
759
- gridCaptionId,
760
- gridHelpId,
761
- activeId,
762
- disabled,
763
- noKeyNav,
764
- isLive,
765
- isRTL,
766
- activeYMD,
767
- selectedYMD,
768
- safeId
769
- } = this
770
- const hideDecadeNav = !this.showDecadeNav
771
- const todayYMD = formatYMD(this.getToday())
772
- const highlightToday = !this.noHighlightToday
773
-
774
- // Header showing current selected date
775
- let $header = h(
776
- 'output',
777
- {
778
- staticClass: 'form-control form-control-sm text-center',
779
- class: { 'text-muted': disabled, readonly: this.readonly || disabled },
780
- attrs: {
781
- id: valueId,
782
- for: gridId,
783
- role: 'status',
784
- tabindex: disabled ? null : '-1',
785
- // Mainly for testing purposes, as we do not know
786
- // the exact format `Intl` will format the date string
787
- 'data-selected': toString(selectedYMD),
788
- // We wait until after mount to enable `aria-live`
789
- // to prevent initial announcement on page render
790
- 'aria-live': isLive ? 'polite' : 'off',
791
- 'aria-atomic': isLive ? 'true' : null
792
- },
793
- on: {
794
- // Transfer focus/click to focus grid
795
- // and focus active date (or today if no selection)
796
- click: this.onHeaderClick,
797
- focus: this.onHeaderClick
798
- }
799
- },
800
- this.selectedDate
801
- ? [
802
- // We use `bdi` elements here in case the label doesn't match the locale
803
- // Although IE 11 does not deal with <BDI> at all (equivalent to a span)
804
- h('bdi', { staticClass: 'sr-only' }, ` (${toString(this.labelSelected)}) `),
805
- h('bdi', this.formatDateString(this.selectedDate))
806
- ]
807
- : this.labelNoDateSelected || '\u00a0' // '&nbsp;'
808
- )
809
- $header = h(
810
- this.headerTag,
811
- {
812
- staticClass: 'b-calendar-header',
813
- class: { 'sr-only': this.hideHeader },
814
- attrs: { title: this.selectedDate ? this.labelSelected || null : null }
815
- },
816
- [$header]
817
- )
818
-
819
- // Content for the date navigation buttons
820
- const navScope = { isRTL }
821
- const navProps = { shiftV: 0.5 }
822
- const navPrevProps = { ...navProps, flipH: isRTL }
823
- const navNextProps = { ...navProps, flipH: !isRTL }
824
- const $prevDecadeIcon =
825
- this.normalizeSlot(SLOT_NAME_NAV_PEV_DECADE, navScope) ||
826
- h(BIconChevronBarLeft, { props: navPrevProps })
827
- const $prevYearIcon =
828
- this.normalizeSlot(SLOT_NAME_NAV_PEV_YEAR, navScope) ||
829
- h(BIconChevronDoubleLeft, { props: navPrevProps })
830
- const $prevMonthIcon =
831
- this.normalizeSlot(SLOT_NAME_NAV_PEV_MONTH, navScope) ||
832
- h(BIconChevronLeft, { props: navPrevProps })
833
- const $thisMonthIcon =
834
- this.normalizeSlot(SLOT_NAME_NAV_THIS_MONTH, navScope) ||
835
- h(BIconCircleFill, { props: navProps })
836
- const $nextMonthIcon =
837
- this.normalizeSlot(SLOT_NAME_NAV_NEXT_MONTH, navScope) ||
838
- h(BIconChevronLeft, { props: navNextProps })
839
- const $nextYearIcon =
840
- this.normalizeSlot(SLOT_NAME_NAV_NEXT_YEAR, navScope) ||
841
- h(BIconChevronDoubleLeft, { props: navNextProps })
842
- const $nextDecadeIcon =
843
- this.normalizeSlot(SLOT_NAME_NAV_NEXT_DECADE, navScope) ||
844
- h(BIconChevronBarLeft, { props: navNextProps })
845
-
846
- // Utility to create the date navigation buttons
847
- const makeNavBtn = (content, label, handler, btnDisabled, shortcut) => {
848
- return h(
849
- 'button',
850
- {
851
- staticClass: 'btn btn-sm border-0 flex-fill',
852
- class: [this.computedNavButtonVariant, { disabled: btnDisabled }],
853
- attrs: {
854
- title: label || null,
855
- type: 'button',
856
- tabindex: noKeyNav ? '-1' : null,
857
- 'aria-label': label || null,
858
- 'aria-disabled': btnDisabled ? 'true' : null,
859
- 'aria-keyshortcuts': shortcut || null
860
- },
861
- on: btnDisabled ? {} : { click: handler }
862
- },
863
- [h('div', { attrs: { 'aria-hidden': 'true' } }, [content])]
864
- )
865
- }
866
-
867
- // Generate the date navigation buttons
868
- const $nav = h(
869
- 'div',
870
- {
871
- staticClass: 'b-calendar-nav d-flex',
872
- attrs: {
873
- id: navId,
874
- role: 'group',
875
- tabindex: noKeyNav ? '-1' : null,
876
- 'aria-hidden': disabled ? 'true' : null,
877
- 'aria-label': this.labelNav || null,
878
- 'aria-controls': gridId
879
- }
880
- },
881
- [
882
- hideDecadeNav
883
- ? h()
884
- : makeNavBtn(
885
- $prevDecadeIcon,
886
- this.labelPrevDecade,
887
- this.gotoPrevDecade,
888
- this.prevDecadeDisabled,
889
- 'Ctrl+Alt+PageDown'
890
- ),
891
- makeNavBtn(
892
- $prevYearIcon,
893
- this.labelPrevYear,
894
- this.gotoPrevYear,
895
- this.prevYearDisabled,
896
- 'Alt+PageDown'
897
- ),
898
- makeNavBtn(
899
- $prevMonthIcon,
900
- this.labelPrevMonth,
901
- this.gotoPrevMonth,
902
- this.prevMonthDisabled,
903
- 'PageDown'
904
- ),
905
- makeNavBtn(
906
- $thisMonthIcon,
907
- this.labelCurrentMonth,
908
- this.gotoCurrentMonth,
909
- this.thisMonthDisabled,
910
- 'Home'
911
- ),
912
- makeNavBtn(
913
- $nextMonthIcon,
914
- this.labelNextMonth,
915
- this.gotoNextMonth,
916
- this.nextMonthDisabled,
917
- 'PageUp'
918
- ),
919
- makeNavBtn(
920
- $nextYearIcon,
921
- this.labelNextYear,
922
- this.gotoNextYear,
923
- this.nextYearDisabled,
924
- 'Alt+PageUp'
925
- ),
926
- hideDecadeNav
927
- ? h()
928
- : makeNavBtn(
929
- $nextDecadeIcon,
930
- this.labelNextDecade,
931
- this.gotoNextDecade,
932
- this.nextDecadeDisabled,
933
- 'Ctrl+Alt+PageUp'
934
- )
935
- ]
936
- )
937
-
938
- // Caption for calendar grid
939
- const $gridCaption = h(
940
- 'div',
941
- {
942
- staticClass: 'b-calendar-grid-caption text-center font-weight-bold',
943
- class: { 'text-muted': disabled },
944
- attrs: {
945
- id: gridCaptionId,
946
- 'aria-live': isLive ? 'polite' : null,
947
- 'aria-atomic': isLive ? 'true' : null
948
- },
949
- key: 'grid-caption'
950
- },
951
- this.formatYearMonth(this.calendarFirstDay)
952
- )
953
-
954
- // Calendar weekday headings
955
- const $gridWeekDays = h(
956
- 'div',
957
- {
958
- staticClass: 'b-calendar-grid-weekdays row no-gutters border-bottom',
959
- attrs: { 'aria-hidden': 'true' }
960
- },
961
- this.calendarHeadings.map((d, idx) => {
962
- return h(
963
- 'small',
964
- {
965
- staticClass: 'col text-truncate',
966
- class: { 'text-muted': disabled },
967
- attrs: {
968
- title: d.label === d.text ? null : d.label,
969
- 'aria-label': d.label
970
- },
971
- key: idx
972
- },
973
- d.text
974
- )
975
- })
976
- )
977
-
978
- // Calendar day grid
979
- let $gridBody = this.calendar.map(week => {
980
- const $cells = week.map((day, dIndex) => {
981
- const isSelected = day.ymd === selectedYMD
982
- const isActive = day.ymd === activeYMD
983
- const isToday = day.ymd === todayYMD
984
- const idCell = safeId(`_cell-${day.ymd}_`)
985
- // "fake" button
986
- const $btn = h(
987
- 'span',
988
- {
989
- staticClass: 'btn border-0 rounded-circle text-nowrap',
990
- // Should we add some classes to signify if today/selected/etc?
991
- class: {
992
- // Give the fake button a focus ring
993
- focus: isActive && this.gridHasFocus,
994
- // Styling
995
- disabled: day.isDisabled || disabled,
996
- active: isSelected, // makes the button look "pressed"
997
- // Selected date style (need to computed from variant)
998
- [this.computedVariant]: isSelected,
999
- // Today day style (if not selected), same variant color as selected date
1000
- [this.computedTodayVariant]:
1001
- isToday && highlightToday && !isSelected && day.isThisMonth,
1002
- // Non selected/today styling
1003
- 'btn-outline-light': !(isToday && highlightToday) && !isSelected && !isActive,
1004
- 'btn-light': !(isToday && highlightToday) && !isSelected && isActive,
1005
- // Text styling
1006
- 'text-muted': !day.isThisMonth && !isSelected,
1007
- 'text-dark':
1008
- !(isToday && highlightToday) && !isSelected && !isActive && day.isThisMonth,
1009
- 'font-weight-bold': (isSelected || day.isThisMonth) && !day.isDisabled
1010
- },
1011
- on: { click: () => this.onClickDay(day) }
1012
- },
1013
- day.day
1014
- )
1015
- return h(
1016
- 'div', // Cell with button
1017
- {
1018
- staticClass: 'col p-0',
1019
- class: day.isDisabled ? 'bg-light' : day.info.class || '',
1020
- attrs: {
1021
- id: idCell,
1022
- role: 'button',
1023
- 'data-date': day.ymd, // Primarily for testing purposes
1024
- // Only days in the month are presented as buttons to screen readers
1025
- 'aria-hidden': day.isThisMonth ? null : 'true',
1026
- 'aria-disabled': day.isDisabled || disabled ? 'true' : null,
1027
- 'aria-label': [
1028
- day.label,
1029
- isSelected ? `(${this.labelSelected})` : null,
1030
- isToday ? `(${this.labelToday})` : null
1031
- ]
1032
- .filter(identity)
1033
- .join(' '),
1034
- // NVDA doesn't convey `aria-selected`, but does `aria-current`,
1035
- // ChromeVox doesn't convey `aria-current`, but does `aria-selected`,
1036
- // so we set both attributes for robustness
1037
- 'aria-selected': isSelected ? 'true' : null,
1038
- 'aria-current': isSelected ? 'date' : null
1039
- },
1040
- key: dIndex
1041
- },
1042
- [$btn]
1043
- )
1044
- })
1045
- // Return the week "row"
1046
- // We use the first day of the weeks YMD value as a
1047
- // key for efficient DOM patching / element re-use
1048
- return h(
1049
- 'div',
1050
- {
1051
- staticClass: 'row no-gutters',
1052
- key: week[0].ymd
1053
- },
1054
- $cells
1055
- )
1056
- })
1057
- $gridBody = h(
1058
- 'div',
1059
- {
1060
- // A key is only required on the body if we add in transition support
1061
- staticClass: 'b-calendar-grid-body',
1062
- style: disabled ? { pointerEvents: 'none' } : {}
1063
- // key: this.activeYMD.slice(0, -3)
1064
- },
1065
- $gridBody
1066
- )
1067
-
1068
- const $gridHelp = h(
1069
- 'div',
1070
- {
1071
- staticClass: 'b-calendar-grid-help border-top small text-muted text-center bg-light',
1072
- attrs: {
1073
- id: gridHelpId
1074
- }
1075
- },
1076
- [h('div', { staticClass: 'small' }, this.labelHelp)]
1077
- )
1078
-
1079
- const $grid = h(
1080
- 'div',
1081
- {
1082
- staticClass: 'b-calendar-grid form-control h-auto text-center',
1083
- attrs: {
1084
- id: gridId,
1085
- role: 'application',
1086
- tabindex: noKeyNav ? '-1' : disabled ? null : '0',
1087
- 'data-month': activeYMD.slice(0, -3), // `YYYY-MM`, mainly for testing
1088
- 'aria-roledescription': this.labelCalendar || null,
1089
- 'aria-labelledby': gridCaptionId,
1090
- 'aria-describedby': gridHelpId,
1091
- // `aria-readonly` is not considered valid on `role="application"`
1092
- // https://www.w3.org/TR/wai-aria-1.1/#aria-readonly
1093
- // 'aria-readonly': this.readonly && !disabled ? 'true' : null,
1094
- 'aria-disabled': disabled ? 'true' : null,
1095
- 'aria-activedescendant': activeId
1096
- },
1097
- on: {
1098
- keydown: this.onKeydownGrid,
1099
- focus: this.setGridFocusFlag,
1100
- blur: this.setGridFocusFlag
1101
- },
1102
- ref: 'grid'
1103
- },
1104
- [$gridCaption, $gridWeekDays, $gridBody, $gridHelp]
1105
- )
1106
-
1107
- // Optional bottom slot
1108
- let $slot = this.normalizeSlot()
1109
- $slot = $slot ? h('footer', { staticClass: 'b-calendar-footer' }, $slot) : h()
1110
-
1111
- const $widget = h(
1112
- 'div',
1113
- {
1114
- staticClass: 'b-calendar-inner',
1115
- style: this.block ? {} : { width: this.width },
1116
- attrs: {
1117
- id: widgetId,
1118
- dir: isRTL ? 'rtl' : 'ltr',
1119
- lang: this.computedLocale || null,
1120
- role: 'group',
1121
- 'aria-disabled': disabled ? 'true' : null,
1122
- // If datepicker controls an input, this will specify the ID of the input
1123
- 'aria-controls': this.ariaControls || null,
1124
- // This should be a prop (so it can be changed to Date picker, etc, localized
1125
- 'aria-roledescription': this.roleDescription || null,
1126
- 'aria-describedby': [
1127
- // Should the attr (if present) go last?
1128
- // Or should this attr be a prop?
1129
- this.bvAttrs['aria-describedby'],
1130
- valueId,
1131
- gridHelpId
1132
- ]
1133
- .filter(identity)
1134
- .join(' ')
1135
- },
1136
- on: {
1137
- keydown: this.onKeydownWrapper
1138
- }
1139
- },
1140
- [$header, $nav, $grid, $slot]
1141
- )
1142
-
1143
- // Wrap in an outer div that can be styled
1144
- return h('div', { staticClass: 'b-calendar', class: { 'd-block': this.block } }, [$widget])
1145
- }
1146
- })