@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 @@
|
|
|
1
|
+
export { BTooltip } from './tooltip';
|
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import { extend } from '../../vue';
|
|
2
|
+
import { NAME_TOOLTIP } from '../../constants/components';
|
|
3
|
+
import { EVENT_NAME_DISABLE, EVENT_NAME_ENABLE, EVENT_NAME_SHOW, EVENT_NAME_SHOWN, EVENT_NAME_HIDE, EVENT_NAME_HIDDEN, EVENT_NAME_DISABLED, EVENT_NAME_ENABLED, EVENT_NAME_OPEN, EVENT_NAME_CLOSE, MODEL_EVENT_NAME_PREFIX } from '../../constants/events';
|
|
4
|
+
import { PROP_TYPE_OBJECT, PROP_TYPE_STRING, PROP_TYPE_NUMBER, PROP_TYPE_BOOLEAN, PROP_TYPE_ARRAY, PROP_TYPE_FUNCTION } from '../../constants/props';
|
|
5
|
+
import { HTMLElement, SVGElement } from '../../constants/safe-types';
|
|
6
|
+
import { useParentMixin } from '../../mixins/use-parent';
|
|
7
|
+
import { getScopeId } from '../../utils/get-scope-id';
|
|
8
|
+
import { isUndefinedOrNull } from '../../utils/inspect';
|
|
9
|
+
import { pick } from '../../utils/object';
|
|
10
|
+
import { TOOLTIP_DELAY } from '../../constants/config';
|
|
11
|
+
import { createNewChildComponent, eventProp } from '../../utils/create-new-child-component';
|
|
12
|
+
import { normalizeSlotMixin } from '../../mixins/normalize-slot';
|
|
13
|
+
import { BVTooltip } from './helpers/bv-tooltip';
|
|
14
|
+
|
|
15
|
+
// --- Constants ---
|
|
16
|
+
|
|
17
|
+
const MODEL_PROP_NAME_ENABLED = 'disabled';
|
|
18
|
+
const MODEL_EVENT_NAME_ENABLED = MODEL_EVENT_NAME_PREFIX + MODEL_PROP_NAME_ENABLED;
|
|
19
|
+
const MODEL_PROP_NAME_SHOW = 'show';
|
|
20
|
+
const MODEL_EVENT_NAME_SHOW = MODEL_EVENT_NAME_PREFIX + MODEL_PROP_NAME_SHOW;
|
|
21
|
+
|
|
22
|
+
// --- Props ---
|
|
23
|
+
|
|
24
|
+
const props = {
|
|
25
|
+
// String: scrollParent, window, or viewport
|
|
26
|
+
// Element: element reference
|
|
27
|
+
// Object: Vue component
|
|
28
|
+
boundary: {
|
|
29
|
+
type: [HTMLElement, PROP_TYPE_OBJECT, PROP_TYPE_STRING],
|
|
30
|
+
required: false,
|
|
31
|
+
default: 'scrollParent'
|
|
32
|
+
},
|
|
33
|
+
boundaryPadding: {
|
|
34
|
+
type: [PROP_TYPE_NUMBER, PROP_TYPE_STRING],
|
|
35
|
+
required: false,
|
|
36
|
+
default: 5
|
|
37
|
+
},
|
|
38
|
+
// String: HTML ID of container, if null body is used (default)
|
|
39
|
+
// HTMLElement: element reference reference
|
|
40
|
+
// Object: Vue Component
|
|
41
|
+
container: {
|
|
42
|
+
type: [HTMLElement, PROP_TYPE_OBJECT, PROP_TYPE_STRING],
|
|
43
|
+
required: false,
|
|
44
|
+
default: undefined
|
|
45
|
+
},
|
|
46
|
+
customClass: {
|
|
47
|
+
type: PROP_TYPE_STRING,
|
|
48
|
+
required: false,
|
|
49
|
+
default: 'gl-tooltip'
|
|
50
|
+
},
|
|
51
|
+
delay: {
|
|
52
|
+
type: [PROP_TYPE_NUMBER, PROP_TYPE_OBJECT, PROP_TYPE_STRING],
|
|
53
|
+
required: false,
|
|
54
|
+
default: () => ({
|
|
55
|
+
...TOOLTIP_DELAY
|
|
56
|
+
})
|
|
57
|
+
},
|
|
58
|
+
[MODEL_PROP_NAME_ENABLED]: {
|
|
59
|
+
type: PROP_TYPE_BOOLEAN,
|
|
60
|
+
required: false,
|
|
61
|
+
default: false
|
|
62
|
+
},
|
|
63
|
+
fallbackPlacement: {
|
|
64
|
+
type: [PROP_TYPE_ARRAY, PROP_TYPE_STRING],
|
|
65
|
+
required: false,
|
|
66
|
+
default: 'flip'
|
|
67
|
+
},
|
|
68
|
+
// ID to use for tooltip element
|
|
69
|
+
// If not provided on will automatically be generated
|
|
70
|
+
id: {
|
|
71
|
+
type: PROP_TYPE_STRING,
|
|
72
|
+
required: false,
|
|
73
|
+
default: undefined
|
|
74
|
+
},
|
|
75
|
+
noFade: {
|
|
76
|
+
type: PROP_TYPE_BOOLEAN,
|
|
77
|
+
required: false,
|
|
78
|
+
default: false
|
|
79
|
+
},
|
|
80
|
+
noninteractive: {
|
|
81
|
+
type: PROP_TYPE_BOOLEAN,
|
|
82
|
+
required: false,
|
|
83
|
+
default: false
|
|
84
|
+
},
|
|
85
|
+
offset: {
|
|
86
|
+
type: [PROP_TYPE_NUMBER, PROP_TYPE_STRING],
|
|
87
|
+
required: false,
|
|
88
|
+
default: 0
|
|
89
|
+
},
|
|
90
|
+
placement: {
|
|
91
|
+
type: PROP_TYPE_STRING,
|
|
92
|
+
required: false,
|
|
93
|
+
default: 'top'
|
|
94
|
+
},
|
|
95
|
+
[MODEL_PROP_NAME_SHOW]: {
|
|
96
|
+
type: PROP_TYPE_BOOLEAN,
|
|
97
|
+
required: false,
|
|
98
|
+
default: false
|
|
99
|
+
},
|
|
100
|
+
// String ID of element, or element/component reference
|
|
101
|
+
// Or function that returns one of the above
|
|
102
|
+
// Required
|
|
103
|
+
target: {
|
|
104
|
+
type: [HTMLElement, SVGElement, PROP_TYPE_FUNCTION, PROP_TYPE_OBJECT, PROP_TYPE_STRING],
|
|
105
|
+
required: true
|
|
106
|
+
},
|
|
107
|
+
title: {
|
|
108
|
+
type: PROP_TYPE_STRING,
|
|
109
|
+
required: false,
|
|
110
|
+
default: undefined
|
|
111
|
+
},
|
|
112
|
+
triggers: {
|
|
113
|
+
type: [PROP_TYPE_ARRAY, PROP_TYPE_STRING],
|
|
114
|
+
required: false,
|
|
115
|
+
default: 'hover focus'
|
|
116
|
+
},
|
|
117
|
+
variant: {
|
|
118
|
+
type: PROP_TYPE_STRING,
|
|
119
|
+
required: false,
|
|
120
|
+
default: undefined
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
// --- Main component ---
|
|
125
|
+
|
|
126
|
+
// @vue/component
|
|
127
|
+
const BTooltip = /*#__PURE__*/extend({
|
|
128
|
+
name: NAME_TOOLTIP,
|
|
129
|
+
mixins: [normalizeSlotMixin, useParentMixin],
|
|
130
|
+
inheritAttrs: false,
|
|
131
|
+
props,
|
|
132
|
+
data() {
|
|
133
|
+
return {
|
|
134
|
+
localShow: this[MODEL_PROP_NAME_SHOW],
|
|
135
|
+
localTitle: '',
|
|
136
|
+
localContent: ''
|
|
137
|
+
};
|
|
138
|
+
},
|
|
139
|
+
computed: {
|
|
140
|
+
// Data that will be passed to the template and popper
|
|
141
|
+
templateData() {
|
|
142
|
+
return {
|
|
143
|
+
title: this.localTitle,
|
|
144
|
+
content: this.localContent,
|
|
145
|
+
interactive: !this.noninteractive,
|
|
146
|
+
// Pass these props as is
|
|
147
|
+
...pick(this.$props, ['boundary', 'boundaryPadding', 'container', 'customClass', 'delay', 'fallbackPlacement', 'id', 'noFade', 'offset', 'placement', 'target', 'target', 'triggers', 'variant', MODEL_PROP_NAME_ENABLED])
|
|
148
|
+
};
|
|
149
|
+
},
|
|
150
|
+
// Used to watch for changes to the title and content props
|
|
151
|
+
templateTitleContent() {
|
|
152
|
+
const {
|
|
153
|
+
title,
|
|
154
|
+
content
|
|
155
|
+
} = this;
|
|
156
|
+
return {
|
|
157
|
+
title,
|
|
158
|
+
content
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
watch: {
|
|
163
|
+
[MODEL_PROP_NAME_SHOW](newValue, oldValue) {
|
|
164
|
+
if (newValue !== oldValue && newValue !== this.localShow && this.$_toolpop) {
|
|
165
|
+
if (newValue) {
|
|
166
|
+
this.$_toolpop.show();
|
|
167
|
+
} else {
|
|
168
|
+
// We use `forceHide()` to override any active triggers
|
|
169
|
+
this.$_toolpop.forceHide();
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
[MODEL_PROP_NAME_ENABLED](newValue) {
|
|
174
|
+
if (newValue) {
|
|
175
|
+
this[EVENT_NAME_DISABLE]();
|
|
176
|
+
} else {
|
|
177
|
+
this[EVENT_NAME_ENABLE]();
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
localShow(newValue) {
|
|
181
|
+
// TODO: May need to be done in a `$nextTick()`
|
|
182
|
+
this.$emit(MODEL_EVENT_NAME_SHOW, newValue);
|
|
183
|
+
},
|
|
184
|
+
templateData() {
|
|
185
|
+
this.$nextTick(() => {
|
|
186
|
+
if (this.$_toolpop) {
|
|
187
|
+
this.$_toolpop.updateData(this.templateData);
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
},
|
|
191
|
+
// Watchers for title/content props (prop changes do not trigger the `updated()` hook)
|
|
192
|
+
templateTitleContent() {
|
|
193
|
+
this.$nextTick(this.updateContent);
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
created() {
|
|
197
|
+
// Create private non-reactive props
|
|
198
|
+
this.$_toolpop = null;
|
|
199
|
+
},
|
|
200
|
+
updated() {
|
|
201
|
+
// Update the `propData` object
|
|
202
|
+
// Done in a `$nextTick()` to ensure slot(s) have updated
|
|
203
|
+
this.$nextTick(this.updateContent);
|
|
204
|
+
},
|
|
205
|
+
beforeDestroy() {
|
|
206
|
+
// Destroy the tip instance
|
|
207
|
+
if (this.$_toolpop) {
|
|
208
|
+
this.$_toolpop.$destroy();
|
|
209
|
+
this.$_toolpop = null;
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
mounted() {
|
|
213
|
+
// Instantiate a new BVTooltip instance
|
|
214
|
+
// Done in a `$nextTick()` to ensure DOM has completed rendering
|
|
215
|
+
// so that target can be found
|
|
216
|
+
this.$nextTick(() => {
|
|
217
|
+
// Load the on demand child instance
|
|
218
|
+
const Component = this.getComponent();
|
|
219
|
+
// Ensure we have initial content
|
|
220
|
+
this.updateContent();
|
|
221
|
+
// Pass down the scoped style attribute if available
|
|
222
|
+
const scopeId = getScopeId(this) || getScopeId(this.bvParent);
|
|
223
|
+
// Create the instance
|
|
224
|
+
const $toolpop = this.$_toolpop = createNewChildComponent(this, Component, {
|
|
225
|
+
// Pass down the scoped style ID
|
|
226
|
+
_scopeId: scopeId || undefined,
|
|
227
|
+
propsData: {
|
|
228
|
+
[eventProp(EVENT_NAME_SHOW)]: this.onShow,
|
|
229
|
+
[eventProp(EVENT_NAME_SHOWN)]: this.onShown,
|
|
230
|
+
[eventProp(EVENT_NAME_HIDE)]: this.onHide,
|
|
231
|
+
[eventProp(EVENT_NAME_HIDDEN)]: this.onHidden,
|
|
232
|
+
[eventProp(EVENT_NAME_DISABLED)]: this.onDisabled,
|
|
233
|
+
[eventProp(EVENT_NAME_ENABLED)]: this.onEnabled
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
// Set the initial data
|
|
237
|
+
$toolpop.updateData(this.templateData);
|
|
238
|
+
// Initially disabled?
|
|
239
|
+
if (this[MODEL_PROP_NAME_ENABLED]) {
|
|
240
|
+
// Initially disabled
|
|
241
|
+
this[EVENT_NAME_DISABLE]();
|
|
242
|
+
}
|
|
243
|
+
// Initially show tooltip?
|
|
244
|
+
if (this.localShow) {
|
|
245
|
+
$toolpop.show();
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
},
|
|
249
|
+
methods: {
|
|
250
|
+
getComponent() {
|
|
251
|
+
// Overridden by BPopover
|
|
252
|
+
return BVTooltip;
|
|
253
|
+
},
|
|
254
|
+
updateContent() {
|
|
255
|
+
// Overridden by BPopover
|
|
256
|
+
// Tooltip: Default slot is `title`
|
|
257
|
+
// Popover: Default slot is `content`, `title` slot is title
|
|
258
|
+
// We pass a scoped slot function reference by default (Vue v2.6x)
|
|
259
|
+
// And pass the title prop as a fallback
|
|
260
|
+
this.setTitle(this.normalizeSlot() || this.title);
|
|
261
|
+
},
|
|
262
|
+
// Helper methods for `updateContent()`
|
|
263
|
+
setTitle(value) {
|
|
264
|
+
value = isUndefinedOrNull(value) ? '' : value;
|
|
265
|
+
// We only update the value if it has changed
|
|
266
|
+
if (this.localTitle !== value) {
|
|
267
|
+
this.localTitle = value;
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
setContent(value) {
|
|
271
|
+
value = isUndefinedOrNull(value) ? '' : value;
|
|
272
|
+
// We only update the value if it has changed
|
|
273
|
+
if (this.localContent !== value) {
|
|
274
|
+
this.localContent = value;
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
// --- Template event handlers ---
|
|
278
|
+
onShow(bvEvent) {
|
|
279
|
+
// Placeholder
|
|
280
|
+
this.$emit(EVENT_NAME_SHOW, bvEvent);
|
|
281
|
+
if (bvEvent) {
|
|
282
|
+
this.localShow = !bvEvent.defaultPrevented;
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
onShown(bvEvent) {
|
|
286
|
+
// Tip is now showing
|
|
287
|
+
this.localShow = true;
|
|
288
|
+
this.$emit(EVENT_NAME_SHOWN, bvEvent);
|
|
289
|
+
},
|
|
290
|
+
onHide(bvEvent) {
|
|
291
|
+
this.$emit(EVENT_NAME_HIDE, bvEvent);
|
|
292
|
+
},
|
|
293
|
+
onHidden(bvEvent) {
|
|
294
|
+
// Tip is no longer showing
|
|
295
|
+
this.$emit(EVENT_NAME_HIDDEN, bvEvent);
|
|
296
|
+
this.localShow = false;
|
|
297
|
+
},
|
|
298
|
+
onDisabled(bvEvent) {
|
|
299
|
+
// Prevent possible endless loop if user mistakenly
|
|
300
|
+
// fires `disabled` instead of `disable`
|
|
301
|
+
if (bvEvent && bvEvent.type === EVENT_NAME_DISABLED) {
|
|
302
|
+
this.$emit(MODEL_EVENT_NAME_ENABLED, true);
|
|
303
|
+
this.$emit(EVENT_NAME_DISABLED, bvEvent);
|
|
304
|
+
}
|
|
305
|
+
},
|
|
306
|
+
onEnabled(bvEvent) {
|
|
307
|
+
// Prevent possible endless loop if user mistakenly
|
|
308
|
+
// fires `enabled` instead of `enable`
|
|
309
|
+
if (bvEvent && bvEvent.type === EVENT_NAME_ENABLED) {
|
|
310
|
+
this.$emit(MODEL_EVENT_NAME_ENABLED, false);
|
|
311
|
+
this.$emit(EVENT_NAME_ENABLED, bvEvent);
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
// --- Public methods for programmatic control ---
|
|
315
|
+
[EVENT_NAME_OPEN]() {
|
|
316
|
+
!this.localShow && this.$_toolpop && this.$_toolpop.show();
|
|
317
|
+
},
|
|
318
|
+
[EVENT_NAME_CLOSE]() {
|
|
319
|
+
this.localShow && this.$_toolpop && this.$_toolpop.hide();
|
|
320
|
+
},
|
|
321
|
+
[EVENT_NAME_DISABLE]() {
|
|
322
|
+
this.$_toolpop && this.$_toolpop.disable();
|
|
323
|
+
},
|
|
324
|
+
[EVENT_NAME_ENABLE]() {
|
|
325
|
+
this.$_toolpop && this.$_toolpop.enable();
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
render(h) {
|
|
329
|
+
// Always renders a comment node
|
|
330
|
+
// TODO:
|
|
331
|
+
// Future: Possibly render a target slot (single root element)
|
|
332
|
+
// which we can apply the listeners to (pass `this.$el` to BVTooltip)
|
|
333
|
+
return h();
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
|
|
337
|
+
export { BTooltip, props };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { extend, mergeData } from '../../vue';
|
|
2
|
+
import { NAME_TRANSITION } from '../../constants/components';
|
|
3
|
+
import { PROP_TYPE_BOOLEAN, PROP_TYPE_STRING, PROP_TYPE_OBJECT } from '../../constants/props';
|
|
4
|
+
import { isPlainObject } from '../../utils/inspect';
|
|
5
|
+
|
|
6
|
+
// Generic Bootstrap v4 fade (no-fade) transition component
|
|
7
|
+
//
|
|
8
|
+
// Assumes that `show` class is not required when
|
|
9
|
+
// the transition has finished the enter transition
|
|
10
|
+
// (show and fade classes are only applied during transition)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
// --- Constants ---
|
|
14
|
+
|
|
15
|
+
const NO_FADE_PROPS = {
|
|
16
|
+
name: '',
|
|
17
|
+
enterClass: '',
|
|
18
|
+
enterActiveClass: '',
|
|
19
|
+
enterToClass: 'show',
|
|
20
|
+
leaveClass: 'show',
|
|
21
|
+
leaveActiveClass: '',
|
|
22
|
+
leaveToClass: ''
|
|
23
|
+
};
|
|
24
|
+
const FADE_PROPS = {
|
|
25
|
+
...NO_FADE_PROPS,
|
|
26
|
+
enterActiveClass: 'fade',
|
|
27
|
+
leaveActiveClass: 'fade'
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// --- Props ---
|
|
31
|
+
|
|
32
|
+
const props = {
|
|
33
|
+
// Has no effect if `trans-props` provided
|
|
34
|
+
appear: {
|
|
35
|
+
type: PROP_TYPE_BOOLEAN,
|
|
36
|
+
required: false,
|
|
37
|
+
default: false
|
|
38
|
+
},
|
|
39
|
+
// Can be overridden by user supplied `trans-props`
|
|
40
|
+
mode: {
|
|
41
|
+
type: PROP_TYPE_STRING,
|
|
42
|
+
required: false,
|
|
43
|
+
default: undefined
|
|
44
|
+
},
|
|
45
|
+
// Only applicable to the built in transition
|
|
46
|
+
// Has no effect if `trans-props` provided
|
|
47
|
+
noFade: {
|
|
48
|
+
type: PROP_TYPE_BOOLEAN,
|
|
49
|
+
required: false,
|
|
50
|
+
default: false
|
|
51
|
+
},
|
|
52
|
+
// For user supplied transitions (if needed)
|
|
53
|
+
transProps: {
|
|
54
|
+
type: PROP_TYPE_OBJECT,
|
|
55
|
+
required: false,
|
|
56
|
+
default: undefined
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const hasAnimateSupport = typeof Element !== 'undefined' && Boolean(Element.prototype.animate);
|
|
60
|
+
|
|
61
|
+
// --- Main component ---
|
|
62
|
+
|
|
63
|
+
// @vue/component
|
|
64
|
+
const BVTransition = /*#__PURE__*/extend({
|
|
65
|
+
name: NAME_TRANSITION,
|
|
66
|
+
functional: true,
|
|
67
|
+
props,
|
|
68
|
+
render(h, _ref) {
|
|
69
|
+
let {
|
|
70
|
+
children,
|
|
71
|
+
data,
|
|
72
|
+
props
|
|
73
|
+
} = _ref;
|
|
74
|
+
let transProps = props.transProps;
|
|
75
|
+
if (!isPlainObject(transProps)) {
|
|
76
|
+
transProps = props.noFade ? NO_FADE_PROPS : FADE_PROPS;
|
|
77
|
+
if (props.appear) {
|
|
78
|
+
// Default the appear classes to equal the enter classes
|
|
79
|
+
transProps = {
|
|
80
|
+
...transProps,
|
|
81
|
+
appear: true,
|
|
82
|
+
appearClass: transProps.enterClass,
|
|
83
|
+
appearActiveClass: transProps.enterActiveClass,
|
|
84
|
+
appearToClass: transProps.enterToClass
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
transProps = {
|
|
89
|
+
mode: props.mode,
|
|
90
|
+
...transProps,
|
|
91
|
+
/*
|
|
92
|
+
bootstrap-vue says: We always need `css` true
|
|
93
|
+
@gitlab/ui says: OMG. THE FREAKING TRANSITIONS.
|
|
94
|
+
So apparently jsdom doesn't implement animations (who can blame them)
|
|
95
|
+
but a Vue Transition relies on the native animationend/transitionend
|
|
96
|
+
events in order to fire onAfterLeave. jsdom will never fire the `onAfterLeave`
|
|
97
|
+
which is relied on by e.g. the tooltip component to do it's `hidden` logic.
|
|
98
|
+
So if in specs, we set `css: false`, everything will work as expected.
|
|
99
|
+
The best way we have found is to do a feature detection on `Element.prototype.animate`
|
|
100
|
+
*/
|
|
101
|
+
css: hasAnimateSupport
|
|
102
|
+
};
|
|
103
|
+
const dataCopy = {
|
|
104
|
+
...data
|
|
105
|
+
};
|
|
106
|
+
delete dataCopy.props;
|
|
107
|
+
Object.keys(props).forEach(key => {
|
|
108
|
+
delete dataCopy[key];
|
|
109
|
+
});
|
|
110
|
+
return h('transition',
|
|
111
|
+
// Any transition event listeners will get merged here
|
|
112
|
+
mergeData(dataCopy, {
|
|
113
|
+
props: transProps
|
|
114
|
+
}), children);
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
export { BVTransition, props };
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { extend, isVue3 } from '../../vue';
|
|
2
|
+
import { NAME_TRANSPORTER, NAME_TRANSPORTER_TARGET } from '../../constants/components';
|
|
3
|
+
import { IS_BROWSER } from '../../constants/env';
|
|
4
|
+
import { PROP_TYPE_STRING, PROP_TYPE_BOOLEAN, PROP_TYPE_ARRAY, PROP_TYPE_FUNCTION } from '../../constants/props';
|
|
5
|
+
import { HTMLElement } from '../../constants/safe-types';
|
|
6
|
+
import { concat } from '../../utils/array';
|
|
7
|
+
import { select, removeNode } from '../../utils/dom';
|
|
8
|
+
import { identity } from '../../utils/identity';
|
|
9
|
+
import { isString, isFunction } from '../../utils/inspect';
|
|
10
|
+
import { normalizeSlotMixin } from '../../mixins/normalize-slot';
|
|
11
|
+
import { createNewChildComponent } from '../../utils/create-new-child-component';
|
|
12
|
+
|
|
13
|
+
// --- Helper components ---
|
|
14
|
+
|
|
15
|
+
// BVTransporter/BVTransporterTarget:
|
|
16
|
+
//
|
|
17
|
+
// Single root node portaling of content, which retains parent/child hierarchy
|
|
18
|
+
// Unlike Portal-Vue where portaled content is no longer a descendent of its
|
|
19
|
+
// intended parent components
|
|
20
|
+
//
|
|
21
|
+
// Private components for use by Tooltips, Popovers and Modals
|
|
22
|
+
//
|
|
23
|
+
// Based on vue-simple-portal
|
|
24
|
+
// https://github.com/LinusBorg/vue-simple-portal
|
|
25
|
+
|
|
26
|
+
// Transporter target used by BVTransporter
|
|
27
|
+
// Supports only a single root element
|
|
28
|
+
// @vue/component
|
|
29
|
+
const BVTransporterTarget = /*#__PURE__*/extend({
|
|
30
|
+
// As an abstract component, it doesn't appear in the $parent chain of
|
|
31
|
+
// components, which means the next parent of any component rendered inside
|
|
32
|
+
// of this one will be the parent from which is was portal'd
|
|
33
|
+
abstract: true,
|
|
34
|
+
name: NAME_TRANSPORTER_TARGET,
|
|
35
|
+
props: {
|
|
36
|
+
// Even though we only support a single root element,
|
|
37
|
+
// VNodes are always passed as an array
|
|
38
|
+
nodes: {
|
|
39
|
+
type: [PROP_TYPE_ARRAY, PROP_TYPE_FUNCTION],
|
|
40
|
+
required: false,
|
|
41
|
+
default: undefined
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
data: vm => {
|
|
45
|
+
return {
|
|
46
|
+
updatedNodes: vm.nodes
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
destroyed() {
|
|
50
|
+
removeNode(this.$el);
|
|
51
|
+
},
|
|
52
|
+
render(h) {
|
|
53
|
+
const {
|
|
54
|
+
updatedNodes
|
|
55
|
+
} = this;
|
|
56
|
+
let $nodes = isFunction(updatedNodes) ? updatedNodes({}) : updatedNodes;
|
|
57
|
+
$nodes = concat($nodes).filter(identity);
|
|
58
|
+
if ($nodes && $nodes.length > 0 && !$nodes[0].text) {
|
|
59
|
+
return $nodes[0];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* istanbul ignore next */
|
|
63
|
+
return h();
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// --- Props ---
|
|
68
|
+
|
|
69
|
+
const props = {
|
|
70
|
+
// String: CSS selector,
|
|
71
|
+
// HTMLElement: Element reference
|
|
72
|
+
// Mainly needed for tooltips/popovers inside modals
|
|
73
|
+
container: {
|
|
74
|
+
type: [HTMLElement, PROP_TYPE_STRING],
|
|
75
|
+
required: false,
|
|
76
|
+
default: 'body'
|
|
77
|
+
},
|
|
78
|
+
disabled: {
|
|
79
|
+
type: PROP_TYPE_BOOLEAN,
|
|
80
|
+
required: false,
|
|
81
|
+
default: false
|
|
82
|
+
},
|
|
83
|
+
// This should be set to match the root element type
|
|
84
|
+
tag: {
|
|
85
|
+
type: PROP_TYPE_STRING,
|
|
86
|
+
required: false,
|
|
87
|
+
default: 'div'
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
// --- Main component ---
|
|
92
|
+
|
|
93
|
+
// @vue/component
|
|
94
|
+
const BVTransporter = /*#__PURE__*/extend({
|
|
95
|
+
name: NAME_TRANSPORTER,
|
|
96
|
+
mixins: [normalizeSlotMixin],
|
|
97
|
+
props,
|
|
98
|
+
watch: {
|
|
99
|
+
disabled: {
|
|
100
|
+
immediate: true,
|
|
101
|
+
handler(disabled) {
|
|
102
|
+
// Vue 2 only: manage manual portaling
|
|
103
|
+
if (isVue3(this)) return;
|
|
104
|
+
disabled ? this.unmountTarget() : this.$nextTick(this.mountTarget);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
created() {
|
|
109
|
+
// Vue 2 only: create private non-reactive props
|
|
110
|
+
if (isVue3(this)) return;
|
|
111
|
+
this.$_defaultFn = null;
|
|
112
|
+
this.$_target = null;
|
|
113
|
+
},
|
|
114
|
+
beforeMount() {
|
|
115
|
+
// Vue 2 only
|
|
116
|
+
if (isVue3(this)) return;
|
|
117
|
+
this.mountTarget();
|
|
118
|
+
},
|
|
119
|
+
updated() {
|
|
120
|
+
// Vue 2 only
|
|
121
|
+
// We need to make sure that all children have completed updating
|
|
122
|
+
// before rendering in the target
|
|
123
|
+
// `vue-simple-portal` has the this in a `$nextTick()`,
|
|
124
|
+
// while `portal-vue` doesn't
|
|
125
|
+
// Just trying to see if the `$nextTick()` delay is required or not
|
|
126
|
+
// Since all slots in Vue 2.6.x are always functions
|
|
127
|
+
if (isVue3(this)) return;
|
|
128
|
+
this.updateTarget();
|
|
129
|
+
},
|
|
130
|
+
beforeDestroy() {
|
|
131
|
+
// Vue 2 only
|
|
132
|
+
if (isVue3(this)) return;
|
|
133
|
+
this.unmountTarget();
|
|
134
|
+
this.$_defaultFn = null;
|
|
135
|
+
},
|
|
136
|
+
methods: {
|
|
137
|
+
// Get the element which the target should be appended to
|
|
138
|
+
getContainer() {
|
|
139
|
+
/* istanbul ignore else */
|
|
140
|
+
if (IS_BROWSER) {
|
|
141
|
+
const {
|
|
142
|
+
container
|
|
143
|
+
} = this;
|
|
144
|
+
return isString(container) ? select(container) : container;
|
|
145
|
+
} else {
|
|
146
|
+
return null;
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
// Mount the target
|
|
150
|
+
mountTarget() {
|
|
151
|
+
if (!this.$_target) {
|
|
152
|
+
const $container = this.getContainer();
|
|
153
|
+
if ($container) {
|
|
154
|
+
const $el = document.createElement('div');
|
|
155
|
+
$container.appendChild($el);
|
|
156
|
+
this.$_target = createNewChildComponent(this, BVTransporterTarget, {
|
|
157
|
+
el: $el,
|
|
158
|
+
propsData: {
|
|
159
|
+
// Initial nodes to be rendered
|
|
160
|
+
nodes: concat(this.normalizeSlot())
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
// Update the content of the target
|
|
167
|
+
updateTarget() {
|
|
168
|
+
if (IS_BROWSER && this.$_target) {
|
|
169
|
+
const defaultFn = this.$scopedSlots.default;
|
|
170
|
+
if (!this.disabled) {
|
|
171
|
+
/* istanbul ignore else: only applicable in Vue 2.5.x */
|
|
172
|
+
if (defaultFn && this.$_defaultFn !== defaultFn) {
|
|
173
|
+
// We only update the target component if the scoped slot
|
|
174
|
+
// function is a fresh one. The new slot syntax (since Vue 2.6)
|
|
175
|
+
// can cache unchanged slot functions and we want to respect that here
|
|
176
|
+
this.$_target.updatedNodes = defaultFn;
|
|
177
|
+
} else if (!defaultFn) {
|
|
178
|
+
// We also need to be back compatible with non-scoped default slot (i.e. 2.5.x)
|
|
179
|
+
this.$_target.updatedNodes = this.$slots.default;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
// Update the scoped slot function cache
|
|
183
|
+
this.$_defaultFn = defaultFn;
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
// Unmount the target
|
|
187
|
+
unmountTarget() {
|
|
188
|
+
this.$_target && this.$_target.$destroy();
|
|
189
|
+
this.$_target = null;
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
render(h) {
|
|
193
|
+
if (isVue3(this)) {
|
|
194
|
+
// Vue 3: use native Teleport
|
|
195
|
+
if (this.disabled) {
|
|
196
|
+
const $nodes = concat(this.normalizeSlot()).filter(identity);
|
|
197
|
+
if ($nodes.length > 0) {
|
|
198
|
+
return $nodes[0];
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
const {
|
|
202
|
+
Teleport
|
|
203
|
+
} = this.$.appContext.config.globalProperties.constructor;
|
|
204
|
+
return h(Teleport, {
|
|
205
|
+
to: this.container
|
|
206
|
+
}, this.normalizeSlot());
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// Vue 2: this component has no root element, so only a single VNode is allowed
|
|
210
|
+
if (this.disabled) {
|
|
211
|
+
const $nodes = concat(this.normalizeSlot()).filter(identity);
|
|
212
|
+
if ($nodes.length > 0 && !$nodes[0].text) {
|
|
213
|
+
return $nodes[0];
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return h();
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
export { BVTransporter, props };
|