@gitlab/ui 132.0.1 → 132.0.3
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/dist/charts.js +13 -0
- package/dist/components/base/accordion/accordion.js +69 -0
- package/dist/components/base/accordion/accordion_item.js +160 -0
- package/dist/components/base/accordion/constants.js +3 -0
- package/dist/components/base/alert/alert.js +263 -0
- package/dist/components/base/animated_icon/animated_chevron_down_up_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_chevron_lg_down_up_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_chevron_lg_right_down_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_chevron_right_down_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_duo_chat_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_loader_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_notifications_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_sidebar_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_smile_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_sort_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_star_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_todo_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_upload_icon.js +45 -0
- package/dist/components/base/animated_icon/base_animated_icon.js +77 -0
- package/dist/components/base/attribute_list/attribute_list.js +100 -0
- package/dist/components/base/avatar/avatar.js +175 -0
- package/dist/components/base/avatar/utils.js +17 -0
- package/dist/components/base/avatar_labeled/avatar_labeled.js +198 -0
- package/dist/components/base/avatar_link/avatar_link.js +47 -0
- package/dist/components/base/avatars_inline/avatars_inline.js +139 -0
- package/dist/components/base/badge/badge.js +197 -0
- package/dist/components/base/banner/banner.js +149 -0
- package/dist/components/base/breadcrumb/breadcrumb.js +282 -0
- package/dist/components/base/breadcrumb/breadcrumb_item.js +96 -0
- package/dist/components/base/broadcast_message/broadcast_message.js +113 -0
- package/dist/components/base/broadcast_message/constants.js +5 -0
- package/dist/components/base/button/button.js +419 -0
- package/dist/components/base/button_group/button_group.js +53 -0
- package/dist/components/base/card/card.js +69 -0
- package/dist/components/base/collapse/collapse.js +163 -0
- package/dist/components/base/color_mode_toggle/color_mode_toggle.js +92 -0
- package/dist/components/base/datepicker/datepicker.js +475 -0
- package/dist/components/base/daterange_picker/daterange_picker.js +394 -0
- package/dist/components/base/drawer/drawer.js +156 -0
- package/dist/components/base/dropdown/dropdown.js +330 -0
- package/dist/components/base/dropdown/dropdown_divider.js +48 -0
- package/dist/components/base/dropdown/dropdown_form.js +48 -0
- package/dist/components/base/dropdown/dropdown_item.js +175 -0
- package/dist/components/base/dropdown/dropdown_section_header.js +48 -0
- package/dist/components/base/dropdown/dropdown_text.js +48 -0
- package/dist/components/base/filtered_search/common_story_options.js +14 -0
- package/dist/components/base/filtered_search/filtered_search.js +428 -0
- package/dist/components/base/filtered_search/filtered_search_suggestion.js +95 -0
- package/dist/components/base/filtered_search/filtered_search_suggestion_list.js +139 -0
- package/dist/components/base/filtered_search/filtered_search_term.js +217 -0
- package/dist/components/base/filtered_search/filtered_search_token.js +383 -0
- package/dist/components/base/filtered_search/filtered_search_token_segment.js +444 -0
- package/dist/components/base/filtered_search/filtered_search_utils.js +241 -0
- package/dist/components/base/form/form.js +43 -0
- package/dist/components/base/form/form_character_count/form_character_count.js +107 -0
- package/dist/components/base/form/form_checkbox/form_checkbox.js +342 -0
- package/dist/components/base/form/form_checkbox/form_checkbox_group.js +188 -0
- package/dist/components/base/form/form_combobox/constants.js +55 -0
- package/dist/components/base/form/form_combobox/form_combobox.js +239 -0
- package/dist/components/base/form/form_date/form_date.js +143 -0
- package/dist/components/base/form/form_fields/form_field_validator.js +93 -0
- package/dist/components/base/form/form_fields/form_fields.js +289 -0
- package/dist/components/base/form/form_fields/form_fields_loop.js +75 -0
- package/dist/components/base/form/form_fields/mappers.js +13 -0
- package/dist/components/base/form/form_fields/validators.js +48 -0
- package/dist/components/base/form/form_group/form_group.js +119 -0
- package/dist/components/base/form/form_input/form_input.js +695 -0
- package/dist/components/base/form/form_input_group/form_input_group.js +120 -0
- package/dist/components/base/form/form_input_group/form_input_group_mixin.js +41 -0
- package/dist/components/base/form/form_radio/form_radio.js +259 -0
- package/dist/components/base/form/form_radio_group/form_radio_group.js +189 -0
- package/dist/components/base/form/form_select/constants.js +12 -0
- package/dist/components/base/form/form_select/form_select.js +96 -0
- package/dist/components/base/form/form_textarea/form_textarea.js +166 -0
- package/dist/components/base/form/input_group_text/input_group_text.js +43 -0
- package/dist/components/base/icon/icon.js +113 -0
- package/dist/components/base/illustration/illustration.js +80 -0
- package/dist/components/base/infinite_scroll/infinite_scroll.js +196 -0
- package/dist/components/base/keyset_pagination/keyset_pagination.js +152 -0
- package/dist/components/base/label/label.js +174 -0
- package/dist/components/base/link/link.js +330 -0
- package/dist/components/base/loading_icon/loading_icon.js +120 -0
- package/dist/components/base/markdown/markdown.js +50 -0
- package/dist/components/base/modal/modal.js +259 -0
- package/dist/components/base/new_dropdowns/base_dropdown/base_dropdown.js +716 -0
- package/dist/components/base/new_dropdowns/base_dropdown/constants.js +5 -0
- package/dist/components/base/new_dropdowns/base_dropdown/dropdown_container.js +32 -0
- package/dist/components/base/new_dropdowns/constants.js +24 -0
- package/dist/components/base/new_dropdowns/disclosure/constants.js +8 -0
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown.js +400 -0
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown_group.js +112 -0
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown_item.js +196 -0
- package/dist/components/base/new_dropdowns/disclosure/mock_data.js +168 -0
- package/dist/components/base/new_dropdowns/disclosure/utils.js +84 -0
- package/dist/components/base/new_dropdowns/listbox/listbox.js +997 -0
- package/dist/components/base/new_dropdowns/listbox/listbox_group.js +58 -0
- package/dist/components/base/new_dropdowns/listbox/listbox_item.js +112 -0
- package/dist/components/base/new_dropdowns/listbox/listbox_search_input.js +94 -0
- package/dist/components/base/new_dropdowns/listbox/mock_data.js +131 -0
- package/dist/components/base/new_dropdowns/listbox/utils.js +33 -0
- package/dist/components/base/pagination/pagination.js +397 -0
- package/dist/components/base/path/data.js +34 -0
- package/dist/components/base/path/path.js +177 -0
- package/dist/components/base/popover/popover.js +142 -0
- package/dist/components/base/progress_bar/progress_bar.js +117 -0
- package/dist/components/base/search_box_by_click/search_box_by_click.js +245 -0
- package/dist/components/base/search_box_by_type/search_box_by_type.js +187 -0
- package/dist/components/base/segmented_control/segmented_control.js +73 -0
- package/dist/components/base/skeleton_loader/skeleton_loader.js +232 -0
- package/dist/components/base/sorting/sorting.js +180 -0
- package/dist/components/base/table/constants.js +5 -0
- package/dist/components/base/table/table.js +187 -0
- package/dist/components/base/table_lite/table_lite.js +80 -0
- package/dist/components/base/tabs/constants.js +3 -0
- package/dist/components/base/tabs/tab/tab.js +113 -0
- package/dist/components/base/tabs/tabs/scrollable_tabs.js +162 -0
- package/dist/components/base/tabs/tabs/tabs.js +223 -0
- package/dist/components/base/toast/index.js +66 -0
- package/dist/components/base/toast/toast.js +125 -0
- package/dist/components/base/toast/toaster.js +87 -0
- package/dist/components/base/toggle/toggle.js +178 -0
- package/dist/components/base/token/token.js +97 -0
- package/dist/components/base/token_selector/helpers.js +5 -0
- package/dist/components/base/token_selector/token_container.js +160 -0
- package/dist/components/base/token_selector/token_selector.js +454 -0
- package/dist/components/base/token_selector/token_selector_dropdown.js +223 -0
- package/dist/components/base/tooltip/tooltip.js +54 -0
- package/dist/components/charts/area/area.js +329 -0
- package/dist/components/charts/bar/bar.js +207 -0
- package/dist/components/charts/chart/chart.js +215 -0
- package/dist/components/charts/column/column.js +221 -0
- package/dist/components/charts/discrete_scatter/discrete_scatter.js +199 -0
- package/dist/components/charts/gauge/gauge.js +205 -0
- package/dist/components/charts/heatmap/heatmap.js +299 -0
- package/dist/components/charts/heatmap/index.js +2 -0
- package/dist/components/charts/legend/legend.js +245 -0
- package/dist/components/charts/line/line.js +340 -0
- package/dist/components/charts/series_label/series_label.js +101 -0
- package/dist/components/charts/shared/tooltip/tooltip.js +369 -0
- package/dist/components/charts/shared/tooltip/tooltip_default_format/tooltip_default_format.js +53 -0
- package/dist/components/charts/single_stat/single_stat.js +164 -0
- package/dist/components/charts/sparkline/sparkline.js +299 -0
- package/dist/components/charts/stacked_column/stacked_column.js +380 -0
- package/dist/components/dashboards/dashboard_layout/dashboard_layout.js +125 -0
- package/dist/components/dashboards/dashboard_layout/grid_layout/grid_layout.js +326 -0
- package/dist/components/dashboards/dashboard_layout/validators.js +14 -0
- package/dist/components/dashboards/dashboard_panel/dashboard_panel.js +236 -0
- package/dist/components/dashboards/mock_data.js +49 -0
- package/dist/components/experimental/experiment_badge/constants.js +4 -0
- package/dist/components/experimental/experiment_badge/experiment_badge.js +102 -0
- package/dist/components/extended/multi_step_form_template/multi_step_form_template.js +87 -0
- package/dist/components/index.js +107 -0
- package/dist/components/mixins/button_mixin.js +11 -0
- package/dist/components/mixins/safe_link_mixin.js +30 -0
- package/dist/components/mixins/tooltip_mixin.js +21 -0
- package/dist/components/regions/dashboard_skeleton/dashboard_skeleton.js +53 -0
- package/dist/components/regions/empty_state/empty_state.js +181 -0
- package/dist/components/shared_components/clear_icon_button/clear_icon_button.js +64 -0
- package/dist/components/shared_components/clipboard_button/clipboard_button.js +100 -0
- package/dist/components/shared_components/close_button/close_button.js +55 -0
- package/dist/components/utilities/animated_number/animated_number.js +131 -0
- package/dist/components/utilities/friendly_wrap/friendly_wrap.js +75 -0
- package/dist/components/utilities/intersection_observer/intersection_observer.js +88 -0
- package/dist/components/utilities/intersperse/intersperse.js +104 -0
- package/dist/components/utilities/sprintf/sprintf.js +171 -0
- package/dist/components/utilities/truncate/constants.js +8 -0
- package/dist/components/utilities/truncate/truncate.js +154 -0
- package/dist/components/utilities/truncate_text/constants.js +7 -0
- package/dist/components/utilities/truncate_text/truncate_text.js +146 -0
- package/dist/config.js +53 -0
- package/dist/directives/hover_load/hover_load.js +45 -0
- package/dist/directives/index.js +8 -0
- package/dist/directives/modal.js +1 -0
- package/dist/directives/outside/outside.js +149 -0
- package/dist/directives/resize_observer/resize_observer.js +58 -0
- package/dist/directives/safe_html/constants.js +6 -0
- package/dist/directives/safe_html/safe_html.js +39 -0
- package/dist/directives/safe_link/mock_data.js +10 -0
- package/dist/directives/safe_link/safe_link.js +67 -0
- package/dist/directives/tooltip/container.js +7 -0
- package/dist/directives/tooltip/tooltip.js +18 -0
- package/dist/index.css +7 -0
- package/dist/index.css.map +1 -0
- package/dist/index.js +2 -0
- package/dist/tailwind.css +2 -0
- package/dist/tailwind.css.map +1 -0
- package/dist/tokens/build/js/tokens.dark.js +1410 -0
- package/dist/tokens/build/js/tokens.js +1410 -0
- package/dist/tokens/common_story_options.js +29 -0
- package/dist/tokens/tokens_story.js +76 -0
- package/dist/utils/breakpoints.js +20 -0
- package/dist/utils/charts/config.js +616 -0
- package/dist/utils/charts/constants.js +69 -0
- package/dist/utils/charts/mock_data.js +191 -0
- package/dist/utils/charts/story_config.js +24 -0
- package/dist/utils/charts/theme.js +200 -0
- package/dist/utils/charts/utils.js +54 -0
- package/dist/utils/constants.js +331 -0
- package/dist/utils/data_utils.js +19 -0
- package/dist/utils/datetime_utility.js +61 -0
- package/dist/utils/equality_utils.js +84 -0
- package/dist/utils/form_options_utils.js +46 -0
- package/dist/utils/i18n.js +65 -0
- package/dist/utils/is_slot_empty.js +34 -0
- package/dist/utils/number_utils.js +132 -0
- package/dist/utils/play_utils.js +11 -0
- package/dist/utils/set_utils.js +25 -0
- package/dist/utils/stories_constants.js +29 -0
- package/dist/utils/stories_utils.js +62 -0
- package/dist/utils/story_decorators/container.js +19 -0
- package/dist/utils/string_utils.js +69 -0
- package/dist/utils/svgs/svg_paths.js +7 -0
- package/dist/utils/test_utils.js +33 -0
- package/dist/utils/url_utils.js +56 -0
- package/dist/utils/use_fake_date.js +29 -0
- package/dist/utils/use_mock_intersection_observer.js +105 -0
- package/dist/utils/utils.js +205 -0
- package/dist/utils/vue_utils.js +57 -0
- package/dist/utils.js +5 -0
- package/dist/vendor/bootstrap-vue/src/bv-config.js +8 -0
- package/dist/vendor/bootstrap-vue/src/components/button/button-close.js +81 -0
- package/dist/vendor/bootstrap-vue/src/components/button/button.js +204 -0
- package/dist/vendor/bootstrap-vue/src/components/button/index.js +2 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-divider.js +44 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-form.js +59 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-group.js +98 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-header.js +63 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-item-button.js +108 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-item.js +97 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-text.js +60 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown.js +270 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/index.js +8 -0
- package/dist/vendor/bootstrap-vue/src/components/form/form-invalid-feedback.js +80 -0
- package/dist/vendor/bootstrap-vue/src/components/form/form-text.js +55 -0
- package/dist/vendor/bootstrap-vue/src/components/form/form-valid-feedback.js +80 -0
- package/dist/vendor/bootstrap-vue/src/components/form/form.js +56 -0
- package/dist/vendor/bootstrap-vue/src/components/form/index.js +4 -0
- package/dist/vendor/bootstrap-vue/src/components/form-group/form-group.js +347 -0
- package/dist/vendor/bootstrap-vue/src/components/form-group/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/components/form-select/form-select-option-group.js +56 -0
- package/dist/vendor/bootstrap-vue/src/components/form-select/form-select-option.js +47 -0
- package/dist/vendor/bootstrap-vue/src/components/form-select/form-select.js +154 -0
- package/dist/vendor/bootstrap-vue/src/components/form-select/helpers/mixin-options.js +63 -0
- package/dist/vendor/bootstrap-vue/src/components/form-select/index.js +3 -0
- package/dist/vendor/bootstrap-vue/src/components/form-textarea/form-textarea.js +236 -0
- package/dist/vendor/bootstrap-vue/src/components/form-textarea/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/components/layout/col.js +155 -0
- package/dist/vendor/bootstrap-vue/src/components/layout/form-row.js +34 -0
- package/dist/vendor/bootstrap-vue/src/components/layout/index.js +2 -0
- package/dist/vendor/bootstrap-vue/src/components/link/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/components/link/link.js +283 -0
- package/dist/vendor/bootstrap-vue/src/components/modal/helpers/bv-modal-event.class.js +21 -0
- package/dist/vendor/bootstrap-vue/src/components/modal/helpers/modal-manager.js +212 -0
- package/dist/vendor/bootstrap-vue/src/components/modal/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/components/modal/modal.js +1059 -0
- package/dist/vendor/bootstrap-vue/src/components/popover/helpers/bv-popover-template.js +55 -0
- package/dist/vendor/bootstrap-vue/src/components/popover/helpers/bv-popover.js +31 -0
- package/dist/vendor/bootstrap-vue/src/components/popover/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/components/popover/popover.js +64 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/constants.js +22 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/default-sort-compare.js +64 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/filter-event.js +40 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-bottom-row.js +43 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-busy.js +86 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-caption.js +57 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-colgroup.js +32 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-empty.js +101 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-filtering.js +292 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-items.js +169 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-pagination.js +51 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-provider.js +210 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-selectable.js +227 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-sorting.js +328 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-stacked.js +42 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-table-renderer.js +241 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody-row.js +349 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody.js +247 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-tfoot.js +69 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-thead.js +233 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-top-row.js +42 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/normalize-fields.js +86 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/sanitize-row.js +31 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/stringify-record-values.js +11 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/text-selection-active.js +14 -0
- package/dist/vendor/bootstrap-vue/src/components/table/index.js +9 -0
- package/dist/vendor/bootstrap-vue/src/components/table/table-lite.js +51 -0
- package/dist/vendor/bootstrap-vue/src/components/table/table-simple.js +44 -0
- package/dist/vendor/bootstrap-vue/src/components/table/table.js +67 -0
- package/dist/vendor/bootstrap-vue/src/components/table/tbody.js +116 -0
- package/dist/vendor/bootstrap-vue/src/components/table/td.js +204 -0
- package/dist/vendor/bootstrap-vue/src/components/table/tfoot.js +96 -0
- package/dist/vendor/bootstrap-vue/src/components/table/th.js +26 -0
- package/dist/vendor/bootstrap-vue/src/components/table/thead.js +99 -0
- package/dist/vendor/bootstrap-vue/src/components/table/tr.js +121 -0
- package/dist/vendor/bootstrap-vue/src/components/tabs/index.js +2 -0
- package/dist/vendor/bootstrap-vue/src/components/tabs/tab.js +238 -0
- package/dist/vendor/bootstrap-vue/src/components/tabs/tabs.js +690 -0
- package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-popper.js +278 -0
- package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip-template.js +125 -0
- package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip.js +932 -0
- package/dist/vendor/bootstrap-vue/src/components/tooltip/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/components/tooltip/tooltip.js +337 -0
- package/dist/vendor/bootstrap-vue/src/components/transition/bv-transition.js +118 -0
- package/dist/vendor/bootstrap-vue/src/components/transporter/transporter.js +220 -0
- package/dist/vendor/bootstrap-vue/src/constants/components.js +55 -0
- package/dist/vendor/bootstrap-vue/src/constants/config.js +11 -0
- package/dist/vendor/bootstrap-vue/src/constants/env.js +36 -0
- package/dist/vendor/bootstrap-vue/src/constants/events.js +56 -0
- package/dist/vendor/bootstrap-vue/src/constants/key-codes.js +11 -0
- package/dist/vendor/bootstrap-vue/src/constants/popper.js +10 -0
- package/dist/vendor/bootstrap-vue/src/constants/props.js +24 -0
- package/dist/vendor/bootstrap-vue/src/constants/regex.js +35 -0
- package/dist/vendor/bootstrap-vue/src/constants/safe-types.js +15 -0
- package/dist/vendor/bootstrap-vue/src/constants/slots.js +36 -0
- package/dist/vendor/bootstrap-vue/src/directives/modal/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/directives/modal/modal.js +112 -0
- package/dist/vendor/bootstrap-vue/src/directives/tooltip/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/directives/tooltip/tooltip.js +267 -0
- package/dist/vendor/bootstrap-vue/src/directives/visible/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/directives/visible/visible.js +187 -0
- package/dist/vendor/bootstrap-vue/src/mixins/attrs.js +5 -0
- package/dist/vendor/bootstrap-vue/src/mixins/click-out.js +54 -0
- package/dist/vendor/bootstrap-vue/src/mixins/dropdown.js +470 -0
- package/dist/vendor/bootstrap-vue/src/mixins/focus-in.js +46 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-control.js +73 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-custom.js +26 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-options.js +91 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-selection.js +62 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-size.js +26 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-state.js +50 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-text.js +293 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-validity.js +50 -0
- package/dist/vendor/bootstrap-vue/src/mixins/has-listener.js +29 -0
- package/dist/vendor/bootstrap-vue/src/mixins/id.js +57 -0
- package/dist/vendor/bootstrap-vue/src/mixins/listen-on-document.js +62 -0
- package/dist/vendor/bootstrap-vue/src/mixins/listen-on-root.js +120 -0
- package/dist/vendor/bootstrap-vue/src/mixins/listen-on-window.js +62 -0
- package/dist/vendor/bootstrap-vue/src/mixins/listeners.js +25 -0
- package/dist/vendor/bootstrap-vue/src/mixins/model.js +10 -0
- package/dist/vendor/bootstrap-vue/src/mixins/normalize-slot.js +30 -0
- package/dist/vendor/bootstrap-vue/src/mixins/scoped-style.js +18 -0
- package/dist/vendor/bootstrap-vue/src/mixins/use-parent.js +14 -0
- package/dist/vendor/bootstrap-vue/src/utils/array.js +27 -0
- package/dist/vendor/bootstrap-vue/src/utils/bv-event.class.js +60 -0
- package/dist/vendor/bootstrap-vue/src/utils/cache.js +60 -0
- package/dist/vendor/bootstrap-vue/src/utils/clone-deep.js +18 -0
- package/dist/vendor/bootstrap-vue/src/utils/config-set.js +86 -0
- package/dist/vendor/bootstrap-vue/src/utils/config.js +71 -0
- package/dist/vendor/bootstrap-vue/src/utils/create-new-child-component.js +133 -0
- package/dist/vendor/bootstrap-vue/src/utils/css-escape.js +70 -0
- package/dist/vendor/bootstrap-vue/src/utils/dom.js +298 -0
- package/dist/vendor/bootstrap-vue/src/utils/element-to-vue-instance-registry.js +28 -0
- package/dist/vendor/bootstrap-vue/src/utils/env.js +16 -0
- package/dist/vendor/bootstrap-vue/src/utils/events.js +78 -0
- package/dist/vendor/bootstrap-vue/src/utils/get-event-root.js +5 -0
- package/dist/vendor/bootstrap-vue/src/utils/get-instance-from-directive.js +3 -0
- package/dist/vendor/bootstrap-vue/src/utils/get-scope-id.js +9 -0
- package/dist/vendor/bootstrap-vue/src/utils/get.js +63 -0
- package/dist/vendor/bootstrap-vue/src/utils/html.js +16 -0
- package/dist/vendor/bootstrap-vue/src/utils/identity.js +3 -0
- package/dist/vendor/bootstrap-vue/src/utils/inspect.js +35 -0
- package/dist/vendor/bootstrap-vue/src/utils/locale.js +18 -0
- package/dist/vendor/bootstrap-vue/src/utils/loose-equal.js +59 -0
- package/dist/vendor/bootstrap-vue/src/utils/loose-index-of.js +13 -0
- package/dist/vendor/bootstrap-vue/src/utils/math.js +9 -0
- package/dist/vendor/bootstrap-vue/src/utils/memoize.js +14 -0
- package/dist/vendor/bootstrap-vue/src/utils/model.js +33 -0
- package/dist/vendor/bootstrap-vue/src/utils/noop.js +3 -0
- package/dist/vendor/bootstrap-vue/src/utils/normalize-slot.js +51 -0
- package/dist/vendor/bootstrap-vue/src/utils/number.js +23 -0
- package/dist/vendor/bootstrap-vue/src/utils/object.js +72 -0
- package/dist/vendor/bootstrap-vue/src/utils/observe-dom.js +76 -0
- package/dist/vendor/bootstrap-vue/src/utils/on-instance-destroy.js +22 -0
- package/dist/vendor/bootstrap-vue/src/utils/plugins.js +124 -0
- package/dist/vendor/bootstrap-vue/src/utils/props.js +67 -0
- package/dist/vendor/bootstrap-vue/src/utils/router.js +150 -0
- package/dist/vendor/bootstrap-vue/src/utils/safe-vue-instance.js +14 -0
- package/dist/vendor/bootstrap-vue/src/utils/stable-sort.js +28 -0
- package/dist/vendor/bootstrap-vue/src/utils/string.js +47 -0
- package/dist/vendor/bootstrap-vue/src/utils/stringify-object-values.js +31 -0
- package/dist/vendor/bootstrap-vue/src/utils/warn.js +45 -0
- package/dist/vendor/bootstrap-vue/src/vue.js +55 -0
- package/package.json +4 -3
- package/src/components/base/link/link.vue +2 -2
- package/src/utils/url_utils.js +66 -0
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-divider.js +5 -2
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-form.js +16 -4
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-group.js +31 -8
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-header.js +15 -4
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-item-button.js +32 -8
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown.js +2 -2
- package/src/vendor/bootstrap-vue/src/components/form/form-invalid-feedback.js +35 -8
- package/src/vendor/bootstrap-vue/src/components/form/form-valid-feedback.js +35 -8
- package/src/vendor/bootstrap-vue/src/components/form-group/form-group.js +2 -2
- package/src/vendor/bootstrap-vue/src/components/form-select/form-select-option-group.js +4 -2
- package/src/vendor/bootstrap-vue/src/components/form-select/form-select-option.js +9 -3
- package/src/vendor/bootstrap-vue/src/components/form-select/form-select.js +16 -9
- package/src/vendor/bootstrap-vue/src/components/form-select/helpers/mixin-options.js +10 -3
- package/src/vendor/bootstrap-vue/src/components/form-textarea/form-textarea.js +26 -7
- package/src/vendor/bootstrap-vue/src/components/layout/col.js +2 -2
- package/src/vendor/bootstrap-vue/src/components/modal/modal.js +2 -2
- package/src/vendor/bootstrap-vue/src/components/popover/popover.js +23 -7
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-busy.js +5 -2
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-caption.js +10 -3
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-empty.js +25 -6
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-items.js +20 -5
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-pagination.js +11 -4
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-provider.js +27 -7
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-selectable.js +21 -7
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-sorting.js +72 -18
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-stacked.js +6 -3
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-table-renderer.js +72 -17
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody-row.js +18 -6
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody.js +7 -3
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-tfoot.js +27 -7
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-thead.js +21 -6
- package/src/vendor/bootstrap-vue/src/components/tabs/tabs.js +2 -2
- package/src/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-popper.js +36 -13
- package/src/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip-template.js +10 -3
- package/src/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip.js +8 -9
- package/src/vendor/bootstrap-vue/src/components/transition/bv-transition.js +20 -5
- package/src/vendor/bootstrap-vue/src/components/transporter/transporter.js +22 -6
- package/src/vendor/bootstrap-vue/src/mixins/listen-on-document.js +1 -2
- package/src/vendor/bootstrap-vue/src/mixins/listen-on-root.js +1 -2
- package/src/vendor/bootstrap-vue/src/mixins/listen-on-window.js +1 -2
- package/src/vendor/bootstrap-vue/src/utils/array.js +0 -1
- package/src/vendor/bootstrap-vue/src/utils/locale.js +1 -2
|
@@ -0,0 +1,690 @@
|
|
|
1
|
+
import { extend, COMPONENT_UID_KEY, REF_FOR_KEY } from '../../vue';
|
|
2
|
+
import { NAME_TABS, NAME_TAB_BUTTON_HELPER } from '../../constants/components';
|
|
3
|
+
import { IS_BROWSER } from '../../constants/env';
|
|
4
|
+
import { EVENT_NAME_CHANGED, EVENT_NAME_ACTIVATE_TAB, EVENT_NAME_CLICK, EVENT_NAME_FIRST, EVENT_NAME_PREV, EVENT_NAME_NEXT, EVENT_NAME_LAST } from '../../constants/events';
|
|
5
|
+
import { CODE_SPACE, CODE_UP, CODE_LEFT, CODE_HOME, CODE_DOWN, CODE_RIGHT, CODE_END } from '../../constants/key-codes';
|
|
6
|
+
import { PROP_TYPE_NUMBER, PROP_TYPE_ARRAY, PROP_TYPE_OBJECT, PROP_TYPE_STRING, PROP_TYPE_BOOLEAN } from '../../constants/props';
|
|
7
|
+
import { SLOT_NAME_TABS_START, SLOT_NAME_TABS_END, SLOT_NAME_TOOLBAR_START, SLOT_NAME_TOOLBAR_END, SLOT_NAME_EMPTY, SLOT_NAME_TITLE } from '../../constants/slots';
|
|
8
|
+
import { BvEvent } from '../../utils/bv-event.class';
|
|
9
|
+
import { selectAll, attemptFocus, requestAF } from '../../utils/dom';
|
|
10
|
+
import { stopEvent } from '../../utils/events';
|
|
11
|
+
import { identity } from '../../utils/identity';
|
|
12
|
+
import { isEvent } from '../../utils/inspect';
|
|
13
|
+
import { looseEqual } from '../../utils/loose-equal';
|
|
14
|
+
import { mathMax } from '../../utils/math';
|
|
15
|
+
import { makeModelMixin } from '../../utils/model';
|
|
16
|
+
import { toInteger } from '../../utils/number';
|
|
17
|
+
import { sortKeys } from '../../utils/object';
|
|
18
|
+
import { observeDom } from '../../utils/observe-dom';
|
|
19
|
+
import { stableSort } from '../../utils/stable-sort';
|
|
20
|
+
import { props as props$1, idMixin } from '../../mixins/id';
|
|
21
|
+
import { normalizeSlotMixin } from '../../mixins/normalize-slot';
|
|
22
|
+
import { BLink } from '../link/link';
|
|
23
|
+
|
|
24
|
+
// --- Constants ---
|
|
25
|
+
|
|
26
|
+
const {
|
|
27
|
+
mixin: modelMixin,
|
|
28
|
+
props: modelProps,
|
|
29
|
+
prop: MODEL_PROP_NAME,
|
|
30
|
+
event: MODEL_EVENT_NAME
|
|
31
|
+
} = makeModelMixin('value', {
|
|
32
|
+
type: PROP_TYPE_NUMBER
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
// --- Helper methods ---
|
|
36
|
+
|
|
37
|
+
// Filter function to filter out disabled tabs
|
|
38
|
+
const notDisabled = tab => !tab.disabled;
|
|
39
|
+
|
|
40
|
+
// --- Helper components ---
|
|
41
|
+
|
|
42
|
+
// @vue/component
|
|
43
|
+
const BVTabButton = /*#__PURE__*/extend({
|
|
44
|
+
name: NAME_TAB_BUTTON_HELPER,
|
|
45
|
+
inject: {
|
|
46
|
+
getBvTabs: {
|
|
47
|
+
default: /* istanbul ignore next */() => () => ({})
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
props: {
|
|
51
|
+
controls: {
|
|
52
|
+
type: PROP_TYPE_STRING,
|
|
53
|
+
required: false,
|
|
54
|
+
default: undefined
|
|
55
|
+
},
|
|
56
|
+
id: {
|
|
57
|
+
type: PROP_TYPE_STRING,
|
|
58
|
+
required: false,
|
|
59
|
+
default: undefined
|
|
60
|
+
},
|
|
61
|
+
noKeyNav: {
|
|
62
|
+
type: PROP_TYPE_BOOLEAN,
|
|
63
|
+
required: false,
|
|
64
|
+
default: false
|
|
65
|
+
},
|
|
66
|
+
posInSet: {
|
|
67
|
+
type: PROP_TYPE_NUMBER,
|
|
68
|
+
required: false,
|
|
69
|
+
default: undefined
|
|
70
|
+
},
|
|
71
|
+
setSize: {
|
|
72
|
+
type: PROP_TYPE_NUMBER,
|
|
73
|
+
required: false,
|
|
74
|
+
default: undefined
|
|
75
|
+
},
|
|
76
|
+
// Reference to the child <b-tab> instance
|
|
77
|
+
tab: {
|
|
78
|
+
required: false,
|
|
79
|
+
default: undefined
|
|
80
|
+
},
|
|
81
|
+
tabIndex: {
|
|
82
|
+
type: PROP_TYPE_NUMBER,
|
|
83
|
+
required: false,
|
|
84
|
+
default: undefined
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
computed: {
|
|
88
|
+
bvTabs() {
|
|
89
|
+
return this.getBvTabs();
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
methods: {
|
|
93
|
+
focus() {
|
|
94
|
+
attemptFocus(this.$refs.link);
|
|
95
|
+
},
|
|
96
|
+
handleEvent(event) {
|
|
97
|
+
/* istanbul ignore next */
|
|
98
|
+
if (this.tab.disabled) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const {
|
|
102
|
+
type,
|
|
103
|
+
keyCode,
|
|
104
|
+
shiftKey
|
|
105
|
+
} = event;
|
|
106
|
+
if (type === 'click') {
|
|
107
|
+
stopEvent(event);
|
|
108
|
+
this.$emit(EVENT_NAME_CLICK, event);
|
|
109
|
+
} else if (type === 'keydown' && keyCode === CODE_SPACE) {
|
|
110
|
+
// For ARIA tabs the SPACE key will also trigger a click/select
|
|
111
|
+
// Even with keyboard navigation disabled, SPACE should "click" the button
|
|
112
|
+
// See: https://github.com/bootstrap-vue/bootstrap-vue/issues/4323
|
|
113
|
+
stopEvent(event);
|
|
114
|
+
this.$emit(EVENT_NAME_CLICK, event);
|
|
115
|
+
} else if (type === 'keydown' && !this.noKeyNav) {
|
|
116
|
+
// For keyboard navigation
|
|
117
|
+
if ([CODE_UP, CODE_LEFT, CODE_HOME].indexOf(keyCode) !== -1) {
|
|
118
|
+
stopEvent(event);
|
|
119
|
+
if (shiftKey || keyCode === CODE_HOME) {
|
|
120
|
+
this.$emit(EVENT_NAME_FIRST, event);
|
|
121
|
+
} else {
|
|
122
|
+
this.$emit(EVENT_NAME_PREV, event);
|
|
123
|
+
}
|
|
124
|
+
} else if ([CODE_DOWN, CODE_RIGHT, CODE_END].indexOf(keyCode) !== -1) {
|
|
125
|
+
stopEvent(event);
|
|
126
|
+
if (shiftKey || keyCode === CODE_END) {
|
|
127
|
+
this.$emit(EVENT_NAME_LAST, event);
|
|
128
|
+
} else {
|
|
129
|
+
this.$emit(EVENT_NAME_NEXT, event);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
render(h) {
|
|
136
|
+
const {
|
|
137
|
+
id,
|
|
138
|
+
tabIndex,
|
|
139
|
+
setSize,
|
|
140
|
+
posInSet,
|
|
141
|
+
controls,
|
|
142
|
+
handleEvent
|
|
143
|
+
} = this;
|
|
144
|
+
const {
|
|
145
|
+
title,
|
|
146
|
+
localActive,
|
|
147
|
+
disabled,
|
|
148
|
+
titleItemClass,
|
|
149
|
+
titleLinkClass,
|
|
150
|
+
titleLinkAttributes
|
|
151
|
+
} = this.tab;
|
|
152
|
+
const $link = h(BLink, {
|
|
153
|
+
staticClass: 'nav-link',
|
|
154
|
+
class: [{
|
|
155
|
+
active: localActive && !disabled,
|
|
156
|
+
disabled
|
|
157
|
+
}, titleLinkClass,
|
|
158
|
+
// Apply <b-tabs> `activeNavItemClass` styles when the tab is active
|
|
159
|
+
localActive ? this.bvTabs.activeNavItemClass : null],
|
|
160
|
+
props: {
|
|
161
|
+
disabled
|
|
162
|
+
},
|
|
163
|
+
attrs: {
|
|
164
|
+
...titleLinkAttributes,
|
|
165
|
+
id,
|
|
166
|
+
role: 'tab',
|
|
167
|
+
// Roving tab index when keynav enabled
|
|
168
|
+
tabindex: tabIndex,
|
|
169
|
+
'aria-selected': localActive && !disabled ? 'true' : 'false',
|
|
170
|
+
'aria-setsize': setSize,
|
|
171
|
+
'aria-posinset': posInSet,
|
|
172
|
+
'aria-controls': controls
|
|
173
|
+
},
|
|
174
|
+
on: {
|
|
175
|
+
click: handleEvent,
|
|
176
|
+
keydown: handleEvent
|
|
177
|
+
},
|
|
178
|
+
ref: 'link'
|
|
179
|
+
}, [this.tab.normalizeSlot(SLOT_NAME_TITLE) || title]);
|
|
180
|
+
return h('li', {
|
|
181
|
+
staticClass: 'nav-item',
|
|
182
|
+
class: [titleItemClass],
|
|
183
|
+
attrs: {
|
|
184
|
+
role: 'presentation'
|
|
185
|
+
}
|
|
186
|
+
}, [$link]);
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
// --- Props ---
|
|
191
|
+
const navProps = {
|
|
192
|
+
align: {
|
|
193
|
+
type: PROP_TYPE_STRING,
|
|
194
|
+
required: false,
|
|
195
|
+
default: undefined
|
|
196
|
+
},
|
|
197
|
+
fill: {
|
|
198
|
+
type: PROP_TYPE_BOOLEAN,
|
|
199
|
+
required: false,
|
|
200
|
+
default: false
|
|
201
|
+
},
|
|
202
|
+
justified: {
|
|
203
|
+
type: PROP_TYPE_BOOLEAN,
|
|
204
|
+
required: false,
|
|
205
|
+
default: false
|
|
206
|
+
},
|
|
207
|
+
pills: {
|
|
208
|
+
type: PROP_TYPE_BOOLEAN,
|
|
209
|
+
required: false,
|
|
210
|
+
default: false
|
|
211
|
+
},
|
|
212
|
+
small: {
|
|
213
|
+
type: PROP_TYPE_BOOLEAN,
|
|
214
|
+
required: false,
|
|
215
|
+
default: false
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
const props = sortKeys({
|
|
219
|
+
...props$1,
|
|
220
|
+
...modelProps,
|
|
221
|
+
...navProps,
|
|
222
|
+
// Only applied to the currently active `li`
|
|
223
|
+
activeNavItemClass: {
|
|
224
|
+
type: [PROP_TYPE_ARRAY, PROP_TYPE_OBJECT, PROP_TYPE_STRING],
|
|
225
|
+
required: false,
|
|
226
|
+
default: undefined
|
|
227
|
+
},
|
|
228
|
+
// Only applied to the currently active `<b-tab>`
|
|
229
|
+
// This prop is sniffed by the `<b-tab>` child
|
|
230
|
+
activeTabClass: {
|
|
231
|
+
type: [PROP_TYPE_ARRAY, PROP_TYPE_OBJECT, PROP_TYPE_STRING],
|
|
232
|
+
required: false,
|
|
233
|
+
default: undefined
|
|
234
|
+
},
|
|
235
|
+
contentClass: {
|
|
236
|
+
type: [PROP_TYPE_ARRAY, PROP_TYPE_OBJECT, PROP_TYPE_STRING],
|
|
237
|
+
required: false,
|
|
238
|
+
default: undefined
|
|
239
|
+
},
|
|
240
|
+
// Synonym for 'bottom'
|
|
241
|
+
end: {
|
|
242
|
+
type: PROP_TYPE_BOOLEAN,
|
|
243
|
+
required: false,
|
|
244
|
+
default: false
|
|
245
|
+
},
|
|
246
|
+
// This prop is sniffed by the `<b-tab>` child
|
|
247
|
+
lazy: {
|
|
248
|
+
type: PROP_TYPE_BOOLEAN,
|
|
249
|
+
required: false,
|
|
250
|
+
default: false
|
|
251
|
+
},
|
|
252
|
+
navClass: {
|
|
253
|
+
type: [PROP_TYPE_ARRAY, PROP_TYPE_OBJECT, PROP_TYPE_STRING],
|
|
254
|
+
required: false,
|
|
255
|
+
default: undefined
|
|
256
|
+
},
|
|
257
|
+
navWrapperClass: {
|
|
258
|
+
type: [PROP_TYPE_ARRAY, PROP_TYPE_OBJECT, PROP_TYPE_STRING],
|
|
259
|
+
required: false,
|
|
260
|
+
default: undefined
|
|
261
|
+
},
|
|
262
|
+
noFade: {
|
|
263
|
+
type: PROP_TYPE_BOOLEAN,
|
|
264
|
+
required: false,
|
|
265
|
+
default: false
|
|
266
|
+
},
|
|
267
|
+
noKeyNav: {
|
|
268
|
+
type: PROP_TYPE_BOOLEAN,
|
|
269
|
+
required: false,
|
|
270
|
+
default: false
|
|
271
|
+
},
|
|
272
|
+
noNavStyle: {
|
|
273
|
+
type: PROP_TYPE_BOOLEAN,
|
|
274
|
+
required: false,
|
|
275
|
+
default: false
|
|
276
|
+
},
|
|
277
|
+
tag: {
|
|
278
|
+
type: PROP_TYPE_STRING,
|
|
279
|
+
required: false,
|
|
280
|
+
default: 'div'
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
// --- Main component ---
|
|
285
|
+
|
|
286
|
+
// @vue/component
|
|
287
|
+
const BTabs = /*#__PURE__*/extend({
|
|
288
|
+
name: NAME_TABS,
|
|
289
|
+
mixins: [idMixin, modelMixin, normalizeSlotMixin],
|
|
290
|
+
provide() {
|
|
291
|
+
return {
|
|
292
|
+
getBvTabs: () => this
|
|
293
|
+
};
|
|
294
|
+
},
|
|
295
|
+
props,
|
|
296
|
+
data() {
|
|
297
|
+
return {
|
|
298
|
+
// Index of current tab
|
|
299
|
+
currentTab: toInteger(this[MODEL_PROP_NAME], -1),
|
|
300
|
+
// Array of direct child `<b-tab>` instances, in DOM order
|
|
301
|
+
tabs: [],
|
|
302
|
+
// Array of child instances registered (for triggering reactive updates)
|
|
303
|
+
registeredTabs: []
|
|
304
|
+
};
|
|
305
|
+
},
|
|
306
|
+
computed: {
|
|
307
|
+
fade() {
|
|
308
|
+
// This computed prop is sniffed by the tab child
|
|
309
|
+
return !this.noFade;
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
watch: {
|
|
313
|
+
[MODEL_PROP_NAME](newValue, oldValue) {
|
|
314
|
+
if (newValue !== oldValue) {
|
|
315
|
+
newValue = toInteger(newValue, -1);
|
|
316
|
+
oldValue = toInteger(oldValue, 0);
|
|
317
|
+
const $tab = this.tabs[newValue];
|
|
318
|
+
if ($tab && !$tab.disabled) {
|
|
319
|
+
this.activateTab($tab);
|
|
320
|
+
} else {
|
|
321
|
+
// Try next or prev tabs
|
|
322
|
+
if (newValue < oldValue) {
|
|
323
|
+
this.previousTab();
|
|
324
|
+
} else {
|
|
325
|
+
this.nextTab();
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
currentTab(newValue) {
|
|
331
|
+
let index = -1;
|
|
332
|
+
|
|
333
|
+
// Ensure only one tab is active at most
|
|
334
|
+
this.tabs.forEach(($tab, i) => {
|
|
335
|
+
if (i === newValue && !$tab.disabled) {
|
|
336
|
+
$tab.localActive = true;
|
|
337
|
+
index = i;
|
|
338
|
+
} else {
|
|
339
|
+
$tab.localActive = false;
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
|
|
343
|
+
// Update the v-model
|
|
344
|
+
this.$emit(MODEL_EVENT_NAME, index);
|
|
345
|
+
},
|
|
346
|
+
// If tabs added, removed, or re-ordered, we emit a `changed` event
|
|
347
|
+
tabs(newValue, oldValue) {
|
|
348
|
+
// We use `_uid` instead of `safeId()`, as the later is changed in a `$nextTick()`
|
|
349
|
+
// if no explicit ID is provided, causing duplicate emits
|
|
350
|
+
if (!looseEqual(newValue.map($tab => $tab[COMPONENT_UID_KEY]), oldValue.map($tab => $tab[COMPONENT_UID_KEY]))) {
|
|
351
|
+
// In a `$nextTick()` to ensure `currentTab` has been set first
|
|
352
|
+
this.$nextTick(() => {
|
|
353
|
+
// We emit shallow copies of the new and old arrays of tabs,
|
|
354
|
+
// to prevent users from potentially mutating the internal arrays
|
|
355
|
+
this.$emit(EVENT_NAME_CHANGED, newValue.slice(), oldValue.slice());
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
// Each `<b-tab>` will register/unregister itself
|
|
360
|
+
// We use this to detect when tabs are added/removed
|
|
361
|
+
// to trigger the update of the tabs
|
|
362
|
+
registeredTabs() {
|
|
363
|
+
this.updateTabs();
|
|
364
|
+
}
|
|
365
|
+
},
|
|
366
|
+
created() {
|
|
367
|
+
// Create private non-reactive props
|
|
368
|
+
this.$_observer = null;
|
|
369
|
+
},
|
|
370
|
+
mounted() {
|
|
371
|
+
this.setObserver(true);
|
|
372
|
+
},
|
|
373
|
+
beforeDestroy() {
|
|
374
|
+
this.setObserver(false);
|
|
375
|
+
// Ensure no references to child instances exist
|
|
376
|
+
this.tabs = [];
|
|
377
|
+
},
|
|
378
|
+
methods: {
|
|
379
|
+
registerTab($tab) {
|
|
380
|
+
if (!this.registeredTabs.includes($tab)) {
|
|
381
|
+
this.registeredTabs.push($tab);
|
|
382
|
+
}
|
|
383
|
+
},
|
|
384
|
+
unregisterTab($tab) {
|
|
385
|
+
this.registeredTabs = this.registeredTabs.slice().filter($t => $t !== $tab);
|
|
386
|
+
},
|
|
387
|
+
// DOM observer is needed to detect changes in order of tabs
|
|
388
|
+
setObserver() {
|
|
389
|
+
let on = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
390
|
+
this.$_observer && this.$_observer.disconnect();
|
|
391
|
+
this.$_observer = null;
|
|
392
|
+
if (on) {
|
|
393
|
+
/* istanbul ignore next: difficult to test mutation observer in JSDOM */
|
|
394
|
+
const handler = () => {
|
|
395
|
+
this.$nextTick(() => {
|
|
396
|
+
requestAF(() => {
|
|
397
|
+
this.updateTabs();
|
|
398
|
+
});
|
|
399
|
+
});
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
// Watch for changes to `<b-tab>` sub components
|
|
403
|
+
this.$_observer = observeDom(this.$refs.content, handler, {
|
|
404
|
+
childList: true,
|
|
405
|
+
subtree: false,
|
|
406
|
+
attributes: true,
|
|
407
|
+
attributeFilter: ['id']
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
getTabs() {
|
|
412
|
+
const $tabs = this.registeredTabs;
|
|
413
|
+
// Dropped intentionally
|
|
414
|
+
// .filter(
|
|
415
|
+
// $tab => $tab.$children.filter($t => $t && $t._isTab).length === 0
|
|
416
|
+
// )
|
|
417
|
+
|
|
418
|
+
// DOM Order of Tabs
|
|
419
|
+
let order = [];
|
|
420
|
+
/* istanbul ignore next: too difficult to test */
|
|
421
|
+
if (IS_BROWSER && $tabs.length > 0) {
|
|
422
|
+
// We rely on the DOM when mounted to get the "true" order of the `<b-tab>` children
|
|
423
|
+
// `querySelectorAll()` always returns elements in document order, regardless of
|
|
424
|
+
// order specified in the selector
|
|
425
|
+
const selector = $tabs.map($tab => `#${$tab.safeId()}`).join(', ');
|
|
426
|
+
order = selectAll(selector, this.$el).map($el => $el.id).filter(identity);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
// Stable sort keeps the original order if not found in the `order` array,
|
|
430
|
+
// which will be an empty array before mount
|
|
431
|
+
return stableSort($tabs, (a, b) => order.indexOf(a.safeId()) - order.indexOf(b.safeId()));
|
|
432
|
+
},
|
|
433
|
+
updateTabs() {
|
|
434
|
+
const $tabs = this.getTabs();
|
|
435
|
+
|
|
436
|
+
// Find last active non-disabled tab in current tabs
|
|
437
|
+
// We trust tab state over `currentTab`, in case tabs were added/removed/re-ordered
|
|
438
|
+
let tabIndex = $tabs.indexOf($tabs.slice().reverse().find($tab => $tab.localActive && !$tab.disabled));
|
|
439
|
+
|
|
440
|
+
// Else try setting to `currentTab`
|
|
441
|
+
if (tabIndex < 0) {
|
|
442
|
+
const {
|
|
443
|
+
currentTab
|
|
444
|
+
} = this;
|
|
445
|
+
if (currentTab >= $tabs.length) {
|
|
446
|
+
// Handle last tab being removed, so find the last non-disabled tab
|
|
447
|
+
tabIndex = $tabs.indexOf($tabs.slice().reverse().find(notDisabled));
|
|
448
|
+
} else if ($tabs[currentTab] && !$tabs[currentTab].disabled) {
|
|
449
|
+
// Current tab is not disabled
|
|
450
|
+
tabIndex = currentTab;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
// Else find first non-disabled tab in current tabs
|
|
455
|
+
if (tabIndex < 0) {
|
|
456
|
+
tabIndex = $tabs.indexOf($tabs.find(notDisabled));
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
// Ensure only one tab is active at a time
|
|
460
|
+
$tabs.forEach(($tab, index) => {
|
|
461
|
+
$tab.localActive = index === tabIndex;
|
|
462
|
+
});
|
|
463
|
+
this.tabs = $tabs;
|
|
464
|
+
this.currentTab = tabIndex;
|
|
465
|
+
},
|
|
466
|
+
// Find a button that controls a tab, given the tab reference
|
|
467
|
+
// Returns the button vm instance
|
|
468
|
+
getButtonForTab($tab) {
|
|
469
|
+
return (this.$refs.buttons || []).find($btn => $btn.tab === $tab);
|
|
470
|
+
},
|
|
471
|
+
// Force a button to re-render its content, given a `<b-tab>` instance
|
|
472
|
+
// Called by `<b-tab>` on `update()`
|
|
473
|
+
updateButton($tab) {
|
|
474
|
+
const $button = this.getButtonForTab($tab);
|
|
475
|
+
if ($button && $button.$forceUpdate) {
|
|
476
|
+
$button.$forceUpdate();
|
|
477
|
+
}
|
|
478
|
+
},
|
|
479
|
+
// Activate a tab given a `<b-tab>` instance
|
|
480
|
+
// Also accessed by `<b-tab>`
|
|
481
|
+
activateTab($tab) {
|
|
482
|
+
const {
|
|
483
|
+
currentTab,
|
|
484
|
+
tabs: $tabs
|
|
485
|
+
} = this;
|
|
486
|
+
let result = false;
|
|
487
|
+
if ($tab) {
|
|
488
|
+
const index = $tabs.indexOf($tab);
|
|
489
|
+
if (index !== currentTab && index > -1 && !$tab.disabled) {
|
|
490
|
+
const tabEvent = new BvEvent(EVENT_NAME_ACTIVATE_TAB, {
|
|
491
|
+
cancelable: true,
|
|
492
|
+
vueTarget: this,
|
|
493
|
+
componentId: this.safeId()
|
|
494
|
+
});
|
|
495
|
+
this.$emit(tabEvent.type, index, currentTab, tabEvent);
|
|
496
|
+
if (!tabEvent.defaultPrevented) {
|
|
497
|
+
this.currentTab = index;
|
|
498
|
+
result = true;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
// Couldn't set tab, so ensure v-model is up to date
|
|
504
|
+
/* istanbul ignore next: should rarely happen */
|
|
505
|
+
if (!result && this[MODEL_PROP_NAME] !== currentTab) {
|
|
506
|
+
this.$emit(MODEL_EVENT_NAME, currentTab);
|
|
507
|
+
}
|
|
508
|
+
return result;
|
|
509
|
+
},
|
|
510
|
+
// Deactivate a tab given a `<b-tab>` instance
|
|
511
|
+
// Accessed by `<b-tab>`
|
|
512
|
+
deactivateTab($tab) {
|
|
513
|
+
if ($tab) {
|
|
514
|
+
// Find first non-disabled tab that isn't the one being deactivated
|
|
515
|
+
// If no tabs are available, then don't deactivate current tab
|
|
516
|
+
return this.activateTab(this.tabs.filter($t => $t !== $tab).find(notDisabled));
|
|
517
|
+
}
|
|
518
|
+
/* istanbul ignore next: should never/rarely happen */
|
|
519
|
+
return false;
|
|
520
|
+
},
|
|
521
|
+
// Focus a tab button given its `<b-tab>` instance
|
|
522
|
+
focusButton($tab) {
|
|
523
|
+
// Wrap in `$nextTick()` to ensure DOM has completed rendering
|
|
524
|
+
this.$nextTick(() => {
|
|
525
|
+
attemptFocus(this.getButtonForTab($tab));
|
|
526
|
+
});
|
|
527
|
+
},
|
|
528
|
+
// Emit a click event on a specified `<b-tab>` component instance
|
|
529
|
+
emitTabClick(tab, event) {
|
|
530
|
+
if (isEvent(event) && tab && tab.$emit && !tab.disabled) {
|
|
531
|
+
tab.$emit(EVENT_NAME_CLICK, event);
|
|
532
|
+
}
|
|
533
|
+
},
|
|
534
|
+
// Click handler
|
|
535
|
+
clickTab($tab, event) {
|
|
536
|
+
this.activateTab($tab);
|
|
537
|
+
this.emitTabClick($tab, event);
|
|
538
|
+
},
|
|
539
|
+
// Move to first non-disabled tab
|
|
540
|
+
firstTab(focus) {
|
|
541
|
+
const $tab = this.tabs.find(notDisabled);
|
|
542
|
+
if (this.activateTab($tab) && focus) {
|
|
543
|
+
this.focusButton($tab);
|
|
544
|
+
this.emitTabClick($tab, focus);
|
|
545
|
+
}
|
|
546
|
+
},
|
|
547
|
+
// Move to previous non-disabled tab
|
|
548
|
+
previousTab(focus) {
|
|
549
|
+
const currentIndex = mathMax(this.currentTab, 0);
|
|
550
|
+
const $tab = this.tabs.slice(0, currentIndex).reverse().find(notDisabled);
|
|
551
|
+
if (this.activateTab($tab) && focus) {
|
|
552
|
+
this.focusButton($tab);
|
|
553
|
+
this.emitTabClick($tab, focus);
|
|
554
|
+
}
|
|
555
|
+
},
|
|
556
|
+
// Move to next non-disabled tab
|
|
557
|
+
nextTab(focus) {
|
|
558
|
+
const currentIndex = mathMax(this.currentTab, -1);
|
|
559
|
+
const $tab = this.tabs.slice(currentIndex + 1).find(notDisabled);
|
|
560
|
+
if (this.activateTab($tab) && focus) {
|
|
561
|
+
this.focusButton($tab);
|
|
562
|
+
this.emitTabClick($tab, focus);
|
|
563
|
+
}
|
|
564
|
+
},
|
|
565
|
+
// Move to last non-disabled tab
|
|
566
|
+
lastTab(focus) {
|
|
567
|
+
const $tab = this.tabs.slice().reverse().find(notDisabled);
|
|
568
|
+
if (this.activateTab($tab) && focus) {
|
|
569
|
+
this.focusButton($tab);
|
|
570
|
+
this.emitTabClick($tab, focus);
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
},
|
|
574
|
+
render(h) {
|
|
575
|
+
const {
|
|
576
|
+
align,
|
|
577
|
+
end,
|
|
578
|
+
fill,
|
|
579
|
+
firstTab,
|
|
580
|
+
justified,
|
|
581
|
+
lastTab,
|
|
582
|
+
nextTab,
|
|
583
|
+
noKeyNav,
|
|
584
|
+
noNavStyle,
|
|
585
|
+
pills,
|
|
586
|
+
previousTab,
|
|
587
|
+
small,
|
|
588
|
+
tabs: $tabs
|
|
589
|
+
} = this;
|
|
590
|
+
|
|
591
|
+
// Currently active tab
|
|
592
|
+
const $activeTab = $tabs.find($tab => $tab.localActive && !$tab.disabled);
|
|
593
|
+
|
|
594
|
+
// Tab button to allow focusing when no active tab found (keynav only)
|
|
595
|
+
const $fallbackTab = $tabs.find($tab => !$tab.disabled);
|
|
596
|
+
|
|
597
|
+
// For each `<b-tab>` found create the tab buttons
|
|
598
|
+
const $buttons = $tabs.map(($tab, index) => {
|
|
599
|
+
const {
|
|
600
|
+
safeId
|
|
601
|
+
} = $tab;
|
|
602
|
+
|
|
603
|
+
// Ensure at least one tab button is focusable when keynav enabled (if possible)
|
|
604
|
+
let tabIndex = null;
|
|
605
|
+
if (!noKeyNav) {
|
|
606
|
+
// Buttons are not in tab index unless active, or a fallback tab
|
|
607
|
+
tabIndex = -1;
|
|
608
|
+
if ($tab === $activeTab || !$activeTab && $tab === $fallbackTab) {
|
|
609
|
+
// Place tab button in tab sequence
|
|
610
|
+
tabIndex = null;
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
return h(BVTabButton, {
|
|
614
|
+
props: {
|
|
615
|
+
controls: safeId ? safeId() : null,
|
|
616
|
+
id: $tab.controlledBy || (safeId ? safeId(`_BV_tab_button_`) : null),
|
|
617
|
+
noKeyNav,
|
|
618
|
+
posInSet: index + 1,
|
|
619
|
+
setSize: $tabs.length,
|
|
620
|
+
tab: $tab,
|
|
621
|
+
tabIndex
|
|
622
|
+
},
|
|
623
|
+
on: {
|
|
624
|
+
[EVENT_NAME_CLICK]: event => {
|
|
625
|
+
this.clickTab($tab, event);
|
|
626
|
+
},
|
|
627
|
+
[EVENT_NAME_FIRST]: firstTab,
|
|
628
|
+
[EVENT_NAME_PREV]: previousTab,
|
|
629
|
+
[EVENT_NAME_NEXT]: nextTab,
|
|
630
|
+
[EVENT_NAME_LAST]: lastTab
|
|
631
|
+
},
|
|
632
|
+
key: $tab[COMPONENT_UID_KEY] || index,
|
|
633
|
+
ref: 'buttons',
|
|
634
|
+
// Needed to make `this.$refs.buttons` an array
|
|
635
|
+
[REF_FOR_KEY]: true
|
|
636
|
+
});
|
|
637
|
+
});
|
|
638
|
+
const computeJustifyContent = value => {
|
|
639
|
+
value = value === 'left' ? 'start' : value === 'right' ? 'end' : value;
|
|
640
|
+
return `justify-content-${value}`;
|
|
641
|
+
};
|
|
642
|
+
let $nav = h('ul', {
|
|
643
|
+
staticClass: 'nav',
|
|
644
|
+
class: [this.navClass, {
|
|
645
|
+
'nav-tabs': !noNavStyle && !pills,
|
|
646
|
+
'nav-pills': !noNavStyle && pills,
|
|
647
|
+
'nav-fill': fill,
|
|
648
|
+
'nav-justified': justified,
|
|
649
|
+
[computeJustifyContent(align)]: align,
|
|
650
|
+
small
|
|
651
|
+
}],
|
|
652
|
+
attrs: {
|
|
653
|
+
role: 'tablist',
|
|
654
|
+
id: this.safeId('_BV_tab_controls_')
|
|
655
|
+
},
|
|
656
|
+
ref: 'nav'
|
|
657
|
+
}, [this.normalizeSlot(SLOT_NAME_TABS_START) || h(), $buttons, this.normalizeSlot(SLOT_NAME_TABS_END) || h()]);
|
|
658
|
+
$nav = h('div', {
|
|
659
|
+
class: this.navWrapperClass,
|
|
660
|
+
key: 'bv-tabs-nav'
|
|
661
|
+
}, [this.normalizeSlot(SLOT_NAME_TOOLBAR_START) || h(), $nav, this.normalizeSlot(SLOT_NAME_TOOLBAR_END) || h()]);
|
|
662
|
+
const $children = this.normalizeSlot() || [];
|
|
663
|
+
let $empty = h();
|
|
664
|
+
if ($children.length === 0) {
|
|
665
|
+
$empty = h('div', {
|
|
666
|
+
class: ['tab-pane', 'active'],
|
|
667
|
+
key: 'bv-empty-tab'
|
|
668
|
+
}, this.normalizeSlot(SLOT_NAME_EMPTY));
|
|
669
|
+
}
|
|
670
|
+
const $content = h('div', {
|
|
671
|
+
staticClass: 'tab-content',
|
|
672
|
+
class: this.contentClass,
|
|
673
|
+
attrs: {
|
|
674
|
+
id: this.safeId('_BV_tab_container_')
|
|
675
|
+
},
|
|
676
|
+
key: 'bv-content',
|
|
677
|
+
ref: 'content'
|
|
678
|
+
}, [$children, $empty]);
|
|
679
|
+
|
|
680
|
+
// Render final output
|
|
681
|
+
return h(this.tag, {
|
|
682
|
+
staticClass: 'tabs',
|
|
683
|
+
attrs: {
|
|
684
|
+
id: this.safeId()
|
|
685
|
+
}
|
|
686
|
+
}, [end ? $content : h(), $nav, end ? h() : $content]);
|
|
687
|
+
}
|
|
688
|
+
});
|
|
689
|
+
|
|
690
|
+
export { BTabs, props };
|