@gitlab/duo-ui 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +7 -0
- package/README.md +88 -0
- package/dist/tokens/css/tokens.css +953 -0
- package/dist/tokens/css/tokens.dark.css +953 -0
- package/dist/tokens/js/tokens.dark.js +951 -0
- package/dist/tokens/js/tokens.js +951 -0
- package/dist/tokens/json/tokens.dark.json +21803 -0
- package/dist/tokens/json/tokens.json +21803 -0
- package/dist/tokens/scss/_tokens.dark.scss +950 -0
- package/dist/tokens/scss/_tokens.scss +950 -0
- package/dist/tokens/scss/_tokens_custom_properties.scss +951 -0
- package/dist/tokens/tailwind/tokens.cjs +336 -0
- package/package.json +234 -0
- package/src/charts.js +14 -0
- package/src/components/base/accordion/accordion.md +3 -0
- package/src/components/base/accordion/accordion.vue +43 -0
- package/src/components/base/accordion/accordion_item.md +3 -0
- package/src/components/base/accordion/accordion_item.scss +16 -0
- package/src/components/base/accordion/accordion_item.vue +122 -0
- package/src/components/base/alert/alert.md +35 -0
- package/src/components/base/alert/alert.scss +179 -0
- package/src/components/base/alert/alert.vue +241 -0
- package/src/components/base/animated_icon/animated_chevron_right_down_icon.vue +28 -0
- package/src/components/base/animated_icon/animated_duo_chat_icon.vue +39 -0
- package/src/components/base/animated_icon/animated_icon.md +4 -0
- package/src/components/base/animated_icon/animated_icon.scss +456 -0
- package/src/components/base/animated_icon/animated_notifications_icon.vue +49 -0
- package/src/components/base/animated_icon/animated_sidebar_icon.vue +35 -0
- package/src/components/base/animated_icon/animated_smile_icon.vue +37 -0
- package/src/components/base/animated_icon/animated_sort_icon.vue +84 -0
- package/src/components/base/animated_icon/animated_star_icon.vue +27 -0
- package/src/components/base/animated_icon/animated_todo_icon.vue +49 -0
- package/src/components/base/animated_icon/animated_upload_icon.vue +41 -0
- package/src/components/base/animated_icon/base_animated_icon.vue +39 -0
- package/src/components/base/avatar/avatar.md +1 -0
- package/src/components/base/avatar/avatar.scss +228 -0
- package/src/components/base/avatar/avatar.vue +151 -0
- package/src/components/base/avatar_labeled/avatar_labeled.md +20 -0
- package/src/components/base/avatar_labeled/avatar_labeled.scss +30 -0
- package/src/components/base/avatar_labeled/avatar_labeled.vue +92 -0
- package/src/components/base/avatar_link/avatar_link.md +33 -0
- package/src/components/base/avatar_link/avatar_link.scss +41 -0
- package/src/components/base/avatar_link/avatar_link.vue +15 -0
- package/src/components/base/avatars_inline/avatars_inline.md +38 -0
- package/src/components/base/avatars_inline/avatars_inline.scss +64 -0
- package/src/components/base/avatars_inline/avatars_inline.vue +110 -0
- package/src/components/base/badge/badge.md +38 -0
- package/src/components/base/badge/badge.scss +251 -0
- package/src/components/base/badge/badge.vue +91 -0
- package/src/components/base/banner/banner.md +35 -0
- package/src/components/base/banner/banner.scss +35 -0
- package/src/components/base/banner/banner.vue +131 -0
- package/src/components/base/breadcrumb/breadcrumb.md +23 -0
- package/src/components/base/breadcrumb/breadcrumb.scss +62 -0
- package/src/components/base/breadcrumb/breadcrumb.vue +229 -0
- package/src/components/base/breadcrumb/breadcrumb_item.vue +44 -0
- package/src/components/base/broadcast_message/broadcast_message.md +25 -0
- package/src/components/base/broadcast_message/broadcast_message.scss +135 -0
- package/src/components/base/broadcast_message/broadcast_message.vue +98 -0
- package/src/components/base/broadcast_message/constants.js +3 -0
- package/src/components/base/button/button.md +61 -0
- package/src/components/base/button/button.scss +699 -0
- package/src/components/base/button/button.vue +143 -0
- package/src/components/base/button_group/button_group.md +28 -0
- package/src/components/base/button_group/button_group.vue +16 -0
- package/src/components/base/card/card.md +4 -0
- package/src/components/base/card/card.scss +46 -0
- package/src/components/base/card/card.vue +49 -0
- package/src/components/base/collapse/collapse.md +26 -0
- package/src/components/base/collapse/collapse.vue +29 -0
- package/src/components/base/datepicker/datepicker.md +8 -0
- package/src/components/base/datepicker/datepicker.scss +228 -0
- package/src/components/base/datepicker/datepicker.vue +454 -0
- package/src/components/base/daterange_picker/daterange_picker.md +32 -0
- package/src/components/base/daterange_picker/daterange_picker.scss +20 -0
- package/src/components/base/daterange_picker/daterange_picker.vue +345 -0
- package/src/components/base/drawer/drawer.md +17 -0
- package/src/components/base/drawer/drawer.scss +153 -0
- package/src/components/base/drawer/drawer.vue +136 -0
- package/src/components/base/dropdown/dropdown.md +72 -0
- package/src/components/base/dropdown/dropdown.scss +210 -0
- package/src/components/base/dropdown/dropdown.vue +323 -0
- package/src/components/base/dropdown/dropdown_divider.scss +20 -0
- package/src/components/base/dropdown/dropdown_divider.vue +15 -0
- package/src/components/base/dropdown/dropdown_form.vue +17 -0
- package/src/components/base/dropdown/dropdown_item.md +2 -0
- package/src/components/base/dropdown/dropdown_item.scss +102 -0
- package/src/components/base/dropdown/dropdown_item.vue +114 -0
- package/src/components/base/dropdown/dropdown_section_header.md +7 -0
- package/src/components/base/dropdown/dropdown_section_header.scss +22 -0
- package/src/components/base/dropdown/dropdown_section_header.vue +17 -0
- package/src/components/base/dropdown/dropdown_text.md +7 -0
- package/src/components/base/dropdown/dropdown_text.scss +6 -0
- package/src/components/base/dropdown/dropdown_text.vue +17 -0
- package/src/components/base/filtered_search/common_story_options.js +12 -0
- package/src/components/base/filtered_search/filtered_search.md +76 -0
- package/src/components/base/filtered_search/filtered_search.scss +51 -0
- package/src/components/base/filtered_search/filtered_search.vue +475 -0
- package/src/components/base/filtered_search/filtered_search_suggestion.md +15 -0
- package/src/components/base/filtered_search/filtered_search_suggestion.scss +11 -0
- package/src/components/base/filtered_search/filtered_search_suggestion.vue +64 -0
- package/src/components/base/filtered_search/filtered_search_suggestion_list.md +13 -0
- package/src/components/base/filtered_search/filtered_search_suggestion_list.scss +36 -0
- package/src/components/base/filtered_search/filtered_search_suggestion_list.vue +122 -0
- package/src/components/base/filtered_search/filtered_search_term.md +7 -0
- package/src/components/base/filtered_search/filtered_search_term.scss +19 -0
- package/src/components/base/filtered_search/filtered_search_term.vue +243 -0
- package/src/components/base/filtered_search/filtered_search_token.md +23 -0
- package/src/components/base/filtered_search/filtered_search_token.scss +63 -0
- package/src/components/base/filtered_search/filtered_search_token.vue +484 -0
- package/src/components/base/filtered_search/filtered_search_token_segment.md +14 -0
- package/src/components/base/filtered_search/filtered_search_token_segment.scss +25 -0
- package/src/components/base/filtered_search/filtered_search_token_segment.vue +468 -0
- package/src/components/base/filtered_search/filtered_search_utils.js +251 -0
- package/src/components/base/form/form.md +2 -0
- package/src/components/base/form/form.vue +17 -0
- package/src/components/base/form/form_character_count/form_character_count.md +53 -0
- package/src/components/base/form/form_character_count/form_character_count.vue +97 -0
- package/src/components/base/form/form_checkbox/form_checkbox.md +6 -0
- package/src/components/base/form/form_checkbox/form_checkbox.scss +221 -0
- package/src/components/base/form/form_checkbox/form_checkbox.vue +58 -0
- package/src/components/base/form/form_checkbox/form_checkbox_group.vue +44 -0
- package/src/components/base/form/form_checkbox_tree/checkbox_tree_node.vue +58 -0
- package/src/components/base/form/form_checkbox_tree/form_checkbox_tree.md +73 -0
- package/src/components/base/form/form_checkbox_tree/form_checkbox_tree.vue +116 -0
- package/src/components/base/form/form_checkbox_tree/models/constants.js +12 -0
- package/src/components/base/form/form_checkbox_tree/models/node.js +48 -0
- package/src/components/base/form/form_checkbox_tree/models/tree.js +186 -0
- package/src/components/base/form/form_combobox/constants.js +50 -0
- package/src/components/base/form/form_combobox/form_combobox.md +52 -0
- package/src/components/base/form/form_combobox/form_combobox.scss +5 -0
- package/src/components/base/form/form_combobox/form_combobox.vue +280 -0
- package/src/components/base/form/form_date/form_date.md +26 -0
- package/src/components/base/form/form_date/form_date.scss +7 -0
- package/src/components/base/form/form_date/form_date.vue +135 -0
- package/src/components/base/form/form_fields/form_field_validator.vue +59 -0
- package/src/components/base/form/form_fields/form_fields.md +41 -0
- package/src/components/base/form/form_fields/form_fields.vue +258 -0
- package/src/components/base/form/form_fields/mappers.js +11 -0
- package/src/components/base/form/form_fields/validators.js +49 -0
- package/src/components/base/form/form_group/form_group.md +1 -0
- package/src/components/base/form/form_group/form_group.scss +59 -0
- package/src/components/base/form/form_group/form_group.vue +76 -0
- package/src/components/base/form/form_input/form_input.md +1 -0
- package/src/components/base/form/form_input/form_input.scss +74 -0
- package/src/components/base/form/form_input/form_input.vue +98 -0
- package/src/components/base/form/form_input_group/form_input_group.md +67 -0
- package/src/components/base/form/form_input_group/form_input_group.vue +103 -0
- package/src/components/base/form/form_input_group/form_input_group_mixin.js +39 -0
- package/src/components/base/form/form_radio/form_radio.md +23 -0
- package/src/components/base/form/form_radio/form_radio.scss +1 -0
- package/src/components/base/form/form_radio/form_radio.vue +51 -0
- package/src/components/base/form/form_radio_group/form_radio_group.md +63 -0
- package/src/components/base/form/form_radio_group/form_radio_group.scss +4 -0
- package/src/components/base/form/form_radio_group/form_radio_group.vue +64 -0
- package/src/components/base/form/form_select/constants.js +5 -0
- package/src/components/base/form/form_select/form_select.md +1 -0
- package/src/components/base/form/form_select/form_select.scss +117 -0
- package/src/components/base/form/form_select/form_select.vue +61 -0
- package/src/components/base/form/form_textarea/form_textarea.md +3 -0
- package/src/components/base/form/form_textarea/form_textarea.vue +141 -0
- package/src/components/base/form/input_group_text/input_group_text.md +4 -0
- package/src/components/base/form/input_group_text/input_group_text.vue +17 -0
- package/src/components/base/icon/icon.md +27 -0
- package/src/components/base/icon/icon.scss +8 -0
- package/src/components/base/icon/icon.vue +98 -0
- package/src/components/base/infinite_scroll/infinite_scroll.md +104 -0
- package/src/components/base/infinite_scroll/infinite_scroll.scss +11 -0
- package/src/components/base/infinite_scroll/infinite_scroll.vue +169 -0
- package/src/components/base/keyset_pagination/keyset_pagination.md +49 -0
- package/src/components/base/keyset_pagination/keyset_pagination.scss +9 -0
- package/src/components/base/keyset_pagination/keyset_pagination.vue +152 -0
- package/src/components/base/label/label.md +15 -0
- package/src/components/base/label/label.scss +156 -0
- package/src/components/base/label/label.vue +160 -0
- package/src/components/base/link/link.md +22 -0
- package/src/components/base/link/link.scss +13 -0
- package/src/components/base/link/link.vue +25 -0
- package/src/components/base/loading_icon/loading_icon.md +3 -0
- package/src/components/base/loading_icon/loading_icon.scss +139 -0
- package/src/components/base/loading_icon/loading_icon.vue +96 -0
- package/src/components/base/markdown/markdown.md +73 -0
- package/src/components/base/markdown/markdown.scss +223 -0
- package/src/components/base/markdown/markdown.vue +18 -0
- package/src/components/base/markdown/markdown_typescale_demo.html +155 -0
- package/src/components/base/modal/modal.md +30 -0
- package/src/components/base/modal/modal.scss +130 -0
- package/src/components/base/modal/modal.vue +269 -0
- package/src/components/base/nav/nav.md +11 -0
- package/src/components/base/nav/nav.scss +7 -0
- package/src/components/base/nav/nav.vue +17 -0
- package/src/components/base/nav/nav_item.vue +17 -0
- package/src/components/base/nav/nav_item_dropdown.vue +40 -0
- package/src/components/base/navbar/navbar.md +4 -0
- package/src/components/base/navbar/navbar.scss +0 -0
- package/src/components/base/navbar/navbar.vue +17 -0
- package/src/components/base/new_dropdowns/base_dropdown/base_dropdown.vue +507 -0
- package/src/components/base/new_dropdowns/base_dropdown/constants.js +2 -0
- package/src/components/base/new_dropdowns/constants.js +20 -0
- package/src/components/base/new_dropdowns/disclosure/constants.js +6 -0
- package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.md +168 -0
- package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.scss +17 -0
- package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown.vue +458 -0
- package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown_group.vue +104 -0
- package/src/components/base/new_dropdowns/disclosure/disclosure_dropdown_item.vue +131 -0
- package/src/components/base/new_dropdowns/disclosure/mock_data.js +201 -0
- package/src/components/base/new_dropdowns/disclosure/utils.js +70 -0
- package/src/components/base/new_dropdowns/dropdown.scss +243 -0
- package/src/components/base/new_dropdowns/dropdown_item.scss +134 -0
- package/src/components/base/new_dropdowns/listbox/listbox.md +159 -0
- package/src/components/base/new_dropdowns/listbox/listbox.scss +53 -0
- package/src/components/base/new_dropdowns/listbox/listbox.vue +940 -0
- package/src/components/base/new_dropdowns/listbox/listbox_group.vue +35 -0
- package/src/components/base/new_dropdowns/listbox/listbox_item.vue +77 -0
- package/src/components/base/new_dropdowns/listbox/listbox_search_input.vue +76 -0
- package/src/components/base/new_dropdowns/listbox/mock_data.js +139 -0
- package/src/components/base/new_dropdowns/listbox/utils.js +25 -0
- package/src/components/base/paginated_list/paginated_list.md +1 -0
- package/src/components/base/paginated_list/paginated_list.vue +179 -0
- package/src/components/base/pagination/pagination.md +45 -0
- package/src/components/base/pagination/pagination.scss +57 -0
- package/src/components/base/pagination/pagination.vue +498 -0
- package/src/components/base/path/data.js +43 -0
- package/src/components/base/path/path.md +41 -0
- package/src/components/base/path/path.scss +163 -0
- package/src/components/base/path/path.vue +191 -0
- package/src/components/base/popover/popover.scss +102 -0
- package/src/components/base/popover/popover.vue +111 -0
- package/src/components/base/progress_bar/progress_bar.scss +19 -0
- package/src/components/base/progress_bar/progress_bar.vue +15 -0
- package/src/components/base/search_box_by_click/search_box_by_click.md +1 -0
- package/src/components/base/search_box_by_click/search_box_by_click.scss +49 -0
- package/src/components/base/search_box_by_click/search_box_by_click.vue +296 -0
- package/src/components/base/search_box_by_type/search_box_by_type.md +1 -0
- package/src/components/base/search_box_by_type/search_box_by_type.scss +70 -0
- package/src/components/base/search_box_by_type/search_box_by_type.vue +159 -0
- package/src/components/base/segmented_control/segmented_control.md +1 -0
- package/src/components/base/segmented_control/segmented_control.scss +179 -0
- package/src/components/base/segmented_control/segmented_control.vue +77 -0
- package/src/components/base/skeleton_loader/skeleton_loader.md +46 -0
- package/src/components/base/skeleton_loader/skeleton_loader.scss +17 -0
- package/src/components/base/skeleton_loader/skeleton_loader.vue +249 -0
- package/src/components/base/sorting/sorting.md +80 -0
- package/src/components/base/sorting/sorting.vue +160 -0
- package/src/components/base/table/constants.js +48 -0
- package/src/components/base/table/table.md +72 -0
- package/src/components/base/table/table.scss +145 -0
- package/src/components/base/table/table.vue +144 -0
- package/src/components/base/table_lite/table_lite.md +68 -0
- package/src/components/base/table_lite/table_lite.vue +43 -0
- package/src/components/base/tabs/constants.js +1 -0
- package/src/components/base/tabs/tab/tab.vue +57 -0
- package/src/components/base/tabs/tabs/scrollable_tabs.vue +140 -0
- package/src/components/base/tabs/tabs/tabs.md +76 -0
- package/src/components/base/tabs/tabs/tabs.scss +164 -0
- package/src/components/base/tabs/tabs/tabs.vue +282 -0
- package/src/components/base/toast/toast.js +93 -0
- package/src/components/base/toast/toast.md +48 -0
- package/src/components/base/toast/toast.scss +62 -0
- package/src/components/base/toggle/toggle.md +4 -0
- package/src/components/base/toggle/toggle.scss +177 -0
- package/src/components/base/toggle/toggle.vue +194 -0
- package/src/components/base/token/token.md +12 -0
- package/src/components/base/token/token.scss +44 -0
- package/src/components/base/token/token.vue +67 -0
- package/src/components/base/token_selector/helpers.js +3 -0
- package/src/components/base/token_selector/token_container.vue +184 -0
- package/src/components/base/token_selector/token_selector.md +78 -0
- package/src/components/base/token_selector/token_selector.scss +19 -0
- package/src/components/base/token_selector/token_selector.vue +489 -0
- package/src/components/base/token_selector/token_selector_dropdown.vue +257 -0
- package/src/components/base/tooltip/tooltip.md +52 -0
- package/src/components/base/tooltip/tooltip.scss +52 -0
- package/src/components/base/tooltip/tooltip.vue +31 -0
- package/src/components/charts/area/area.vue +372 -0
- package/src/components/charts/bar/bar.md +3 -0
- package/src/components/charts/bar/bar.vue +237 -0
- package/src/components/charts/chart/chart.md +19 -0
- package/src/components/charts/chart/chart.vue +188 -0
- package/src/components/charts/column/column.vue +204 -0
- package/src/components/charts/discrete_scatter/discrete_scatter.vue +207 -0
- package/src/components/charts/gauge/gauge.md +8 -0
- package/src/components/charts/gauge/gauge.scss +0 -0
- package/src/components/charts/gauge/gauge.vue +178 -0
- package/src/components/charts/heatmap/heatmap.md +7 -0
- package/src/components/charts/heatmap/heatmap.scss +7 -0
- package/src/components/charts/heatmap/heatmap.vue +290 -0
- package/src/components/charts/heatmap/index.js +3 -0
- package/src/components/charts/legend/legend.md +16 -0
- package/src/components/charts/legend/legend.scss +97 -0
- package/src/components/charts/legend/legend.vue +284 -0
- package/src/components/charts/line/line.md +7 -0
- package/src/components/charts/line/line.vue +368 -0
- package/src/components/charts/series_label/series_label.md +1 -0
- package/src/components/charts/series_label/series_label.scss +23 -0
- package/src/components/charts/series_label/series_label.vue +85 -0
- package/src/components/charts/single_stat/single_stat.md +8 -0
- package/src/components/charts/single_stat/single_stat.scss +17 -0
- package/src/components/charts/single_stat/single_stat.vue +158 -0
- package/src/components/charts/sparkline/sparkline.md +8 -0
- package/src/components/charts/sparkline/sparkline.vue +308 -0
- package/src/components/charts/stacked_column/stacked_column.md +10 -0
- package/src/components/charts/stacked_column/stacked_column.vue +330 -0
- package/src/components/charts/tooltip/tooltip.md +3 -0
- package/src/components/charts/tooltip/tooltip.scss +9 -0
- package/src/components/charts/tooltip/tooltip.vue +253 -0
- package/src/components/experimental/duo/chat/components/duo_chat_context/constants.js +11 -0
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_details_modal/duo_chat_context_item_details_modal.vue +112 -0
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu.vue +279 -0
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_category_items.vue +44 -0
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_search_item.vue +84 -0
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_search_items.vue +157 -0
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_menu/duo_chat_context_item_menu_search_items_loading.vue +34 -0
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_popover/duo_chat_context_item_popover.vue +153 -0
- package/src/components/experimental/duo/chat/components/duo_chat_context/duo_chat_context_item_selections/duo_chat_context_item_selections.vue +180 -0
- package/src/components/experimental/duo/chat/components/duo_chat_context/mock_context_data.js +214 -0
- package/src/components/experimental/duo/chat/components/duo_chat_context/utils.js +129 -0
- package/src/components/experimental/duo/chat/components/duo_chat_conversation/duo_chat_conversation.md +18 -0
- package/src/components/experimental/duo/chat/components/duo_chat_conversation/duo_chat_conversation.vue +90 -0
- package/src/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.md +1 -0
- package/src/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.scss +62 -0
- package/src/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.vue +105 -0
- package/src/components/experimental/duo/chat/components/duo_chat_message/buttons_utils.js +30 -0
- package/src/components/experimental/duo/chat/components/duo_chat_message/copy_code_element.js +15 -0
- package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.md +69 -0
- package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.scss +65 -0
- package/src/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.vue +327 -0
- package/src/components/experimental/duo/chat/components/duo_chat_message/insert_code_snippet_element.js +42 -0
- package/src/components/experimental/duo/chat/components/duo_chat_message/utils.js +9 -0
- package/src/components/experimental/duo/chat/components/duo_chat_message_sources/duo_chat_message_sources.md +1 -0
- package/src/components/experimental/duo/chat/components/duo_chat_message_sources/duo_chat_message_sources.vue +81 -0
- package/src/components/experimental/duo/chat/components/duo_chat_predefined_prompts/duo_chat_predefined_prompts.md +1 -0
- package/src/components/experimental/duo/chat/components/duo_chat_predefined_prompts/duo_chat_predefined_prompts.vue +36 -0
- package/src/components/experimental/duo/chat/constants.js +32 -0
- package/src/components/experimental/duo/chat/duo_chat.md +194 -0
- package/src/components/experimental/duo/chat/duo_chat.scss +168 -0
- package/src/components/experimental/duo/chat/duo_chat.vue +732 -0
- package/src/components/experimental/duo/chat/markdown_renderer.js +20 -0
- package/src/components/experimental/duo/chat/mock_data.js +178 -0
- package/src/components/experimental/duo/user_feedback/user_feedback.md +81 -0
- package/src/components/experimental/duo/user_feedback/user_feedback.vue +85 -0
- package/src/components/experimental/duo/user_feedback/user_feedback_modal.vue +157 -0
- package/src/components/experimental/duo/workflow/components/duo_workflow_panel/duo_workflow_panel.md +33 -0
- package/src/components/experimental/duo/workflow/components/duo_workflow_panel/duo_workflow_panel.vue +84 -0
- package/src/components/experimental/duo/workflow/components/duo_workflow_prompt/duo_workflow_prompt.md +37 -0
- package/src/components/experimental/duo/workflow/components/duo_workflow_prompt/duo_workflow_prompt.vue +258 -0
- package/src/components/experimental/experiment_badge/constants.js +2 -0
- package/src/components/experimental/experiment_badge/experiment_badge.md +9 -0
- package/src/components/experimental/experiment_badge/experiment_badge.vue +113 -0
- package/src/components/mixins/button_mixin.js +9 -0
- package/src/components/mixins/safe_link_mixin.js +28 -0
- package/src/components/mixins/tooltip_mixin.js +21 -0
- package/src/components/regions/dashboard_skeleton/dashboard_skeleton.md +4 -0
- package/src/components/regions/dashboard_skeleton/dashboard_skeleton.vue +40 -0
- package/src/components/regions/empty_state/empty_state.md +4 -0
- package/src/components/regions/empty_state/empty_state.scss +3 -0
- package/src/components/regions/empty_state/empty_state.vue +187 -0
- package/src/components/shared_components/charts/tooltip_default_format.scss +18 -0
- package/src/components/shared_components/charts/tooltip_default_format.vue +32 -0
- package/src/components/shared_components/clear_icon_button/clear_icon_button.scss +10 -0
- package/src/components/shared_components/clear_icon_button/clear_icon_button.vue +43 -0
- package/src/components/shared_components/close_button/close_button.vue +29 -0
- package/src/components/utilities/animated_number/animated_number.md +6 -0
- package/src/components/utilities/animated_number/animated_number.vue +99 -0
- package/src/components/utilities/friendly_wrap/friendly_wrap.md +66 -0
- package/src/components/utilities/friendly_wrap/friendly_wrap.vue +33 -0
- package/src/components/utilities/intersection_observer/intersection_observer.md +16 -0
- package/src/components/utilities/intersection_observer/intersection_observer.vue +67 -0
- package/src/components/utilities/intersperse/intersperse.md +90 -0
- package/src/components/utilities/intersperse/intersperse.vue +60 -0
- package/src/components/utilities/sprintf/sprintf.md +243 -0
- package/src/components/utilities/sprintf/sprintf.vue +142 -0
- package/src/components/utilities/truncate/constants.js +5 -0
- package/src/components/utilities/truncate/truncate.md +14 -0
- package/src/components/utilities/truncate/truncate.scss +21 -0
- package/src/components/utilities/truncate/truncate.vue +109 -0
- package/src/components/utilities/truncate_text/constants.js +5 -0
- package/src/components/utilities/truncate_text/truncate_text.md +26 -0
- package/src/components/utilities/truncate_text/truncate_text.scss +14 -0
- package/src/components/utilities/truncate_text/truncate_text.vue +124 -0
- package/src/config.js +86 -0
- package/src/directives/collapse_toggle.js +1 -0
- package/src/directives/hover_load/hover_load.js +46 -0
- package/src/directives/hover_load/hover_load.md +22 -0
- package/src/directives/modal.js +1 -0
- package/src/directives/outside/outside.js +151 -0
- package/src/directives/outside/outside.md +140 -0
- package/src/directives/resize_observer/resize_observer.js +45 -0
- package/src/directives/resize_observer/resize_observer.md +54 -0
- package/src/directives/safe_html/constants.js +14 -0
- package/src/directives/safe_html/safe_html.js +35 -0
- package/src/directives/safe_html/safe_html.md +58 -0
- package/src/directives/safe_link/mock_data.js +33 -0
- package/src/directives/safe_link/safe_link.js +56 -0
- package/src/directives/safe_link/safe_link.md +37 -0
- package/src/directives/tooltip.js +1 -0
- package/src/index.js +130 -0
- package/src/internal/color_contrast/color_contrast.md +8 -0
- package/src/internal/color_contrast/color_contrast.vue +52 -0
- package/src/scss/README.md +1 -0
- package/src/scss/body.scss +4 -0
- package/src/scss/bootstrap.scss +34 -0
- package/src/scss/bootstrap_vue.scss +25 -0
- package/src/scss/components.scss +83 -0
- package/src/scss/fonts.scss +67 -0
- package/src/scss/functions.scss +63 -0
- package/src/scss/gitlab_ui.scss +19 -0
- package/src/scss/mixins.scss +262 -0
- package/src/scss/storybook.scss +43 -0
- package/src/scss/storybook_dark_mode.scss +21 -0
- package/src/scss/tailwind.css +3 -0
- package/src/scss/tokens.scss +2 -0
- package/src/scss/typescale/_index.scss +103 -0
- package/src/scss/typescale/typeface_demo.html +70 -0
- package/src/scss/typescale/typescale.md +82 -0
- package/src/scss/typescale/typescale_demo.html +78 -0
- package/src/scss/typescale/typescale_demo.scss +8 -0
- package/src/scss/utilities.scss +9196 -0
- package/src/scss/utility-mixins/accessibility.scss +19 -0
- package/src/scss/utility-mixins/animation.scss +90 -0
- package/src/scss/utility-mixins/background.scss +421 -0
- package/src/scss/utility-mixins/border.scss +498 -0
- package/src/scss/utility-mixins/box-shadow.scss +220 -0
- package/src/scss/utility-mixins/clearfix.scss +9 -0
- package/src/scss/utility-mixins/color.scss +228 -0
- package/src/scss/utility-mixins/composite.scss +24 -0
- package/src/scss/utility-mixins/cursor.scss +36 -0
- package/src/scss/utility-mixins/deprecated.scss +20 -0
- package/src/scss/utility-mixins/display.scss +192 -0
- package/src/scss/utility-mixins/flex.scss +360 -0
- package/src/scss/utility-mixins/grid.scss +50 -0
- package/src/scss/utility-mixins/image.scss +8 -0
- package/src/scss/utility-mixins/index.scss +47 -0
- package/src/scss/utility-mixins/list-style.scss +12 -0
- package/src/scss/utility-mixins/opacity.scss +32 -0
- package/src/scss/utility-mixins/outline.scss +12 -0
- package/src/scss/utility-mixins/overflow.scss +45 -0
- package/src/scss/utility-mixins/pointer-events.scss +12 -0
- package/src/scss/utility-mixins/sizing.scss +582 -0
- package/src/scss/utility-mixins/spacing.scss +1564 -0
- package/src/scss/utility-mixins/svg.scss +79 -0
- package/src/scss/utility-mixins/text.scss +183 -0
- package/src/scss/utility-mixins/transform.scss +58 -0
- package/src/scss/utility-mixins/transition.scss +44 -0
- package/src/scss/utility-mixins/typography.scss +381 -0
- package/src/scss/utility-mixins/vertical-align.scss +22 -0
- package/src/scss/utility-mixins/visibility.scss +12 -0
- package/src/scss/utility-mixins/z-index.scss +37 -0
- package/src/scss/variables.scss +337 -0
- package/src/tokens/action.tokens.json +566 -0
- package/src/tokens/background.tokens.json +62 -0
- package/src/tokens/border.tokens.json +43 -0
- package/src/tokens/build/css/tokens.css +953 -0
- package/src/tokens/build/css/tokens.dark.css +953 -0
- package/src/tokens/build/js/tokens.dark.js +951 -0
- package/src/tokens/build/js/tokens.js +951 -0
- package/src/tokens/build/json/tokens.dark.json +21803 -0
- package/src/tokens/build/json/tokens.json +21803 -0
- package/src/tokens/build/scss/_tokens.dark.scss +950 -0
- package/src/tokens/build/scss/_tokens.scss +950 -0
- package/src/tokens/build/scss/_tokens_custom_properties.scss +951 -0
- package/src/tokens/build/tailwind/tokens.cjs +336 -0
- package/src/tokens/color.alpha.tokens.json +70 -0
- package/src/tokens/color.constant.tokens.json +660 -0
- package/src/tokens/color.data_viz.tokens.json +509 -0
- package/src/tokens/common_story_options.js +25 -0
- package/src/tokens/contextual/alert.tokens.json +209 -0
- package/src/tokens/contextual/avatar.tokens.json +112 -0
- package/src/tokens/contextual/badge.tokens.json +879 -0
- package/src/tokens/contextual/banner.tokens.json +38 -0
- package/src/tokens/contextual/breadcrumb.tokens.json +11 -0
- package/src/tokens/contextual/broadcast.tokens.json +222 -0
- package/src/tokens/contextual/button.tokens.json +874 -0
- package/src/tokens/contextual/datepicker.tokens.json +25 -0
- package/src/tokens/contextual/dropdown.tokens.json +148 -0
- package/src/tokens/contextual/filtered-search.tokens.json +72 -0
- package/src/tokens/contextual/label.tokens.json +118 -0
- package/src/tokens/contextual/link.tokens.json +46 -0
- package/src/tokens/contextual/progress-bar.tokens.json +38 -0
- package/src/tokens/contextual/skeleton-loader.tokens.json +24 -0
- package/src/tokens/contextual/spinner.tokens.json +38 -0
- package/src/tokens/contextual/table.tokens.json +24 -0
- package/src/tokens/contextual/tabs.tokens.json +18 -0
- package/src/tokens/contextual/toggle.tokens.json +59 -0
- package/src/tokens/contextual/token.tokens.json +21 -0
- package/src/tokens/control.tokens.json +177 -0
- package/src/tokens/deprecated.color.theme.tokens.json +736 -0
- package/src/tokens/deprecated.color.tokens.json +800 -0
- package/src/tokens/deprecated.color.transparency.tokens.json +110 -0
- package/src/tokens/feedback.tokens.json +200 -0
- package/src/tokens/focus-ring.tokens.json +21 -0
- package/src/tokens/icon.tokens.json +78 -0
- package/src/tokens/line_height.tokens.json +74 -0
- package/src/tokens/shadow.tokens.json +14 -0
- package/src/tokens/status.tokens.json +196 -0
- package/src/tokens/text.tokens.json +105 -0
- package/src/tokens/tokens_story.vue +84 -0
- package/src/tokens/tokens_table.vue +248 -0
- package/src/utils/breakpoints.js +21 -0
- package/src/utils/charts/config.js +514 -0
- package/src/utils/charts/constants.js +61 -0
- package/src/utils/charts/mock_data.js +259 -0
- package/src/utils/charts/story_config.js +21 -0
- package/src/utils/charts/theme.js +344 -0
- package/src/utils/charts/utils.js +49 -0
- package/src/utils/constants.js +347 -0
- package/src/utils/data_utils.js +28 -0
- package/src/utils/datetime_utility.js +63 -0
- package/src/utils/i18n.js +62 -0
- package/src/utils/is_slot_empty.js +40 -0
- package/src/utils/number_utils.js +120 -0
- package/src/utils/play_utils.js +9 -0
- package/src/utils/set_utils.js +24 -0
- package/src/utils/stories_constants.js +30 -0
- package/src/utils/stories_utils.js +5 -0
- package/src/utils/story_decorators/container.js +14 -0
- package/src/utils/string_utils.js +79 -0
- package/src/utils/svgs/svg_paths.js +10 -0
- package/src/utils/test_utils.js +33 -0
- package/src/utils/use_fake_date.js +27 -0
- package/src/utils/use_mock_intersection_observer.js +96 -0
- package/src/utils/utils.js +206 -0
- package/src/utils.js +4 -0
- package/src/vendor/bootstrap/scss/_alert.scss +52 -0
- package/src/vendor/bootstrap/scss/_badge.scss +54 -0
- package/src/vendor/bootstrap/scss/_breadcrumb.scss +42 -0
- package/src/vendor/bootstrap/scss/_button-group.scss +163 -0
- package/src/vendor/bootstrap/scss/_buttons.scss +142 -0
- package/src/vendor/bootstrap/scss/_card.scss +286 -0
- package/src/vendor/bootstrap/scss/_carousel.scss +200 -0
- package/src/vendor/bootstrap/scss/_close.scss +40 -0
- package/src/vendor/bootstrap/scss/_code.scss +48 -0
- package/src/vendor/bootstrap/scss/_custom-forms.scss +526 -0
- package/src/vendor/bootstrap/scss/_dropdown.scss +192 -0
- package/src/vendor/bootstrap/scss/_forms.scss +347 -0
- package/src/vendor/bootstrap/scss/_functions.scss +190 -0
- package/src/vendor/bootstrap/scss/_grid.scss +73 -0
- package/src/vendor/bootstrap/scss/_images.scss +42 -0
- package/src/vendor/bootstrap/scss/_input-group.scss +211 -0
- package/src/vendor/bootstrap/scss/_jumbotron.scss +17 -0
- package/src/vendor/bootstrap/scss/_list-group.scss +154 -0
- package/src/vendor/bootstrap/scss/_media.scss +8 -0
- package/src/vendor/bootstrap/scss/_mixins.scss +47 -0
- package/src/vendor/bootstrap/scss/_modal.scss +240 -0
- package/src/vendor/bootstrap/scss/_nav.scss +125 -0
- package/src/vendor/bootstrap/scss/_navbar.scss +332 -0
- package/src/vendor/bootstrap/scss/_pagination.scss +74 -0
- package/src/vendor/bootstrap/scss/_popover.scss +170 -0
- package/src/vendor/bootstrap/scss/_print.scss +132 -0
- package/src/vendor/bootstrap/scss/_progress.scss +47 -0
- package/src/vendor/bootstrap/scss/_reboot.scss +484 -0
- package/src/vendor/bootstrap/scss/_root.scss +19 -0
- package/src/vendor/bootstrap/scss/_spinners.scss +65 -0
- package/src/vendor/bootstrap/scss/_tables.scss +185 -0
- package/src/vendor/bootstrap/scss/_toasts.scss +46 -0
- package/src/vendor/bootstrap/scss/_tooltip.scss +115 -0
- package/src/vendor/bootstrap/scss/_transitions.scss +26 -0
- package/src/vendor/bootstrap/scss/_type.scss +125 -0
- package/src/vendor/bootstrap/scss/_utilities.scss +18 -0
- package/src/vendor/bootstrap/scss/_variables.scss +1149 -0
- package/src/vendor/bootstrap/scss/bootstrap-grid.scss +30 -0
- package/src/vendor/bootstrap/scss/bootstrap-reboot.scss +12 -0
- package/src/vendor/bootstrap/scss/bootstrap.scss +44 -0
- package/src/vendor/bootstrap/scss/mixins/_alert.scss +13 -0
- package/src/vendor/bootstrap/scss/mixins/_background-variant.scss +23 -0
- package/src/vendor/bootstrap/scss/mixins/_badge.scss +17 -0
- package/src/vendor/bootstrap/scss/mixins/_border-radius.scss +76 -0
- package/src/vendor/bootstrap/scss/mixins/_box-shadow.scss +20 -0
- package/src/vendor/bootstrap/scss/mixins/_breakpoints.scss +123 -0
- package/src/vendor/bootstrap/scss/mixins/_buttons.scss +110 -0
- package/src/vendor/bootstrap/scss/mixins/_caret.scss +62 -0
- package/src/vendor/bootstrap/scss/mixins/_clearfix.scss +7 -0
- package/src/vendor/bootstrap/scss/mixins/_deprecate.scss +10 -0
- package/src/vendor/bootstrap/scss/mixins/_float.scss +14 -0
- package/src/vendor/bootstrap/scss/mixins/_forms.scss +195 -0
- package/src/vendor/bootstrap/scss/mixins/_gradients.scss +45 -0
- package/src/vendor/bootstrap/scss/mixins/_grid-framework.scss +80 -0
- package/src/vendor/bootstrap/scss/mixins/_grid.scss +69 -0
- package/src/vendor/bootstrap/scss/mixins/_hover.scss +37 -0
- package/src/vendor/bootstrap/scss/mixins/_image.scss +36 -0
- package/src/vendor/bootstrap/scss/mixins/_list-group.scss +21 -0
- package/src/vendor/bootstrap/scss/mixins/_lists.scss +7 -0
- package/src/vendor/bootstrap/scss/mixins/_nav-divider.scss +11 -0
- package/src/vendor/bootstrap/scss/mixins/_pagination.scss +22 -0
- package/src/vendor/bootstrap/scss/mixins/_reset-text.scss +17 -0
- package/src/vendor/bootstrap/scss/mixins/_resize.scss +6 -0
- package/src/vendor/bootstrap/scss/mixins/_screen-reader.scss +34 -0
- package/src/vendor/bootstrap/scss/mixins/_size.scss +7 -0
- package/src/vendor/bootstrap/scss/mixins/_table-row.scss +39 -0
- package/src/vendor/bootstrap/scss/mixins/_text-emphasis.scss +17 -0
- package/src/vendor/bootstrap/scss/mixins/_text-hide.scss +11 -0
- package/src/vendor/bootstrap/scss/mixins/_text-truncate.scss +8 -0
- package/src/vendor/bootstrap/scss/mixins/_transition.scss +26 -0
- package/src/vendor/bootstrap/scss/mixins/_visibility.scss +8 -0
- package/src/vendor/bootstrap/scss/utilities/_align.scss +8 -0
- package/src/vendor/bootstrap/scss/utilities/_background.scss +19 -0
- package/src/vendor/bootstrap/scss/utilities/_borders.scss +75 -0
- package/src/vendor/bootstrap/scss/utilities/_clearfix.scss +3 -0
- package/src/vendor/bootstrap/scss/utilities/_display.scss +26 -0
- package/src/vendor/bootstrap/scss/utilities/_embed.scss +39 -0
- package/src/vendor/bootstrap/scss/utilities/_flex.scss +51 -0
- package/src/vendor/bootstrap/scss/utilities/_float.scss +11 -0
- package/src/vendor/bootstrap/scss/utilities/_interactions.scss +5 -0
- package/src/vendor/bootstrap/scss/utilities/_overflow.scss +5 -0
- package/src/vendor/bootstrap/scss/utilities/_position.scss +32 -0
- package/src/vendor/bootstrap/scss/utilities/_screenreaders.scss +11 -0
- package/src/vendor/bootstrap/scss/utilities/_shadows.scss +6 -0
- package/src/vendor/bootstrap/scss/utilities/_sizing.scss +20 -0
- package/src/vendor/bootstrap/scss/utilities/_spacing.scss +73 -0
- package/src/vendor/bootstrap/scss/utilities/_stretched-link.scss +19 -0
- package/src/vendor/bootstrap/scss/utilities/_text.scss +72 -0
- package/src/vendor/bootstrap/scss/utilities/_visibility.scss +13 -0
- package/src/vendor/bootstrap/scss/vendor/_rfs.scss +228 -0
- package/src/vendor/bootstrap-vue/src/_utilities.scss +13 -0
- package/src/vendor/bootstrap-vue/src/_variables.scss +111 -0
- package/src/vendor/bootstrap-vue/src/browser.js +9 -0
- package/src/vendor/bootstrap-vue/src/bv-config.js +6 -0
- package/src/vendor/bootstrap-vue/src/components/badge/badge.js +55 -0
- package/src/vendor/bootstrap-vue/src/components/badge/index.js +3 -0
- package/src/vendor/bootstrap-vue/src/components/breadcrumb/breadcrumb-item.js +27 -0
- package/src/vendor/bootstrap-vue/src/components/breadcrumb/breadcrumb-link.js +43 -0
- package/src/vendor/bootstrap-vue/src/components/breadcrumb/breadcrumb.js +52 -0
- package/src/vendor/bootstrap-vue/src/components/breadcrumb/index.js +5 -0
- package/src/vendor/bootstrap-vue/src/components/button/button-close.js +65 -0
- package/src/vendor/bootstrap-vue/src/components/button/button.js +179 -0
- package/src/vendor/bootstrap-vue/src/components/button/index.js +4 -0
- package/src/vendor/bootstrap-vue/src/components/button-group/button-group.js +42 -0
- package/src/vendor/bootstrap-vue/src/components/button-group/index.js +3 -0
- package/src/vendor/bootstrap-vue/src/components/collapse/collapse.js +272 -0
- package/src/vendor/bootstrap-vue/src/components/collapse/helpers/bv-collapse.js +88 -0
- package/src/vendor/bootstrap-vue/src/components/collapse/index.js +3 -0
- package/src/vendor/bootstrap-vue/src/components/dropdown/_dropdown-form.scss +38 -0
- package/src/vendor/bootstrap-vue/src/components/dropdown/_dropdown-text.scss +17 -0
- package/src/vendor/bootstrap-vue/src/components/dropdown/_dropdown.scss +58 -0
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-divider.js +36 -0
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-form.js +47 -0
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-group.js +76 -0
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-header.js +46 -0
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-item-button.js +93 -0
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-item.js +87 -0
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-text.js +42 -0
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown.js +202 -0
- package/src/vendor/bootstrap-vue/src/components/dropdown/index.js +19 -0
- package/src/vendor/bootstrap-vue/src/components/dropdown/index.scss +3 -0
- package/src/vendor/bootstrap-vue/src/components/form/form-invalid-feedback.js +51 -0
- package/src/vendor/bootstrap-vue/src/components/form/form-text.js +40 -0
- package/src/vendor/bootstrap-vue/src/components/form/form-valid-feedback.js +51 -0
- package/src/vendor/bootstrap-vue/src/components/form/form.js +41 -0
- package/src/vendor/bootstrap-vue/src/components/form/index.js +7 -0
- package/src/vendor/bootstrap-vue/src/components/form-checkbox/_form-checkbox-group.scss +2 -0
- package/src/vendor/bootstrap-vue/src/components/form-checkbox/_form-checkbox.scss +125 -0
- package/src/vendor/bootstrap-vue/src/components/form-checkbox/form-checkbox-group.js +42 -0
- package/src/vendor/bootstrap-vue/src/components/form-checkbox/form-checkbox.js +132 -0
- package/src/vendor/bootstrap-vue/src/components/form-checkbox/index.js +4 -0
- package/src/vendor/bootstrap-vue/src/components/form-checkbox/index.scss +2 -0
- package/src/vendor/bootstrap-vue/src/components/form-group/form-group.js +403 -0
- package/src/vendor/bootstrap-vue/src/components/form-group/index.js +3 -0
- package/src/vendor/bootstrap-vue/src/components/form-input/_form-input.scss +217 -0
- package/src/vendor/bootstrap-vue/src/components/form-input/form-input.js +168 -0
- package/src/vendor/bootstrap-vue/src/components/form-input/index.js +3 -0
- package/src/vendor/bootstrap-vue/src/components/form-input/index.scss +1 -0
- package/src/vendor/bootstrap-vue/src/components/form-radio/_form-radio-group.scss +3 -0
- package/src/vendor/bootstrap-vue/src/components/form-radio/_form-radio.scss +47 -0
- package/src/vendor/bootstrap-vue/src/components/form-radio/form-radio-group.js +30 -0
- package/src/vendor/bootstrap-vue/src/components/form-radio/form-radio.js +28 -0
- package/src/vendor/bootstrap-vue/src/components/form-radio/index.js +4 -0
- package/src/vendor/bootstrap-vue/src/components/form-radio/index.scss +2 -0
- package/src/vendor/bootstrap-vue/src/components/form-select/form-select-option-group.js +48 -0
- package/src/vendor/bootstrap-vue/src/components/form-select/form-select-option.js +35 -0
- package/src/vendor/bootstrap-vue/src/components/form-select/form-select.js +153 -0
- package/src/vendor/bootstrap-vue/src/components/form-select/helpers/mixin-options.js +56 -0
- package/src/vendor/bootstrap-vue/src/components/form-select/index.js +5 -0
- package/src/vendor/bootstrap-vue/src/components/form-textarea/form-textarea.js +226 -0
- package/src/vendor/bootstrap-vue/src/components/form-textarea/index.js +3 -0
- package/src/vendor/bootstrap-vue/src/components/index.js +11 -0
- package/src/vendor/bootstrap-vue/src/components/index.scss +12 -0
- package/src/vendor/bootstrap-vue/src/components/input-group/_input-group.scss +29 -0
- package/src/vendor/bootstrap-vue/src/components/input-group/index.js +7 -0
- package/src/vendor/bootstrap-vue/src/components/input-group/index.scss +1 -0
- package/src/vendor/bootstrap-vue/src/components/input-group/input-group-addon.js +43 -0
- package/src/vendor/bootstrap-vue/src/components/input-group/input-group-append.js +31 -0
- package/src/vendor/bootstrap-vue/src/components/input-group/input-group-prepend.js +31 -0
- package/src/vendor/bootstrap-vue/src/components/input-group/input-group-text.js +31 -0
- package/src/vendor/bootstrap-vue/src/components/input-group/input-group.js +73 -0
- package/src/vendor/bootstrap-vue/src/components/layout/col.js +154 -0
- package/src/vendor/bootstrap-vue/src/components/layout/form-row.js +31 -0
- package/src/vendor/bootstrap-vue/src/components/layout/index.js +4 -0
- package/src/vendor/bootstrap-vue/src/components/link/index.js +3 -0
- package/src/vendor/bootstrap-vue/src/components/link/link.js +212 -0
- package/src/vendor/bootstrap-vue/src/components/modal/_modal.scss +5 -0
- package/src/vendor/bootstrap-vue/src/components/modal/helpers/bv-modal-event.class.js +22 -0
- package/src/vendor/bootstrap-vue/src/components/modal/helpers/modal-manager.js +219 -0
- package/src/vendor/bootstrap-vue/src/components/modal/index.js +3 -0
- package/src/vendor/bootstrap-vue/src/components/modal/index.scss +1 -0
- package/src/vendor/bootstrap-vue/src/components/modal/modal.js +981 -0
- package/src/vendor/bootstrap-vue/src/components/nav/_nav-item-dropdown.scss +1 -0
- package/src/vendor/bootstrap-vue/src/components/nav/index.js +5 -0
- package/src/vendor/bootstrap-vue/src/components/nav/index.scss +1 -0
- package/src/vendor/bootstrap-vue/src/components/nav/nav-item-dropdown.js +123 -0
- package/src/vendor/bootstrap-vue/src/components/nav/nav-item.js +49 -0
- package/src/vendor/bootstrap-vue/src/components/nav/nav.js +60 -0
- package/src/vendor/bootstrap-vue/src/components/navbar/_navbar.scss +1 -0
- package/src/vendor/bootstrap-vue/src/components/navbar/index.js +4 -0
- package/src/vendor/bootstrap-vue/src/components/navbar/index.scss +1 -0
- package/src/vendor/bootstrap-vue/src/components/navbar/navbar-brand.js +42 -0
- package/src/vendor/bootstrap-vue/src/components/navbar/navbar.js +78 -0
- package/src/vendor/bootstrap-vue/src/components/popover/_popover.scss +113 -0
- package/src/vendor/bootstrap-vue/src/components/popover/helpers/bv-popover-template.js +50 -0
- package/src/vendor/bootstrap-vue/src/components/popover/helpers/bv-popover.js +28 -0
- package/src/vendor/bootstrap-vue/src/components/popover/index.js +3 -0
- package/src/vendor/bootstrap-vue/src/components/popover/index.scss +1 -0
- package/src/vendor/bootstrap-vue/src/components/popover/popover.js +46 -0
- package/src/vendor/bootstrap-vue/src/components/progress/index.js +4 -0
- package/src/vendor/bootstrap-vue/src/components/progress/progress-bar.js +133 -0
- package/src/vendor/bootstrap-vue/src/components/progress/progress.js +57 -0
- package/src/vendor/bootstrap-vue/src/components/table/_table.scss +474 -0
- package/src/vendor/bootstrap-vue/src/components/table/helpers/constants.js +30 -0
- package/src/vendor/bootstrap-vue/src/components/table/helpers/default-sort-compare.js +60 -0
- package/src/vendor/bootstrap-vue/src/components/table/helpers/filter-event.js +38 -0
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-bottom-row.js +44 -0
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-busy.js +88 -0
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-caption.js +49 -0
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-colgroup.js +27 -0
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-empty.js +105 -0
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-filtering.js +271 -0
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-items.js +146 -0
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-pagination.js +38 -0
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-provider.js +188 -0
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-selectable.js +241 -0
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-sorting.js +299 -0
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-stacked.js +33 -0
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-table-renderer.js +209 -0
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody-row.js +360 -0
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody.js +258 -0
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-tfoot.js +55 -0
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-thead.js +238 -0
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-top-row.js +37 -0
- package/src/vendor/bootstrap-vue/src/components/table/helpers/normalize-fields.js +71 -0
- package/src/vendor/bootstrap-vue/src/components/table/helpers/sanitize-row.js +39 -0
- package/src/vendor/bootstrap-vue/src/components/table/helpers/stringify-record-values.js +11 -0
- package/src/vendor/bootstrap-vue/src/components/table/helpers/text-selection-active.js +13 -0
- package/src/vendor/bootstrap-vue/src/components/table/index.js +23 -0
- package/src/vendor/bootstrap-vue/src/components/table/index.scss +1 -0
- package/src/vendor/bootstrap-vue/src/components/table/table-lite.js +63 -0
- package/src/vendor/bootstrap-vue/src/components/table/table-simple.js +50 -0
- package/src/vendor/bootstrap-vue/src/components/table/table.js +89 -0
- package/src/vendor/bootstrap-vue/src/components/table/tbody.js +103 -0
- package/src/vendor/bootstrap-vue/src/components/table/td.js +195 -0
- package/src/vendor/bootstrap-vue/src/components/table/tfoot.js +95 -0
- package/src/vendor/bootstrap-vue/src/components/table/th.js +25 -0
- package/src/vendor/bootstrap-vue/src/components/table/thead.js +98 -0
- package/src/vendor/bootstrap-vue/src/components/table/tr.js +122 -0
- package/src/vendor/bootstrap-vue/src/components/tabs/index.js +4 -0
- package/src/vendor/bootstrap-vue/src/components/tabs/tab.js +197 -0
- package/src/vendor/bootstrap-vue/src/components/tabs/tabs.js +688 -0
- package/src/vendor/bootstrap-vue/src/components/toast/_toast.scss +79 -0
- package/src/vendor/bootstrap-vue/src/components/toast/_toaster-transition.scss +45 -0
- package/src/vendor/bootstrap-vue/src/components/toast/_toaster.scss +108 -0
- package/src/vendor/bootstrap-vue/src/components/toast/helpers/bv-toast.js +208 -0
- package/src/vendor/bootstrap-vue/src/components/toast/index.js +12 -0
- package/src/vendor/bootstrap-vue/src/components/toast/index.scss +3 -0
- package/src/vendor/bootstrap-vue/src/components/toast/toast.js +454 -0
- package/src/vendor/bootstrap-vue/src/components/toast/toaster.js +139 -0
- package/src/vendor/bootstrap-vue/src/components/tooltip/_tooltip.scss +86 -0
- package/src/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-popper.js +248 -0
- package/src/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip-template.js +130 -0
- package/src/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip.js +977 -0
- package/src/vendor/bootstrap-vue/src/components/tooltip/index.js +3 -0
- package/src/vendor/bootstrap-vue/src/components/tooltip/index.scss +1 -0
- package/src/vendor/bootstrap-vue/src/components/tooltip/tooltip.js +316 -0
- package/src/vendor/bootstrap-vue/src/components/transition/bv-transition.js +83 -0
- package/src/vendor/bootstrap-vue/src/components/transporter/transporter.js +202 -0
- package/src/vendor/bootstrap-vue/src/constants/classes.js +1 -0
- package/src/vendor/bootstrap-vue/src/constants/components.js +77 -0
- package/src/vendor/bootstrap-vue/src/constants/config.js +4 -0
- package/src/vendor/bootstrap-vue/src/constants/env.js +57 -0
- package/src/vendor/bootstrap-vue/src/constants/events.js +57 -0
- package/src/vendor/bootstrap-vue/src/constants/key-codes.js +10 -0
- package/src/vendor/bootstrap-vue/src/constants/popper.js +8 -0
- package/src/vendor/bootstrap-vue/src/constants/props.js +26 -0
- package/src/vendor/bootstrap-vue/src/constants/regex.js +33 -0
- package/src/vendor/bootstrap-vue/src/constants/safe-types.js +17 -0
- package/src/vendor/bootstrap-vue/src/constants/slots.js +32 -0
- package/src/vendor/bootstrap-vue/src/directives/modal/index.js +3 -0
- package/src/vendor/bootstrap-vue/src/directives/modal/modal.js +115 -0
- package/src/vendor/bootstrap-vue/src/directives/toggle/index.js +3 -0
- package/src/vendor/bootstrap-vue/src/directives/toggle/toggle.js +274 -0
- package/src/vendor/bootstrap-vue/src/directives/tooltip/index.js +3 -0
- package/src/vendor/bootstrap-vue/src/directives/tooltip/tooltip.js +270 -0
- package/src/vendor/bootstrap-vue/src/directives/visible/index.js +3 -0
- package/src/vendor/bootstrap-vue/src/directives/visible/visible.js +184 -0
- package/src/vendor/bootstrap-vue/src/index.js +187 -0
- package/src/vendor/bootstrap-vue/src/index.scss +11 -0
- package/src/vendor/bootstrap-vue/src/mixins/attrs.js +19 -0
- package/src/vendor/bootstrap-vue/src/mixins/click-out.js +72 -0
- package/src/vendor/bootstrap-vue/src/mixins/dropdown.js +460 -0
- package/src/vendor/bootstrap-vue/src/mixins/focus-in.js +44 -0
- package/src/vendor/bootstrap-vue/src/mixins/form-control.js +51 -0
- package/src/vendor/bootstrap-vue/src/mixins/form-custom.js +24 -0
- package/src/vendor/bootstrap-vue/src/mixins/form-options.js +73 -0
- package/src/vendor/bootstrap-vue/src/mixins/form-radio-check-group.js +162 -0
- package/src/vendor/bootstrap-vue/src/mixins/form-radio-check.js +332 -0
- package/src/vendor/bootstrap-vue/src/mixins/form-selection.js +60 -0
- package/src/vendor/bootstrap-vue/src/mixins/form-size.js +24 -0
- package/src/vendor/bootstrap-vue/src/mixins/form-state.js +47 -0
- package/src/vendor/bootstrap-vue/src/mixins/form-text.js +250 -0
- package/src/vendor/bootstrap-vue/src/mixins/form-validity.js +48 -0
- package/src/vendor/bootstrap-vue/src/mixins/has-listener.js +26 -0
- package/src/vendor/bootstrap-vue/src/mixins/id.js +51 -0
- package/src/vendor/bootstrap-vue/src/mixins/listen-on-document.js +64 -0
- package/src/vendor/bootstrap-vue/src/mixins/listen-on-root.js +121 -0
- package/src/vendor/bootstrap-vue/src/mixins/listen-on-window.js +64 -0
- package/src/vendor/bootstrap-vue/src/mixins/listeners.js +24 -0
- package/src/vendor/bootstrap-vue/src/mixins/model.js +5 -0
- package/src/vendor/bootstrap-vue/src/mixins/normalize-slot.js +30 -0
- package/src/vendor/bootstrap-vue/src/mixins/scoped-style.js +14 -0
- package/src/vendor/bootstrap-vue/src/mixins/use-parent.js +12 -0
- package/src/vendor/bootstrap-vue/src/utils/array.js +17 -0
- package/src/vendor/bootstrap-vue/src/utils/bv-event.class.js +60 -0
- package/src/vendor/bootstrap-vue/src/utils/cache.js +37 -0
- package/src/vendor/bootstrap-vue/src/utils/clone-deep.js +15 -0
- package/src/vendor/bootstrap-vue/src/utils/config-set.js +80 -0
- package/src/vendor/bootstrap-vue/src/utils/config.js +72 -0
- package/src/vendor/bootstrap-vue/src/utils/create-new-child-component.js +10 -0
- package/src/vendor/bootstrap-vue/src/utils/css-escape.js +73 -0
- package/src/vendor/bootstrap-vue/src/utils/dom.js +308 -0
- package/src/vendor/bootstrap-vue/src/utils/element-to-vue-instance-registry.js +40 -0
- package/src/vendor/bootstrap-vue/src/utils/env.js +15 -0
- package/src/vendor/bootstrap-vue/src/utils/events.js +71 -0
- package/src/vendor/bootstrap-vue/src/utils/get-event-root.js +3 -0
- package/src/vendor/bootstrap-vue/src/utils/get-instance-from-directive.js +4 -0
- package/src/vendor/bootstrap-vue/src/utils/get-scope-id.js +6 -0
- package/src/vendor/bootstrap-vue/src/utils/get.js +64 -0
- package/src/vendor/bootstrap-vue/src/utils/html.js +8 -0
- package/src/vendor/bootstrap-vue/src/utils/identity.js +1 -0
- package/src/vendor/bootstrap-vue/src/utils/inspect.js +51 -0
- package/src/vendor/bootstrap-vue/src/utils/locale.js +34 -0
- package/src/vendor/bootstrap-vue/src/utils/loose-equal.js +57 -0
- package/src/vendor/bootstrap-vue/src/utils/loose-index-of.js +11 -0
- package/src/vendor/bootstrap-vue/src/utils/math.js +11 -0
- package/src/vendor/bootstrap-vue/src/utils/memoize.js +10 -0
- package/src/vendor/bootstrap-vue/src/utils/model.js +29 -0
- package/src/vendor/bootstrap-vue/src/utils/noop.js +1 -0
- package/src/vendor/bootstrap-vue/src/utils/normalize-slot.js +44 -0
- package/src/vendor/bootstrap-vue/src/utils/number.js +19 -0
- package/src/vendor/bootstrap-vue/src/utils/object.js +61 -0
- package/src/vendor/bootstrap-vue/src/utils/observe-dom.js +77 -0
- package/src/vendor/bootstrap-vue/src/utils/plugins.js +169 -0
- package/src/vendor/bootstrap-vue/src/utils/props.js +92 -0
- package/src/vendor/bootstrap-vue/src/utils/router.js +145 -0
- package/src/vendor/bootstrap-vue/src/utils/safe-vue-instance.js +13 -0
- package/src/vendor/bootstrap-vue/src/utils/stable-sort.js +31 -0
- package/src/vendor/bootstrap-vue/src/utils/string.js +59 -0
- package/src/vendor/bootstrap-vue/src/utils/stringify-object-values.js +31 -0
- package/src/vendor/bootstrap-vue/src/utils/warn.js +42 -0
- package/src/vendor/bootstrap-vue/src/vue.js +126 -0
- package/tailwind.defaults.js +543 -0
- package/translations.js +85 -0
|
@@ -0,0 +1,981 @@
|
|
|
1
|
+
import { COMPONENT_UID_KEY, extend } from '../../vue'
|
|
2
|
+
import { NAME_MODAL } from '../../constants/components'
|
|
3
|
+
import { IS_BROWSER } from '../../constants/env'
|
|
4
|
+
import {
|
|
5
|
+
EVENT_NAME_CANCEL,
|
|
6
|
+
EVENT_NAME_CHANGE,
|
|
7
|
+
EVENT_NAME_CLOSE,
|
|
8
|
+
EVENT_NAME_HIDDEN,
|
|
9
|
+
EVENT_NAME_HIDE,
|
|
10
|
+
EVENT_NAME_OK,
|
|
11
|
+
EVENT_NAME_SHOW,
|
|
12
|
+
EVENT_NAME_SHOWN,
|
|
13
|
+
EVENT_NAME_TOGGLE,
|
|
14
|
+
EVENT_OPTIONS_NO_CAPTURE
|
|
15
|
+
} from '../../constants/events'
|
|
16
|
+
import { CODE_ESC } from '../../constants/key-codes'
|
|
17
|
+
import {
|
|
18
|
+
PROP_TYPE_ARRAY_OBJECT_STRING,
|
|
19
|
+
PROP_TYPE_ARRAY_STRING,
|
|
20
|
+
PROP_TYPE_BOOLEAN,
|
|
21
|
+
PROP_TYPE_OBJECT,
|
|
22
|
+
PROP_TYPE_STRING
|
|
23
|
+
} from '../../constants/props'
|
|
24
|
+
import { HTMLElement } from '../../constants/safe-types'
|
|
25
|
+
import {
|
|
26
|
+
SLOT_NAME_DEFAULT,
|
|
27
|
+
SLOT_NAME_MODAL_BACKDROP,
|
|
28
|
+
SLOT_NAME_MODAL_CANCEL,
|
|
29
|
+
SLOT_NAME_MODAL_FOOTER,
|
|
30
|
+
SLOT_NAME_MODAL_HEADER,
|
|
31
|
+
SLOT_NAME_MODAL_HEADER_CLOSE,
|
|
32
|
+
SLOT_NAME_MODAL_OK,
|
|
33
|
+
SLOT_NAME_MODAL_TITLE
|
|
34
|
+
} from '../../constants/slots'
|
|
35
|
+
import { arrayIncludes, concat } from '../../utils/array'
|
|
36
|
+
import {
|
|
37
|
+
attemptFocus,
|
|
38
|
+
closest,
|
|
39
|
+
contains,
|
|
40
|
+
getActiveElement,
|
|
41
|
+
getTabables,
|
|
42
|
+
requestAF,
|
|
43
|
+
select
|
|
44
|
+
} from '../../utils/dom'
|
|
45
|
+
import { getRootActionEventName, getRootEventName, eventOn, eventOff } from '../../utils/events'
|
|
46
|
+
import { htmlOrText } from '../../utils/html'
|
|
47
|
+
import { identity } from '../../utils/identity'
|
|
48
|
+
import { isString, isUndefinedOrNull } from '../../utils/inspect'
|
|
49
|
+
import { makeModelMixin } from '../../utils/model'
|
|
50
|
+
import { sortKeys } from '../../utils/object'
|
|
51
|
+
import { observeDom } from '../../utils/observe-dom'
|
|
52
|
+
import { makeProp, makePropsConfigurable } from '../../utils/props'
|
|
53
|
+
import { attrsMixin } from '../../mixins/attrs'
|
|
54
|
+
import { idMixin, props as idProps } from '../../mixins/id'
|
|
55
|
+
import { listenOnDocumentMixin } from '../../mixins/listen-on-document'
|
|
56
|
+
import { listenOnRootMixin } from '../../mixins/listen-on-root'
|
|
57
|
+
import { listenOnWindowMixin } from '../../mixins/listen-on-window'
|
|
58
|
+
import { normalizeSlotMixin } from '../../mixins/normalize-slot'
|
|
59
|
+
import { scopedStyleMixin } from '../../mixins/scoped-style'
|
|
60
|
+
import { BButton } from '../button/button'
|
|
61
|
+
import { BButtonClose } from '../button/button-close'
|
|
62
|
+
import { BVTransition } from '../transition/bv-transition'
|
|
63
|
+
import { BVTransporter } from '../transporter/transporter'
|
|
64
|
+
import { BvModalEvent } from './helpers/bv-modal-event.class'
|
|
65
|
+
import { modalManager } from './helpers/modal-manager'
|
|
66
|
+
|
|
67
|
+
// --- Constants ---
|
|
68
|
+
|
|
69
|
+
const {
|
|
70
|
+
mixin: modelMixin,
|
|
71
|
+
props: modelProps,
|
|
72
|
+
prop: MODEL_PROP_NAME,
|
|
73
|
+
event: MODEL_EVENT_NAME
|
|
74
|
+
} = makeModelMixin('visible', {
|
|
75
|
+
type: PROP_TYPE_BOOLEAN,
|
|
76
|
+
defaultValue: false,
|
|
77
|
+
event: EVENT_NAME_CHANGE
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
const TRIGGER_BACKDROP = 'backdrop'
|
|
81
|
+
const TRIGGER_ESC = 'esc'
|
|
82
|
+
const TRIGGER_FORCE = 'FORCE'
|
|
83
|
+
const TRIGGER_TOGGLE = 'toggle'
|
|
84
|
+
|
|
85
|
+
const BUTTON_CANCEL = 'cancel'
|
|
86
|
+
// TODO: This should be renamed to 'close'
|
|
87
|
+
const BUTTON_CLOSE = 'headerclose'
|
|
88
|
+
const BUTTON_OK = 'ok'
|
|
89
|
+
|
|
90
|
+
const BUTTONS = [BUTTON_CANCEL, BUTTON_CLOSE, BUTTON_OK]
|
|
91
|
+
|
|
92
|
+
// `ObserveDom` config to detect changes in modal content
|
|
93
|
+
// so that we can adjust the modal padding if needed
|
|
94
|
+
const OBSERVER_CONFIG = {
|
|
95
|
+
subtree: true,
|
|
96
|
+
childList: true,
|
|
97
|
+
characterData: true,
|
|
98
|
+
attributes: true,
|
|
99
|
+
attributeFilter: ['style', 'class']
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// --- Props ---
|
|
103
|
+
|
|
104
|
+
export const props = makePropsConfigurable(
|
|
105
|
+
sortKeys({
|
|
106
|
+
...idProps,
|
|
107
|
+
...modelProps,
|
|
108
|
+
ariaLabel: makeProp(PROP_TYPE_STRING),
|
|
109
|
+
autoFocusButton: makeProp(
|
|
110
|
+
PROP_TYPE_STRING,
|
|
111
|
+
null,
|
|
112
|
+
/* istanbul ignore next */ value => {
|
|
113
|
+
return isUndefinedOrNull(value) || arrayIncludes(BUTTONS, value)
|
|
114
|
+
}
|
|
115
|
+
),
|
|
116
|
+
bodyClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),
|
|
117
|
+
busy: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
118
|
+
buttonSize: makeProp(PROP_TYPE_STRING),
|
|
119
|
+
cancelDisabled: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
120
|
+
cancelTitle: makeProp(PROP_TYPE_STRING, 'Cancel'),
|
|
121
|
+
cancelTitleHtml: makeProp(PROP_TYPE_STRING),
|
|
122
|
+
cancelVariant: makeProp(PROP_TYPE_STRING, 'secondary'),
|
|
123
|
+
centered: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
124
|
+
contentClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),
|
|
125
|
+
dialogClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),
|
|
126
|
+
footerClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),
|
|
127
|
+
footerTag: makeProp(PROP_TYPE_STRING, 'footer'),
|
|
128
|
+
headerClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),
|
|
129
|
+
headerCloseContent: makeProp(PROP_TYPE_STRING, '×'),
|
|
130
|
+
headerCloseLabel: makeProp(PROP_TYPE_STRING, 'Close'),
|
|
131
|
+
headerTag: makeProp(PROP_TYPE_STRING, 'header'),
|
|
132
|
+
// TODO: Rename to `noBackdrop` and deprecate `hideBackdrop`
|
|
133
|
+
hideBackdrop: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
134
|
+
// TODO: Rename to `noFooter` and deprecate `hideFooter`
|
|
135
|
+
hideFooter: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
136
|
+
// TODO: Rename to `noHeader` and deprecate `hideHeader`
|
|
137
|
+
hideHeader: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
138
|
+
// TODO: Rename to `noHeaderClose` and deprecate `hideHeaderClose`
|
|
139
|
+
hideHeaderClose: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
140
|
+
ignoreEnforceFocusSelector: makeProp(PROP_TYPE_ARRAY_STRING),
|
|
141
|
+
lazy: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
142
|
+
modalClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),
|
|
143
|
+
noCloseOnBackdrop: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
144
|
+
noCloseOnEsc: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
145
|
+
noEnforceFocus: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
146
|
+
noFade: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
147
|
+
noStacking: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
148
|
+
okDisabled: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
149
|
+
okOnly: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
150
|
+
okTitle: makeProp(PROP_TYPE_STRING, 'OK'),
|
|
151
|
+
okTitleHtml: makeProp(PROP_TYPE_STRING),
|
|
152
|
+
okVariant: makeProp(PROP_TYPE_STRING, 'primary'),
|
|
153
|
+
// HTML Element, CSS selector string or Vue component instance
|
|
154
|
+
returnFocus: makeProp([HTMLElement, PROP_TYPE_OBJECT, PROP_TYPE_STRING]),
|
|
155
|
+
scrollable: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
156
|
+
size: makeProp(PROP_TYPE_STRING, 'md'),
|
|
157
|
+
static: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
158
|
+
title: makeProp(PROP_TYPE_STRING),
|
|
159
|
+
titleClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),
|
|
160
|
+
titleHtml: makeProp(PROP_TYPE_STRING),
|
|
161
|
+
titleSrOnly: makeProp(PROP_TYPE_BOOLEAN, false),
|
|
162
|
+
titleTag: makeProp(PROP_TYPE_STRING, 'h5')
|
|
163
|
+
}),
|
|
164
|
+
NAME_MODAL
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
// --- Main component ---
|
|
168
|
+
|
|
169
|
+
// @vue/component
|
|
170
|
+
export const BModal = /*#__PURE__*/ extend({
|
|
171
|
+
name: NAME_MODAL,
|
|
172
|
+
mixins: [
|
|
173
|
+
attrsMixin,
|
|
174
|
+
idMixin,
|
|
175
|
+
modelMixin,
|
|
176
|
+
listenOnDocumentMixin,
|
|
177
|
+
listenOnRootMixin,
|
|
178
|
+
listenOnWindowMixin,
|
|
179
|
+
normalizeSlotMixin,
|
|
180
|
+
scopedStyleMixin
|
|
181
|
+
],
|
|
182
|
+
inheritAttrs: false,
|
|
183
|
+
props,
|
|
184
|
+
data() {
|
|
185
|
+
return {
|
|
186
|
+
isHidden: true, // If modal should not be in document
|
|
187
|
+
isVisible: false, // Controls modal visible state
|
|
188
|
+
isTransitioning: false, // Used for style control
|
|
189
|
+
isShow: false, // Used for style control
|
|
190
|
+
isBlock: false, // Used for style control
|
|
191
|
+
isOpening: false, // To signal that the modal is in the process of opening
|
|
192
|
+
isClosing: false, // To signal that the modal is in the process of closing
|
|
193
|
+
ignoreBackdropClick: false, // Used to signify if click out listener should ignore the click
|
|
194
|
+
isModalOverflowing: false,
|
|
195
|
+
// The following items are controlled by the modalManager instance
|
|
196
|
+
scrollbarWidth: 0,
|
|
197
|
+
zIndex: modalManager.getBaseZIndex(),
|
|
198
|
+
isTop: true,
|
|
199
|
+
isBodyOverflowing: false
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
computed: {
|
|
203
|
+
modalId() {
|
|
204
|
+
return this.safeId()
|
|
205
|
+
},
|
|
206
|
+
modalOuterId() {
|
|
207
|
+
return this.safeId('__BV_modal_outer_')
|
|
208
|
+
},
|
|
209
|
+
modalHeaderId() {
|
|
210
|
+
return this.safeId('__BV_modal_header_')
|
|
211
|
+
},
|
|
212
|
+
modalBodyId() {
|
|
213
|
+
return this.safeId('__BV_modal_body_')
|
|
214
|
+
},
|
|
215
|
+
modalTitleId() {
|
|
216
|
+
return this.safeId('__BV_modal_title_')
|
|
217
|
+
},
|
|
218
|
+
modalContentId() {
|
|
219
|
+
return this.safeId('__BV_modal_content_')
|
|
220
|
+
},
|
|
221
|
+
modalFooterId() {
|
|
222
|
+
return this.safeId('__BV_modal_footer_')
|
|
223
|
+
},
|
|
224
|
+
modalBackdropId() {
|
|
225
|
+
return this.safeId('__BV_modal_backdrop_')
|
|
226
|
+
},
|
|
227
|
+
modalClasses() {
|
|
228
|
+
return [
|
|
229
|
+
{
|
|
230
|
+
fade: !this.noFade,
|
|
231
|
+
show: this.isShow,
|
|
232
|
+
'd-block': this.isBlock
|
|
233
|
+
},
|
|
234
|
+
this.modalClass
|
|
235
|
+
]
|
|
236
|
+
},
|
|
237
|
+
modalStyles() {
|
|
238
|
+
const sbWidth = `${this.scrollbarWidth}px`
|
|
239
|
+
return {
|
|
240
|
+
paddingLeft: !this.isBodyOverflowing && this.isModalOverflowing ? sbWidth : '',
|
|
241
|
+
paddingRight: this.isBodyOverflowing && !this.isModalOverflowing ? sbWidth : ''
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
dialogClasses() {
|
|
245
|
+
return [
|
|
246
|
+
{
|
|
247
|
+
[`modal-${this.size}`]: this.size,
|
|
248
|
+
'modal-dialog-centered': this.centered,
|
|
249
|
+
'modal-dialog-scrollable': this.scrollable
|
|
250
|
+
},
|
|
251
|
+
this.dialogClass
|
|
252
|
+
]
|
|
253
|
+
},
|
|
254
|
+
titleClasses() {
|
|
255
|
+
return [{ 'sr-only': this.titleSrOnly }, this.titleClass]
|
|
256
|
+
},
|
|
257
|
+
modalOuterStyle() {
|
|
258
|
+
// Styles needed for proper stacking of modals
|
|
259
|
+
return {
|
|
260
|
+
position: 'absolute',
|
|
261
|
+
zIndex: this.zIndex
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
slotScope() {
|
|
265
|
+
return {
|
|
266
|
+
cancel: this.onCancel,
|
|
267
|
+
close: this.onClose,
|
|
268
|
+
hide: this.hide,
|
|
269
|
+
ok: this.onOk,
|
|
270
|
+
visible: this.isVisible
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
computeIgnoreEnforceFocusSelector() {
|
|
274
|
+
// Normalize to an single selector with selectors separated by `,`
|
|
275
|
+
return concat(this.ignoreEnforceFocusSelector)
|
|
276
|
+
.filter(identity)
|
|
277
|
+
.join(',')
|
|
278
|
+
.trim()
|
|
279
|
+
},
|
|
280
|
+
computedAttrs() {
|
|
281
|
+
// If the parent has a scoped style attribute, and the modal
|
|
282
|
+
// is portalled, add the scoped attribute to the modal wrapper
|
|
283
|
+
const scopedStyleAttrs = !this.static ? this.scopedStyleAttrs : {}
|
|
284
|
+
|
|
285
|
+
return {
|
|
286
|
+
...scopedStyleAttrs,
|
|
287
|
+
...this.bvAttrs,
|
|
288
|
+
id: this.modalOuterId
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
computedModalAttrs() {
|
|
292
|
+
const { isVisible, ariaLabel } = this
|
|
293
|
+
|
|
294
|
+
return {
|
|
295
|
+
id: this.modalId,
|
|
296
|
+
role: 'dialog',
|
|
297
|
+
'aria-hidden': isVisible ? null : 'true',
|
|
298
|
+
'aria-modal': isVisible ? 'true' : null,
|
|
299
|
+
'aria-label': ariaLabel,
|
|
300
|
+
'aria-labelledby':
|
|
301
|
+
this.hideHeader ||
|
|
302
|
+
ariaLabel ||
|
|
303
|
+
// TODO: Rename slot to `title` and deprecate `modal-title`
|
|
304
|
+
!(this.hasNormalizedSlot(SLOT_NAME_MODAL_TITLE) || this.titleHtml || this.title)
|
|
305
|
+
? null
|
|
306
|
+
: this.modalTitleId,
|
|
307
|
+
'aria-describedby': this.modalBodyId
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
watch: {
|
|
312
|
+
[MODEL_PROP_NAME](newValue, oldValue) {
|
|
313
|
+
if (newValue !== oldValue) {
|
|
314
|
+
this[newValue ? 'show' : 'hide']()
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
created() {
|
|
319
|
+
// Define non-reactive properties
|
|
320
|
+
this.$_observer = null
|
|
321
|
+
this.$_returnFocus = this.returnFocus || null
|
|
322
|
+
},
|
|
323
|
+
mounted() {
|
|
324
|
+
// Set initial z-index as queried from the DOM
|
|
325
|
+
this.zIndex = modalManager.getBaseZIndex()
|
|
326
|
+
// Listen for events from others to either open or close ourselves
|
|
327
|
+
// and listen to all modals to enable/disable enforce focus
|
|
328
|
+
this.listenOnRoot(getRootActionEventName(NAME_MODAL, EVENT_NAME_SHOW), this.showHandler)
|
|
329
|
+
this.listenOnRoot(getRootActionEventName(NAME_MODAL, EVENT_NAME_HIDE), this.hideHandler)
|
|
330
|
+
this.listenOnRoot(getRootActionEventName(NAME_MODAL, EVENT_NAME_TOGGLE), this.toggleHandler)
|
|
331
|
+
// Listen for `bv:modal::show events`, and close ourselves if the
|
|
332
|
+
// opening modal not us
|
|
333
|
+
this.listenOnRoot(getRootEventName(NAME_MODAL, EVENT_NAME_SHOW), this.modalListener)
|
|
334
|
+
// Initially show modal?
|
|
335
|
+
if (this[MODEL_PROP_NAME] === true) {
|
|
336
|
+
this.$nextTick(this.show)
|
|
337
|
+
}
|
|
338
|
+
},
|
|
339
|
+
beforeDestroy() {
|
|
340
|
+
// Ensure everything is back to normal
|
|
341
|
+
modalManager.unregisterModal(this)
|
|
342
|
+
this.setObserver(false)
|
|
343
|
+
if (this.isVisible) {
|
|
344
|
+
this.isVisible = false
|
|
345
|
+
this.isShow = false
|
|
346
|
+
this.isTransitioning = false
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
methods: {
|
|
350
|
+
setObserver(on = false) {
|
|
351
|
+
this.$_observer && this.$_observer.disconnect()
|
|
352
|
+
this.$_observer = null
|
|
353
|
+
if (on) {
|
|
354
|
+
this.$_observer = observeDom(
|
|
355
|
+
this.$refs.content,
|
|
356
|
+
this.checkModalOverflow.bind(this),
|
|
357
|
+
OBSERVER_CONFIG
|
|
358
|
+
)
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
// Private method to update the v-model
|
|
362
|
+
updateModel(value) {
|
|
363
|
+
if (value !== this[MODEL_PROP_NAME]) {
|
|
364
|
+
this.$emit(MODEL_EVENT_NAME, value)
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
// Private method to create a BvModalEvent object
|
|
368
|
+
buildEvent(type, options = {}) {
|
|
369
|
+
return new BvModalEvent(type, {
|
|
370
|
+
// Default options
|
|
371
|
+
cancelable: false,
|
|
372
|
+
target: this.$refs.modal || this.$el || null,
|
|
373
|
+
relatedTarget: null,
|
|
374
|
+
trigger: null,
|
|
375
|
+
// Supplied options
|
|
376
|
+
...options,
|
|
377
|
+
// Options that can't be overridden
|
|
378
|
+
vueTarget: this,
|
|
379
|
+
componentId: this.modalId
|
|
380
|
+
})
|
|
381
|
+
},
|
|
382
|
+
// Public method to show modal
|
|
383
|
+
show() {
|
|
384
|
+
if (this.isVisible || this.isOpening) {
|
|
385
|
+
// If already open, or in the process of opening, do nothing
|
|
386
|
+
/* istanbul ignore next */
|
|
387
|
+
return
|
|
388
|
+
}
|
|
389
|
+
/* istanbul ignore next */
|
|
390
|
+
if (this.isClosing) {
|
|
391
|
+
// If we are in the process of closing, wait until hidden before re-opening
|
|
392
|
+
/* istanbul ignore next */
|
|
393
|
+
this.$once(EVENT_NAME_HIDDEN, this.show)
|
|
394
|
+
/* istanbul ignore next */
|
|
395
|
+
return
|
|
396
|
+
}
|
|
397
|
+
this.isOpening = true
|
|
398
|
+
// Set the element to return focus to when closed
|
|
399
|
+
this.$_returnFocus = this.$_returnFocus || this.getActiveElement()
|
|
400
|
+
const showEvent = this.buildEvent(EVENT_NAME_SHOW, {
|
|
401
|
+
cancelable: true
|
|
402
|
+
})
|
|
403
|
+
this.emitEvent(showEvent)
|
|
404
|
+
// Don't show if canceled
|
|
405
|
+
if (showEvent.defaultPrevented || this.isVisible) {
|
|
406
|
+
this.isOpening = false
|
|
407
|
+
// Ensure the v-model reflects the current state
|
|
408
|
+
this.updateModel(false)
|
|
409
|
+
return
|
|
410
|
+
}
|
|
411
|
+
// Show the modal
|
|
412
|
+
this.doShow()
|
|
413
|
+
},
|
|
414
|
+
// Public method to hide modal
|
|
415
|
+
hide(trigger = '') {
|
|
416
|
+
if (!this.isVisible || this.isClosing) {
|
|
417
|
+
/* istanbul ignore next */
|
|
418
|
+
return
|
|
419
|
+
}
|
|
420
|
+
this.isClosing = true
|
|
421
|
+
const hideEvent = this.buildEvent(EVENT_NAME_HIDE, {
|
|
422
|
+
cancelable: trigger !== TRIGGER_FORCE,
|
|
423
|
+
trigger: trigger || null
|
|
424
|
+
})
|
|
425
|
+
// We emit specific event for one of the three built-in buttons
|
|
426
|
+
if (trigger === BUTTON_OK) {
|
|
427
|
+
this.$emit(EVENT_NAME_OK, hideEvent)
|
|
428
|
+
} else if (trigger === BUTTON_CANCEL) {
|
|
429
|
+
this.$emit(EVENT_NAME_CANCEL, hideEvent)
|
|
430
|
+
} else if (trigger === BUTTON_CLOSE) {
|
|
431
|
+
this.$emit(EVENT_NAME_CLOSE, hideEvent)
|
|
432
|
+
}
|
|
433
|
+
this.emitEvent(hideEvent)
|
|
434
|
+
// Hide if not canceled
|
|
435
|
+
if (hideEvent.defaultPrevented || !this.isVisible) {
|
|
436
|
+
this.isClosing = false
|
|
437
|
+
// Ensure v-model reflects current state
|
|
438
|
+
this.updateModel(true)
|
|
439
|
+
return
|
|
440
|
+
}
|
|
441
|
+
// Stop observing for content changes
|
|
442
|
+
this.setObserver(false)
|
|
443
|
+
// Trigger the hide transition
|
|
444
|
+
this.isVisible = false
|
|
445
|
+
// Update the v-model
|
|
446
|
+
this.updateModel(false)
|
|
447
|
+
},
|
|
448
|
+
// Public method to toggle modal visibility
|
|
449
|
+
toggle(triggerEl) {
|
|
450
|
+
if (triggerEl) {
|
|
451
|
+
this.$_returnFocus = triggerEl
|
|
452
|
+
}
|
|
453
|
+
if (this.isVisible) {
|
|
454
|
+
this.hide(TRIGGER_TOGGLE)
|
|
455
|
+
} else {
|
|
456
|
+
this.show()
|
|
457
|
+
}
|
|
458
|
+
},
|
|
459
|
+
// Private method to get the current document active element
|
|
460
|
+
getActiveElement() {
|
|
461
|
+
// Returning focus to `document.body` may cause unwanted scrolls,
|
|
462
|
+
// so we exclude setting focus on body
|
|
463
|
+
const activeElement = getActiveElement(IS_BROWSER ? [document.body] : [])
|
|
464
|
+
// Preset the fallback return focus value if it is not set
|
|
465
|
+
// `document.activeElement` should be the trigger element that was clicked or
|
|
466
|
+
// in the case of using the v-model, which ever element has current focus
|
|
467
|
+
// Will be overridden by some commands such as toggle, etc.
|
|
468
|
+
// Note: On IE 11, `document.activeElement` may be `null`
|
|
469
|
+
// So we test it for truthiness first
|
|
470
|
+
// https://github.com/bootstrap-vue/bootstrap-vue/issues/3206
|
|
471
|
+
return activeElement && activeElement.focus ? activeElement : null
|
|
472
|
+
},
|
|
473
|
+
// Private method to finish showing modal
|
|
474
|
+
doShow() {
|
|
475
|
+
/* istanbul ignore next: commenting out for now until we can test stacking */
|
|
476
|
+
if (modalManager.modalsAreOpen && this.noStacking) {
|
|
477
|
+
// If another modal(s) is already open, wait for it(them) to close
|
|
478
|
+
this.listenOnRootOnce(getRootEventName(NAME_MODAL, EVENT_NAME_HIDDEN), this.doShow)
|
|
479
|
+
return
|
|
480
|
+
}
|
|
481
|
+
modalManager.registerModal(this)
|
|
482
|
+
// Place modal in DOM
|
|
483
|
+
this.isHidden = false
|
|
484
|
+
this.$nextTick(() => {
|
|
485
|
+
// We do this in `$nextTick()` to ensure the modal is in DOM first
|
|
486
|
+
// before we show it
|
|
487
|
+
this.isVisible = true
|
|
488
|
+
this.isOpening = false
|
|
489
|
+
// Update the v-model
|
|
490
|
+
this.updateModel(true)
|
|
491
|
+
this.$nextTick(() => {
|
|
492
|
+
// Observe changes in modal content and adjust if necessary
|
|
493
|
+
// In a `$nextTick()` in case modal content is lazy
|
|
494
|
+
this.setObserver(true)
|
|
495
|
+
})
|
|
496
|
+
})
|
|
497
|
+
},
|
|
498
|
+
// Transition handlers
|
|
499
|
+
onBeforeEnter() {
|
|
500
|
+
this.isTransitioning = true
|
|
501
|
+
this.setResizeEvent(true)
|
|
502
|
+
},
|
|
503
|
+
onEnter() {
|
|
504
|
+
this.isBlock = true
|
|
505
|
+
// We add the `show` class 1 frame later
|
|
506
|
+
// `requestAF()` runs the callback before the next repaint, so we need
|
|
507
|
+
// two calls to guarantee the next frame has been rendered
|
|
508
|
+
requestAF(() => {
|
|
509
|
+
requestAF(() => {
|
|
510
|
+
this.isShow = true
|
|
511
|
+
})
|
|
512
|
+
})
|
|
513
|
+
},
|
|
514
|
+
onAfterEnter() {
|
|
515
|
+
this.checkModalOverflow()
|
|
516
|
+
this.isTransitioning = false
|
|
517
|
+
// We use `requestAF()` to allow transition hooks to complete
|
|
518
|
+
// before passing control over to the other handlers
|
|
519
|
+
// This will allow users to not have to use `$nextTick()` or `requestAF()`
|
|
520
|
+
// when trying to pre-focus an element
|
|
521
|
+
requestAF(() => {
|
|
522
|
+
this.emitEvent(this.buildEvent(EVENT_NAME_SHOWN))
|
|
523
|
+
this.setEnforceFocus(true)
|
|
524
|
+
this.$nextTick(() => {
|
|
525
|
+
// Delayed in a `$nextTick()` to allow users time to pre-focus
|
|
526
|
+
// an element if the wish
|
|
527
|
+
this.focusFirst()
|
|
528
|
+
})
|
|
529
|
+
})
|
|
530
|
+
},
|
|
531
|
+
onBeforeLeave() {
|
|
532
|
+
this.isTransitioning = true
|
|
533
|
+
this.setResizeEvent(false)
|
|
534
|
+
this.setEnforceFocus(false)
|
|
535
|
+
},
|
|
536
|
+
onLeave() {
|
|
537
|
+
// Remove the 'show' class
|
|
538
|
+
this.isShow = false
|
|
539
|
+
},
|
|
540
|
+
onAfterLeave() {
|
|
541
|
+
this.isBlock = false
|
|
542
|
+
this.isTransitioning = false
|
|
543
|
+
this.isModalOverflowing = false
|
|
544
|
+
this.isHidden = true
|
|
545
|
+
this.$nextTick(() => {
|
|
546
|
+
this.isClosing = false
|
|
547
|
+
modalManager.unregisterModal(this)
|
|
548
|
+
this.returnFocusTo()
|
|
549
|
+
// TODO: Need to find a way to pass the `trigger` property
|
|
550
|
+
// to the `hidden` event, not just only the `hide` event
|
|
551
|
+
this.emitEvent(this.buildEvent(EVENT_NAME_HIDDEN))
|
|
552
|
+
})
|
|
553
|
+
},
|
|
554
|
+
emitEvent(bvEvent) {
|
|
555
|
+
const { type } = bvEvent
|
|
556
|
+
// We emit on `$root` first in case a global listener wants to cancel
|
|
557
|
+
// the event first before the instance emits its event
|
|
558
|
+
this.emitOnRoot(getRootEventName(NAME_MODAL, type), bvEvent, bvEvent.componentId)
|
|
559
|
+
this.$emit(type, bvEvent)
|
|
560
|
+
},
|
|
561
|
+
// UI event handlers
|
|
562
|
+
onDialogMousedown() {
|
|
563
|
+
// Watch to see if the matching mouseup event occurs outside the dialog
|
|
564
|
+
// And if it does, cancel the clickOut handler
|
|
565
|
+
const modal = this.$refs.modal
|
|
566
|
+
const onceModalMouseup = event => {
|
|
567
|
+
eventOff(modal, 'mouseup', onceModalMouseup, EVENT_OPTIONS_NO_CAPTURE)
|
|
568
|
+
if (event.target === modal) {
|
|
569
|
+
this.ignoreBackdropClick = true
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
eventOn(modal, 'mouseup', onceModalMouseup, EVENT_OPTIONS_NO_CAPTURE)
|
|
573
|
+
},
|
|
574
|
+
onClickOut(event) {
|
|
575
|
+
if (this.ignoreBackdropClick) {
|
|
576
|
+
// Click was initiated inside the modal content, but finished outside.
|
|
577
|
+
// Set by the above onDialogMousedown handler
|
|
578
|
+
this.ignoreBackdropClick = false
|
|
579
|
+
return
|
|
580
|
+
}
|
|
581
|
+
// Do nothing if not visible, backdrop click disabled, or element
|
|
582
|
+
// that generated click event is no longer in document body
|
|
583
|
+
if (!this.isVisible || this.noCloseOnBackdrop || !contains(document.body, event.target)) {
|
|
584
|
+
return
|
|
585
|
+
}
|
|
586
|
+
// If backdrop clicked, hide modal
|
|
587
|
+
if (!contains(this.$refs.content, event.target)) {
|
|
588
|
+
this.hide(TRIGGER_BACKDROP)
|
|
589
|
+
}
|
|
590
|
+
},
|
|
591
|
+
onOk() {
|
|
592
|
+
this.hide(BUTTON_OK)
|
|
593
|
+
},
|
|
594
|
+
onCancel() {
|
|
595
|
+
this.hide(BUTTON_CANCEL)
|
|
596
|
+
},
|
|
597
|
+
onClose() {
|
|
598
|
+
this.hide(BUTTON_CLOSE)
|
|
599
|
+
},
|
|
600
|
+
onEsc(event) {
|
|
601
|
+
// If ESC pressed, hide modal
|
|
602
|
+
if (event.keyCode === CODE_ESC && this.isVisible && !this.noCloseOnEsc) {
|
|
603
|
+
this.hide(TRIGGER_ESC)
|
|
604
|
+
}
|
|
605
|
+
},
|
|
606
|
+
// Document focusin listener
|
|
607
|
+
focusHandler(event) {
|
|
608
|
+
// If focus leaves modal content, bring it back
|
|
609
|
+
const content = this.$refs.content
|
|
610
|
+
const { target } = event
|
|
611
|
+
if (
|
|
612
|
+
this.noEnforceFocus ||
|
|
613
|
+
!this.isTop ||
|
|
614
|
+
!this.isVisible ||
|
|
615
|
+
!content ||
|
|
616
|
+
document === target ||
|
|
617
|
+
contains(content, target) ||
|
|
618
|
+
(this.computeIgnoreEnforceFocusSelector &&
|
|
619
|
+
closest(this.computeIgnoreEnforceFocusSelector, target, true))
|
|
620
|
+
) {
|
|
621
|
+
return
|
|
622
|
+
}
|
|
623
|
+
const tabables = getTabables(this.$refs.content)
|
|
624
|
+
const bottomTrap = this.$refs['bottom-trap']
|
|
625
|
+
const topTrap = this.$refs['top-trap']
|
|
626
|
+
if (bottomTrap && target === bottomTrap) {
|
|
627
|
+
// If user pressed TAB out of modal into our bottom trab trap element
|
|
628
|
+
// Find the first tabable element in the modal content and focus it
|
|
629
|
+
if (attemptFocus(tabables[0])) {
|
|
630
|
+
// Focus was successful
|
|
631
|
+
return
|
|
632
|
+
}
|
|
633
|
+
} else if (topTrap && target === topTrap) {
|
|
634
|
+
// If user pressed CTRL-TAB out of modal and into our top tab trap element
|
|
635
|
+
// Find the last tabable element in the modal content and focus it
|
|
636
|
+
if (attemptFocus(tabables[tabables.length - 1])) {
|
|
637
|
+
// Focus was successful
|
|
638
|
+
return
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
// Otherwise focus the modal content container
|
|
642
|
+
attemptFocus(content, { preventScroll: true })
|
|
643
|
+
},
|
|
644
|
+
// Turn on/off focusin listener
|
|
645
|
+
setEnforceFocus(on) {
|
|
646
|
+
this.listenDocument(on, 'focusin', this.focusHandler)
|
|
647
|
+
},
|
|
648
|
+
// Resize listener
|
|
649
|
+
setResizeEvent(on) {
|
|
650
|
+
this.listenWindow(on, 'resize', this.checkModalOverflow)
|
|
651
|
+
this.listenWindow(on, 'orientationchange', this.checkModalOverflow)
|
|
652
|
+
},
|
|
653
|
+
// Root listener handlers
|
|
654
|
+
showHandler(id, triggerEl) {
|
|
655
|
+
if (id === this.modalId) {
|
|
656
|
+
this.$_returnFocus = triggerEl || this.getActiveElement()
|
|
657
|
+
this.show()
|
|
658
|
+
}
|
|
659
|
+
},
|
|
660
|
+
hideHandler(id) {
|
|
661
|
+
if (id === this.modalId) {
|
|
662
|
+
this.hide('event')
|
|
663
|
+
}
|
|
664
|
+
},
|
|
665
|
+
toggleHandler(id, triggerEl) {
|
|
666
|
+
if (id === this.modalId) {
|
|
667
|
+
this.toggle(triggerEl)
|
|
668
|
+
}
|
|
669
|
+
},
|
|
670
|
+
modalListener(bvEvent) {
|
|
671
|
+
// If another modal opens, close this one if stacking not permitted
|
|
672
|
+
if (this.noStacking && bvEvent.vueTarget !== this) {
|
|
673
|
+
this.hide()
|
|
674
|
+
}
|
|
675
|
+
},
|
|
676
|
+
// Focus control handlers
|
|
677
|
+
focusFirst() {
|
|
678
|
+
// Don't try and focus if we are SSR
|
|
679
|
+
if (IS_BROWSER) {
|
|
680
|
+
requestAF(() => {
|
|
681
|
+
const modal = this.$refs.modal
|
|
682
|
+
const content = this.$refs.content
|
|
683
|
+
const activeElement = this.getActiveElement()
|
|
684
|
+
// If the modal contains the activeElement, we don't do anything
|
|
685
|
+
if (modal && content && !(activeElement && contains(content, activeElement))) {
|
|
686
|
+
const ok = this.$refs['ok-button']
|
|
687
|
+
const cancel = this.$refs['cancel-button']
|
|
688
|
+
const close = this.$refs['close-button']
|
|
689
|
+
// Focus the appropriate button or modal content wrapper
|
|
690
|
+
const autoFocus = this.autoFocusButton
|
|
691
|
+
/* istanbul ignore next */
|
|
692
|
+
const el =
|
|
693
|
+
autoFocus === BUTTON_OK && ok
|
|
694
|
+
? ok.$el || ok
|
|
695
|
+
: autoFocus === BUTTON_CANCEL && cancel
|
|
696
|
+
? cancel.$el || cancel
|
|
697
|
+
: autoFocus === BUTTON_CLOSE && close
|
|
698
|
+
? close.$el || close
|
|
699
|
+
: content
|
|
700
|
+
// Focus the element
|
|
701
|
+
attemptFocus(el)
|
|
702
|
+
if (el === content) {
|
|
703
|
+
// Make sure top of modal is showing (if longer than the viewport)
|
|
704
|
+
this.$nextTick(() => {
|
|
705
|
+
modal.scrollTop = 0
|
|
706
|
+
})
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
})
|
|
710
|
+
}
|
|
711
|
+
},
|
|
712
|
+
returnFocusTo() {
|
|
713
|
+
// Prefer `returnFocus` prop over event specified
|
|
714
|
+
// `return_focus` value
|
|
715
|
+
let el = this.returnFocus || this.$_returnFocus || null
|
|
716
|
+
this.$_returnFocus = null
|
|
717
|
+
this.$nextTick(() => {
|
|
718
|
+
// Is el a string CSS selector?
|
|
719
|
+
el = isString(el) ? select(el) : el
|
|
720
|
+
if (el) {
|
|
721
|
+
// Possibly could be a component reference
|
|
722
|
+
el = el.$el || el
|
|
723
|
+
attemptFocus(el)
|
|
724
|
+
}
|
|
725
|
+
})
|
|
726
|
+
},
|
|
727
|
+
checkModalOverflow() {
|
|
728
|
+
if (this.isVisible) {
|
|
729
|
+
const modal = this.$refs.modal
|
|
730
|
+
this.isModalOverflowing = modal.scrollHeight > document.documentElement.clientHeight
|
|
731
|
+
}
|
|
732
|
+
},
|
|
733
|
+
makeModal(h) {
|
|
734
|
+
// Modal header
|
|
735
|
+
let $header = h()
|
|
736
|
+
if (!this.hideHeader) {
|
|
737
|
+
// TODO: Rename slot to `header` and deprecate `modal-header`
|
|
738
|
+
let $modalHeader = this.normalizeSlot(SLOT_NAME_MODAL_HEADER, this.slotScope)
|
|
739
|
+
if (!$modalHeader) {
|
|
740
|
+
let $closeButton = h()
|
|
741
|
+
if (!this.hideHeaderClose) {
|
|
742
|
+
$closeButton = h(
|
|
743
|
+
BButtonClose,
|
|
744
|
+
{
|
|
745
|
+
props: {
|
|
746
|
+
content: this.headerCloseContent,
|
|
747
|
+
disabled: this.isTransitioning,
|
|
748
|
+
ariaLabel: this.headerCloseLabel
|
|
749
|
+
},
|
|
750
|
+
on: { click: this.onClose },
|
|
751
|
+
ref: 'close-button'
|
|
752
|
+
},
|
|
753
|
+
// TODO: Rename slot to `header-close` and deprecate `modal-header-close`
|
|
754
|
+
[this.normalizeSlot(SLOT_NAME_MODAL_HEADER_CLOSE)]
|
|
755
|
+
)
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
$modalHeader = [
|
|
759
|
+
h(
|
|
760
|
+
this.titleTag,
|
|
761
|
+
{
|
|
762
|
+
staticClass: 'modal-title',
|
|
763
|
+
class: this.titleClasses,
|
|
764
|
+
attrs: { id: this.modalTitleId },
|
|
765
|
+
// TODO: Rename slot to `title` and deprecate `modal-title`
|
|
766
|
+
domProps: this.hasNormalizedSlot(SLOT_NAME_MODAL_TITLE)
|
|
767
|
+
? {}
|
|
768
|
+
: htmlOrText(this.titleHtml, this.title)
|
|
769
|
+
},
|
|
770
|
+
// TODO: Rename slot to `title` and deprecate `modal-title`
|
|
771
|
+
this.normalizeSlot(SLOT_NAME_MODAL_TITLE, this.slotScope)
|
|
772
|
+
),
|
|
773
|
+
$closeButton
|
|
774
|
+
]
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
$header = h(
|
|
778
|
+
this.headerTag,
|
|
779
|
+
{
|
|
780
|
+
staticClass: 'modal-header',
|
|
781
|
+
class: this.headerClass,
|
|
782
|
+
attrs: { id: this.modalHeaderId },
|
|
783
|
+
ref: 'header'
|
|
784
|
+
},
|
|
785
|
+
[$modalHeader]
|
|
786
|
+
)
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
// Modal body
|
|
790
|
+
const $body = h(
|
|
791
|
+
'div',
|
|
792
|
+
{
|
|
793
|
+
staticClass: 'modal-body',
|
|
794
|
+
class: this.bodyClass,
|
|
795
|
+
attrs: { id: this.modalBodyId },
|
|
796
|
+
ref: 'body'
|
|
797
|
+
},
|
|
798
|
+
this.normalizeSlot(SLOT_NAME_DEFAULT, this.slotScope)
|
|
799
|
+
)
|
|
800
|
+
|
|
801
|
+
// Modal footer
|
|
802
|
+
let $footer = h()
|
|
803
|
+
if (!this.hideFooter) {
|
|
804
|
+
// TODO: Rename slot to `footer` and deprecate `modal-footer`
|
|
805
|
+
let $modalFooter = this.normalizeSlot(SLOT_NAME_MODAL_FOOTER, this.slotScope)
|
|
806
|
+
if (!$modalFooter) {
|
|
807
|
+
let $cancelButton = h()
|
|
808
|
+
if (!this.okOnly) {
|
|
809
|
+
$cancelButton = h(
|
|
810
|
+
BButton,
|
|
811
|
+
{
|
|
812
|
+
props: {
|
|
813
|
+
variant: this.cancelVariant,
|
|
814
|
+
size: this.buttonSize,
|
|
815
|
+
disabled: this.cancelDisabled || this.busy || this.isTransitioning
|
|
816
|
+
},
|
|
817
|
+
// TODO: Rename slot to `cancel-button` and deprecate `modal-cancel`
|
|
818
|
+
domProps: this.hasNormalizedSlot(SLOT_NAME_MODAL_CANCEL)
|
|
819
|
+
? {}
|
|
820
|
+
: htmlOrText(this.cancelTitleHtml, this.cancelTitle),
|
|
821
|
+
on: { click: this.onCancel },
|
|
822
|
+
ref: 'cancel-button'
|
|
823
|
+
},
|
|
824
|
+
// TODO: Rename slot to `cancel-button` and deprecate `modal-cancel`
|
|
825
|
+
this.normalizeSlot(SLOT_NAME_MODAL_CANCEL)
|
|
826
|
+
)
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
const $okButton = h(
|
|
830
|
+
BButton,
|
|
831
|
+
{
|
|
832
|
+
props: {
|
|
833
|
+
variant: this.okVariant,
|
|
834
|
+
size: this.buttonSize,
|
|
835
|
+
disabled: this.okDisabled || this.busy || this.isTransitioning
|
|
836
|
+
},
|
|
837
|
+
// TODO: Rename slot to `ok-button` and deprecate `modal-ok`
|
|
838
|
+
domProps: this.hasNormalizedSlot(SLOT_NAME_MODAL_OK)
|
|
839
|
+
? {}
|
|
840
|
+
: htmlOrText(this.okTitleHtml, this.okTitle),
|
|
841
|
+
on: { click: this.onOk },
|
|
842
|
+
ref: 'ok-button'
|
|
843
|
+
},
|
|
844
|
+
// TODO: Rename slot to `ok-button` and deprecate `modal-ok`
|
|
845
|
+
this.normalizeSlot(SLOT_NAME_MODAL_OK)
|
|
846
|
+
)
|
|
847
|
+
|
|
848
|
+
$modalFooter = [$cancelButton, $okButton]
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
$footer = h(
|
|
852
|
+
this.footerTag,
|
|
853
|
+
{
|
|
854
|
+
staticClass: 'modal-footer',
|
|
855
|
+
class: this.footerClass,
|
|
856
|
+
attrs: { id: this.modalFooterId },
|
|
857
|
+
ref: 'footer'
|
|
858
|
+
},
|
|
859
|
+
[$modalFooter]
|
|
860
|
+
)
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
// Assemble modal content
|
|
864
|
+
const $modalContent = h(
|
|
865
|
+
'div',
|
|
866
|
+
{
|
|
867
|
+
staticClass: 'modal-content',
|
|
868
|
+
class: this.contentClass,
|
|
869
|
+
attrs: {
|
|
870
|
+
id: this.modalContentId,
|
|
871
|
+
tabindex: '-1'
|
|
872
|
+
},
|
|
873
|
+
ref: 'content'
|
|
874
|
+
},
|
|
875
|
+
[$header, $body, $footer]
|
|
876
|
+
)
|
|
877
|
+
|
|
878
|
+
// Tab traps to prevent page from scrolling to next element in
|
|
879
|
+
// tab index during enforce-focus tab cycle
|
|
880
|
+
let $tabTrapTop = h()
|
|
881
|
+
let $tabTrapBottom = h()
|
|
882
|
+
if (this.isVisible && !this.noEnforceFocus) {
|
|
883
|
+
$tabTrapTop = h('span', {
|
|
884
|
+
attrs: { tabindex: '0' },
|
|
885
|
+
ref: 'top-trap'
|
|
886
|
+
})
|
|
887
|
+
$tabTrapBottom = h('span', {
|
|
888
|
+
attrs: { tabindex: '0' },
|
|
889
|
+
ref: 'bottom-trap'
|
|
890
|
+
})
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
// Modal dialog wrapper
|
|
894
|
+
const $modalDialog = h(
|
|
895
|
+
'div',
|
|
896
|
+
{
|
|
897
|
+
staticClass: 'modal-dialog',
|
|
898
|
+
class: this.dialogClasses,
|
|
899
|
+
on: { mousedown: this.onDialogMousedown },
|
|
900
|
+
ref: 'dialog'
|
|
901
|
+
},
|
|
902
|
+
[$tabTrapTop, $modalContent, $tabTrapBottom]
|
|
903
|
+
)
|
|
904
|
+
|
|
905
|
+
// Modal
|
|
906
|
+
let $modal = h(
|
|
907
|
+
'div',
|
|
908
|
+
{
|
|
909
|
+
staticClass: 'modal',
|
|
910
|
+
class: this.modalClasses,
|
|
911
|
+
style: this.modalStyles,
|
|
912
|
+
attrs: this.computedModalAttrs,
|
|
913
|
+
on: { keydown: this.onEsc, click: this.onClickOut },
|
|
914
|
+
directives: [{ name: 'show', value: this.isVisible }],
|
|
915
|
+
ref: 'modal'
|
|
916
|
+
},
|
|
917
|
+
[$modalDialog]
|
|
918
|
+
)
|
|
919
|
+
|
|
920
|
+
// Wrap modal in transition
|
|
921
|
+
// Sadly, we can't use `BVTransition` here due to the differences in
|
|
922
|
+
// transition durations for `.modal` and `.modal-dialog`
|
|
923
|
+
// At least until https://github.com/vuejs/vue/issues/9986 is resolved
|
|
924
|
+
$modal = h(
|
|
925
|
+
'transition',
|
|
926
|
+
{
|
|
927
|
+
props: {
|
|
928
|
+
enterClass: '',
|
|
929
|
+
enterToClass: '',
|
|
930
|
+
enterActiveClass: '',
|
|
931
|
+
leaveClass: '',
|
|
932
|
+
leaveActiveClass: '',
|
|
933
|
+
leaveToClass: ''
|
|
934
|
+
},
|
|
935
|
+
on: {
|
|
936
|
+
beforeEnter: this.onBeforeEnter,
|
|
937
|
+
enter: this.onEnter,
|
|
938
|
+
afterEnter: this.onAfterEnter,
|
|
939
|
+
beforeLeave: this.onBeforeLeave,
|
|
940
|
+
leave: this.onLeave,
|
|
941
|
+
afterLeave: this.onAfterLeave
|
|
942
|
+
}
|
|
943
|
+
},
|
|
944
|
+
[$modal]
|
|
945
|
+
)
|
|
946
|
+
|
|
947
|
+
// Modal backdrop
|
|
948
|
+
let $backdrop = h()
|
|
949
|
+
if (!this.hideBackdrop && this.isVisible) {
|
|
950
|
+
$backdrop = h(
|
|
951
|
+
'div',
|
|
952
|
+
{
|
|
953
|
+
staticClass: 'modal-backdrop',
|
|
954
|
+
attrs: { id: this.modalBackdropId }
|
|
955
|
+
},
|
|
956
|
+
// TODO: Rename slot to `backdrop` and deprecate `modal-backdrop`
|
|
957
|
+
this.normalizeSlot(SLOT_NAME_MODAL_BACKDROP)
|
|
958
|
+
)
|
|
959
|
+
}
|
|
960
|
+
$backdrop = h(BVTransition, { props: { noFade: this.noFade } }, [$backdrop])
|
|
961
|
+
|
|
962
|
+
// Assemble modal and backdrop in an outer <div>
|
|
963
|
+
return h(
|
|
964
|
+
'div',
|
|
965
|
+
{
|
|
966
|
+
style: this.modalOuterStyle,
|
|
967
|
+
attrs: this.computedAttrs,
|
|
968
|
+
key: `modal-outer-${this[COMPONENT_UID_KEY]}`
|
|
969
|
+
},
|
|
970
|
+
[$modal, $backdrop]
|
|
971
|
+
)
|
|
972
|
+
}
|
|
973
|
+
},
|
|
974
|
+
render(h) {
|
|
975
|
+
if (this.static) {
|
|
976
|
+
return this.lazy && this.isHidden ? h() : this.makeModal(h)
|
|
977
|
+
} else {
|
|
978
|
+
return this.isHidden ? h() : h(BVTransporter, [this.makeModal(h)])
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
})
|