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