@gitlab/ui 132.0.0 → 132.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/charts.js +13 -0
- package/dist/components/base/accordion/accordion.js +69 -0
- package/dist/components/base/accordion/accordion_item.js +160 -0
- package/dist/components/base/accordion/constants.js +3 -0
- package/dist/components/base/alert/alert.js +263 -0
- package/dist/components/base/animated_icon/animated_chevron_down_up_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_chevron_lg_down_up_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_chevron_lg_right_down_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_chevron_right_down_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_duo_chat_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_loader_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_notifications_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_sidebar_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_smile_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_sort_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_star_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_todo_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_upload_icon.js +45 -0
- package/dist/components/base/animated_icon/base_animated_icon.js +77 -0
- package/dist/components/base/attribute_list/attribute_list.js +100 -0
- package/dist/components/base/avatar/avatar.js +175 -0
- package/dist/components/base/avatar/utils.js +17 -0
- package/dist/components/base/avatar_labeled/avatar_labeled.js +198 -0
- package/dist/components/base/avatar_link/avatar_link.js +47 -0
- package/dist/components/base/avatars_inline/avatars_inline.js +139 -0
- package/dist/components/base/badge/badge.js +197 -0
- package/dist/components/base/banner/banner.js +149 -0
- package/dist/components/base/breadcrumb/breadcrumb.js +282 -0
- package/dist/components/base/breadcrumb/breadcrumb_item.js +96 -0
- package/dist/components/base/broadcast_message/broadcast_message.js +113 -0
- package/dist/components/base/broadcast_message/constants.js +5 -0
- package/dist/components/base/button/button.js +419 -0
- package/dist/components/base/button_group/button_group.js +53 -0
- package/dist/components/base/card/card.js +69 -0
- package/dist/components/base/collapse/collapse.js +163 -0
- package/dist/components/base/color_mode_toggle/color_mode_toggle.js +92 -0
- package/dist/components/base/datepicker/datepicker.js +475 -0
- package/dist/components/base/daterange_picker/daterange_picker.js +394 -0
- package/dist/components/base/drawer/drawer.js +156 -0
- package/dist/components/base/dropdown/dropdown.js +330 -0
- package/dist/components/base/dropdown/dropdown_divider.js +48 -0
- package/dist/components/base/dropdown/dropdown_form.js +48 -0
- package/dist/components/base/dropdown/dropdown_item.js +175 -0
- package/dist/components/base/dropdown/dropdown_section_header.js +48 -0
- package/dist/components/base/dropdown/dropdown_text.js +48 -0
- package/dist/components/base/filtered_search/common_story_options.js +14 -0
- package/dist/components/base/filtered_search/filtered_search.js +428 -0
- package/dist/components/base/filtered_search/filtered_search_suggestion.js +95 -0
- package/dist/components/base/filtered_search/filtered_search_suggestion_list.js +139 -0
- package/dist/components/base/filtered_search/filtered_search_term.js +217 -0
- package/dist/components/base/filtered_search/filtered_search_token.js +383 -0
- package/dist/components/base/filtered_search/filtered_search_token_segment.js +444 -0
- package/dist/components/base/filtered_search/filtered_search_utils.js +241 -0
- package/dist/components/base/form/form.js +43 -0
- package/dist/components/base/form/form_character_count/form_character_count.js +107 -0
- package/dist/components/base/form/form_checkbox/form_checkbox.js +342 -0
- package/dist/components/base/form/form_checkbox/form_checkbox_group.js +188 -0
- package/dist/components/base/form/form_combobox/constants.js +55 -0
- package/dist/components/base/form/form_combobox/form_combobox.js +239 -0
- package/dist/components/base/form/form_date/form_date.js +143 -0
- package/dist/components/base/form/form_fields/form_field_validator.js +93 -0
- package/dist/components/base/form/form_fields/form_fields.js +289 -0
- package/dist/components/base/form/form_fields/form_fields_loop.js +75 -0
- package/dist/components/base/form/form_fields/mappers.js +13 -0
- package/dist/components/base/form/form_fields/validators.js +48 -0
- package/dist/components/base/form/form_group/form_group.js +119 -0
- package/dist/components/base/form/form_input/form_input.js +695 -0
- package/dist/components/base/form/form_input_group/form_input_group.js +120 -0
- package/dist/components/base/form/form_input_group/form_input_group_mixin.js +41 -0
- package/dist/components/base/form/form_radio/form_radio.js +259 -0
- package/dist/components/base/form/form_radio_group/form_radio_group.js +189 -0
- package/dist/components/base/form/form_select/constants.js +12 -0
- package/dist/components/base/form/form_select/form_select.js +96 -0
- package/dist/components/base/form/form_textarea/form_textarea.js +166 -0
- package/dist/components/base/form/input_group_text/input_group_text.js +43 -0
- package/dist/components/base/icon/icon.js +113 -0
- package/dist/components/base/illustration/illustration.js +80 -0
- package/dist/components/base/infinite_scroll/infinite_scroll.js +196 -0
- package/dist/components/base/keyset_pagination/keyset_pagination.js +152 -0
- package/dist/components/base/label/label.js +174 -0
- package/dist/components/base/link/link.js +330 -0
- package/dist/components/base/loading_icon/loading_icon.js +120 -0
- package/dist/components/base/markdown/markdown.js +50 -0
- package/dist/components/base/modal/modal.js +259 -0
- package/dist/components/base/new_dropdowns/base_dropdown/base_dropdown.js +716 -0
- package/dist/components/base/new_dropdowns/base_dropdown/constants.js +5 -0
- package/dist/components/base/new_dropdowns/base_dropdown/dropdown_container.js +32 -0
- package/dist/components/base/new_dropdowns/constants.js +24 -0
- package/dist/components/base/new_dropdowns/disclosure/constants.js +8 -0
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown.js +400 -0
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown_group.js +112 -0
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown_item.js +196 -0
- package/dist/components/base/new_dropdowns/disclosure/mock_data.js +168 -0
- package/dist/components/base/new_dropdowns/disclosure/utils.js +84 -0
- package/dist/components/base/new_dropdowns/listbox/listbox.js +997 -0
- package/dist/components/base/new_dropdowns/listbox/listbox_group.js +58 -0
- package/dist/components/base/new_dropdowns/listbox/listbox_item.js +112 -0
- package/dist/components/base/new_dropdowns/listbox/listbox_search_input.js +94 -0
- package/dist/components/base/new_dropdowns/listbox/mock_data.js +131 -0
- package/dist/components/base/new_dropdowns/listbox/utils.js +33 -0
- package/dist/components/base/pagination/pagination.js +397 -0
- package/dist/components/base/path/data.js +34 -0
- package/dist/components/base/path/path.js +177 -0
- package/dist/components/base/popover/popover.js +142 -0
- package/dist/components/base/progress_bar/progress_bar.js +117 -0
- package/dist/components/base/search_box_by_click/search_box_by_click.js +245 -0
- package/dist/components/base/search_box_by_type/search_box_by_type.js +187 -0
- package/dist/components/base/segmented_control/segmented_control.js +73 -0
- package/dist/components/base/skeleton_loader/skeleton_loader.js +232 -0
- package/dist/components/base/sorting/sorting.js +180 -0
- package/dist/components/base/table/constants.js +5 -0
- package/dist/components/base/table/table.js +187 -0
- package/dist/components/base/table_lite/table_lite.js +80 -0
- package/dist/components/base/tabs/constants.js +3 -0
- package/dist/components/base/tabs/tab/tab.js +113 -0
- package/dist/components/base/tabs/tabs/scrollable_tabs.js +162 -0
- package/dist/components/base/tabs/tabs/tabs.js +223 -0
- package/dist/components/base/toast/index.js +66 -0
- package/dist/components/base/toast/toast.js +125 -0
- package/dist/components/base/toast/toaster.js +87 -0
- package/dist/components/base/toggle/toggle.js +178 -0
- package/dist/components/base/token/token.js +97 -0
- package/dist/components/base/token_selector/helpers.js +5 -0
- package/dist/components/base/token_selector/token_container.js +160 -0
- package/dist/components/base/token_selector/token_selector.js +454 -0
- package/dist/components/base/token_selector/token_selector_dropdown.js +223 -0
- package/dist/components/base/tooltip/tooltip.js +54 -0
- package/dist/components/charts/area/area.js +329 -0
- package/dist/components/charts/bar/bar.js +207 -0
- package/dist/components/charts/chart/chart.js +215 -0
- package/dist/components/charts/column/column.js +221 -0
- package/dist/components/charts/discrete_scatter/discrete_scatter.js +199 -0
- package/dist/components/charts/gauge/gauge.js +205 -0
- package/dist/components/charts/heatmap/heatmap.js +299 -0
- package/dist/components/charts/heatmap/index.js +2 -0
- package/dist/components/charts/legend/legend.js +245 -0
- package/dist/components/charts/line/line.js +340 -0
- package/dist/components/charts/series_label/series_label.js +101 -0
- package/dist/components/charts/shared/tooltip/tooltip.js +369 -0
- package/dist/components/charts/shared/tooltip/tooltip_default_format/tooltip_default_format.js +53 -0
- package/dist/components/charts/single_stat/single_stat.js +164 -0
- package/dist/components/charts/sparkline/sparkline.js +299 -0
- package/dist/components/charts/stacked_column/stacked_column.js +380 -0
- package/dist/components/dashboards/dashboard_layout/dashboard_layout.js +125 -0
- package/dist/components/dashboards/dashboard_layout/grid_layout/grid_layout.js +326 -0
- package/dist/components/dashboards/dashboard_layout/validators.js +14 -0
- package/dist/components/dashboards/dashboard_panel/dashboard_panel.js +236 -0
- package/dist/components/dashboards/mock_data.js +49 -0
- package/dist/components/experimental/experiment_badge/constants.js +4 -0
- package/dist/components/experimental/experiment_badge/experiment_badge.js +102 -0
- package/dist/components/extended/multi_step_form_template/multi_step_form_template.js +87 -0
- package/dist/components/index.js +107 -0
- package/dist/components/mixins/button_mixin.js +11 -0
- package/dist/components/mixins/safe_link_mixin.js +30 -0
- package/dist/components/mixins/tooltip_mixin.js +21 -0
- package/dist/components/regions/dashboard_skeleton/dashboard_skeleton.js +53 -0
- package/dist/components/regions/empty_state/empty_state.js +181 -0
- package/dist/components/shared_components/clear_icon_button/clear_icon_button.js +64 -0
- package/dist/components/shared_components/clipboard_button/clipboard_button.js +100 -0
- package/dist/components/shared_components/close_button/close_button.js +55 -0
- package/dist/components/utilities/animated_number/animated_number.js +131 -0
- package/dist/components/utilities/friendly_wrap/friendly_wrap.js +75 -0
- package/dist/components/utilities/intersection_observer/intersection_observer.js +88 -0
- package/dist/components/utilities/intersperse/intersperse.js +104 -0
- package/dist/components/utilities/sprintf/sprintf.js +171 -0
- package/dist/components/utilities/truncate/constants.js +8 -0
- package/dist/components/utilities/truncate/truncate.js +154 -0
- package/dist/components/utilities/truncate_text/constants.js +7 -0
- package/dist/components/utilities/truncate_text/truncate_text.js +146 -0
- package/dist/config.js +53 -0
- package/dist/directives/hover_load/hover_load.js +45 -0
- package/dist/directives/index.js +8 -0
- package/dist/directives/modal.js +1 -0
- package/dist/directives/outside/outside.js +149 -0
- package/dist/directives/resize_observer/resize_observer.js +58 -0
- package/dist/directives/safe_html/constants.js +6 -0
- package/dist/directives/safe_html/safe_html.js +39 -0
- package/dist/directives/safe_link/mock_data.js +10 -0
- package/dist/directives/safe_link/safe_link.js +67 -0
- package/dist/directives/tooltip/container.js +7 -0
- package/dist/directives/tooltip/tooltip.js +18 -0
- package/dist/index.css +7 -0
- package/dist/index.css.map +1 -0
- package/dist/index.js +2 -0
- package/dist/tailwind.css +2 -0
- package/dist/tailwind.css.map +1 -0
- package/dist/tokens/build/js/tokens.dark.js +1410 -0
- package/dist/tokens/build/js/tokens.js +1410 -0
- package/dist/tokens/common_story_options.js +29 -0
- package/dist/tokens/tokens_story.js +76 -0
- package/dist/utils/breakpoints.js +20 -0
- package/dist/utils/charts/config.js +616 -0
- package/dist/utils/charts/constants.js +69 -0
- package/dist/utils/charts/mock_data.js +191 -0
- package/dist/utils/charts/story_config.js +24 -0
- package/dist/utils/charts/theme.js +200 -0
- package/dist/utils/charts/utils.js +54 -0
- package/dist/utils/constants.js +331 -0
- package/dist/utils/data_utils.js +19 -0
- package/dist/utils/datetime_utility.js +61 -0
- package/dist/utils/equality_utils.js +84 -0
- package/dist/utils/form_options_utils.js +46 -0
- package/dist/utils/i18n.js +65 -0
- package/dist/utils/is_slot_empty.js +34 -0
- package/dist/utils/number_utils.js +132 -0
- package/dist/utils/play_utils.js +11 -0
- package/dist/utils/set_utils.js +25 -0
- package/dist/utils/stories_constants.js +29 -0
- package/dist/utils/stories_utils.js +62 -0
- package/dist/utils/story_decorators/container.js +19 -0
- package/dist/utils/string_utils.js +69 -0
- package/dist/utils/svgs/svg_paths.js +7 -0
- package/dist/utils/test_utils.js +33 -0
- package/dist/utils/use_fake_date.js +29 -0
- package/dist/utils/use_mock_intersection_observer.js +105 -0
- package/dist/utils/utils.js +205 -0
- package/dist/utils/vue_utils.js +57 -0
- package/dist/utils.js +5 -0
- package/dist/vendor/bootstrap-vue/src/bv-config.js +8 -0
- package/dist/vendor/bootstrap-vue/src/components/button/button-close.js +81 -0
- package/dist/vendor/bootstrap-vue/src/components/button/button.js +204 -0
- package/dist/vendor/bootstrap-vue/src/components/button/index.js +2 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-divider.js +41 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-form.js +52 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-group.js +75 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-header.js +52 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-item-button.js +85 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-item.js +97 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-text.js +60 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown.js +270 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/index.js +8 -0
- package/dist/vendor/bootstrap-vue/src/components/form/form-invalid-feedback.js +53 -0
- package/dist/vendor/bootstrap-vue/src/components/form/form-text.js +55 -0
- package/dist/vendor/bootstrap-vue/src/components/form/form-valid-feedback.js +53 -0
- package/dist/vendor/bootstrap-vue/src/components/form/form.js +56 -0
- package/dist/vendor/bootstrap-vue/src/components/form/index.js +4 -0
- package/dist/vendor/bootstrap-vue/src/components/form-group/form-group.js +347 -0
- package/dist/vendor/bootstrap-vue/src/components/form-group/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/components/form-select/form-select-option-group.js +54 -0
- package/dist/vendor/bootstrap-vue/src/components/form-select/form-select-option.js +41 -0
- package/dist/vendor/bootstrap-vue/src/components/form-select/form-select.js +143 -0
- package/dist/vendor/bootstrap-vue/src/components/form-select/helpers/mixin-options.js +56 -0
- package/dist/vendor/bootstrap-vue/src/components/form-select/index.js +3 -0
- package/dist/vendor/bootstrap-vue/src/components/form-textarea/form-textarea.js +217 -0
- package/dist/vendor/bootstrap-vue/src/components/form-textarea/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/components/layout/col.js +155 -0
- package/dist/vendor/bootstrap-vue/src/components/layout/form-row.js +34 -0
- package/dist/vendor/bootstrap-vue/src/components/layout/index.js +2 -0
- package/dist/vendor/bootstrap-vue/src/components/link/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/components/link/link.js +283 -0
- package/dist/vendor/bootstrap-vue/src/components/modal/helpers/bv-modal-event.class.js +21 -0
- package/dist/vendor/bootstrap-vue/src/components/modal/helpers/modal-manager.js +212 -0
- package/dist/vendor/bootstrap-vue/src/components/modal/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/components/modal/modal.js +1059 -0
- package/dist/vendor/bootstrap-vue/src/components/popover/helpers/bv-popover-template.js +55 -0
- package/dist/vendor/bootstrap-vue/src/components/popover/helpers/bv-popover.js +31 -0
- package/dist/vendor/bootstrap-vue/src/components/popover/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/components/popover/popover.js +49 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/constants.js +22 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/default-sort-compare.js +64 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/filter-event.js +40 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-bottom-row.js +43 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-busy.js +83 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-caption.js +50 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-colgroup.js +32 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-empty.js +82 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-filtering.js +292 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-items.js +154 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-pagination.js +44 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-provider.js +191 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-selectable.js +213 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-sorting.js +274 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-stacked.js +39 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-table-renderer.js +186 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody-row.js +338 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody.js +243 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-tfoot.js +50 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-thead.js +218 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-top-row.js +42 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/normalize-fields.js +86 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/sanitize-row.js +31 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/stringify-record-values.js +11 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/text-selection-active.js +14 -0
- package/dist/vendor/bootstrap-vue/src/components/table/index.js +9 -0
- package/dist/vendor/bootstrap-vue/src/components/table/table-lite.js +51 -0
- package/dist/vendor/bootstrap-vue/src/components/table/table-simple.js +44 -0
- package/dist/vendor/bootstrap-vue/src/components/table/table.js +67 -0
- package/dist/vendor/bootstrap-vue/src/components/table/tbody.js +116 -0
- package/dist/vendor/bootstrap-vue/src/components/table/td.js +204 -0
- package/dist/vendor/bootstrap-vue/src/components/table/tfoot.js +96 -0
- package/dist/vendor/bootstrap-vue/src/components/table/th.js +26 -0
- package/dist/vendor/bootstrap-vue/src/components/table/thead.js +99 -0
- package/dist/vendor/bootstrap-vue/src/components/table/tr.js +121 -0
- package/dist/vendor/bootstrap-vue/src/components/tabs/index.js +2 -0
- package/dist/vendor/bootstrap-vue/src/components/tabs/tab.js +238 -0
- package/dist/vendor/bootstrap-vue/src/components/tabs/tabs.js +690 -0
- package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-popper.js +251 -0
- package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip-template.js +118 -0
- package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip.js +932 -0
- package/dist/vendor/bootstrap-vue/src/components/tooltip/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/components/tooltip/tooltip.js +337 -0
- package/dist/vendor/bootstrap-vue/src/components/transition/bv-transition.js +103 -0
- package/dist/vendor/bootstrap-vue/src/components/transporter/transporter.js +205 -0
- package/dist/vendor/bootstrap-vue/src/constants/components.js +55 -0
- package/dist/vendor/bootstrap-vue/src/constants/config.js +11 -0
- package/dist/vendor/bootstrap-vue/src/constants/env.js +36 -0
- package/dist/vendor/bootstrap-vue/src/constants/events.js +56 -0
- package/dist/vendor/bootstrap-vue/src/constants/key-codes.js +11 -0
- package/dist/vendor/bootstrap-vue/src/constants/popper.js +10 -0
- package/dist/vendor/bootstrap-vue/src/constants/props.js +24 -0
- package/dist/vendor/bootstrap-vue/src/constants/regex.js +35 -0
- package/dist/vendor/bootstrap-vue/src/constants/safe-types.js +15 -0
- package/dist/vendor/bootstrap-vue/src/constants/slots.js +36 -0
- package/dist/vendor/bootstrap-vue/src/directives/modal/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/directives/modal/modal.js +112 -0
- package/dist/vendor/bootstrap-vue/src/directives/tooltip/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/directives/tooltip/tooltip.js +267 -0
- package/dist/vendor/bootstrap-vue/src/directives/visible/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/directives/visible/visible.js +187 -0
- package/dist/vendor/bootstrap-vue/src/mixins/attrs.js +5 -0
- package/dist/vendor/bootstrap-vue/src/mixins/click-out.js +54 -0
- package/dist/vendor/bootstrap-vue/src/mixins/dropdown.js +470 -0
- package/dist/vendor/bootstrap-vue/src/mixins/focus-in.js +46 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-control.js +73 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-custom.js +26 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-options.js +91 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-selection.js +62 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-size.js +26 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-state.js +50 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-text.js +293 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-validity.js +50 -0
- package/dist/vendor/bootstrap-vue/src/mixins/has-listener.js +29 -0
- package/dist/vendor/bootstrap-vue/src/mixins/id.js +57 -0
- package/dist/vendor/bootstrap-vue/src/mixins/listen-on-document.js +62 -0
- package/dist/vendor/bootstrap-vue/src/mixins/listen-on-root.js +120 -0
- package/dist/vendor/bootstrap-vue/src/mixins/listen-on-window.js +62 -0
- package/dist/vendor/bootstrap-vue/src/mixins/listeners.js +25 -0
- package/dist/vendor/bootstrap-vue/src/mixins/model.js +10 -0
- package/dist/vendor/bootstrap-vue/src/mixins/normalize-slot.js +30 -0
- package/dist/vendor/bootstrap-vue/src/mixins/scoped-style.js +18 -0
- package/dist/vendor/bootstrap-vue/src/mixins/use-parent.js +14 -0
- package/dist/vendor/bootstrap-vue/src/utils/array.js +27 -0
- package/dist/vendor/bootstrap-vue/src/utils/bv-event.class.js +60 -0
- package/dist/vendor/bootstrap-vue/src/utils/cache.js +60 -0
- package/dist/vendor/bootstrap-vue/src/utils/clone-deep.js +18 -0
- package/dist/vendor/bootstrap-vue/src/utils/config-set.js +86 -0
- package/dist/vendor/bootstrap-vue/src/utils/config.js +71 -0
- package/dist/vendor/bootstrap-vue/src/utils/create-new-child-component.js +133 -0
- package/dist/vendor/bootstrap-vue/src/utils/css-escape.js +70 -0
- package/dist/vendor/bootstrap-vue/src/utils/dom.js +298 -0
- package/dist/vendor/bootstrap-vue/src/utils/element-to-vue-instance-registry.js +28 -0
- package/dist/vendor/bootstrap-vue/src/utils/env.js +16 -0
- package/dist/vendor/bootstrap-vue/src/utils/events.js +78 -0
- package/dist/vendor/bootstrap-vue/src/utils/get-event-root.js +5 -0
- package/dist/vendor/bootstrap-vue/src/utils/get-instance-from-directive.js +3 -0
- package/dist/vendor/bootstrap-vue/src/utils/get-scope-id.js +9 -0
- package/dist/vendor/bootstrap-vue/src/utils/get.js +63 -0
- package/dist/vendor/bootstrap-vue/src/utils/html.js +16 -0
- package/dist/vendor/bootstrap-vue/src/utils/identity.js +3 -0
- package/dist/vendor/bootstrap-vue/src/utils/inspect.js +35 -0
- package/dist/vendor/bootstrap-vue/src/utils/locale.js +18 -0
- package/dist/vendor/bootstrap-vue/src/utils/loose-equal.js +59 -0
- package/dist/vendor/bootstrap-vue/src/utils/loose-index-of.js +13 -0
- package/dist/vendor/bootstrap-vue/src/utils/math.js +9 -0
- package/dist/vendor/bootstrap-vue/src/utils/memoize.js +14 -0
- package/dist/vendor/bootstrap-vue/src/utils/model.js +33 -0
- package/dist/vendor/bootstrap-vue/src/utils/noop.js +3 -0
- package/dist/vendor/bootstrap-vue/src/utils/normalize-slot.js +51 -0
- package/dist/vendor/bootstrap-vue/src/utils/number.js +23 -0
- package/dist/vendor/bootstrap-vue/src/utils/object.js +72 -0
- package/dist/vendor/bootstrap-vue/src/utils/observe-dom.js +76 -0
- package/dist/vendor/bootstrap-vue/src/utils/on-instance-destroy.js +22 -0
- package/dist/vendor/bootstrap-vue/src/utils/plugins.js +124 -0
- package/dist/vendor/bootstrap-vue/src/utils/props.js +67 -0
- package/dist/vendor/bootstrap-vue/src/utils/router.js +150 -0
- package/dist/vendor/bootstrap-vue/src/utils/safe-vue-instance.js +14 -0
- package/dist/vendor/bootstrap-vue/src/utils/stable-sort.js +28 -0
- package/dist/vendor/bootstrap-vue/src/utils/string.js +47 -0
- package/dist/vendor/bootstrap-vue/src/utils/stringify-object-values.js +31 -0
- package/dist/vendor/bootstrap-vue/src/utils/warn.js +45 -0
- package/dist/vendor/bootstrap-vue/src/vue.js +55 -0
- package/package.json +6 -5
- package/src/components/base/link/link.vue +5 -8
- package/src/utils/constants.js +0 -3
- package/src/utils/vue_utils.js +56 -0
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown.js +2 -2
- package/src/vendor/bootstrap-vue/src/components/form-group/form-group.js +2 -2
- package/src/vendor/bootstrap-vue/src/components/layout/col.js +2 -2
- package/src/vendor/bootstrap-vue/src/components/modal/modal.js +219 -52
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-filtering.js +30 -11
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-selectable.js +3 -3
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-sorting.js +1 -2
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody.js +4 -4
- package/src/vendor/bootstrap-vue/src/components/table/helpers/sanitize-row.js +2 -3
- package/src/vendor/bootstrap-vue/src/components/tabs/tabs.js +2 -2
- package/src/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip.js +8 -9
- package/src/vendor/bootstrap-vue/src/constants/config.js +2 -2
- package/src/vendor/bootstrap-vue/src/directives/tooltip/tooltip.js +1 -1
- package/src/vendor/bootstrap-vue/src/mixins/listen-on-document.js +1 -2
- package/src/vendor/bootstrap-vue/src/mixins/listen-on-root.js +1 -2
- package/src/vendor/bootstrap-vue/src/mixins/listen-on-window.js +1 -2
- package/src/vendor/bootstrap-vue/src/utils/array.js +0 -1
- package/src/vendor/bootstrap-vue/src/utils/locale.js +1 -2
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { isVue3 } from '../vue';
|
|
2
|
+
|
|
3
|
+
// Regex to detect event handler props: onSomething or onSomethingOnce
|
|
4
|
+
const EVENT_HANDLER_RE = /^on([A-Z][a-zA-Z]*)$/;
|
|
5
|
+
const ONCE_SUFFIX = 'Once';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Converts an event name to a handler prop name.
|
|
9
|
+
* Use as computed property key with event constants: [eventProp(EVENT_NAME_HIDDEN)]
|
|
10
|
+
* @param {string} eventName - The event name (e.g., 'hidden', 'show', 'mouseenter')
|
|
11
|
+
* @param {Object} options - Options object
|
|
12
|
+
* @param {boolean} options.once - If true, returns the "once" variant (e.g., 'onHiddenOnce')
|
|
13
|
+
* @returns {string} The handler prop name (e.g., 'onHidden', 'onHiddenOnce')
|
|
14
|
+
*/
|
|
15
|
+
const eventProp = function (eventName) {
|
|
16
|
+
let {
|
|
17
|
+
once = false
|
|
18
|
+
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
19
|
+
const capitalized = eventName.charAt(0).toUpperCase() + eventName.slice(1);
|
|
20
|
+
return `on${capitalized}${once ? ONCE_SUFFIX : ''}`;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Parses a handler prop name to extract event name and once flag.
|
|
25
|
+
* Examples:
|
|
26
|
+
* onShow -> { eventName: 'show', once: false }
|
|
27
|
+
* onShowOnce -> { eventName: 'show', once: true }
|
|
28
|
+
* onMouseenter -> { eventName: 'mouseenter', once: false }
|
|
29
|
+
*/
|
|
30
|
+
const parseEventHandlerProp = propName => {
|
|
31
|
+
const match = propName.match(EVENT_HANDLER_RE);
|
|
32
|
+
if (!match) return null;
|
|
33
|
+
let eventPart = match[1];
|
|
34
|
+
const once = eventPart.endsWith(ONCE_SUFFIX);
|
|
35
|
+
if (once) eventPart = eventPart.slice(0, -ONCE_SUFFIX.length);
|
|
36
|
+
const eventName = eventPart.charAt(0).toLowerCase() + eventPart.slice(1);
|
|
37
|
+
return {
|
|
38
|
+
eventName,
|
|
39
|
+
once
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Extracts event handlers from config and separates them from other props.
|
|
45
|
+
* @param {Object} config - The config object with potential event handler props
|
|
46
|
+
* @returns {{ handlers: Array<{eventName: string, handler: Function, once: boolean}>, cleanConfig: Object }}
|
|
47
|
+
*/
|
|
48
|
+
const extractEventHandlers = config => {
|
|
49
|
+
const handlers = [];
|
|
50
|
+
const cleanConfig = {
|
|
51
|
+
...config
|
|
52
|
+
};
|
|
53
|
+
if (cleanConfig.propsData) {
|
|
54
|
+
const cleanPropsData = {};
|
|
55
|
+
Object.keys(cleanConfig.propsData).forEach(propName => {
|
|
56
|
+
const parsed = parseEventHandlerProp(propName);
|
|
57
|
+
if (parsed && typeof cleanConfig.propsData[propName] === 'function') {
|
|
58
|
+
handlers.push({
|
|
59
|
+
...parsed,
|
|
60
|
+
handler: cleanConfig.propsData[propName]
|
|
61
|
+
});
|
|
62
|
+
} else {
|
|
63
|
+
cleanPropsData[propName] = cleanConfig.propsData[propName];
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
cleanConfig.propsData = cleanPropsData;
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
handlers,
|
|
70
|
+
cleanConfig
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
const getVue3Constructor = parent => {
|
|
74
|
+
return parent.$.appContext.config.globalProperties.constructor;
|
|
75
|
+
};
|
|
76
|
+
const BUILTIN_DIRECTIVES = ['show', 'model', 'bind', 'cloak', 'else', 'else-if', 'for', 'html', 'if', 'memo', 'on', 'once', 'pre', 'slot', 'text'];
|
|
77
|
+
const resolveComponentOptions = Component => {
|
|
78
|
+
const opts = typeof Component === 'function' && Component.options ? {
|
|
79
|
+
...Component.options
|
|
80
|
+
} : {
|
|
81
|
+
...Component
|
|
82
|
+
};
|
|
83
|
+
if (opts.directives) {
|
|
84
|
+
opts.directives = Object.fromEntries(Object.entries(opts.directives).filter(_ref => {
|
|
85
|
+
let [key] = _ref;
|
|
86
|
+
return !BUILTIN_DIRECTIVES.includes(key);
|
|
87
|
+
}));
|
|
88
|
+
}
|
|
89
|
+
return opts;
|
|
90
|
+
};
|
|
91
|
+
const createNewChildComponent = function (parent, Component) {
|
|
92
|
+
let config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
93
|
+
const bvEventRoot = parent.$root ? parent.$root.$options.bvEventRoot || parent.$root : null;
|
|
94
|
+
|
|
95
|
+
// Vue 3: resolve component options and instantiate via the Vue constructor
|
|
96
|
+
// to ensure the component runs through the Vue 3 runtime path
|
|
97
|
+
if (isVue3(parent)) {
|
|
98
|
+
const Vue = getVue3Constructor(parent);
|
|
99
|
+
const componentOptions = resolveComponentOptions(Component);
|
|
100
|
+
return new Vue({
|
|
101
|
+
...componentOptions,
|
|
102
|
+
...config,
|
|
103
|
+
parent,
|
|
104
|
+
bvParent: parent,
|
|
105
|
+
bvEventRoot
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// Vue 2: extract handlers and subscribe manually after creation
|
|
110
|
+
const {
|
|
111
|
+
handlers,
|
|
112
|
+
cleanConfig
|
|
113
|
+
} = extractEventHandlers(config);
|
|
114
|
+
const instance = new Component({
|
|
115
|
+
...cleanConfig,
|
|
116
|
+
parent,
|
|
117
|
+
bvParent: parent,
|
|
118
|
+
bvEventRoot
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
// Subscribe to events using $on/$once
|
|
122
|
+
handlers.forEach(_ref2 => {
|
|
123
|
+
let {
|
|
124
|
+
eventName,
|
|
125
|
+
handler,
|
|
126
|
+
once
|
|
127
|
+
} = _ref2;
|
|
128
|
+
instance[once ? '$once' : '$on'](eventName, handler);
|
|
129
|
+
});
|
|
130
|
+
return instance;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export { createNewChildComponent, eventProp };
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { toString } from './string';
|
|
2
|
+
|
|
3
|
+
const escapeChar = value => '\\' + value;
|
|
4
|
+
|
|
5
|
+
// The `cssEscape()` util is based on this `CSS.escape()` polyfill:
|
|
6
|
+
// https://github.com/mathiasbynens/CSS.escape
|
|
7
|
+
const cssEscape = value => {
|
|
8
|
+
value = toString(value);
|
|
9
|
+
const length = value.length;
|
|
10
|
+
const firstCharCode = value.charCodeAt(0);
|
|
11
|
+
return value.split('').reduce((result, char, index) => {
|
|
12
|
+
const charCode = value.charCodeAt(index);
|
|
13
|
+
|
|
14
|
+
// If the character is NULL (U+0000), use (U+FFFD) as replacement
|
|
15
|
+
if (charCode === 0x0000) {
|
|
16
|
+
return result + '\uFFFD';
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// If the character ...
|
|
20
|
+
if (
|
|
21
|
+
// ... is U+007F OR
|
|
22
|
+
charCode === 0x007f ||
|
|
23
|
+
// ... is in the range [\1-\1F] (U+0001 to U+001F) OR ...
|
|
24
|
+
charCode >= 0x0001 && charCode <= 0x001f ||
|
|
25
|
+
// ... is the first character and is in the range [0-9] (U+0030 to U+0039) OR ...
|
|
26
|
+
index === 0 && charCode >= 0x0030 && charCode <= 0x0039 ||
|
|
27
|
+
// ... is the second character and is in the range [0-9] (U+0030 to U+0039)
|
|
28
|
+
// and the first character is a `-` (U+002D) ...
|
|
29
|
+
index === 1 && charCode >= 0x0030 && charCode <= 0x0039 && firstCharCode === 0x002d) {
|
|
30
|
+
// ... https://drafts.csswg.org/cssom/#escape-a-character-as-code-point
|
|
31
|
+
return result + escapeChar(`${charCode.toString(16)} `);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// If the character ...
|
|
35
|
+
if (
|
|
36
|
+
// ... is the first character AND ...
|
|
37
|
+
index === 0 &&
|
|
38
|
+
// ... is a `-` (U+002D) AND ...
|
|
39
|
+
charCode === 0x002d &&
|
|
40
|
+
// ... there is no second character ...
|
|
41
|
+
length === 1) {
|
|
42
|
+
// ... use the escaped character
|
|
43
|
+
return result + escapeChar(char);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// If the character ...
|
|
47
|
+
if (
|
|
48
|
+
// ... is greater than or equal to U+0080 OR ...
|
|
49
|
+
charCode >= 0x0080 ||
|
|
50
|
+
// ... is `-` (U+002D) OR ...
|
|
51
|
+
charCode === 0x002d ||
|
|
52
|
+
// ... is `_` (U+005F) OR ...
|
|
53
|
+
charCode === 0x005f ||
|
|
54
|
+
// ... is in the range [0-9] (U+0030 to U+0039) OR ...
|
|
55
|
+
charCode >= 0x0030 && charCode <= 0x0039 ||
|
|
56
|
+
// ... is in the range [A-Z] (U+0041 to U+005A) OR ...
|
|
57
|
+
charCode >= 0x0041 && charCode <= 0x005a ||
|
|
58
|
+
// ... is in the range [a-z] (U+0061 to U+007A) ...
|
|
59
|
+
charCode >= 0x0061 && charCode <= 0x007a) {
|
|
60
|
+
// ... use the character itself
|
|
61
|
+
return result + char;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Otherwise use the escaped character
|
|
65
|
+
// See: https://drafts.csswg.org/cssom/#escape-a-character
|
|
66
|
+
return result + escapeChar(char);
|
|
67
|
+
}, '');
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export { cssEscape };
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import { WINDOW, DOCUMENT } from '../constants/env';
|
|
2
|
+
import { Element } from '../constants/safe-types';
|
|
3
|
+
import { from } from './array';
|
|
4
|
+
import { isNull, isFunction } from './inspect';
|
|
5
|
+
import { toFloat } from './number';
|
|
6
|
+
import { toString } from './string';
|
|
7
|
+
|
|
8
|
+
// --- Constants ---
|
|
9
|
+
|
|
10
|
+
const ELEMENT_PROTO = Element.prototype;
|
|
11
|
+
const TABABLE_SELECTOR = ['button', '[href]:not(.disabled)', 'input', 'select', 'textarea', '[tabindex]', '[contenteditable]'].map(s => `${s}:not(:disabled):not([disabled])`).join(', ');
|
|
12
|
+
|
|
13
|
+
// --- Normalization utils ---
|
|
14
|
+
|
|
15
|
+
// See: https://developer.mozilla.org/en-US/docs/Web/API/Element/matches#Polyfill
|
|
16
|
+
/* istanbul ignore next */
|
|
17
|
+
const matchesEl = ELEMENT_PROTO.matches || ELEMENT_PROTO.msMatchesSelector || ELEMENT_PROTO.webkitMatchesSelector;
|
|
18
|
+
|
|
19
|
+
// See: https://developer.mozilla.org/en-US/docs/Web/API/Element/closest
|
|
20
|
+
/* istanbul ignore next */
|
|
21
|
+
const closestEl = ELEMENT_PROTO.closest || function (sel) {
|
|
22
|
+
let el = this;
|
|
23
|
+
do {
|
|
24
|
+
// Use our "patched" matches function
|
|
25
|
+
if (matches(el, sel)) {
|
|
26
|
+
return el;
|
|
27
|
+
}
|
|
28
|
+
el = el.parentElement || el.parentNode;
|
|
29
|
+
} while (!isNull(el) && el.nodeType === Node.ELEMENT_NODE);
|
|
30
|
+
return null;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// `requestAnimationFrame()` convenience method
|
|
34
|
+
/* istanbul ignore next: JSDOM always returns the first option */
|
|
35
|
+
const requestAF = (WINDOW.requestAnimationFrame || WINDOW.webkitRequestAnimationFrame || WINDOW.mozRequestAnimationFrame || WINDOW.msRequestAnimationFrame || WINDOW.oRequestAnimationFrame || (
|
|
36
|
+
// Fallback, but not a true polyfill
|
|
37
|
+
// Only needed for Opera Mini
|
|
38
|
+
/* istanbul ignore next */
|
|
39
|
+
cb => setTimeout(cb, 16))).bind(WINDOW);
|
|
40
|
+
const MutationObs = WINDOW.MutationObserver || WINDOW.WebKitMutationObserver || WINDOW.MozMutationObserver || null;
|
|
41
|
+
|
|
42
|
+
// --- Utils ---
|
|
43
|
+
|
|
44
|
+
// Remove a node from DOM
|
|
45
|
+
const removeNode = el => el && el.parentNode && el.parentNode.removeChild(el);
|
|
46
|
+
|
|
47
|
+
// Determine if an element is an HTML element
|
|
48
|
+
const isElement = el => !!(el && el.nodeType === Node.ELEMENT_NODE);
|
|
49
|
+
|
|
50
|
+
// Get the currently active HTML element
|
|
51
|
+
const getActiveElement = function () {
|
|
52
|
+
let excludes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
53
|
+
const {
|
|
54
|
+
activeElement
|
|
55
|
+
} = DOCUMENT;
|
|
56
|
+
return activeElement && !excludes.some(el => el === activeElement) ? activeElement : null;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// Returns `true` if a tag's name equals `name`
|
|
60
|
+
const isTag = (tag, name) => toString(tag).toLowerCase() === toString(name).toLowerCase();
|
|
61
|
+
|
|
62
|
+
// Determine if an HTML element is the currently active element
|
|
63
|
+
const isActiveElement = el => isElement(el) && el === getActiveElement();
|
|
64
|
+
|
|
65
|
+
// Determine if an HTML element is visible - Faster than CSS check
|
|
66
|
+
const isVisible = el => {
|
|
67
|
+
if (!isElement(el) || !el.parentNode || !contains(DOCUMENT.body, el)) {
|
|
68
|
+
// Note this can fail for shadow dom elements since they
|
|
69
|
+
// are not a direct descendant of document.body
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
if (getStyle(el, 'display') === 'none') {
|
|
73
|
+
// We do this check to help with vue-test-utils when using v-show
|
|
74
|
+
/* istanbul ignore next */
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
// All browsers support getBoundingClientRect(), except JSDOM as it returns all 0's for values :(
|
|
78
|
+
// So any tests that need isVisible will fail in JSDOM
|
|
79
|
+
// Except when we override the getBCR prototype in some tests
|
|
80
|
+
const bcr = getBCR(el);
|
|
81
|
+
return !!(bcr && bcr.height > 0 && bcr.width > 0);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// Determine if an element is disabled
|
|
85
|
+
const isDisabled = el => !isElement(el) || el.disabled || hasAttr(el, 'disabled') || hasClass(el, 'disabled');
|
|
86
|
+
|
|
87
|
+
// Cause/wait-for an element to reflow its content (adjusting its height/width)
|
|
88
|
+
const reflow = el => {
|
|
89
|
+
// Requesting an elements offsetHight will trigger a reflow of the element content
|
|
90
|
+
/* istanbul ignore next: reflow doesn't happen in JSDOM */
|
|
91
|
+
return isElement(el) && el.offsetHeight;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
// Select all elements matching selector. Returns `[]` if none found
|
|
95
|
+
const selectAll = (selector, root) => from((isElement(root) ? root : DOCUMENT).querySelectorAll(selector));
|
|
96
|
+
|
|
97
|
+
// Select a single element, returns `null` if not found
|
|
98
|
+
const select = (selector, root) => (isElement(root) ? root : DOCUMENT).querySelector(selector) || null;
|
|
99
|
+
|
|
100
|
+
// Determine if an element matches a selector
|
|
101
|
+
const matches = (el, selector) => isElement(el) ? matchesEl.call(el, selector) : false;
|
|
102
|
+
|
|
103
|
+
// Finds closest element matching selector. Returns `null` if not found
|
|
104
|
+
const closest = function (selector, root) {
|
|
105
|
+
let includeRoot = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
106
|
+
if (!isElement(root)) {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
const el = closestEl.call(root, selector);
|
|
110
|
+
|
|
111
|
+
// Native closest behaviour when `includeRoot` is truthy,
|
|
112
|
+
// else emulate jQuery closest and return `null` if match is
|
|
113
|
+
// the passed in root element when `includeRoot` is falsey
|
|
114
|
+
return includeRoot ? el : el === root ? null : el;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
// Returns true if the parent element contains the child element
|
|
118
|
+
const contains = (parent, child) => parent && isFunction(parent.contains) ? parent.contains(child) : false;
|
|
119
|
+
|
|
120
|
+
// Get an element given an ID
|
|
121
|
+
const getById = id => DOCUMENT.getElementById(/^#/.test(id) ? id.slice(1) : id) || null;
|
|
122
|
+
|
|
123
|
+
// Add a class to an element
|
|
124
|
+
const addClass = (el, className) => {
|
|
125
|
+
// We are checking for `el.classList` existence here since IE 11
|
|
126
|
+
// returns `undefined` for some elements (e.g. SVG elements)
|
|
127
|
+
// See https://github.com/bootstrap-vue/bootstrap-vue/issues/2713
|
|
128
|
+
if (className && isElement(el) && el.classList) {
|
|
129
|
+
el.classList.add(className);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
// Remove a class from an element
|
|
134
|
+
const removeClass = (el, className) => {
|
|
135
|
+
// We are checking for `el.classList` existence here since IE 11
|
|
136
|
+
// returns `undefined` for some elements (e.g. SVG elements)
|
|
137
|
+
// See https://github.com/bootstrap-vue/bootstrap-vue/issues/2713
|
|
138
|
+
if (className && isElement(el) && el.classList) {
|
|
139
|
+
el.classList.remove(className);
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
// Test if an element has a class
|
|
144
|
+
const hasClass = (el, className) => {
|
|
145
|
+
// We are checking for `el.classList` existence here since IE 11
|
|
146
|
+
// returns `undefined` for some elements (e.g. SVG elements)
|
|
147
|
+
// See https://github.com/bootstrap-vue/bootstrap-vue/issues/2713
|
|
148
|
+
if (className && isElement(el) && el.classList) {
|
|
149
|
+
return el.classList.contains(className);
|
|
150
|
+
}
|
|
151
|
+
return false;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
// Set an attribute on an element
|
|
155
|
+
const setAttr = (el, attr, value) => {
|
|
156
|
+
if (attr && isElement(el)) {
|
|
157
|
+
el.setAttribute(attr, value);
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
// Remove an attribute from an element
|
|
162
|
+
const removeAttr = (el, attr) => {
|
|
163
|
+
if (attr && isElement(el)) {
|
|
164
|
+
el.removeAttribute(attr);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
// Get an attribute value from an element
|
|
169
|
+
// Returns `null` if not found
|
|
170
|
+
const getAttr = (el, attr) => attr && isElement(el) ? el.getAttribute(attr) : null;
|
|
171
|
+
|
|
172
|
+
// Determine if an attribute exists on an element
|
|
173
|
+
// Returns `true` or `false`, or `null` if element not found
|
|
174
|
+
const hasAttr = (el, attr) => attr && isElement(el) ? el.hasAttribute(attr) : null;
|
|
175
|
+
|
|
176
|
+
// Set an style property on an element
|
|
177
|
+
const setStyle = (el, prop, value) => {
|
|
178
|
+
if (prop && isElement(el)) {
|
|
179
|
+
el.style[prop] = value;
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
// Remove an style property from an element
|
|
184
|
+
const removeStyle = (el, prop) => {
|
|
185
|
+
if (prop && isElement(el)) {
|
|
186
|
+
el.style[prop] = '';
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
// Get an style property value from an element
|
|
191
|
+
// Returns `null` if not found
|
|
192
|
+
const getStyle = (el, prop) => prop && isElement(el) ? el.style[prop] || null : null;
|
|
193
|
+
|
|
194
|
+
// Return the Bounding Client Rect of an element
|
|
195
|
+
// Returns `null` if not an element
|
|
196
|
+
/* istanbul ignore next: getBoundingClientRect() doesn't work in JSDOM */
|
|
197
|
+
const getBCR = el => isElement(el) ? el.getBoundingClientRect() : null;
|
|
198
|
+
|
|
199
|
+
// Get computed style object for an element
|
|
200
|
+
/* istanbul ignore next: getComputedStyle() doesn't work in JSDOM */
|
|
201
|
+
const getCS = el => {
|
|
202
|
+
const {
|
|
203
|
+
getComputedStyle
|
|
204
|
+
} = WINDOW;
|
|
205
|
+
return getComputedStyle && isElement(el) ? getComputedStyle(el) : {};
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
// Returns a `Selection` object representing the range of text selected
|
|
209
|
+
// Returns `null` if no window support is given
|
|
210
|
+
/* istanbul ignore next: getSelection() doesn't work in JSDOM */
|
|
211
|
+
const getSel = () => {
|
|
212
|
+
const {
|
|
213
|
+
getSelection
|
|
214
|
+
} = WINDOW;
|
|
215
|
+
return getSelection ? WINDOW.getSelection() : null;
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
// Return an element's offset with respect to document element
|
|
219
|
+
// https://j11y.io/jquery/#v=git&fn=jQuery.fn.offset
|
|
220
|
+
const offset = el => /* istanbul ignore next: getBoundingClientRect(), getClientRects() doesn't work in JSDOM */{
|
|
221
|
+
const _offset = {
|
|
222
|
+
top: 0,
|
|
223
|
+
left: 0
|
|
224
|
+
};
|
|
225
|
+
if (!isElement(el) || el.getClientRects().length === 0) {
|
|
226
|
+
return _offset;
|
|
227
|
+
}
|
|
228
|
+
const bcr = getBCR(el);
|
|
229
|
+
if (bcr) {
|
|
230
|
+
const win = el.ownerDocument.defaultView;
|
|
231
|
+
_offset.top = bcr.top + win.pageYOffset;
|
|
232
|
+
_offset.left = bcr.left + win.pageXOffset;
|
|
233
|
+
}
|
|
234
|
+
return _offset;
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
// Return an element's offset with respect to to its offsetParent
|
|
238
|
+
// https://j11y.io/jquery/#v=git&fn=jQuery.fn.position
|
|
239
|
+
const position = el => /* istanbul ignore next: getBoundingClientRect() doesn't work in JSDOM */{
|
|
240
|
+
let _offset = {
|
|
241
|
+
top: 0,
|
|
242
|
+
left: 0
|
|
243
|
+
};
|
|
244
|
+
if (!isElement(el)) {
|
|
245
|
+
return _offset;
|
|
246
|
+
}
|
|
247
|
+
let parentOffset = {
|
|
248
|
+
top: 0,
|
|
249
|
+
left: 0
|
|
250
|
+
};
|
|
251
|
+
const elStyles = getCS(el);
|
|
252
|
+
if (elStyles.position === 'fixed') {
|
|
253
|
+
_offset = getBCR(el) || _offset;
|
|
254
|
+
} else {
|
|
255
|
+
_offset = offset(el);
|
|
256
|
+
const doc = el.ownerDocument;
|
|
257
|
+
let offsetParent = el.offsetParent || doc.documentElement;
|
|
258
|
+
while (offsetParent && (offsetParent === doc.body || offsetParent === doc.documentElement) && getCS(offsetParent).position === 'static') {
|
|
259
|
+
offsetParent = offsetParent.parentNode;
|
|
260
|
+
}
|
|
261
|
+
if (offsetParent && offsetParent !== el && offsetParent.nodeType === Node.ELEMENT_NODE) {
|
|
262
|
+
parentOffset = offset(offsetParent);
|
|
263
|
+
const offsetParentStyles = getCS(offsetParent);
|
|
264
|
+
parentOffset.top += toFloat(offsetParentStyles.borderTopWidth, 0);
|
|
265
|
+
parentOffset.left += toFloat(offsetParentStyles.borderLeftWidth, 0);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
return {
|
|
269
|
+
top: _offset.top - parentOffset.top - toFloat(elStyles.marginTop, 0),
|
|
270
|
+
left: _offset.left - parentOffset.left - toFloat(elStyles.marginLeft, 0)
|
|
271
|
+
};
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
// Find all tabable elements in the given element
|
|
275
|
+
// Assumes users have not used `tabindex` > `0` on elements
|
|
276
|
+
const getTabables = function () {
|
|
277
|
+
let rootEl = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
|
|
278
|
+
return selectAll(TABABLE_SELECTOR, rootEl).filter(isVisible).filter(el => el.tabIndex > -1 && !el.disabled);
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
// Attempt to focus an element, and return `true` if successful
|
|
282
|
+
const attemptFocus = function (el) {
|
|
283
|
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
284
|
+
try {
|
|
285
|
+
el.focus(options);
|
|
286
|
+
} catch {}
|
|
287
|
+
return isActiveElement(el);
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
// Attempt to blur an element, and return `true` if successful
|
|
291
|
+
const attemptBlur = el => {
|
|
292
|
+
try {
|
|
293
|
+
el.blur();
|
|
294
|
+
} catch {}
|
|
295
|
+
return !isActiveElement(el);
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
export { MutationObs, addClass, attemptBlur, attemptFocus, closest, closestEl, contains, getActiveElement, getAttr, getBCR, getById, getCS, getSel, getStyle, getTabables, hasAttr, hasClass, isActiveElement, isDisabled, isElement, isTag, isVisible, matches, matchesEl, offset, position, reflow, removeAttr, removeClass, removeNode, removeStyle, requestAF, select, selectAll, setAttr, setStyle };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { isVue3 } from '../vue';
|
|
2
|
+
|
|
3
|
+
const registry = new WeakMap();
|
|
4
|
+
const registerElementToInstance = (element, instance) => {
|
|
5
|
+
if (!isVue3(instance)) {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
registry.set(element, instance);
|
|
9
|
+
};
|
|
10
|
+
const removeElementToInstance = element => {
|
|
11
|
+
registry.delete(element);
|
|
12
|
+
};
|
|
13
|
+
const getInstanceFromElement = element => {
|
|
14
|
+
if (element.__vue__) {
|
|
15
|
+
return element.__vue__;
|
|
16
|
+
}
|
|
17
|
+
let currentElement = element;
|
|
18
|
+
while (currentElement) {
|
|
19
|
+
if (registry.has(currentElement)) {
|
|
20
|
+
/* istanbul ignore next */
|
|
21
|
+
return registry.get(currentElement);
|
|
22
|
+
}
|
|
23
|
+
currentElement = currentElement.parentNode;
|
|
24
|
+
}
|
|
25
|
+
return null;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export { getInstanceFromElement, registerElementToInstance, removeElementToInstance };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utilities to get information about the current environment
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const getEnv = function (key) {
|
|
6
|
+
let fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
7
|
+
const env = typeof process !== 'undefined' && process ? process.env || {} : {};
|
|
8
|
+
if (!key) {
|
|
9
|
+
/* istanbul ignore next */
|
|
10
|
+
return env;
|
|
11
|
+
}
|
|
12
|
+
return env[key] || fallback;
|
|
13
|
+
};
|
|
14
|
+
const getNoWarn = () => getEnv('BOOTSTRAP_VUE_NO_WARN') || getEnv('NODE_ENV') === 'production';
|
|
15
|
+
|
|
16
|
+
export { getEnv, getNoWarn };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { HAS_PASSIVE_EVENT_SUPPORT } from '../constants/env';
|
|
2
|
+
import { ROOT_EVENT_NAME_PREFIX, ROOT_EVENT_NAME_SEPARATOR } from '../constants/events';
|
|
3
|
+
import { RX_BV_PREFIX } from '../constants/regex';
|
|
4
|
+
import { isObject } from './inspect';
|
|
5
|
+
import { kebabCase } from './string';
|
|
6
|
+
|
|
7
|
+
// --- Utils ---
|
|
8
|
+
|
|
9
|
+
// Normalize event options based on support of passive option
|
|
10
|
+
// Exported only for testing purposes
|
|
11
|
+
const parseEventOptions = options => {
|
|
12
|
+
/* istanbul ignore else: can't test in JSDOM, as it supports passive */
|
|
13
|
+
if (HAS_PASSIVE_EVENT_SUPPORT) {
|
|
14
|
+
return isObject(options) ? options : {
|
|
15
|
+
capture: !!options || false
|
|
16
|
+
};
|
|
17
|
+
} else {
|
|
18
|
+
// Need to translate to actual Boolean value
|
|
19
|
+
return !!(isObject(options) ? options.capture : options);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// Attach an event listener to an element
|
|
24
|
+
const eventOn = (el, eventName, handler, options) => {
|
|
25
|
+
if (el && el.addEventListener) {
|
|
26
|
+
el.addEventListener(eventName, handler, parseEventOptions(options));
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// Remove an event listener from an element
|
|
31
|
+
const eventOff = (el, eventName, handler, options) => {
|
|
32
|
+
if (el && el.removeEventListener) {
|
|
33
|
+
el.removeEventListener(eventName, handler, parseEventOptions(options));
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// Utility method to add/remove a event listener based on first argument (boolean)
|
|
38
|
+
// It passes all other arguments to the `eventOn()` or `eventOff` method
|
|
39
|
+
const eventOnOff = function (on) {
|
|
40
|
+
const method = on ? eventOn : eventOff;
|
|
41
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
42
|
+
args[_key - 1] = arguments[_key];
|
|
43
|
+
}
|
|
44
|
+
method(...args);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// Utility method to prevent the default event handling and propagation
|
|
48
|
+
const stopEvent = function (event) {
|
|
49
|
+
let {
|
|
50
|
+
preventDefault = true,
|
|
51
|
+
propagation = true,
|
|
52
|
+
immediatePropagation = false
|
|
53
|
+
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
54
|
+
if (preventDefault) {
|
|
55
|
+
event.preventDefault();
|
|
56
|
+
}
|
|
57
|
+
if (propagation) {
|
|
58
|
+
event.stopPropagation();
|
|
59
|
+
}
|
|
60
|
+
if (immediatePropagation) {
|
|
61
|
+
event.stopImmediatePropagation();
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
// Helper method to convert a component/directive name to a base event name
|
|
66
|
+
// `getBaseEventName('BNavigationItem')` => 'navigation-item'
|
|
67
|
+
// `getBaseEventName('BVToggle')` => 'toggle'
|
|
68
|
+
const getBaseEventName = value => kebabCase(value.replace(RX_BV_PREFIX, ''));
|
|
69
|
+
|
|
70
|
+
// Get a root event name by component/directive and event name
|
|
71
|
+
// `getBaseEventName('BModal', 'show')` => 'bv::modal::show'
|
|
72
|
+
const getRootEventName = (name, eventName) => [ROOT_EVENT_NAME_PREFIX, getBaseEventName(name), eventName].join(ROOT_EVENT_NAME_SEPARATOR);
|
|
73
|
+
|
|
74
|
+
// Get a root action event name by component/directive and action name
|
|
75
|
+
// `getRootActionEventName('BModal', 'show')` => 'bv::show::modal'
|
|
76
|
+
const getRootActionEventName = (name, actionName) => [ROOT_EVENT_NAME_PREFIX, actionName, getBaseEventName(name)].join(ROOT_EVENT_NAME_SEPARATOR);
|
|
77
|
+
|
|
78
|
+
export { eventOff, eventOn, eventOnOff, getRootActionEventName, getRootEventName, parseEventOptions, stopEvent };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// This method returns a component's scoped style attribute name: `data-v-xxxxxxx`
|
|
2
|
+
// The `_scopeId` options property is added by vue-loader when using scoped styles
|
|
3
|
+
// and will be `undefined` if no scoped styles are in use
|
|
4
|
+
const getScopeId = function (vm) {
|
|
5
|
+
let defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
6
|
+
return vm ? vm.$options._scopeId || defaultValue : defaultValue;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export { getScopeId };
|