@gitlab/ui 132.0.1 → 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 +4 -3
- 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 +2 -2
- 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/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,54 @@
|
|
|
1
|
+
import { BTooltip } from '../../../vendor/bootstrap-vue/src/components/tooltip/tooltip';
|
|
2
|
+
import tooltipMixin from '../../mixins/tooltip_mixin';
|
|
3
|
+
import { getGlTooltipDefaultContainer } from '../../../directives/tooltip/container';
|
|
4
|
+
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
5
|
+
|
|
6
|
+
const tooltipRefName = 'bvTooltip';
|
|
7
|
+
var script = {
|
|
8
|
+
name: 'GlTooltip',
|
|
9
|
+
components: {
|
|
10
|
+
BTooltip
|
|
11
|
+
},
|
|
12
|
+
mixins: [tooltipMixin(tooltipRefName)],
|
|
13
|
+
inheritAttrs: false,
|
|
14
|
+
tooltipRefName,
|
|
15
|
+
getGlTooltipDefaultContainer
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/* script */
|
|
19
|
+
const __vue_script__ = script;
|
|
20
|
+
|
|
21
|
+
/* template */
|
|
22
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-tooltip',_vm._g(_vm._b({ref:_vm.$options.tooltipRefName,attrs:{"container":_vm.$attrs.container || _vm.$options.getGlTooltipDefaultContainer()}},'b-tooltip',_vm.$attrs,false),_vm.$listeners),[_vm._t("default")],2)};
|
|
23
|
+
var __vue_staticRenderFns__ = [];
|
|
24
|
+
|
|
25
|
+
/* style */
|
|
26
|
+
const __vue_inject_styles__ = undefined;
|
|
27
|
+
/* scoped */
|
|
28
|
+
const __vue_scope_id__ = undefined;
|
|
29
|
+
/* module identifier */
|
|
30
|
+
const __vue_module_identifier__ = undefined;
|
|
31
|
+
/* functional template */
|
|
32
|
+
const __vue_is_functional_template__ = false;
|
|
33
|
+
/* style inject */
|
|
34
|
+
|
|
35
|
+
/* style inject SSR */
|
|
36
|
+
|
|
37
|
+
/* style inject shadow dom */
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
const __vue_component__ = /*#__PURE__*/__vue_normalize__(
|
|
42
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
43
|
+
__vue_inject_styles__,
|
|
44
|
+
__vue_script__,
|
|
45
|
+
__vue_scope_id__,
|
|
46
|
+
__vue_is_functional_template__,
|
|
47
|
+
__vue_module_identifier__,
|
|
48
|
+
false,
|
|
49
|
+
undefined,
|
|
50
|
+
undefined,
|
|
51
|
+
undefined
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
export { __vue_component__ as default };
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
import { merge } from 'lodash-es';
|
|
2
|
+
import { defaultAreaOpacity, lineStyle, getThresholdConfig, generateAnnotationSeries, defaultChartOptions, dataZoomAdjustments, mergeSeriesToOptions, mergeAnnotationAxisToOptions, grid } from '../../../utils/charts/config';
|
|
3
|
+
import { LEGEND_AVERAGE_TEXT, LEGEND_MAX_TEXT, LEGEND_MIN_TEXT, LEGEND_CURRENT_TEXT, LEGEND_LAYOUT_INLINE, LEGEND_LAYOUT_TABLE, HEIGHT_AUTO_CLASSES } from '../../../utils/charts/constants';
|
|
4
|
+
import { colorFromDefaultPalette } from '../../../utils/charts/theme';
|
|
5
|
+
import { seriesHasAnnotations, isDataPointAnnotation } from '../../../utils/charts/utils';
|
|
6
|
+
import Chart from '../chart/chart';
|
|
7
|
+
import ChartLegend from '../legend/legend';
|
|
8
|
+
import ChartTooltip from '../shared/tooltip/tooltip';
|
|
9
|
+
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Area charts as of %12.10 support annotations.
|
|
13
|
+
* Annotations is composed of a dotted line and an arrow
|
|
14
|
+
* at the bottom. The dotted line is constructed
|
|
15
|
+
* with markLine and arrows with markPoint.
|
|
16
|
+
*
|
|
17
|
+
* Similar to how custom tooltips are displayed when area chart
|
|
18
|
+
* is hovered, a tooltip should be displayed when the annotation
|
|
19
|
+
* arrow is hovered. This component adds event listeners
|
|
20
|
+
* to figure out if mouse is hovered on charts to show tooltips.
|
|
21
|
+
* While that works for data points inside the grid, for arrows
|
|
22
|
+
* that live right under the chart, we use eCharts inbuilt
|
|
23
|
+
* event listeners to detect hover. Given this limitation,
|
|
24
|
+
* we use a separate tooltip for data point and arrow.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
var script = {
|
|
28
|
+
name: 'GlAreaChart',
|
|
29
|
+
components: {
|
|
30
|
+
Chart,
|
|
31
|
+
ChartLegend,
|
|
32
|
+
ChartTooltip
|
|
33
|
+
},
|
|
34
|
+
inheritAttrs: false,
|
|
35
|
+
props: {
|
|
36
|
+
data: {
|
|
37
|
+
type: Array,
|
|
38
|
+
required: true
|
|
39
|
+
},
|
|
40
|
+
option: {
|
|
41
|
+
type: Object,
|
|
42
|
+
required: false,
|
|
43
|
+
default: () => ({})
|
|
44
|
+
},
|
|
45
|
+
thresholds: {
|
|
46
|
+
type: Array,
|
|
47
|
+
required: false,
|
|
48
|
+
default: () => []
|
|
49
|
+
},
|
|
50
|
+
annotations: {
|
|
51
|
+
type: Array,
|
|
52
|
+
required: false,
|
|
53
|
+
default: () => []
|
|
54
|
+
},
|
|
55
|
+
includeLegendAvgMax: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
required: false,
|
|
58
|
+
default: true
|
|
59
|
+
},
|
|
60
|
+
formatAnnotationsTooltipText: {
|
|
61
|
+
type: Function,
|
|
62
|
+
required: false,
|
|
63
|
+
default: null
|
|
64
|
+
},
|
|
65
|
+
/**
|
|
66
|
+
* Callback called when showing or refreshing a tooltip.
|
|
67
|
+
* **Deprecated:** Use slots `#tooltip-title`, `#tooltip-content` or `#tooltip-value`.
|
|
68
|
+
*
|
|
69
|
+
* @deprecated Use slots `#tooltip-title`, `#tooltip-content` or `#tooltip-value`.
|
|
70
|
+
*/
|
|
71
|
+
formatTooltipText: {
|
|
72
|
+
type: Function,
|
|
73
|
+
required: false,
|
|
74
|
+
default: null
|
|
75
|
+
},
|
|
76
|
+
legendAverageText: {
|
|
77
|
+
type: String,
|
|
78
|
+
required: false,
|
|
79
|
+
default: LEGEND_AVERAGE_TEXT
|
|
80
|
+
},
|
|
81
|
+
legendMaxText: {
|
|
82
|
+
type: String,
|
|
83
|
+
required: false,
|
|
84
|
+
default: LEGEND_MAX_TEXT
|
|
85
|
+
},
|
|
86
|
+
legendMinText: {
|
|
87
|
+
type: String,
|
|
88
|
+
required: false,
|
|
89
|
+
default: LEGEND_MIN_TEXT
|
|
90
|
+
},
|
|
91
|
+
legendCurrentText: {
|
|
92
|
+
type: String,
|
|
93
|
+
required: false,
|
|
94
|
+
default: LEGEND_CURRENT_TEXT
|
|
95
|
+
},
|
|
96
|
+
legendLayout: {
|
|
97
|
+
type: String,
|
|
98
|
+
required: false,
|
|
99
|
+
default: LEGEND_LAYOUT_INLINE,
|
|
100
|
+
validator(layout) {
|
|
101
|
+
return [LEGEND_LAYOUT_INLINE, LEGEND_LAYOUT_TABLE].indexOf(layout) !== -1;
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
/**
|
|
105
|
+
* Sets the chart's height in pixels. Set to `"auto"` to use the height of the container.
|
|
106
|
+
*/
|
|
107
|
+
height: {
|
|
108
|
+
type: [Number, String],
|
|
109
|
+
required: false,
|
|
110
|
+
default: null
|
|
111
|
+
},
|
|
112
|
+
legendSeriesInfo: {
|
|
113
|
+
type: Array,
|
|
114
|
+
required: false,
|
|
115
|
+
default: () => []
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
data() {
|
|
119
|
+
// Part of the tooltip related data can be
|
|
120
|
+
// moved into the tooltip component.
|
|
121
|
+
// Tracking that progress in
|
|
122
|
+
// https://gitlab.com/gitlab-org/gitlab-ui/-/issues/618
|
|
123
|
+
return {
|
|
124
|
+
chart: null,
|
|
125
|
+
compiledOptions: null,
|
|
126
|
+
showAnnotationsTooltip: false,
|
|
127
|
+
annotationsTooltipTitle: '',
|
|
128
|
+
annotationsTooltipContent: '',
|
|
129
|
+
annotationsTooltipPosition: {
|
|
130
|
+
left: '0',
|
|
131
|
+
top: '0'
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
},
|
|
135
|
+
computed: {
|
|
136
|
+
series() {
|
|
137
|
+
const dataSeries = this.data.map((series, index) => {
|
|
138
|
+
const defaultColor = colorFromDefaultPalette(index);
|
|
139
|
+
const getColor = type => series[type] && series[type].color ? series[type].color : defaultColor;
|
|
140
|
+
return merge({
|
|
141
|
+
areaStyle: {
|
|
142
|
+
opacity: defaultAreaOpacity,
|
|
143
|
+
color: getColor('areaStyle')
|
|
144
|
+
},
|
|
145
|
+
showSymbol: false,
|
|
146
|
+
lineStyle: {
|
|
147
|
+
color: getColor('lineStyle')
|
|
148
|
+
},
|
|
149
|
+
itemStyle: {
|
|
150
|
+
color: getColor('itemStyle')
|
|
151
|
+
}
|
|
152
|
+
}, lineStyle, series, getThresholdConfig(this.thresholds));
|
|
153
|
+
});
|
|
154
|
+
// if annotation series exists, append it
|
|
155
|
+
// along with data series
|
|
156
|
+
if (this.annotationSeries) {
|
|
157
|
+
return [...dataSeries, this.annotationSeries];
|
|
158
|
+
}
|
|
159
|
+
return dataSeries;
|
|
160
|
+
},
|
|
161
|
+
annotationSeries() {
|
|
162
|
+
return generateAnnotationSeries(this.annotations);
|
|
163
|
+
},
|
|
164
|
+
options() {
|
|
165
|
+
const areaChartOptions = {
|
|
166
|
+
yAxis: {
|
|
167
|
+
axisTick: {
|
|
168
|
+
show: false
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
// `formatTooltipText` is deprecated, these added options should be
|
|
174
|
+
// removed when `formatTooltipText` is removed.
|
|
175
|
+
const deprecatedTooltipFormatterOptions = {
|
|
176
|
+
xAxis: {
|
|
177
|
+
axisPointer: {
|
|
178
|
+
show: true,
|
|
179
|
+
label: {
|
|
180
|
+
formatter: this.formatTooltipText
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
const mergedOptions = merge({}, defaultChartOptions, areaChartOptions, this.formatTooltipText ? deprecatedTooltipFormatterOptions : {}, this.option, dataZoomAdjustments(this.option.dataZoom));
|
|
186
|
+
// All chart options can be merged but series
|
|
187
|
+
// needs to be handled specially.
|
|
188
|
+
return mergeSeriesToOptions(mergeAnnotationAxisToOptions(mergedOptions, this.hasAnnotations), this.series);
|
|
189
|
+
},
|
|
190
|
+
/**
|
|
191
|
+
* Annotations currently are passed as series options in monitoring dashboard.
|
|
192
|
+
* Once https://gitlab.com/gitlab-org/gitlab/-/issues/213390 is closed,
|
|
193
|
+
* annotations will be passed as props and not as series options.
|
|
194
|
+
*
|
|
195
|
+
* For backward compatibility, we're having to check for both.
|
|
196
|
+
*/
|
|
197
|
+
hasAnnotations() {
|
|
198
|
+
return this.annotations.length !== 0 || seriesHasAnnotations(this.option.series);
|
|
199
|
+
},
|
|
200
|
+
shouldShowAnnotationsTooltip() {
|
|
201
|
+
return this.chart && this.hasAnnotations;
|
|
202
|
+
},
|
|
203
|
+
legendStyle() {
|
|
204
|
+
return {
|
|
205
|
+
paddingLeft: `${grid.left}px`
|
|
206
|
+
};
|
|
207
|
+
},
|
|
208
|
+
seriesInfo() {
|
|
209
|
+
var _this$compiledOptions;
|
|
210
|
+
if (this.legendSeriesInfo.length > 0) return this.legendSeriesInfo;
|
|
211
|
+
const compiledSeries = ((_this$compiledOptions = this.compiledOptions) === null || _this$compiledOptions === void 0 ? void 0 : _this$compiledOptions.series) || [];
|
|
212
|
+
return compiledSeries.reduce((acc, series, index) => {
|
|
213
|
+
if (series.type === 'line') {
|
|
214
|
+
var _series$data;
|
|
215
|
+
acc.push({
|
|
216
|
+
name: series.name,
|
|
217
|
+
type: series.lineStyle.type,
|
|
218
|
+
color: series.lineStyle.color || colorFromDefaultPalette(index),
|
|
219
|
+
data: this.includeLegendAvgMax ? (_series$data = series.data) === null || _series$data === void 0 ? void 0 : _series$data.map(data => data[1]) : undefined
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
return acc;
|
|
223
|
+
}, []);
|
|
224
|
+
},
|
|
225
|
+
autoHeight() {
|
|
226
|
+
return this.height === 'auto';
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
beforeDestroy() {
|
|
230
|
+
this.chart.off('mouseout', this.hideAnnotationsTooltip);
|
|
231
|
+
this.chart.off('mouseover', this.onChartMouseOver);
|
|
232
|
+
},
|
|
233
|
+
methods: {
|
|
234
|
+
defaultAnnotationTooltipText(params) {
|
|
235
|
+
var _params$data$tooltipD;
|
|
236
|
+
return {
|
|
237
|
+
title: params.data.xAxis,
|
|
238
|
+
content: (_params$data$tooltipD = params.data.tooltipData) === null || _params$data$tooltipD === void 0 ? void 0 : _params$data$tooltipD.content
|
|
239
|
+
};
|
|
240
|
+
},
|
|
241
|
+
onCreated(chart) {
|
|
242
|
+
// eCharts inbuild mouse events
|
|
243
|
+
// https://echarts.apache.org/en/api.html#events.Mouse%20events
|
|
244
|
+
// is used to attach listeners to markPoints. These listeners
|
|
245
|
+
// are currently used for annotation arrows at the bottom of the chart.
|
|
246
|
+
|
|
247
|
+
// Because data points and annotations arrows are in different
|
|
248
|
+
// sections of the charts with their own mouseovers and mouseouts,
|
|
249
|
+
// there shouldn't be an overlapping situation where both tooltips
|
|
250
|
+
// are visible.
|
|
251
|
+
if (this.hasAnnotations) {
|
|
252
|
+
chart.on('mouseout', this.onChartDataPointMouseOut);
|
|
253
|
+
chart.on('mouseover', this.onChartDataPointMouseOver);
|
|
254
|
+
}
|
|
255
|
+
this.chart = chart;
|
|
256
|
+
this.$emit('created', chart);
|
|
257
|
+
},
|
|
258
|
+
onUpdated() {
|
|
259
|
+
this.compiledOptions = this.chart.getOption();
|
|
260
|
+
},
|
|
261
|
+
onChartDataPointMouseOut() {
|
|
262
|
+
this.showAnnotationsTooltip = false;
|
|
263
|
+
},
|
|
264
|
+
/**
|
|
265
|
+
* Check if the hovered data point is an annotation
|
|
266
|
+
* point to show the annotation tooltip.
|
|
267
|
+
*/
|
|
268
|
+
onChartDataPointMouseOver(params) {
|
|
269
|
+
if (isDataPointAnnotation(params)) {
|
|
270
|
+
const {
|
|
271
|
+
event
|
|
272
|
+
} = params;
|
|
273
|
+
const toolTipFormatter = this.formatAnnotationsTooltipText || this.defaultAnnotationTooltipText;
|
|
274
|
+
const {
|
|
275
|
+
title = '',
|
|
276
|
+
content = ''
|
|
277
|
+
} = toolTipFormatter(params);
|
|
278
|
+
this.showAnnotationsTooltip = true;
|
|
279
|
+
this.annotationsTooltipTitle = title;
|
|
280
|
+
this.annotationsTooltipContent = content;
|
|
281
|
+
this.annotationsTooltipPosition = {
|
|
282
|
+
left: `${event.event.zrX}px`,
|
|
283
|
+
top: `${event.event.zrY}px`
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
HEIGHT_AUTO_CLASSES
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
/* script */
|
|
292
|
+
const __vue_script__ = script;
|
|
293
|
+
|
|
294
|
+
/* template */
|
|
295
|
+
var __vue_render__ = function () {
|
|
296
|
+
var _obj;
|
|
297
|
+
var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-relative",class:( _obj = {}, _obj[_vm.$options.HEIGHT_AUTO_CLASSES] = _vm.autoHeight, _obj )},[_c('chart',_vm._g(_vm._b({class:{ 'gl-grow': _vm.autoHeight },attrs:{"height":_vm.height,"options":_vm.options},on:{"created":_vm.onCreated,"updated":_vm.onUpdated}},'chart',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),(_vm.shouldShowAnnotationsTooltip)?_c('chart-tooltip',{ref:"annotationsTooltip",attrs:{"id":"annotationsTooltip","show":_vm.showAnnotationsTooltip,"top":_vm.annotationsTooltipPosition.top,"left":_vm.annotationsTooltipPosition.left,"chart":_vm.chart,"placement":"bottom"},scopedSlots:_vm._u([{key:"title",fn:function(){return [_c('div',[_vm._v(_vm._s(_vm.annotationsTooltipTitle))])]},proxy:true}],null,false,1889294429)},[_vm._v(" "),_c('div',[_vm._v(_vm._s(_vm.annotationsTooltipContent))])]):_vm._e(),_vm._v(" "),(_vm.chart)?_c('chart-tooltip',{ref:"dataTooltip",attrs:{"chart":_vm.chart,"use-default-tooltip-formatter":!_vm.formatTooltipText},scopedSlots:_vm._u([(_vm.$scopedSlots['tooltip-title'])?{key:"title",fn:function(scope){return [_vm._t("tooltip-title",null,null,scope)]}}:null,(_vm.$scopedSlots['tooltip-content'])?{key:"default",fn:function(scope){return [_vm._t("tooltip-content",null,null,scope)]}}:null,(_vm.$scopedSlots['tooltip-value'])?{key:"tooltip-value",fn:function(scope){return [_vm._t("tooltip-value",null,null,scope)]}}:null],null,true)}):_vm._e(),_vm._v(" "),(_vm.compiledOptions)?_c('chart-legend',{style:(_vm.legendStyle),attrs:{"chart":_vm.chart,"series-info":_vm.seriesInfo,"text-style":_vm.compiledOptions.textStyle,"min-text":_vm.legendMinText,"max-text":_vm.legendMaxText,"average-text":_vm.legendAverageText,"current-text":_vm.legendCurrentText,"layout":_vm.legendLayout}}):_vm._e()],1)};
|
|
298
|
+
var __vue_staticRenderFns__ = [];
|
|
299
|
+
|
|
300
|
+
/* style */
|
|
301
|
+
const __vue_inject_styles__ = undefined;
|
|
302
|
+
/* scoped */
|
|
303
|
+
const __vue_scope_id__ = undefined;
|
|
304
|
+
/* module identifier */
|
|
305
|
+
const __vue_module_identifier__ = undefined;
|
|
306
|
+
/* functional template */
|
|
307
|
+
const __vue_is_functional_template__ = false;
|
|
308
|
+
/* style inject */
|
|
309
|
+
|
|
310
|
+
/* style inject SSR */
|
|
311
|
+
|
|
312
|
+
/* style inject shadow dom */
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
const __vue_component__ = /*#__PURE__*/__vue_normalize__(
|
|
317
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
318
|
+
__vue_inject_styles__,
|
|
319
|
+
__vue_script__,
|
|
320
|
+
__vue_scope_id__,
|
|
321
|
+
__vue_is_functional_template__,
|
|
322
|
+
__vue_module_identifier__,
|
|
323
|
+
false,
|
|
324
|
+
undefined,
|
|
325
|
+
undefined,
|
|
326
|
+
undefined
|
|
327
|
+
);
|
|
328
|
+
|
|
329
|
+
export { __vue_component__ as default };
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { merge, truncate } from 'lodash-es';
|
|
2
|
+
import { dataZoomAdjustments, mergeSeriesToOptions, grid } from '../../../utils/charts/config';
|
|
3
|
+
import { CHART_DEFAULT_SERIES_STACK, HEIGHT_AUTO_CLASSES } from '../../../utils/charts/constants';
|
|
4
|
+
import { colorFromDefaultPalette } from '../../../utils/charts/theme';
|
|
5
|
+
import { engineeringNotation } from '../../../utils/number_utils';
|
|
6
|
+
import { hexToRgba } from '../../../utils/utils';
|
|
7
|
+
import Chart from '../chart/chart';
|
|
8
|
+
import ChartTooltip from '../shared/tooltip/tooltip';
|
|
9
|
+
import { stackedPresentationOptions } from '../../../utils/constants';
|
|
10
|
+
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* `nameGap` in charts/config is set to 50 but it is not
|
|
14
|
+
* used for bar charts as the axes are flipped. That is why
|
|
15
|
+
* we're explicitly setting it here
|
|
16
|
+
*/
|
|
17
|
+
const DEFAULT_NAME_GAP = 50;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* This is the magic number at which the y-axis name
|
|
21
|
+
* and y-axis labels don't overlap
|
|
22
|
+
* @Number
|
|
23
|
+
*/
|
|
24
|
+
const AXIS_LABEL_LENGTH = 7;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Because the axes are reversed in bar charts defaultChartOptions
|
|
28
|
+
* xAxis and yAxis needs to be handled specifically.
|
|
29
|
+
*/
|
|
30
|
+
const defaultOptions = {
|
|
31
|
+
grid,
|
|
32
|
+
xAxis: {
|
|
33
|
+
nameLocation: 'center',
|
|
34
|
+
axisLabel: {
|
|
35
|
+
formatter: num => engineeringNotation(num, 2)
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
yAxis: {
|
|
39
|
+
nameGap: DEFAULT_NAME_GAP,
|
|
40
|
+
boundaryGap: true,
|
|
41
|
+
nameLocation: 'center',
|
|
42
|
+
splitLine: {
|
|
43
|
+
show: false
|
|
44
|
+
},
|
|
45
|
+
axisLabel: {
|
|
46
|
+
interval: 0,
|
|
47
|
+
formatter: str => truncate(str, {
|
|
48
|
+
length: AXIS_LABEL_LENGTH,
|
|
49
|
+
separator: '...'
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
legend: {
|
|
54
|
+
show: false
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
var script = {
|
|
58
|
+
name: 'GlBarChart',
|
|
59
|
+
components: {
|
|
60
|
+
Chart,
|
|
61
|
+
ChartTooltip
|
|
62
|
+
},
|
|
63
|
+
inheritAttrs: false,
|
|
64
|
+
props: {
|
|
65
|
+
data: {
|
|
66
|
+
type: Object,
|
|
67
|
+
required: true
|
|
68
|
+
},
|
|
69
|
+
option: {
|
|
70
|
+
type: Object,
|
|
71
|
+
required: false,
|
|
72
|
+
default: () => ({})
|
|
73
|
+
},
|
|
74
|
+
yAxisTitle: {
|
|
75
|
+
type: String,
|
|
76
|
+
required: true
|
|
77
|
+
},
|
|
78
|
+
xAxisTitle: {
|
|
79
|
+
type: String,
|
|
80
|
+
required: true
|
|
81
|
+
},
|
|
82
|
+
xAxisType: {
|
|
83
|
+
type: String,
|
|
84
|
+
required: false,
|
|
85
|
+
default: 'value'
|
|
86
|
+
},
|
|
87
|
+
/**
|
|
88
|
+
* Sets the chart's height in pixels. Set to `"auto"` to use the height of the container.
|
|
89
|
+
*/
|
|
90
|
+
height: {
|
|
91
|
+
type: [Number, String],
|
|
92
|
+
required: false,
|
|
93
|
+
default: null
|
|
94
|
+
},
|
|
95
|
+
/**
|
|
96
|
+
* Controls how multiple series data are displayed in the chart –
|
|
97
|
+
* `stacked` stacks series horizontally, and
|
|
98
|
+
* `tiled` displays series as grouped bars.
|
|
99
|
+
*/
|
|
100
|
+
presentation: {
|
|
101
|
+
type: String,
|
|
102
|
+
required: false,
|
|
103
|
+
default: stackedPresentationOptions.stacked,
|
|
104
|
+
validator: value => Object.values(stackedPresentationOptions).includes(value)
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
data() {
|
|
108
|
+
return {
|
|
109
|
+
chart: null
|
|
110
|
+
};
|
|
111
|
+
},
|
|
112
|
+
computed: {
|
|
113
|
+
series() {
|
|
114
|
+
return Object.keys(this.data).map((key, index) => {
|
|
115
|
+
const barColor = colorFromDefaultPalette(index);
|
|
116
|
+
return {
|
|
117
|
+
name: key,
|
|
118
|
+
data: this.data[key],
|
|
119
|
+
type: 'bar',
|
|
120
|
+
stack: this.presentation === stackedPresentationOptions.tiled ? null : CHART_DEFAULT_SERIES_STACK,
|
|
121
|
+
itemStyle: {
|
|
122
|
+
color: hexToRgba(barColor, 0.2),
|
|
123
|
+
borderColor: barColor,
|
|
124
|
+
borderWidth: 1
|
|
125
|
+
},
|
|
126
|
+
emphasis: {
|
|
127
|
+
itemStyle: {
|
|
128
|
+
color: hexToRgba(barColor, 0.4)
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
barMaxWidth: '50%'
|
|
132
|
+
};
|
|
133
|
+
});
|
|
134
|
+
},
|
|
135
|
+
options() {
|
|
136
|
+
const mergedOptions = merge({}, defaultOptions, {
|
|
137
|
+
xAxis: {
|
|
138
|
+
axisLine: {
|
|
139
|
+
show: false
|
|
140
|
+
},
|
|
141
|
+
name: this.xAxisTitle,
|
|
142
|
+
type: this.xAxisType
|
|
143
|
+
},
|
|
144
|
+
yAxis: {
|
|
145
|
+
name: this.yAxisTitle,
|
|
146
|
+
type: 'category',
|
|
147
|
+
axisTick: {
|
|
148
|
+
show: true
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}, this.option, dataZoomAdjustments(this.option.dataZoom));
|
|
152
|
+
// All chart options can be merged but series
|
|
153
|
+
// needs to be handled specially
|
|
154
|
+
return mergeSeriesToOptions(mergedOptions, this.series);
|
|
155
|
+
},
|
|
156
|
+
autoHeight() {
|
|
157
|
+
return this.height === 'auto';
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
methods: {
|
|
161
|
+
onCreated(chart) {
|
|
162
|
+
this.chart = chart;
|
|
163
|
+
this.$emit('created', chart);
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
HEIGHT_AUTO_CLASSES
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
/* script */
|
|
170
|
+
const __vue_script__ = script;
|
|
171
|
+
|
|
172
|
+
/* template */
|
|
173
|
+
var __vue_render__ = function () {
|
|
174
|
+
var _obj;
|
|
175
|
+
var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-relative",class:( _obj = {}, _obj[_vm.$options.HEIGHT_AUTO_CLASSES] = _vm.autoHeight, _obj )},[_c('chart',_vm._g(_vm._b({class:{ 'gl-grow': _vm.autoHeight },attrs:{"height":_vm.height,"options":_vm.options},on:{"created":_vm.onCreated}},'chart',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),(_vm.chart)?_c('chart-tooltip',{attrs:{"chart":_vm.chart,"use-default-tooltip-formatter":true,"dimension-axis":"yAxis"},scopedSlots:_vm._u([(_vm.$scopedSlots['tooltip-title'])?{key:"title",fn:function(scope){return [_vm._t("tooltip-title",null,null,scope)]}}:null,(_vm.$scopedSlots['tooltip-content'])?{key:"default",fn:function(scope){return [_vm._t("tooltip-content",null,null,scope)]}}:null,(_vm.$scopedSlots['tooltip-value'])?{key:"tooltip-value",fn:function(scope){return [_vm._t("tooltip-value",null,null,scope)]}}:null],null,true)}):_vm._e()],1)};
|
|
176
|
+
var __vue_staticRenderFns__ = [];
|
|
177
|
+
|
|
178
|
+
/* style */
|
|
179
|
+
const __vue_inject_styles__ = undefined;
|
|
180
|
+
/* scoped */
|
|
181
|
+
const __vue_scope_id__ = undefined;
|
|
182
|
+
/* module identifier */
|
|
183
|
+
const __vue_module_identifier__ = undefined;
|
|
184
|
+
/* functional template */
|
|
185
|
+
const __vue_is_functional_template__ = false;
|
|
186
|
+
/* style inject */
|
|
187
|
+
|
|
188
|
+
/* style inject SSR */
|
|
189
|
+
|
|
190
|
+
/* style inject shadow dom */
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
const __vue_component__ = /*#__PURE__*/__vue_normalize__(
|
|
195
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
196
|
+
__vue_inject_styles__,
|
|
197
|
+
__vue_script__,
|
|
198
|
+
__vue_scope_id__,
|
|
199
|
+
__vue_is_functional_template__,
|
|
200
|
+
__vue_module_identifier__,
|
|
201
|
+
false,
|
|
202
|
+
undefined,
|
|
203
|
+
undefined,
|
|
204
|
+
undefined
|
|
205
|
+
);
|
|
206
|
+
|
|
207
|
+
export { __vue_component__ as default };
|