@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,470 @@
|
|
|
1
|
+
import Popper from 'popper.js';
|
|
2
|
+
import { extend } from '../vue';
|
|
3
|
+
import { NAME_DROPDOWN } from '../constants/components';
|
|
4
|
+
import { EVENT_NAME_SHOWN, EVENT_NAME_HIDDEN, EVENT_NAME_TOGGLE, EVENT_NAME_CLICK, EVENT_NAME_SHOW, EVENT_NAME_HIDE } from '../constants/events';
|
|
5
|
+
import { CODE_ENTER, CODE_SPACE, CODE_DOWN, CODE_ESC, CODE_UP } from '../constants/key-codes';
|
|
6
|
+
import { PLACEMENT_TOP_END, PLACEMENT_TOP_START, PLACEMENT_BOTTOM_START, PLACEMENT_RIGHT_START, PLACEMENT_LEFT_START, PLACEMENT_BOTTOM_END } from '../constants/popper';
|
|
7
|
+
import { PROP_TYPE_STRING, PROP_TYPE_BOOLEAN, PROP_TYPE_NUMBER, PROP_TYPE_OBJECT } from '../constants/props';
|
|
8
|
+
import { HTMLElement } from '../constants/safe-types';
|
|
9
|
+
import { BvEvent } from '../utils/bv-event.class';
|
|
10
|
+
import { requestAF, contains, closest, attemptFocus, selectAll, isVisible } from '../utils/dom';
|
|
11
|
+
import { getRootEventName, stopEvent } from '../utils/events';
|
|
12
|
+
import { sortKeys, mergeDeep } from '../utils/object';
|
|
13
|
+
import { warn } from '../utils/warn';
|
|
14
|
+
import { clickOutMixin } from './click-out';
|
|
15
|
+
import { focusInMixin } from './focus-in';
|
|
16
|
+
import { props as props$1, idMixin } from './id';
|
|
17
|
+
import { listenOnRootMixin } from './listen-on-root';
|
|
18
|
+
import { registerElementToInstance, removeElementToInstance } from '../utils/element-to-vue-instance-registry';
|
|
19
|
+
|
|
20
|
+
// --- Constants ---
|
|
21
|
+
|
|
22
|
+
const ROOT_EVENT_NAME_SHOWN = getRootEventName(NAME_DROPDOWN, EVENT_NAME_SHOWN);
|
|
23
|
+
const ROOT_EVENT_NAME_HIDDEN = getRootEventName(NAME_DROPDOWN, EVENT_NAME_HIDDEN);
|
|
24
|
+
|
|
25
|
+
// CSS selectors
|
|
26
|
+
const SELECTOR_FORM_CHILD = '.dropdown form';
|
|
27
|
+
const SELECTOR_ITEM = ['.dropdown-item', '.b-dropdown-form'].map(selector => `${selector}:not(.disabled):not([disabled])`).join(', ');
|
|
28
|
+
|
|
29
|
+
// --- Helper methods ---
|
|
30
|
+
|
|
31
|
+
// Return an array of visible items
|
|
32
|
+
const filterVisibles = els => (els || []).filter(isVisible);
|
|
33
|
+
|
|
34
|
+
// --- Props ---
|
|
35
|
+
|
|
36
|
+
const props = sortKeys({
|
|
37
|
+
...props$1,
|
|
38
|
+
// String: `scrollParent`, `window` or `viewport`
|
|
39
|
+
// HTMLElement: HTML Element reference
|
|
40
|
+
boundary: {
|
|
41
|
+
type: [HTMLElement, PROP_TYPE_STRING],
|
|
42
|
+
required: false,
|
|
43
|
+
default: 'scrollParent'
|
|
44
|
+
},
|
|
45
|
+
disabled: {
|
|
46
|
+
type: PROP_TYPE_BOOLEAN,
|
|
47
|
+
required: false,
|
|
48
|
+
default: false
|
|
49
|
+
},
|
|
50
|
+
// Place left if possible
|
|
51
|
+
dropleft: {
|
|
52
|
+
type: PROP_TYPE_BOOLEAN,
|
|
53
|
+
required: false,
|
|
54
|
+
default: false
|
|
55
|
+
},
|
|
56
|
+
// Place right if possible
|
|
57
|
+
dropright: {
|
|
58
|
+
type: PROP_TYPE_BOOLEAN,
|
|
59
|
+
required: false,
|
|
60
|
+
default: false
|
|
61
|
+
},
|
|
62
|
+
// Place on top if possible
|
|
63
|
+
dropup: {
|
|
64
|
+
type: PROP_TYPE_BOOLEAN,
|
|
65
|
+
required: false,
|
|
66
|
+
default: false
|
|
67
|
+
},
|
|
68
|
+
// Disable auto-flipping of menu from bottom <=> top
|
|
69
|
+
noFlip: {
|
|
70
|
+
type: PROP_TYPE_BOOLEAN,
|
|
71
|
+
required: false,
|
|
72
|
+
default: false
|
|
73
|
+
},
|
|
74
|
+
// Number of pixels or a CSS unit value to offset menu
|
|
75
|
+
// (i.e. `1px`, `1rem`, etc.)
|
|
76
|
+
offset: {
|
|
77
|
+
type: [PROP_TYPE_NUMBER, PROP_TYPE_STRING],
|
|
78
|
+
required: false,
|
|
79
|
+
default: 0
|
|
80
|
+
},
|
|
81
|
+
popperOpts: {
|
|
82
|
+
type: PROP_TYPE_OBJECT,
|
|
83
|
+
required: false,
|
|
84
|
+
default: () => ({})
|
|
85
|
+
},
|
|
86
|
+
// Right align menu (default is left align)
|
|
87
|
+
right: {
|
|
88
|
+
type: PROP_TYPE_BOOLEAN,
|
|
89
|
+
required: false,
|
|
90
|
+
default: false
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
// --- Mixin ---
|
|
95
|
+
|
|
96
|
+
// @vue/component
|
|
97
|
+
const dropdownMixin = extend({
|
|
98
|
+
mixins: [idMixin, listenOnRootMixin, clickOutMixin, focusInMixin],
|
|
99
|
+
provide() {
|
|
100
|
+
return {
|
|
101
|
+
getBvDropdown: () => this
|
|
102
|
+
};
|
|
103
|
+
},
|
|
104
|
+
props,
|
|
105
|
+
data() {
|
|
106
|
+
return {
|
|
107
|
+
visible: false,
|
|
108
|
+
visibleChangePrevented: false
|
|
109
|
+
};
|
|
110
|
+
},
|
|
111
|
+
computed: {
|
|
112
|
+
toggler() {
|
|
113
|
+
const {
|
|
114
|
+
toggle
|
|
115
|
+
} = this.$refs;
|
|
116
|
+
return toggle ? toggle.$el || toggle : null;
|
|
117
|
+
},
|
|
118
|
+
directionClass() {
|
|
119
|
+
if (this.dropup) {
|
|
120
|
+
return 'dropup';
|
|
121
|
+
} else if (this.dropright) {
|
|
122
|
+
return 'dropright';
|
|
123
|
+
} else if (this.dropleft) {
|
|
124
|
+
return 'dropleft';
|
|
125
|
+
}
|
|
126
|
+
return '';
|
|
127
|
+
},
|
|
128
|
+
boundaryClass() {
|
|
129
|
+
// Position `static` is needed to allow menu to "breakout" of the `scrollParent`
|
|
130
|
+
// boundaries when boundary is anything other than `scrollParent`
|
|
131
|
+
// See: https://github.com/twbs/bootstrap/issues/24251#issuecomment-341413786
|
|
132
|
+
return this.boundary !== 'scrollParent' ? 'gl-static' : '';
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
watch: {
|
|
136
|
+
visible(newValue, oldValue) {
|
|
137
|
+
if (this.visibleChangePrevented) {
|
|
138
|
+
this.visibleChangePrevented = false;
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
if (newValue !== oldValue) {
|
|
142
|
+
const eventName = newValue ? EVENT_NAME_SHOW : EVENT_NAME_HIDE;
|
|
143
|
+
const bvEvent = new BvEvent(eventName, {
|
|
144
|
+
cancelable: true,
|
|
145
|
+
vueTarget: this,
|
|
146
|
+
target: this.$refs.menu,
|
|
147
|
+
relatedTarget: null,
|
|
148
|
+
componentId: this.safeId ? this.safeId() : this.id || null
|
|
149
|
+
});
|
|
150
|
+
this.emitEvent(bvEvent);
|
|
151
|
+
if (bvEvent.defaultPrevented) {
|
|
152
|
+
// Reset value and exit if canceled
|
|
153
|
+
this.visibleChangePrevented = true;
|
|
154
|
+
this.visible = oldValue;
|
|
155
|
+
// Just in case a child element triggered `this.hide(true)`
|
|
156
|
+
this.$_focusOnHidden = false;
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
if (newValue) {
|
|
160
|
+
this.showMenu();
|
|
161
|
+
} else {
|
|
162
|
+
this.hideMenu();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
disabled(newValue, oldValue) {
|
|
167
|
+
if (newValue !== oldValue && newValue && this.visible) {
|
|
168
|
+
// Hide dropdown if disabled changes to true
|
|
169
|
+
this.visible = false;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
created() {
|
|
174
|
+
// Create private non-reactive props
|
|
175
|
+
this.$_popper = null;
|
|
176
|
+
},
|
|
177
|
+
/* istanbul ignore next */
|
|
178
|
+
deactivated() {
|
|
179
|
+
// In case we are inside a `<keep-alive>`
|
|
180
|
+
this.visible = false;
|
|
181
|
+
this.whileOpenListen(false);
|
|
182
|
+
this.destroyPopper();
|
|
183
|
+
},
|
|
184
|
+
mounted() {
|
|
185
|
+
registerElementToInstance(this.$el, this);
|
|
186
|
+
},
|
|
187
|
+
beforeDestroy() {
|
|
188
|
+
this.visible = false;
|
|
189
|
+
this.whileOpenListen(false);
|
|
190
|
+
this.destroyPopper();
|
|
191
|
+
removeElementToInstance(this.$el);
|
|
192
|
+
},
|
|
193
|
+
methods: {
|
|
194
|
+
// Event emitter
|
|
195
|
+
emitEvent(bvEvent) {
|
|
196
|
+
const {
|
|
197
|
+
type
|
|
198
|
+
} = bvEvent;
|
|
199
|
+
this.emitOnRoot(getRootEventName(NAME_DROPDOWN, type), bvEvent);
|
|
200
|
+
this.$emit(type, bvEvent);
|
|
201
|
+
},
|
|
202
|
+
showMenu() {
|
|
203
|
+
if (this.disabled) {
|
|
204
|
+
/* istanbul ignore next */
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
if (typeof Popper === 'undefined') {
|
|
208
|
+
/* istanbul ignore next */
|
|
209
|
+
warn('Popper.js not found. Falling back to CSS positioning', NAME_DROPDOWN);
|
|
210
|
+
} else {
|
|
211
|
+
// For dropup with alignment we use the parent element as popper container
|
|
212
|
+
let el = this.dropup && this.right || this.split ? this.$el : this.$refs.toggle;
|
|
213
|
+
// Make sure we have a reference to an element, not a component!
|
|
214
|
+
el = el.$el || el;
|
|
215
|
+
// Instantiate Popper.js
|
|
216
|
+
this.createPopper(el);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// Ensure other menus are closed
|
|
220
|
+
this.emitOnRoot(ROOT_EVENT_NAME_SHOWN, this);
|
|
221
|
+
|
|
222
|
+
// Enable listeners
|
|
223
|
+
this.whileOpenListen(true);
|
|
224
|
+
|
|
225
|
+
// Wrap in `$nextTick()` to ensure menu is fully rendered/shown
|
|
226
|
+
this.$nextTick(() => {
|
|
227
|
+
// Focus on the menu container on show
|
|
228
|
+
this.focusMenu();
|
|
229
|
+
// Emit the shown event
|
|
230
|
+
this.$emit(EVENT_NAME_SHOWN);
|
|
231
|
+
});
|
|
232
|
+
},
|
|
233
|
+
hideMenu() {
|
|
234
|
+
this.whileOpenListen(false);
|
|
235
|
+
this.emitOnRoot(ROOT_EVENT_NAME_HIDDEN, this);
|
|
236
|
+
this.$emit(EVENT_NAME_HIDDEN);
|
|
237
|
+
this.destroyPopper();
|
|
238
|
+
// Handle pending focus request
|
|
239
|
+
if (this.$_focusOnHidden) {
|
|
240
|
+
this.$_focusOnHidden = false;
|
|
241
|
+
this.focusToggler();
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
createPopper(element) {
|
|
245
|
+
this.destroyPopper();
|
|
246
|
+
this.$_popper = new Popper(element, this.$refs.menu, this.getPopperConfig());
|
|
247
|
+
},
|
|
248
|
+
// Ensure popper event listeners are removed cleanly
|
|
249
|
+
destroyPopper() {
|
|
250
|
+
this.$_popper && this.$_popper.destroy();
|
|
251
|
+
this.$_popper = null;
|
|
252
|
+
},
|
|
253
|
+
// Instructs popper to re-computes the dropdown position
|
|
254
|
+
// useful if the content changes size
|
|
255
|
+
updatePopper() {
|
|
256
|
+
try {
|
|
257
|
+
this.$_popper.scheduleUpdate();
|
|
258
|
+
} catch {}
|
|
259
|
+
},
|
|
260
|
+
getPopperConfig() {
|
|
261
|
+
let placement = PLACEMENT_BOTTOM_START;
|
|
262
|
+
if (this.dropup) {
|
|
263
|
+
placement = this.right ? PLACEMENT_TOP_END : PLACEMENT_TOP_START;
|
|
264
|
+
} else if (this.dropright) {
|
|
265
|
+
placement = PLACEMENT_RIGHT_START;
|
|
266
|
+
} else if (this.dropleft) {
|
|
267
|
+
placement = PLACEMENT_LEFT_START;
|
|
268
|
+
} else if (this.right) {
|
|
269
|
+
placement = PLACEMENT_BOTTOM_END;
|
|
270
|
+
}
|
|
271
|
+
const popperConfig = {
|
|
272
|
+
placement,
|
|
273
|
+
modifiers: {
|
|
274
|
+
offset: {
|
|
275
|
+
offset: this.offset || 0
|
|
276
|
+
},
|
|
277
|
+
flip: {
|
|
278
|
+
enabled: !this.noFlip
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
const boundariesElement = this.boundary;
|
|
283
|
+
if (boundariesElement) {
|
|
284
|
+
popperConfig.modifiers.preventOverflow = {
|
|
285
|
+
boundariesElement
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
return mergeDeep(popperConfig, this.popperOpts || {});
|
|
289
|
+
},
|
|
290
|
+
// Turn listeners on/off while open
|
|
291
|
+
whileOpenListen(isOpen) {
|
|
292
|
+
// Hide the dropdown when clicked outside
|
|
293
|
+
this.listenForClickOut = isOpen;
|
|
294
|
+
// Hide the dropdown when it loses focus
|
|
295
|
+
this.listenForFocusIn = isOpen;
|
|
296
|
+
// Hide the dropdown when another dropdown is opened
|
|
297
|
+
const method = isOpen ? 'listenOnRoot' : 'listenOffRoot';
|
|
298
|
+
this[method](ROOT_EVENT_NAME_SHOWN, this.rootCloseListener);
|
|
299
|
+
},
|
|
300
|
+
rootCloseListener(vm) {
|
|
301
|
+
if (vm !== this) {
|
|
302
|
+
this.visible = false;
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
// Public method to show dropdown
|
|
306
|
+
show() {
|
|
307
|
+
if (this.disabled) {
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
// Wrap in a `requestAF()` to allow any previous
|
|
311
|
+
// click handling to occur first
|
|
312
|
+
requestAF(() => {
|
|
313
|
+
this.visible = true;
|
|
314
|
+
});
|
|
315
|
+
},
|
|
316
|
+
// Public method to hide dropdown
|
|
317
|
+
hide() {
|
|
318
|
+
let refocus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
319
|
+
/* istanbul ignore next */
|
|
320
|
+
if (this.disabled) {
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
this.visible = false;
|
|
324
|
+
if (refocus) {
|
|
325
|
+
// Child element is closing the dropdown on click
|
|
326
|
+
this.$_focusOnHidden = true;
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
// Called only by a button that toggles the menu
|
|
330
|
+
toggle(event) {
|
|
331
|
+
event = event || {};
|
|
332
|
+
// Early exit when not a click event or ENTER, SPACE or DOWN were pressed
|
|
333
|
+
const {
|
|
334
|
+
type,
|
|
335
|
+
keyCode
|
|
336
|
+
} = event;
|
|
337
|
+
if (type !== 'click' && !(type === 'keydown' && [CODE_ENTER, CODE_SPACE, CODE_DOWN].indexOf(keyCode) !== -1)) {
|
|
338
|
+
/* istanbul ignore next */
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
/* istanbul ignore next */
|
|
342
|
+
if (this.disabled) {
|
|
343
|
+
this.visible = false;
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
this.$emit(EVENT_NAME_TOGGLE, event);
|
|
347
|
+
stopEvent(event);
|
|
348
|
+
// Toggle visibility
|
|
349
|
+
if (this.visible) {
|
|
350
|
+
this.hide(true);
|
|
351
|
+
} else {
|
|
352
|
+
this.show();
|
|
353
|
+
}
|
|
354
|
+
},
|
|
355
|
+
// Mousedown handler for the toggle
|
|
356
|
+
/* istanbul ignore next */
|
|
357
|
+
onMousedown(event) {
|
|
358
|
+
// We prevent the 'mousedown' event for the toggle to stop the
|
|
359
|
+
// 'focusin' event from being fired
|
|
360
|
+
// The event would otherwise be picked up by the global 'focusin'
|
|
361
|
+
// listener and there is no cross-browser solution to detect it
|
|
362
|
+
// relates to the toggle click
|
|
363
|
+
// The 'click' event will still be fired and we handle closing
|
|
364
|
+
// other dropdowns there too
|
|
365
|
+
// See https://github.com/bootstrap-vue/bootstrap-vue/issues/4328
|
|
366
|
+
stopEvent(event, {
|
|
367
|
+
propagation: false
|
|
368
|
+
});
|
|
369
|
+
},
|
|
370
|
+
// Called from dropdown menu context
|
|
371
|
+
onKeydown(event) {
|
|
372
|
+
const {
|
|
373
|
+
keyCode
|
|
374
|
+
} = event;
|
|
375
|
+
if (keyCode === CODE_ESC) {
|
|
376
|
+
// Close on ESC
|
|
377
|
+
this.onEsc(event);
|
|
378
|
+
} else if (keyCode === CODE_DOWN) {
|
|
379
|
+
// Down Arrow
|
|
380
|
+
this.focusNext(event, false);
|
|
381
|
+
} else if (keyCode === CODE_UP) {
|
|
382
|
+
// Up Arrow
|
|
383
|
+
this.focusNext(event, true);
|
|
384
|
+
}
|
|
385
|
+
},
|
|
386
|
+
// If user presses ESC, close the menu
|
|
387
|
+
onEsc(event) {
|
|
388
|
+
if (this.visible) {
|
|
389
|
+
this.visible = false;
|
|
390
|
+
stopEvent(event);
|
|
391
|
+
// Return focus to original trigger button
|
|
392
|
+
this.$_focusOnHidden = true;
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
// Called only in split button mode, for the split button
|
|
396
|
+
onSplitClick(event) {
|
|
397
|
+
/* istanbul ignore next */
|
|
398
|
+
if (this.disabled) {
|
|
399
|
+
this.visible = false;
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
this.$emit(EVENT_NAME_CLICK, event);
|
|
403
|
+
},
|
|
404
|
+
// Shared hide handler between click-out and focus-in events
|
|
405
|
+
hideHandler(event) {
|
|
406
|
+
const {
|
|
407
|
+
target
|
|
408
|
+
} = event;
|
|
409
|
+
if (this.visible && !contains(this.$refs.menu, target) && !contains(this.toggler, target)) {
|
|
410
|
+
this.hide();
|
|
411
|
+
}
|
|
412
|
+
},
|
|
413
|
+
// Document click-out listener
|
|
414
|
+
clickOutHandler(event) {
|
|
415
|
+
this.hideHandler(event);
|
|
416
|
+
},
|
|
417
|
+
// Document focus-in listener
|
|
418
|
+
focusInHandler(event) {
|
|
419
|
+
this.hideHandler(event);
|
|
420
|
+
},
|
|
421
|
+
// Keyboard nav
|
|
422
|
+
focusNext(event, up) {
|
|
423
|
+
// Ignore key up/down on form elements
|
|
424
|
+
const {
|
|
425
|
+
target
|
|
426
|
+
} = event;
|
|
427
|
+
if (!this.visible || event && closest(SELECTOR_FORM_CHILD, target)) {
|
|
428
|
+
/* istanbul ignore next: should never happen */
|
|
429
|
+
return;
|
|
430
|
+
}
|
|
431
|
+
stopEvent(event);
|
|
432
|
+
this.$nextTick(() => {
|
|
433
|
+
const items = this.getItems();
|
|
434
|
+
if (items.length < 1) {
|
|
435
|
+
/* istanbul ignore next: should never happen */
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
438
|
+
let index = items.indexOf(target);
|
|
439
|
+
if (up && index > 0) {
|
|
440
|
+
index--;
|
|
441
|
+
} else if (!up && index < items.length - 1) {
|
|
442
|
+
index++;
|
|
443
|
+
}
|
|
444
|
+
if (index < 0) {
|
|
445
|
+
/* istanbul ignore next: should never happen */
|
|
446
|
+
index = 0;
|
|
447
|
+
}
|
|
448
|
+
this.focusItem(index, items);
|
|
449
|
+
});
|
|
450
|
+
},
|
|
451
|
+
focusItem(index, items) {
|
|
452
|
+
const el = items.find((el, i) => i === index);
|
|
453
|
+
attemptFocus(el);
|
|
454
|
+
},
|
|
455
|
+
getItems() {
|
|
456
|
+
// Get all items
|
|
457
|
+
return filterVisibles(selectAll(SELECTOR_ITEM, this.$refs.menu));
|
|
458
|
+
},
|
|
459
|
+
focusMenu() {
|
|
460
|
+
attemptFocus(this.$refs.menu);
|
|
461
|
+
},
|
|
462
|
+
focusToggler() {
|
|
463
|
+
this.$nextTick(() => {
|
|
464
|
+
attemptFocus(this.toggler);
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
});
|
|
469
|
+
|
|
470
|
+
export { dropdownMixin, props };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { extend } from '../vue';
|
|
2
|
+
import { EVENT_OPTIONS_NO_CAPTURE } from '../constants/events';
|
|
3
|
+
import { eventOff, eventOn } from '../utils/events';
|
|
4
|
+
|
|
5
|
+
// @vue/component
|
|
6
|
+
const focusInMixin = extend({
|
|
7
|
+
data() {
|
|
8
|
+
return {
|
|
9
|
+
listenForFocusIn: false
|
|
10
|
+
};
|
|
11
|
+
},
|
|
12
|
+
watch: {
|
|
13
|
+
listenForFocusIn(newValue, oldValue) {
|
|
14
|
+
if (newValue !== oldValue) {
|
|
15
|
+
eventOff(this.focusInElement, 'focusin', this._focusInHandler, EVENT_OPTIONS_NO_CAPTURE);
|
|
16
|
+
if (newValue) {
|
|
17
|
+
eventOn(this.focusInElement, 'focusin', this._focusInHandler, EVENT_OPTIONS_NO_CAPTURE);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
beforeCreate() {
|
|
23
|
+
// Declare non-reactive properties
|
|
24
|
+
this.focusInElement = null;
|
|
25
|
+
},
|
|
26
|
+
mounted() {
|
|
27
|
+
if (!this.focusInElement) {
|
|
28
|
+
this.focusInElement = document;
|
|
29
|
+
}
|
|
30
|
+
if (this.listenForFocusIn) {
|
|
31
|
+
eventOn(this.focusInElement, 'focusin', this._focusInHandler, EVENT_OPTIONS_NO_CAPTURE);
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
beforeDestroy() {
|
|
35
|
+
eventOff(this.focusInElement, 'focusin', this._focusInHandler, EVENT_OPTIONS_NO_CAPTURE);
|
|
36
|
+
},
|
|
37
|
+
methods: {
|
|
38
|
+
_focusInHandler(event) {
|
|
39
|
+
if (this.focusInHandler) {
|
|
40
|
+
this.focusInHandler(event);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export { focusInMixin };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { extend } from '../vue';
|
|
2
|
+
import { PROP_TYPE_BOOLEAN, PROP_TYPE_STRING } from '../constants/props';
|
|
3
|
+
import { requestAF, isVisible, matches, select, attemptFocus } from '../utils/dom';
|
|
4
|
+
|
|
5
|
+
// --- Constants ---
|
|
6
|
+
|
|
7
|
+
const SELECTOR = 'input, textarea, select';
|
|
8
|
+
|
|
9
|
+
// --- Props ---
|
|
10
|
+
|
|
11
|
+
const props = {
|
|
12
|
+
autofocus: {
|
|
13
|
+
type: PROP_TYPE_BOOLEAN,
|
|
14
|
+
required: false,
|
|
15
|
+
default: false
|
|
16
|
+
},
|
|
17
|
+
disabled: {
|
|
18
|
+
type: PROP_TYPE_BOOLEAN,
|
|
19
|
+
required: false,
|
|
20
|
+
default: false
|
|
21
|
+
},
|
|
22
|
+
form: {
|
|
23
|
+
type: PROP_TYPE_STRING,
|
|
24
|
+
required: false,
|
|
25
|
+
default: undefined
|
|
26
|
+
},
|
|
27
|
+
id: {
|
|
28
|
+
type: PROP_TYPE_STRING,
|
|
29
|
+
required: false,
|
|
30
|
+
default: undefined
|
|
31
|
+
},
|
|
32
|
+
name: {
|
|
33
|
+
type: PROP_TYPE_STRING,
|
|
34
|
+
required: false,
|
|
35
|
+
default: undefined
|
|
36
|
+
},
|
|
37
|
+
required: {
|
|
38
|
+
type: PROP_TYPE_BOOLEAN,
|
|
39
|
+
required: false,
|
|
40
|
+
default: false
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
// --- Mixin ---
|
|
45
|
+
|
|
46
|
+
// @vue/component
|
|
47
|
+
const formControlMixin = extend({
|
|
48
|
+
props,
|
|
49
|
+
mounted() {
|
|
50
|
+
this.handleAutofocus();
|
|
51
|
+
},
|
|
52
|
+
/* istanbul ignore next */
|
|
53
|
+
activated() {
|
|
54
|
+
this.handleAutofocus();
|
|
55
|
+
},
|
|
56
|
+
methods: {
|
|
57
|
+
handleAutofocus() {
|
|
58
|
+
this.$nextTick(() => {
|
|
59
|
+
requestAF(() => {
|
|
60
|
+
let el = this.$el;
|
|
61
|
+
if (this.autofocus && isVisible(el)) {
|
|
62
|
+
if (!matches(el, SELECTOR)) {
|
|
63
|
+
el = select(SELECTOR, el);
|
|
64
|
+
}
|
|
65
|
+
attemptFocus(el);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
export { formControlMixin, props };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { extend } from '../vue';
|
|
2
|
+
import { PROP_TYPE_BOOLEAN } from '../constants/props';
|
|
3
|
+
|
|
4
|
+
// --- Props ---
|
|
5
|
+
|
|
6
|
+
const props = {
|
|
7
|
+
plain: {
|
|
8
|
+
type: PROP_TYPE_BOOLEAN,
|
|
9
|
+
required: false,
|
|
10
|
+
default: false
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
// --- Mixin ---
|
|
15
|
+
|
|
16
|
+
// @vue/component
|
|
17
|
+
const formCustomMixin = extend({
|
|
18
|
+
props,
|
|
19
|
+
computed: {
|
|
20
|
+
custom() {
|
|
21
|
+
return !this.plain;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export { formCustomMixin, props };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { extend } from '../vue';
|
|
2
|
+
import { PROP_TYPE_STRING, PROP_TYPE_ARRAY, PROP_TYPE_OBJECT } from '../constants/props';
|
|
3
|
+
import { get } from '../utils/get';
|
|
4
|
+
import { stripTags } from '../utils/html';
|
|
5
|
+
import { isPlainObject, isUndefined, isArray } from '../utils/inspect';
|
|
6
|
+
import { keys } from '../utils/object';
|
|
7
|
+
import { warn } from '../utils/warn';
|
|
8
|
+
|
|
9
|
+
// --- Constants ---
|
|
10
|
+
|
|
11
|
+
const OPTIONS_OBJECT_DEPRECATED_MSG = 'Setting prop "options" to an object is deprecated. Use the array format instead.';
|
|
12
|
+
|
|
13
|
+
// --- Props ---
|
|
14
|
+
|
|
15
|
+
const props = {
|
|
16
|
+
disabledField: {
|
|
17
|
+
type: PROP_TYPE_STRING,
|
|
18
|
+
required: false,
|
|
19
|
+
default: 'disabled'
|
|
20
|
+
},
|
|
21
|
+
htmlField: {
|
|
22
|
+
type: PROP_TYPE_STRING,
|
|
23
|
+
required: false,
|
|
24
|
+
default: 'html'
|
|
25
|
+
},
|
|
26
|
+
options: {
|
|
27
|
+
type: [PROP_TYPE_ARRAY, PROP_TYPE_OBJECT],
|
|
28
|
+
required: false,
|
|
29
|
+
default: () => []
|
|
30
|
+
},
|
|
31
|
+
textField: {
|
|
32
|
+
type: PROP_TYPE_STRING,
|
|
33
|
+
required: false,
|
|
34
|
+
default: 'text'
|
|
35
|
+
},
|
|
36
|
+
valueField: {
|
|
37
|
+
type: PROP_TYPE_STRING,
|
|
38
|
+
required: false,
|
|
39
|
+
default: 'value'
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// --- Mixin ---
|
|
44
|
+
|
|
45
|
+
// @vue/component
|
|
46
|
+
const formOptionsMixin = extend({
|
|
47
|
+
props,
|
|
48
|
+
computed: {
|
|
49
|
+
formOptions() {
|
|
50
|
+
return this.normalizeOptions(this.options);
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
methods: {
|
|
54
|
+
normalizeOption(option) {
|
|
55
|
+
let key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
56
|
+
// When the option is an object, normalize it
|
|
57
|
+
if (isPlainObject(option)) {
|
|
58
|
+
const value = get(option, this.valueField);
|
|
59
|
+
const text = get(option, this.textField);
|
|
60
|
+
return {
|
|
61
|
+
value: isUndefined(value) ? key || text : value,
|
|
62
|
+
text: stripTags(String(isUndefined(text) ? key : text)),
|
|
63
|
+
html: get(option, this.htmlField),
|
|
64
|
+
disabled: Boolean(get(option, this.disabledField))
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
// Otherwise create an `<option>` object from the given value
|
|
68
|
+
return {
|
|
69
|
+
value: key || option,
|
|
70
|
+
text: stripTags(String(option)),
|
|
71
|
+
disabled: false
|
|
72
|
+
};
|
|
73
|
+
},
|
|
74
|
+
normalizeOptions(options) {
|
|
75
|
+
// Normalize the given options array
|
|
76
|
+
if (isArray(options)) {
|
|
77
|
+
return options.map(option => this.normalizeOption(option));
|
|
78
|
+
} else if (isPlainObject(options)) {
|
|
79
|
+
// Deprecate the object options format
|
|
80
|
+
warn(OPTIONS_OBJECT_DEPRECATED_MSG, this.$options.name);
|
|
81
|
+
// Normalize a `options` object to an array of options
|
|
82
|
+
return keys(options).map(key => this.normalizeOption(options[key] || {}, key));
|
|
83
|
+
}
|
|
84
|
+
// If not an array or object, return an empty array
|
|
85
|
+
/* istanbul ignore next */
|
|
86
|
+
return [];
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
export { formOptionsMixin, props };
|