@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,120 @@
|
|
|
1
|
+
import { extend } from '../vue';
|
|
2
|
+
import { keys } from '../utils/object';
|
|
3
|
+
import { getEventRoot } from '../utils/get-event-root';
|
|
4
|
+
|
|
5
|
+
// --- Constants ---
|
|
6
|
+
|
|
7
|
+
const PROP = '$_rootListeners';
|
|
8
|
+
|
|
9
|
+
// --- Mixin ---
|
|
10
|
+
|
|
11
|
+
// @vue/component
|
|
12
|
+
const listenOnRootMixin = extend({
|
|
13
|
+
computed: {
|
|
14
|
+
bvEventRoot() {
|
|
15
|
+
return getEventRoot(this);
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
created() {
|
|
19
|
+
// Define non-reactive property
|
|
20
|
+
// Object of arrays, keyed by event name,
|
|
21
|
+
// where value is an array of callbacks
|
|
22
|
+
this[PROP] = {};
|
|
23
|
+
},
|
|
24
|
+
beforeDestroy() {
|
|
25
|
+
// Unregister all registered listeners
|
|
26
|
+
keys(this[PROP] || {}).forEach(event => {
|
|
27
|
+
this[PROP][event].forEach(callback => {
|
|
28
|
+
this.listenOffRoot(event, callback);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
this[PROP] = null;
|
|
32
|
+
},
|
|
33
|
+
methods: {
|
|
34
|
+
registerRootListener(event, callback) {
|
|
35
|
+
if (this[PROP]) {
|
|
36
|
+
this[PROP][event] = this[PROP][event] || [];
|
|
37
|
+
if (!this[PROP][event].includes(callback)) {
|
|
38
|
+
this[PROP][event].push(callback);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
unregisterRootListener(event, callback) {
|
|
43
|
+
if (this[PROP] && this[PROP][event]) {
|
|
44
|
+
this[PROP][event] = this[PROP][event].filter(cb => cb !== callback);
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
/**
|
|
48
|
+
* Safely register event listeners on the root Vue node
|
|
49
|
+
* While Vue automatically removes listeners for individual components,
|
|
50
|
+
* when a component registers a listener on `$root` and is destroyed,
|
|
51
|
+
* this orphans a callback because the node is gone, but the `$root`
|
|
52
|
+
* does not clear the callback
|
|
53
|
+
*
|
|
54
|
+
* When registering a `$root` listener, it also registers the listener
|
|
55
|
+
* to be removed in the component's `beforeDestroy()` hook
|
|
56
|
+
*
|
|
57
|
+
* @param {string} event
|
|
58
|
+
* @param {function} callback
|
|
59
|
+
*/
|
|
60
|
+
listenOnRoot(event, callback) {
|
|
61
|
+
if (this.bvEventRoot) {
|
|
62
|
+
this.bvEventRoot.$on(event, callback);
|
|
63
|
+
this.registerRootListener(event, callback);
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
/**
|
|
67
|
+
* Safely register a `$once()` event listener on the root Vue node
|
|
68
|
+
* While Vue automatically removes listeners for individual components,
|
|
69
|
+
* when a component registers a listener on `$root` and is destroyed,
|
|
70
|
+
* this orphans a callback because the node is gone, but the `$root`
|
|
71
|
+
* does not clear the callback
|
|
72
|
+
*
|
|
73
|
+
* When registering a `$root` listener, it also registers the listener
|
|
74
|
+
* to be removed in the component's `beforeDestroy()` hook
|
|
75
|
+
*
|
|
76
|
+
* @param {string} event
|
|
77
|
+
* @param {function} callback
|
|
78
|
+
*/
|
|
79
|
+
listenOnRootOnce(event, callback) {
|
|
80
|
+
var _this = this;
|
|
81
|
+
if (this.bvEventRoot) {
|
|
82
|
+
const _callback = function () {
|
|
83
|
+
_this.unregisterRootListener(_callback);
|
|
84
|
+
// eslint-disable-next-line node/no-callback-literal
|
|
85
|
+
callback(...arguments);
|
|
86
|
+
};
|
|
87
|
+
this.bvEventRoot.$once(event, _callback);
|
|
88
|
+
this.registerRootListener(event, _callback);
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
/**
|
|
92
|
+
* Safely unregister event listeners from the root Vue node
|
|
93
|
+
*
|
|
94
|
+
* @param {string} event
|
|
95
|
+
* @param {function} callback
|
|
96
|
+
*/
|
|
97
|
+
listenOffRoot(event, callback) {
|
|
98
|
+
this.unregisterRootListener(event, callback);
|
|
99
|
+
if (this.bvEventRoot) {
|
|
100
|
+
this.bvEventRoot.$off(event, callback);
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
/**
|
|
104
|
+
* Convenience method for calling `vm.$emit()` on `$root`
|
|
105
|
+
*
|
|
106
|
+
* @param {string} event
|
|
107
|
+
* @param {*} args
|
|
108
|
+
*/
|
|
109
|
+
emitOnRoot(event) {
|
|
110
|
+
if (this.bvEventRoot) {
|
|
111
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
112
|
+
args[_key - 1] = arguments[_key];
|
|
113
|
+
}
|
|
114
|
+
this.bvEventRoot.$emit(event, ...args);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
export { listenOnRootMixin };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { extend } from '../vue';
|
|
2
|
+
import { IS_BROWSER } from '../constants/env';
|
|
3
|
+
import { EVENT_OPTIONS_NO_CAPTURE } from '../constants/events';
|
|
4
|
+
import { eventOn, eventOff } from '../utils/events';
|
|
5
|
+
import { keys } from '../utils/object';
|
|
6
|
+
|
|
7
|
+
// --- Constants ---
|
|
8
|
+
|
|
9
|
+
const PROP = '$_windowListeners';
|
|
10
|
+
|
|
11
|
+
// --- Mixin ---
|
|
12
|
+
|
|
13
|
+
// @vue/component
|
|
14
|
+
const listenOnWindowMixin = extend({
|
|
15
|
+
created() {
|
|
16
|
+
// Define non-reactive property
|
|
17
|
+
// Object of arrays, keyed by event name,
|
|
18
|
+
// where value is an array of callbacks
|
|
19
|
+
this[PROP] = {};
|
|
20
|
+
},
|
|
21
|
+
beforeDestroy() {
|
|
22
|
+
// Unregister all registered listeners
|
|
23
|
+
keys(this[PROP] || {}).forEach(event => {
|
|
24
|
+
this[PROP][event].forEach(callback => {
|
|
25
|
+
this.listenOffWindow(event, callback);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
this[PROP] = null;
|
|
29
|
+
},
|
|
30
|
+
methods: {
|
|
31
|
+
registerWindowListener(event, callback) {
|
|
32
|
+
if (this[PROP]) {
|
|
33
|
+
this[PROP][event] = this[PROP][event] || [];
|
|
34
|
+
if (!this[PROP][event].includes(callback)) {
|
|
35
|
+
this[PROP][event].push(callback);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
unregisterWindowListener(event, callback) {
|
|
40
|
+
if (this[PROP] && this[PROP][event]) {
|
|
41
|
+
this[PROP][event] = this[PROP][event].filter(cb => cb !== callback);
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
listenWindow(on, event, callback) {
|
|
45
|
+
on ? this.listenOnWindow(event, callback) : this.listenOffWindow(event, callback);
|
|
46
|
+
},
|
|
47
|
+
listenOnWindow(event, callback) {
|
|
48
|
+
if (IS_BROWSER) {
|
|
49
|
+
eventOn(window, event, callback, EVENT_OPTIONS_NO_CAPTURE);
|
|
50
|
+
this.registerWindowListener(event, callback);
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
listenOffWindow(event, callback) {
|
|
54
|
+
if (IS_BROWSER) {
|
|
55
|
+
eventOff(window, event, callback, EVENT_OPTIONS_NO_CAPTURE);
|
|
56
|
+
}
|
|
57
|
+
this.unregisterWindowListener(event, callback);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
export { listenOnWindowMixin };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { isVue3 } from '../vue';
|
|
2
|
+
import { getInternalPropName, makePropCacheMixin } from '../utils/cache';
|
|
3
|
+
|
|
4
|
+
const internalPropName = getInternalPropName('bvListeners');
|
|
5
|
+
const listenersMixin = makePropCacheMixin('$listeners', 'bvListeners').extend({
|
|
6
|
+
created() {
|
|
7
|
+
if (!isVue3(this)) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
this[internalPropName] = {
|
|
11
|
+
// bug: this.$listeners is non-reactive in Vue.js 3 compat
|
|
12
|
+
...this.$listeners
|
|
13
|
+
};
|
|
14
|
+
},
|
|
15
|
+
beforeUpdate() {
|
|
16
|
+
if (!isVue3(this)) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
this[internalPropName] = {
|
|
20
|
+
...this.$listeners
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export { listenersMixin };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { extend } from '../vue';
|
|
2
|
+
import { SLOT_NAME_DEFAULT } from '../constants/slots';
|
|
3
|
+
import { hasNormalizedSlot, normalizeSlot } from '../utils/normalize-slot';
|
|
4
|
+
import { concat } from '../utils/array';
|
|
5
|
+
|
|
6
|
+
// @vue/component
|
|
7
|
+
const normalizeSlotMixin = extend({
|
|
8
|
+
methods: {
|
|
9
|
+
// Returns `true` if the either a `$scopedSlot` or `$slot` exists with the specified name
|
|
10
|
+
// `name` can be a string name or an array of names
|
|
11
|
+
hasNormalizedSlot() {
|
|
12
|
+
let name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : SLOT_NAME_DEFAULT;
|
|
13
|
+
let scopedSlots = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.$scopedSlots;
|
|
14
|
+
let slots = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.$slots;
|
|
15
|
+
return hasNormalizedSlot(name, scopedSlots, slots);
|
|
16
|
+
},
|
|
17
|
+
// Returns an array of rendered VNodes if slot found, otherwise `undefined`
|
|
18
|
+
// `name` can be a string name or an array of names
|
|
19
|
+
normalizeSlot() {
|
|
20
|
+
let name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : SLOT_NAME_DEFAULT;
|
|
21
|
+
let scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
22
|
+
let scopedSlots = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.$scopedSlots;
|
|
23
|
+
let slots = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : this.$slots;
|
|
24
|
+
const vNodes = normalizeSlot(name, scope, scopedSlots, slots);
|
|
25
|
+
return vNodes ? concat(vNodes) : vNodes;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export { normalizeSlotMixin };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { extend } from '../vue';
|
|
2
|
+
import { useParentMixin } from './use-parent';
|
|
3
|
+
import { getScopeId } from '../utils/get-scope-id';
|
|
4
|
+
|
|
5
|
+
// @vue/component
|
|
6
|
+
const scopedStyleMixin = extend({
|
|
7
|
+
mixins: [useParentMixin],
|
|
8
|
+
computed: {
|
|
9
|
+
scopedStyleAttrs() {
|
|
10
|
+
const scopeId = getScopeId(this.bvParent);
|
|
11
|
+
return scopeId ? {
|
|
12
|
+
[scopeId]: ''
|
|
13
|
+
} : {};
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export { scopedStyleMixin };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { extend } from '../vue';
|
|
2
|
+
|
|
3
|
+
// --- Mixin ---
|
|
4
|
+
|
|
5
|
+
// @vue/component
|
|
6
|
+
const useParentMixin = extend({
|
|
7
|
+
computed: {
|
|
8
|
+
bvParent() {
|
|
9
|
+
return this.$parent || this.$root === this && this.$options.bvParent;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export { useParentMixin };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { isFunction } from './inspect';
|
|
2
|
+
|
|
3
|
+
// --- Static ---
|
|
4
|
+
|
|
5
|
+
const from = function () {
|
|
6
|
+
return Array.from(...arguments);
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
// --- Instance ---
|
|
10
|
+
|
|
11
|
+
const concat = function () {
|
|
12
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
13
|
+
args[_key] = arguments[_key];
|
|
14
|
+
}
|
|
15
|
+
return Array.prototype.concat.apply([], args);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// --- Utilities ---
|
|
19
|
+
|
|
20
|
+
const createArray = (length, fillFn) => {
|
|
21
|
+
const mapFn = isFunction(fillFn) ? fillFn : () => fillFn;
|
|
22
|
+
return Array.apply(null, {
|
|
23
|
+
length
|
|
24
|
+
}).map(mapFn);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export { concat, createArray, from };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { assign, defineProperties, readonlyDescriptor, defineProperty } from './object';
|
|
2
|
+
|
|
3
|
+
class BvEvent {
|
|
4
|
+
constructor(type) {
|
|
5
|
+
let eventInit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
6
|
+
// Start by emulating native Event constructor
|
|
7
|
+
if (!type) {
|
|
8
|
+
/* istanbul ignore next */
|
|
9
|
+
throw new TypeError(`Failed to construct '${this.constructor.name}'. 1 argument required, ${arguments.length} given.`);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Merge defaults first, the eventInit, and the type last
|
|
13
|
+
// so it can't be overwritten
|
|
14
|
+
assign(this, BvEvent.Defaults, this.constructor.Defaults, eventInit, {
|
|
15
|
+
type
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
// Freeze some props as readonly, but leave them enumerable
|
|
19
|
+
defineProperties(this, {
|
|
20
|
+
type: readonlyDescriptor(),
|
|
21
|
+
cancelable: readonlyDescriptor(),
|
|
22
|
+
nativeEvent: readonlyDescriptor(),
|
|
23
|
+
target: readonlyDescriptor(),
|
|
24
|
+
relatedTarget: readonlyDescriptor(),
|
|
25
|
+
vueTarget: readonlyDescriptor(),
|
|
26
|
+
componentId: readonlyDescriptor()
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// Create a private variable using closure scoping
|
|
30
|
+
let defaultPrevented = false;
|
|
31
|
+
// Recreate preventDefault method. One way setter
|
|
32
|
+
this.preventDefault = function preventDefault() {
|
|
33
|
+
if (this.cancelable) {
|
|
34
|
+
defaultPrevented = true;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// Create `defaultPrevented` publicly accessible prop that
|
|
39
|
+
// can only be altered by the preventDefault method
|
|
40
|
+
defineProperty(this, 'defaultPrevented', {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get() {
|
|
43
|
+
return defaultPrevented;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
static get Defaults() {
|
|
48
|
+
return {
|
|
49
|
+
type: '',
|
|
50
|
+
cancelable: true,
|
|
51
|
+
nativeEvent: null,
|
|
52
|
+
target: null,
|
|
53
|
+
relatedTarget: null,
|
|
54
|
+
vueTarget: null,
|
|
55
|
+
componentId: null
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export { BvEvent };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { extend, isVue3 } from '../vue';
|
|
2
|
+
import { cloneDeep } from './clone-deep';
|
|
3
|
+
import { looseEqual } from './loose-equal';
|
|
4
|
+
import { hasOwnProperty, keys } from './object';
|
|
5
|
+
|
|
6
|
+
const isEmpty = value => !value || keys(value).length === 0;
|
|
7
|
+
const makePropWatcher = propName => ({
|
|
8
|
+
handler(newValue, oldValue) {
|
|
9
|
+
if (looseEqual(newValue, oldValue)) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
if (isEmpty(newValue) || isEmpty(oldValue)) {
|
|
13
|
+
this[propName] = cloneDeep(newValue);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
for (const key in oldValue) {
|
|
17
|
+
if (!hasOwnProperty(newValue, key)) {
|
|
18
|
+
this.$delete(this.$data[propName], key);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
for (const key in newValue) {
|
|
22
|
+
this.$set(this.$data[propName], key, newValue[key]);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
const getInternalPropName = proxyPropName => `bv_internal__${proxyPropName}`;
|
|
27
|
+
const makePropCacheMixin = (propName, proxyPropName) => {
|
|
28
|
+
const internalPropName = getInternalPropName(proxyPropName);
|
|
29
|
+
return extend({
|
|
30
|
+
data() {
|
|
31
|
+
return {
|
|
32
|
+
[internalPropName]: isVue3(this) ? null : cloneDeep(this[propName] || {})
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
computed: {
|
|
36
|
+
[proxyPropName]() {
|
|
37
|
+
if (internalPropName in this && this[internalPropName]) {
|
|
38
|
+
return this[internalPropName];
|
|
39
|
+
}
|
|
40
|
+
const result = {
|
|
41
|
+
...this[propName]
|
|
42
|
+
};
|
|
43
|
+
Object.keys(result).forEach(key => {
|
|
44
|
+
if (result[key] === undefined) {
|
|
45
|
+
delete result[key];
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
return result;
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
created() {
|
|
52
|
+
if (!isVue3(this)) {
|
|
53
|
+
// Work around unwanted re-renders: https://github.com/vuejs/vue/issues/10115
|
|
54
|
+
this.$watch(propName, makePropWatcher(internalPropName).handler);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export { getInternalPropName, makePropCacheMixin, makePropWatcher };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { isArray, isPlainObject } from './inspect';
|
|
2
|
+
import { keys } from './object';
|
|
3
|
+
|
|
4
|
+
const cloneDeep = function (obj) {
|
|
5
|
+
let defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : obj;
|
|
6
|
+
if (isArray(obj)) {
|
|
7
|
+
return obj.reduce((result, val) => [...result, cloneDeep(val, val)], []);
|
|
8
|
+
}
|
|
9
|
+
if (isPlainObject(obj)) {
|
|
10
|
+
return keys(obj).reduce((result, key) => ({
|
|
11
|
+
...result,
|
|
12
|
+
[key]: cloneDeep(obj[key], obj[key])
|
|
13
|
+
}), {});
|
|
14
|
+
}
|
|
15
|
+
return defaultValue;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { cloneDeep };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { NAME } from '../constants/config';
|
|
2
|
+
import { cloneDeep } from './clone-deep';
|
|
3
|
+
import { getRaw } from './get';
|
|
4
|
+
import { isPlainObject, isArray, isString, isUndefined } from './inspect';
|
|
5
|
+
import { getOwnPropertyNames } from './object';
|
|
6
|
+
import { warn } from './warn';
|
|
7
|
+
|
|
8
|
+
// Config manager class
|
|
9
|
+
class BvConfig {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.$_config = {};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Method to merge in user config parameters
|
|
15
|
+
setConfig() {
|
|
16
|
+
let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
17
|
+
/* istanbul ignore next */
|
|
18
|
+
if (!isPlainObject(config)) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const configKeys = getOwnPropertyNames(config);
|
|
22
|
+
configKeys.forEach(key => {
|
|
23
|
+
/* istanbul ignore next */
|
|
24
|
+
const subConfig = config[key];
|
|
25
|
+
if (key === 'breakpoints') {
|
|
26
|
+
/* istanbul ignore if */
|
|
27
|
+
if (!isArray(subConfig) || subConfig.length < 2 || subConfig.some(b => !isString(b) || b.length === 0)) {
|
|
28
|
+
warn('"breakpoints" must be an array of at least 2 breakpoint names', NAME);
|
|
29
|
+
} else {
|
|
30
|
+
this.$_config[key] = cloneDeep(subConfig);
|
|
31
|
+
}
|
|
32
|
+
} else if (isPlainObject(subConfig)) {
|
|
33
|
+
// Component prop defaults
|
|
34
|
+
this.$_config[key] = getOwnPropertyNames(subConfig).reduce((config, prop) => {
|
|
35
|
+
if (!isUndefined(subConfig[prop])) {
|
|
36
|
+
config[prop] = cloneDeep(subConfig[prop]);
|
|
37
|
+
}
|
|
38
|
+
return config;
|
|
39
|
+
}, this.$_config[key] || {});
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Clear the config
|
|
45
|
+
resetConfig() {
|
|
46
|
+
this.$_config = {};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Returns a deep copy of the user config
|
|
50
|
+
getConfig() {
|
|
51
|
+
return cloneDeep(this.$_config);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Returns a deep copy of the config value
|
|
55
|
+
getConfigValue(key) {
|
|
56
|
+
let defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
|
|
57
|
+
return cloneDeep(getRaw(this.$_config, key, defaultValue));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Module-level singleton instance
|
|
62
|
+
let bvConfig = null;
|
|
63
|
+
|
|
64
|
+
// Get or create the config instance
|
|
65
|
+
const getConfigInstance = () => {
|
|
66
|
+
if (!bvConfig) {
|
|
67
|
+
bvConfig = new BvConfig();
|
|
68
|
+
}
|
|
69
|
+
return bvConfig;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// Method for applying a global config
|
|
73
|
+
const setConfig = function () {
|
|
74
|
+
let config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
75
|
+
getConfigInstance().setConfig(config);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// Method for resetting the user config
|
|
79
|
+
// Exported for testing purposes only
|
|
80
|
+
const resetConfig = () => {
|
|
81
|
+
if (bvConfig) {
|
|
82
|
+
bvConfig.resetConfig();
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
export { getConfigInstance, resetConfig, setConfig };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { DEFAULT_BREAKPOINT } from '../constants/config';
|
|
2
|
+
import { cloneDeep } from './clone-deep';
|
|
3
|
+
import { getConfigInstance } from './config-set';
|
|
4
|
+
import { memoize } from './memoize';
|
|
5
|
+
|
|
6
|
+
// --- Getter methods ---
|
|
7
|
+
// All methods return a deep clone (immutable) copy of the config value,
|
|
8
|
+
// to prevent mutation of the user config object
|
|
9
|
+
|
|
10
|
+
// Get the current config
|
|
11
|
+
const getConfig = () => {
|
|
12
|
+
return getConfigInstance().getConfig();
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
// Method to grab a config value based on a dotted/array notation key
|
|
16
|
+
const getConfigValue = function (key) {
|
|
17
|
+
let defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
|
|
18
|
+
return getConfigInstance().getConfigValue(key, defaultValue);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
// Method to grab a config value for a particular component
|
|
22
|
+
const getComponentConfig = function (key) {
|
|
23
|
+
let propKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
24
|
+
let defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
|
|
25
|
+
// Return the particular config value for key if specified,
|
|
26
|
+
// otherwise we return the full config (or an empty object if not found)
|
|
27
|
+
return propKey ? getConfigValue(`${key}.${propKey}`, defaultValue) : getConfigValue(key, {});
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// Get all breakpoint names
|
|
31
|
+
const getBreakpoints = () => getConfigValue('breakpoints', DEFAULT_BREAKPOINT);
|
|
32
|
+
|
|
33
|
+
// Private method for caching breakpoint names
|
|
34
|
+
const _getBreakpointsCached = memoize(() => getBreakpoints());
|
|
35
|
+
|
|
36
|
+
// Get all breakpoint names (cached)
|
|
37
|
+
const getBreakpointsCached = () => cloneDeep(_getBreakpointsCached());
|
|
38
|
+
|
|
39
|
+
// Get breakpoints with the smallest breakpoint set as ''
|
|
40
|
+
// Useful for components that create breakpoint specific props
|
|
41
|
+
const getBreakpointsUp = () => {
|
|
42
|
+
const breakpoints = getBreakpoints();
|
|
43
|
+
breakpoints[0] = '';
|
|
44
|
+
return breakpoints;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// Get breakpoints with the smallest breakpoint set as '' (cached)
|
|
48
|
+
// Useful for components that create breakpoint specific props
|
|
49
|
+
const getBreakpointsUpCached = memoize(() => {
|
|
50
|
+
const breakpoints = getBreakpointsCached();
|
|
51
|
+
breakpoints[0] = '';
|
|
52
|
+
return breakpoints;
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
// Get breakpoints with the largest breakpoint set as ''
|
|
56
|
+
const getBreakpointsDown = () => {
|
|
57
|
+
const breakpoints = getBreakpoints();
|
|
58
|
+
breakpoints[breakpoints.length - 1] = '';
|
|
59
|
+
return breakpoints;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
// Get breakpoints with the largest breakpoint set as '' (cached)
|
|
63
|
+
// Useful for components that create breakpoint specific props
|
|
64
|
+
/* istanbul ignore next: we don't use this method anywhere, yet */
|
|
65
|
+
const getBreakpointsDownCached = () => {
|
|
66
|
+
const breakpoints = getBreakpointsCached();
|
|
67
|
+
breakpoints[breakpoints.length - 1] = '';
|
|
68
|
+
return breakpoints;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export { getBreakpoints, getBreakpointsCached, getBreakpointsDown, getBreakpointsDownCached, getBreakpointsUp, getBreakpointsUpCached, getComponentConfig, getConfig, getConfigValue };
|