@gitlab/ui 132.0.1 → 132.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/charts.js +13 -0
- package/dist/components/base/accordion/accordion.js +69 -0
- package/dist/components/base/accordion/accordion_item.js +160 -0
- package/dist/components/base/accordion/constants.js +3 -0
- package/dist/components/base/alert/alert.js +263 -0
- package/dist/components/base/animated_icon/animated_chevron_down_up_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_chevron_lg_down_up_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_chevron_lg_right_down_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_chevron_right_down_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_duo_chat_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_loader_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_notifications_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_sidebar_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_smile_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_sort_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_star_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_todo_icon.js +45 -0
- package/dist/components/base/animated_icon/animated_upload_icon.js +45 -0
- package/dist/components/base/animated_icon/base_animated_icon.js +77 -0
- package/dist/components/base/attribute_list/attribute_list.js +100 -0
- package/dist/components/base/avatar/avatar.js +175 -0
- package/dist/components/base/avatar/utils.js +17 -0
- package/dist/components/base/avatar_labeled/avatar_labeled.js +198 -0
- package/dist/components/base/avatar_link/avatar_link.js +47 -0
- package/dist/components/base/avatars_inline/avatars_inline.js +139 -0
- package/dist/components/base/badge/badge.js +197 -0
- package/dist/components/base/banner/banner.js +149 -0
- package/dist/components/base/breadcrumb/breadcrumb.js +282 -0
- package/dist/components/base/breadcrumb/breadcrumb_item.js +96 -0
- package/dist/components/base/broadcast_message/broadcast_message.js +113 -0
- package/dist/components/base/broadcast_message/constants.js +5 -0
- package/dist/components/base/button/button.js +419 -0
- package/dist/components/base/button_group/button_group.js +53 -0
- package/dist/components/base/card/card.js +69 -0
- package/dist/components/base/collapse/collapse.js +163 -0
- package/dist/components/base/color_mode_toggle/color_mode_toggle.js +92 -0
- package/dist/components/base/datepicker/datepicker.js +475 -0
- package/dist/components/base/daterange_picker/daterange_picker.js +394 -0
- package/dist/components/base/drawer/drawer.js +156 -0
- package/dist/components/base/dropdown/dropdown.js +330 -0
- package/dist/components/base/dropdown/dropdown_divider.js +48 -0
- package/dist/components/base/dropdown/dropdown_form.js +48 -0
- package/dist/components/base/dropdown/dropdown_item.js +175 -0
- package/dist/components/base/dropdown/dropdown_section_header.js +48 -0
- package/dist/components/base/dropdown/dropdown_text.js +48 -0
- package/dist/components/base/filtered_search/common_story_options.js +14 -0
- package/dist/components/base/filtered_search/filtered_search.js +428 -0
- package/dist/components/base/filtered_search/filtered_search_suggestion.js +95 -0
- package/dist/components/base/filtered_search/filtered_search_suggestion_list.js +139 -0
- package/dist/components/base/filtered_search/filtered_search_term.js +217 -0
- package/dist/components/base/filtered_search/filtered_search_token.js +383 -0
- package/dist/components/base/filtered_search/filtered_search_token_segment.js +444 -0
- package/dist/components/base/filtered_search/filtered_search_utils.js +241 -0
- package/dist/components/base/form/form.js +43 -0
- package/dist/components/base/form/form_character_count/form_character_count.js +107 -0
- package/dist/components/base/form/form_checkbox/form_checkbox.js +342 -0
- package/dist/components/base/form/form_checkbox/form_checkbox_group.js +188 -0
- package/dist/components/base/form/form_combobox/constants.js +55 -0
- package/dist/components/base/form/form_combobox/form_combobox.js +239 -0
- package/dist/components/base/form/form_date/form_date.js +143 -0
- package/dist/components/base/form/form_fields/form_field_validator.js +93 -0
- package/dist/components/base/form/form_fields/form_fields.js +289 -0
- package/dist/components/base/form/form_fields/form_fields_loop.js +75 -0
- package/dist/components/base/form/form_fields/mappers.js +13 -0
- package/dist/components/base/form/form_fields/validators.js +48 -0
- package/dist/components/base/form/form_group/form_group.js +119 -0
- package/dist/components/base/form/form_input/form_input.js +695 -0
- package/dist/components/base/form/form_input_group/form_input_group.js +120 -0
- package/dist/components/base/form/form_input_group/form_input_group_mixin.js +41 -0
- package/dist/components/base/form/form_radio/form_radio.js +259 -0
- package/dist/components/base/form/form_radio_group/form_radio_group.js +189 -0
- package/dist/components/base/form/form_select/constants.js +12 -0
- package/dist/components/base/form/form_select/form_select.js +96 -0
- package/dist/components/base/form/form_textarea/form_textarea.js +166 -0
- package/dist/components/base/form/input_group_text/input_group_text.js +43 -0
- package/dist/components/base/icon/icon.js +113 -0
- package/dist/components/base/illustration/illustration.js +80 -0
- package/dist/components/base/infinite_scroll/infinite_scroll.js +196 -0
- package/dist/components/base/keyset_pagination/keyset_pagination.js +152 -0
- package/dist/components/base/label/label.js +174 -0
- package/dist/components/base/link/link.js +330 -0
- package/dist/components/base/loading_icon/loading_icon.js +120 -0
- package/dist/components/base/markdown/markdown.js +50 -0
- package/dist/components/base/modal/modal.js +259 -0
- package/dist/components/base/new_dropdowns/base_dropdown/base_dropdown.js +716 -0
- package/dist/components/base/new_dropdowns/base_dropdown/constants.js +5 -0
- package/dist/components/base/new_dropdowns/base_dropdown/dropdown_container.js +32 -0
- package/dist/components/base/new_dropdowns/constants.js +24 -0
- package/dist/components/base/new_dropdowns/disclosure/constants.js +8 -0
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown.js +400 -0
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown_group.js +112 -0
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown_item.js +196 -0
- package/dist/components/base/new_dropdowns/disclosure/mock_data.js +168 -0
- package/dist/components/base/new_dropdowns/disclosure/utils.js +84 -0
- package/dist/components/base/new_dropdowns/listbox/listbox.js +997 -0
- package/dist/components/base/new_dropdowns/listbox/listbox_group.js +58 -0
- package/dist/components/base/new_dropdowns/listbox/listbox_item.js +112 -0
- package/dist/components/base/new_dropdowns/listbox/listbox_search_input.js +94 -0
- package/dist/components/base/new_dropdowns/listbox/mock_data.js +131 -0
- package/dist/components/base/new_dropdowns/listbox/utils.js +33 -0
- package/dist/components/base/pagination/pagination.js +397 -0
- package/dist/components/base/path/data.js +34 -0
- package/dist/components/base/path/path.js +177 -0
- package/dist/components/base/popover/popover.js +142 -0
- package/dist/components/base/progress_bar/progress_bar.js +117 -0
- package/dist/components/base/search_box_by_click/search_box_by_click.js +245 -0
- package/dist/components/base/search_box_by_type/search_box_by_type.js +187 -0
- package/dist/components/base/segmented_control/segmented_control.js +73 -0
- package/dist/components/base/skeleton_loader/skeleton_loader.js +232 -0
- package/dist/components/base/sorting/sorting.js +180 -0
- package/dist/components/base/table/constants.js +5 -0
- package/dist/components/base/table/table.js +187 -0
- package/dist/components/base/table_lite/table_lite.js +80 -0
- package/dist/components/base/tabs/constants.js +3 -0
- package/dist/components/base/tabs/tab/tab.js +113 -0
- package/dist/components/base/tabs/tabs/scrollable_tabs.js +162 -0
- package/dist/components/base/tabs/tabs/tabs.js +223 -0
- package/dist/components/base/toast/index.js +66 -0
- package/dist/components/base/toast/toast.js +125 -0
- package/dist/components/base/toast/toaster.js +87 -0
- package/dist/components/base/toggle/toggle.js +178 -0
- package/dist/components/base/token/token.js +97 -0
- package/dist/components/base/token_selector/helpers.js +5 -0
- package/dist/components/base/token_selector/token_container.js +160 -0
- package/dist/components/base/token_selector/token_selector.js +454 -0
- package/dist/components/base/token_selector/token_selector_dropdown.js +223 -0
- package/dist/components/base/tooltip/tooltip.js +54 -0
- package/dist/components/charts/area/area.js +329 -0
- package/dist/components/charts/bar/bar.js +207 -0
- package/dist/components/charts/chart/chart.js +215 -0
- package/dist/components/charts/column/column.js +221 -0
- package/dist/components/charts/discrete_scatter/discrete_scatter.js +199 -0
- package/dist/components/charts/gauge/gauge.js +205 -0
- package/dist/components/charts/heatmap/heatmap.js +299 -0
- package/dist/components/charts/heatmap/index.js +2 -0
- package/dist/components/charts/legend/legend.js +245 -0
- package/dist/components/charts/line/line.js +340 -0
- package/dist/components/charts/series_label/series_label.js +101 -0
- package/dist/components/charts/shared/tooltip/tooltip.js +369 -0
- package/dist/components/charts/shared/tooltip/tooltip_default_format/tooltip_default_format.js +53 -0
- package/dist/components/charts/single_stat/single_stat.js +164 -0
- package/dist/components/charts/sparkline/sparkline.js +299 -0
- package/dist/components/charts/stacked_column/stacked_column.js +380 -0
- package/dist/components/dashboards/dashboard_layout/dashboard_layout.js +125 -0
- package/dist/components/dashboards/dashboard_layout/grid_layout/grid_layout.js +326 -0
- package/dist/components/dashboards/dashboard_layout/validators.js +14 -0
- package/dist/components/dashboards/dashboard_panel/dashboard_panel.js +236 -0
- package/dist/components/dashboards/mock_data.js +49 -0
- package/dist/components/experimental/experiment_badge/constants.js +4 -0
- package/dist/components/experimental/experiment_badge/experiment_badge.js +102 -0
- package/dist/components/extended/multi_step_form_template/multi_step_form_template.js +87 -0
- package/dist/components/index.js +107 -0
- package/dist/components/mixins/button_mixin.js +11 -0
- package/dist/components/mixins/safe_link_mixin.js +30 -0
- package/dist/components/mixins/tooltip_mixin.js +21 -0
- package/dist/components/regions/dashboard_skeleton/dashboard_skeleton.js +53 -0
- package/dist/components/regions/empty_state/empty_state.js +181 -0
- package/dist/components/shared_components/clear_icon_button/clear_icon_button.js +64 -0
- package/dist/components/shared_components/clipboard_button/clipboard_button.js +100 -0
- package/dist/components/shared_components/close_button/close_button.js +55 -0
- package/dist/components/utilities/animated_number/animated_number.js +131 -0
- package/dist/components/utilities/friendly_wrap/friendly_wrap.js +75 -0
- package/dist/components/utilities/intersection_observer/intersection_observer.js +88 -0
- package/dist/components/utilities/intersperse/intersperse.js +104 -0
- package/dist/components/utilities/sprintf/sprintf.js +171 -0
- package/dist/components/utilities/truncate/constants.js +8 -0
- package/dist/components/utilities/truncate/truncate.js +154 -0
- package/dist/components/utilities/truncate_text/constants.js +7 -0
- package/dist/components/utilities/truncate_text/truncate_text.js +146 -0
- package/dist/config.js +53 -0
- package/dist/directives/hover_load/hover_load.js +45 -0
- package/dist/directives/index.js +8 -0
- package/dist/directives/modal.js +1 -0
- package/dist/directives/outside/outside.js +149 -0
- package/dist/directives/resize_observer/resize_observer.js +58 -0
- package/dist/directives/safe_html/constants.js +6 -0
- package/dist/directives/safe_html/safe_html.js +39 -0
- package/dist/directives/safe_link/mock_data.js +10 -0
- package/dist/directives/safe_link/safe_link.js +67 -0
- package/dist/directives/tooltip/container.js +7 -0
- package/dist/directives/tooltip/tooltip.js +18 -0
- package/dist/index.css +7 -0
- package/dist/index.css.map +1 -0
- package/dist/index.js +2 -0
- package/dist/tailwind.css +2 -0
- package/dist/tailwind.css.map +1 -0
- package/dist/tokens/build/js/tokens.dark.js +1410 -0
- package/dist/tokens/build/js/tokens.js +1410 -0
- package/dist/tokens/common_story_options.js +29 -0
- package/dist/tokens/tokens_story.js +76 -0
- package/dist/utils/breakpoints.js +20 -0
- package/dist/utils/charts/config.js +616 -0
- package/dist/utils/charts/constants.js +69 -0
- package/dist/utils/charts/mock_data.js +191 -0
- package/dist/utils/charts/story_config.js +24 -0
- package/dist/utils/charts/theme.js +200 -0
- package/dist/utils/charts/utils.js +54 -0
- package/dist/utils/constants.js +331 -0
- package/dist/utils/data_utils.js +19 -0
- package/dist/utils/datetime_utility.js +61 -0
- package/dist/utils/equality_utils.js +84 -0
- package/dist/utils/form_options_utils.js +46 -0
- package/dist/utils/i18n.js +65 -0
- package/dist/utils/is_slot_empty.js +34 -0
- package/dist/utils/number_utils.js +132 -0
- package/dist/utils/play_utils.js +11 -0
- package/dist/utils/set_utils.js +25 -0
- package/dist/utils/stories_constants.js +29 -0
- package/dist/utils/stories_utils.js +62 -0
- package/dist/utils/story_decorators/container.js +19 -0
- package/dist/utils/string_utils.js +69 -0
- package/dist/utils/svgs/svg_paths.js +7 -0
- package/dist/utils/test_utils.js +33 -0
- package/dist/utils/url_utils.js +56 -0
- package/dist/utils/use_fake_date.js +29 -0
- package/dist/utils/use_mock_intersection_observer.js +105 -0
- package/dist/utils/utils.js +205 -0
- package/dist/utils/vue_utils.js +57 -0
- package/dist/utils.js +5 -0
- package/dist/vendor/bootstrap-vue/src/bv-config.js +8 -0
- package/dist/vendor/bootstrap-vue/src/components/button/button-close.js +81 -0
- package/dist/vendor/bootstrap-vue/src/components/button/button.js +204 -0
- package/dist/vendor/bootstrap-vue/src/components/button/index.js +2 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-divider.js +44 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-form.js +59 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-group.js +98 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-header.js +63 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-item-button.js +108 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-item.js +97 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown-text.js +60 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/dropdown.js +270 -0
- package/dist/vendor/bootstrap-vue/src/components/dropdown/index.js +8 -0
- package/dist/vendor/bootstrap-vue/src/components/form/form-invalid-feedback.js +80 -0
- package/dist/vendor/bootstrap-vue/src/components/form/form-text.js +55 -0
- package/dist/vendor/bootstrap-vue/src/components/form/form-valid-feedback.js +80 -0
- package/dist/vendor/bootstrap-vue/src/components/form/form.js +56 -0
- package/dist/vendor/bootstrap-vue/src/components/form/index.js +4 -0
- package/dist/vendor/bootstrap-vue/src/components/form-group/form-group.js +347 -0
- package/dist/vendor/bootstrap-vue/src/components/form-group/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/components/form-select/form-select-option-group.js +56 -0
- package/dist/vendor/bootstrap-vue/src/components/form-select/form-select-option.js +47 -0
- package/dist/vendor/bootstrap-vue/src/components/form-select/form-select.js +154 -0
- package/dist/vendor/bootstrap-vue/src/components/form-select/helpers/mixin-options.js +63 -0
- package/dist/vendor/bootstrap-vue/src/components/form-select/index.js +3 -0
- package/dist/vendor/bootstrap-vue/src/components/form-textarea/form-textarea.js +236 -0
- package/dist/vendor/bootstrap-vue/src/components/form-textarea/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/components/layout/col.js +155 -0
- package/dist/vendor/bootstrap-vue/src/components/layout/form-row.js +34 -0
- package/dist/vendor/bootstrap-vue/src/components/layout/index.js +2 -0
- package/dist/vendor/bootstrap-vue/src/components/link/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/components/link/link.js +283 -0
- package/dist/vendor/bootstrap-vue/src/components/modal/helpers/bv-modal-event.class.js +21 -0
- package/dist/vendor/bootstrap-vue/src/components/modal/helpers/modal-manager.js +212 -0
- package/dist/vendor/bootstrap-vue/src/components/modal/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/components/modal/modal.js +1059 -0
- package/dist/vendor/bootstrap-vue/src/components/popover/helpers/bv-popover-template.js +55 -0
- package/dist/vendor/bootstrap-vue/src/components/popover/helpers/bv-popover.js +31 -0
- package/dist/vendor/bootstrap-vue/src/components/popover/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/components/popover/popover.js +64 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/constants.js +22 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/default-sort-compare.js +64 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/filter-event.js +40 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-bottom-row.js +43 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-busy.js +86 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-caption.js +57 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-colgroup.js +32 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-empty.js +101 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-filtering.js +292 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-items.js +169 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-pagination.js +51 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-provider.js +210 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-selectable.js +227 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-sorting.js +328 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-stacked.js +42 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-table-renderer.js +241 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody-row.js +349 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody.js +247 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-tfoot.js +69 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-thead.js +233 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/mixin-top-row.js +42 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/normalize-fields.js +86 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/sanitize-row.js +31 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/stringify-record-values.js +11 -0
- package/dist/vendor/bootstrap-vue/src/components/table/helpers/text-selection-active.js +14 -0
- package/dist/vendor/bootstrap-vue/src/components/table/index.js +9 -0
- package/dist/vendor/bootstrap-vue/src/components/table/table-lite.js +51 -0
- package/dist/vendor/bootstrap-vue/src/components/table/table-simple.js +44 -0
- package/dist/vendor/bootstrap-vue/src/components/table/table.js +67 -0
- package/dist/vendor/bootstrap-vue/src/components/table/tbody.js +116 -0
- package/dist/vendor/bootstrap-vue/src/components/table/td.js +204 -0
- package/dist/vendor/bootstrap-vue/src/components/table/tfoot.js +96 -0
- package/dist/vendor/bootstrap-vue/src/components/table/th.js +26 -0
- package/dist/vendor/bootstrap-vue/src/components/table/thead.js +99 -0
- package/dist/vendor/bootstrap-vue/src/components/table/tr.js +121 -0
- package/dist/vendor/bootstrap-vue/src/components/tabs/index.js +2 -0
- package/dist/vendor/bootstrap-vue/src/components/tabs/tab.js +238 -0
- package/dist/vendor/bootstrap-vue/src/components/tabs/tabs.js +690 -0
- package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-popper.js +278 -0
- package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip-template.js +125 -0
- package/dist/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip.js +932 -0
- package/dist/vendor/bootstrap-vue/src/components/tooltip/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/components/tooltip/tooltip.js +337 -0
- package/dist/vendor/bootstrap-vue/src/components/transition/bv-transition.js +118 -0
- package/dist/vendor/bootstrap-vue/src/components/transporter/transporter.js +220 -0
- package/dist/vendor/bootstrap-vue/src/constants/components.js +55 -0
- package/dist/vendor/bootstrap-vue/src/constants/config.js +11 -0
- package/dist/vendor/bootstrap-vue/src/constants/env.js +36 -0
- package/dist/vendor/bootstrap-vue/src/constants/events.js +56 -0
- package/dist/vendor/bootstrap-vue/src/constants/key-codes.js +11 -0
- package/dist/vendor/bootstrap-vue/src/constants/popper.js +10 -0
- package/dist/vendor/bootstrap-vue/src/constants/props.js +24 -0
- package/dist/vendor/bootstrap-vue/src/constants/regex.js +35 -0
- package/dist/vendor/bootstrap-vue/src/constants/safe-types.js +15 -0
- package/dist/vendor/bootstrap-vue/src/constants/slots.js +36 -0
- package/dist/vendor/bootstrap-vue/src/directives/modal/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/directives/modal/modal.js +112 -0
- package/dist/vendor/bootstrap-vue/src/directives/tooltip/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/directives/tooltip/tooltip.js +267 -0
- package/dist/vendor/bootstrap-vue/src/directives/visible/index.js +1 -0
- package/dist/vendor/bootstrap-vue/src/directives/visible/visible.js +187 -0
- package/dist/vendor/bootstrap-vue/src/mixins/attrs.js +5 -0
- package/dist/vendor/bootstrap-vue/src/mixins/click-out.js +54 -0
- package/dist/vendor/bootstrap-vue/src/mixins/dropdown.js +470 -0
- package/dist/vendor/bootstrap-vue/src/mixins/focus-in.js +46 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-control.js +73 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-custom.js +26 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-options.js +91 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-selection.js +62 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-size.js +26 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-state.js +50 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-text.js +293 -0
- package/dist/vendor/bootstrap-vue/src/mixins/form-validity.js +50 -0
- package/dist/vendor/bootstrap-vue/src/mixins/has-listener.js +29 -0
- package/dist/vendor/bootstrap-vue/src/mixins/id.js +57 -0
- package/dist/vendor/bootstrap-vue/src/mixins/listen-on-document.js +62 -0
- package/dist/vendor/bootstrap-vue/src/mixins/listen-on-root.js +120 -0
- package/dist/vendor/bootstrap-vue/src/mixins/listen-on-window.js +62 -0
- package/dist/vendor/bootstrap-vue/src/mixins/listeners.js +25 -0
- package/dist/vendor/bootstrap-vue/src/mixins/model.js +10 -0
- package/dist/vendor/bootstrap-vue/src/mixins/normalize-slot.js +30 -0
- package/dist/vendor/bootstrap-vue/src/mixins/scoped-style.js +18 -0
- package/dist/vendor/bootstrap-vue/src/mixins/use-parent.js +14 -0
- package/dist/vendor/bootstrap-vue/src/utils/array.js +27 -0
- package/dist/vendor/bootstrap-vue/src/utils/bv-event.class.js +60 -0
- package/dist/vendor/bootstrap-vue/src/utils/cache.js +60 -0
- package/dist/vendor/bootstrap-vue/src/utils/clone-deep.js +18 -0
- package/dist/vendor/bootstrap-vue/src/utils/config-set.js +86 -0
- package/dist/vendor/bootstrap-vue/src/utils/config.js +71 -0
- package/dist/vendor/bootstrap-vue/src/utils/create-new-child-component.js +133 -0
- package/dist/vendor/bootstrap-vue/src/utils/css-escape.js +70 -0
- package/dist/vendor/bootstrap-vue/src/utils/dom.js +298 -0
- package/dist/vendor/bootstrap-vue/src/utils/element-to-vue-instance-registry.js +28 -0
- package/dist/vendor/bootstrap-vue/src/utils/env.js +16 -0
- package/dist/vendor/bootstrap-vue/src/utils/events.js +78 -0
- package/dist/vendor/bootstrap-vue/src/utils/get-event-root.js +5 -0
- package/dist/vendor/bootstrap-vue/src/utils/get-instance-from-directive.js +3 -0
- package/dist/vendor/bootstrap-vue/src/utils/get-scope-id.js +9 -0
- package/dist/vendor/bootstrap-vue/src/utils/get.js +63 -0
- package/dist/vendor/bootstrap-vue/src/utils/html.js +16 -0
- package/dist/vendor/bootstrap-vue/src/utils/identity.js +3 -0
- package/dist/vendor/bootstrap-vue/src/utils/inspect.js +35 -0
- package/dist/vendor/bootstrap-vue/src/utils/locale.js +18 -0
- package/dist/vendor/bootstrap-vue/src/utils/loose-equal.js +59 -0
- package/dist/vendor/bootstrap-vue/src/utils/loose-index-of.js +13 -0
- package/dist/vendor/bootstrap-vue/src/utils/math.js +9 -0
- package/dist/vendor/bootstrap-vue/src/utils/memoize.js +14 -0
- package/dist/vendor/bootstrap-vue/src/utils/model.js +33 -0
- package/dist/vendor/bootstrap-vue/src/utils/noop.js +3 -0
- package/dist/vendor/bootstrap-vue/src/utils/normalize-slot.js +51 -0
- package/dist/vendor/bootstrap-vue/src/utils/number.js +23 -0
- package/dist/vendor/bootstrap-vue/src/utils/object.js +72 -0
- package/dist/vendor/bootstrap-vue/src/utils/observe-dom.js +76 -0
- package/dist/vendor/bootstrap-vue/src/utils/on-instance-destroy.js +22 -0
- package/dist/vendor/bootstrap-vue/src/utils/plugins.js +124 -0
- package/dist/vendor/bootstrap-vue/src/utils/props.js +67 -0
- package/dist/vendor/bootstrap-vue/src/utils/router.js +150 -0
- package/dist/vendor/bootstrap-vue/src/utils/safe-vue-instance.js +14 -0
- package/dist/vendor/bootstrap-vue/src/utils/stable-sort.js +28 -0
- package/dist/vendor/bootstrap-vue/src/utils/string.js +47 -0
- package/dist/vendor/bootstrap-vue/src/utils/stringify-object-values.js +31 -0
- package/dist/vendor/bootstrap-vue/src/utils/warn.js +45 -0
- package/dist/vendor/bootstrap-vue/src/vue.js +55 -0
- package/package.json +4 -3
- package/src/components/base/link/link.vue +2 -2
- package/src/utils/url_utils.js +66 -0
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-divider.js +5 -2
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-form.js +16 -4
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-group.js +31 -8
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-header.js +15 -4
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown-item-button.js +32 -8
- package/src/vendor/bootstrap-vue/src/components/dropdown/dropdown.js +2 -2
- package/src/vendor/bootstrap-vue/src/components/form/form-invalid-feedback.js +35 -8
- package/src/vendor/bootstrap-vue/src/components/form/form-valid-feedback.js +35 -8
- package/src/vendor/bootstrap-vue/src/components/form-group/form-group.js +2 -2
- package/src/vendor/bootstrap-vue/src/components/form-select/form-select-option-group.js +4 -2
- package/src/vendor/bootstrap-vue/src/components/form-select/form-select-option.js +9 -3
- package/src/vendor/bootstrap-vue/src/components/form-select/form-select.js +16 -9
- package/src/vendor/bootstrap-vue/src/components/form-select/helpers/mixin-options.js +10 -3
- package/src/vendor/bootstrap-vue/src/components/form-textarea/form-textarea.js +26 -7
- package/src/vendor/bootstrap-vue/src/components/layout/col.js +2 -2
- package/src/vendor/bootstrap-vue/src/components/modal/modal.js +2 -2
- package/src/vendor/bootstrap-vue/src/components/popover/popover.js +23 -7
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-busy.js +5 -2
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-caption.js +10 -3
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-empty.js +25 -6
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-items.js +20 -5
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-pagination.js +11 -4
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-provider.js +27 -7
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-selectable.js +21 -7
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-sorting.js +72 -18
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-stacked.js +6 -3
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-table-renderer.js +72 -17
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody-row.js +18 -6
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-tbody.js +7 -3
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-tfoot.js +27 -7
- package/src/vendor/bootstrap-vue/src/components/table/helpers/mixin-thead.js +21 -6
- package/src/vendor/bootstrap-vue/src/components/tabs/tabs.js +2 -2
- package/src/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-popper.js +36 -13
- package/src/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip-template.js +10 -3
- package/src/vendor/bootstrap-vue/src/components/tooltip/helpers/bv-tooltip.js +8 -9
- package/src/vendor/bootstrap-vue/src/components/transition/bv-transition.js +20 -5
- package/src/vendor/bootstrap-vue/src/components/transporter/transporter.js +22 -6
- package/src/vendor/bootstrap-vue/src/mixins/listen-on-document.js +1 -2
- package/src/vendor/bootstrap-vue/src/mixins/listen-on-root.js +1 -2
- package/src/vendor/bootstrap-vue/src/mixins/listen-on-window.js +1 -2
- package/src/vendor/bootstrap-vue/src/utils/array.js +0 -1
- package/src/vendor/bootstrap-vue/src/utils/locale.js +1 -2
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
import { POSITION } from '../components/utilities/truncate/constants';
|
|
2
|
+
|
|
3
|
+
const COMMA = ',';
|
|
4
|
+
const CONTRAST_LEVELS = [{
|
|
5
|
+
grade: 'F',
|
|
6
|
+
min: 0,
|
|
7
|
+
max: 3
|
|
8
|
+
}, {
|
|
9
|
+
grade: 'AA+',
|
|
10
|
+
min: 3,
|
|
11
|
+
max: 4.5
|
|
12
|
+
}, {
|
|
13
|
+
grade: 'AA',
|
|
14
|
+
min: 4.5,
|
|
15
|
+
max: 7
|
|
16
|
+
}, {
|
|
17
|
+
grade: 'AAA',
|
|
18
|
+
min: 7,
|
|
19
|
+
max: 22
|
|
20
|
+
}];
|
|
21
|
+
const HEX_REGEX = /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;
|
|
22
|
+
const LEFT_MOUSE_BUTTON = 0;
|
|
23
|
+
const progressBarVariantOptions = {
|
|
24
|
+
primary: 'primary',
|
|
25
|
+
success: 'success',
|
|
26
|
+
warning: 'warning',
|
|
27
|
+
danger: 'danger'
|
|
28
|
+
};
|
|
29
|
+
const badgeSizeOptions = {
|
|
30
|
+
sm: 'sm',
|
|
31
|
+
md: 'md',
|
|
32
|
+
lg: 'lg'
|
|
33
|
+
};
|
|
34
|
+
const badgeVariantOptions = {
|
|
35
|
+
neutral: 'neutral',
|
|
36
|
+
info: 'info',
|
|
37
|
+
success: 'success',
|
|
38
|
+
warning: 'warning',
|
|
39
|
+
danger: 'danger',
|
|
40
|
+
tier: 'tier'
|
|
41
|
+
};
|
|
42
|
+
const badgeIconSizeOptions = {
|
|
43
|
+
sm: 12,
|
|
44
|
+
md: 16
|
|
45
|
+
};
|
|
46
|
+
const variantCssColorMap = {
|
|
47
|
+
muted: 'gl-text-gray-500',
|
|
48
|
+
neutral: 'gl-text-blue-100',
|
|
49
|
+
info: 'gl-text-blue-500',
|
|
50
|
+
success: 'gl-text-green-500',
|
|
51
|
+
warning: 'gl-text-orange-500',
|
|
52
|
+
danger: 'gl-text-red-500'
|
|
53
|
+
};
|
|
54
|
+
const targetOptions = ['_self', '_blank', '_parent', '_top', null];
|
|
55
|
+
const viewModeOptions = {
|
|
56
|
+
dark: 'dark',
|
|
57
|
+
light: 'light'
|
|
58
|
+
};
|
|
59
|
+
const labelColorOptions = {
|
|
60
|
+
...viewModeOptions
|
|
61
|
+
};
|
|
62
|
+
const avatarSizeOptions = [96, 64, 48, 32, 24, 16];
|
|
63
|
+
const avatarsInlineSizeOptions = [32, 24, 16];
|
|
64
|
+
const avatarShapeOptions = {
|
|
65
|
+
circle: 'circle',
|
|
66
|
+
rect: 'rect'
|
|
67
|
+
};
|
|
68
|
+
const formStateOptions = {
|
|
69
|
+
default: null,
|
|
70
|
+
valid: true,
|
|
71
|
+
invalid: false
|
|
72
|
+
};
|
|
73
|
+
const breadCrumbSizeOptions = {
|
|
74
|
+
sm: 'sm',
|
|
75
|
+
md: 'md'
|
|
76
|
+
};
|
|
77
|
+
const buttonCategoryOptions = {
|
|
78
|
+
primary: 'primary',
|
|
79
|
+
secondary: 'secondary',
|
|
80
|
+
tertiary: 'tertiary'
|
|
81
|
+
};
|
|
82
|
+
const buttonVariantOptions = {
|
|
83
|
+
default: 'default',
|
|
84
|
+
confirm: 'confirm',
|
|
85
|
+
danger: 'danger',
|
|
86
|
+
link: 'link',
|
|
87
|
+
/**
|
|
88
|
+
* The "reset" variant can be used when customization of GlButton styles is required
|
|
89
|
+
* (e.g. for the "close" button in GlLabel).
|
|
90
|
+
* It should be used sparingly and only when other approaches fail.
|
|
91
|
+
* Prefer supported variants where ever possible.
|
|
92
|
+
*/
|
|
93
|
+
reset: 'gl-reset'
|
|
94
|
+
};
|
|
95
|
+
const badgeForButtonOptions = {
|
|
96
|
+
[buttonVariantOptions.default]: badgeVariantOptions.neutral,
|
|
97
|
+
[buttonVariantOptions.confirm]: badgeVariantOptions.info,
|
|
98
|
+
[buttonVariantOptions.danger]: badgeVariantOptions.danger
|
|
99
|
+
};
|
|
100
|
+
const dropdownVariantOptions = {
|
|
101
|
+
default: 'default',
|
|
102
|
+
confirm: 'confirm',
|
|
103
|
+
info: 'info (deprecated)',
|
|
104
|
+
danger: 'danger',
|
|
105
|
+
link: 'link'
|
|
106
|
+
};
|
|
107
|
+
const dropdownItemVariantOptions = {
|
|
108
|
+
default: 'default',
|
|
109
|
+
danger: 'danger'
|
|
110
|
+
};
|
|
111
|
+
const dropdownPlacements = {
|
|
112
|
+
'right-start': 'right-start',
|
|
113
|
+
'bottom-start': 'bottom-start',
|
|
114
|
+
'bottom-end': 'bottom-end',
|
|
115
|
+
bottom: 'bottom',
|
|
116
|
+
left: 'bottom-start',
|
|
117
|
+
// deprecated, should be replaced with "bottom-start"
|
|
118
|
+
center: 'bottom',
|
|
119
|
+
// deprecated, should be replaced with "bottom"
|
|
120
|
+
right: 'bottom-end' // deprecated, should be replaced with "bottom-end"
|
|
121
|
+
};
|
|
122
|
+
const dropdownHorizontalCornerPlacement = ['right-start', 'right-end', 'left-start', 'left-end'];
|
|
123
|
+
const dropdownVerticalCornerPlacement = ['bottom-start', 'top-start', 'bottom-end', 'top-end'];
|
|
124
|
+
const dropdownAllowedAutoPlacements = {
|
|
125
|
+
'right-start': dropdownHorizontalCornerPlacement,
|
|
126
|
+
'bottom-start': dropdownVerticalCornerPlacement,
|
|
127
|
+
'bottom-end': dropdownVerticalCornerPlacement,
|
|
128
|
+
bottom: ['bottom', 'top'],
|
|
129
|
+
left: dropdownVerticalCornerPlacement,
|
|
130
|
+
// deprecated, should be replaced with "bottom-start"
|
|
131
|
+
center: ['bottom', 'top'],
|
|
132
|
+
// deprecated, should be replaced with "bottom"
|
|
133
|
+
right: dropdownVerticalCornerPlacement // deprecated, should be replaced with "bottom-end"
|
|
134
|
+
};
|
|
135
|
+
const buttonSizeOptions = {
|
|
136
|
+
small: 'sm',
|
|
137
|
+
medium: 'md'
|
|
138
|
+
};
|
|
139
|
+
const datepickerWidthOptionsMap = {
|
|
140
|
+
sm: 'sm',
|
|
141
|
+
md: 'md',
|
|
142
|
+
lg: 'lg',
|
|
143
|
+
xl: 'xl'
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
// size options all have corresponding styles (e.g. .s12 defined in icon.scss)
|
|
147
|
+
const iconSizeOptions = [8, 12, 14, 16, 24, 32, 48, 72];
|
|
148
|
+
const iconVariantOptions = {
|
|
149
|
+
current: 'gl-fill-current',
|
|
150
|
+
default: 'gl-fill-icon-default',
|
|
151
|
+
subtle: 'gl-fill-icon-subtle',
|
|
152
|
+
strong: 'gl-fill-icon-strong',
|
|
153
|
+
disabled: 'gl-fill-icon-disabled',
|
|
154
|
+
link: 'gl-fill-icon-link',
|
|
155
|
+
info: 'gl-fill-icon-info',
|
|
156
|
+
warning: 'gl-fill-icon-warning',
|
|
157
|
+
danger: 'gl-fill-icon-danger',
|
|
158
|
+
success: 'gl-fill-icon-success'
|
|
159
|
+
};
|
|
160
|
+
const animatedIconVariantOptions = {
|
|
161
|
+
current: 'gl-animated-icon-current',
|
|
162
|
+
default: 'gl-animated-icon-default',
|
|
163
|
+
subtle: 'gl-animated-icon-subtle',
|
|
164
|
+
strong: 'gl-animated-icon-strong',
|
|
165
|
+
disabled: 'gl-animated-icon-disabled',
|
|
166
|
+
link: 'gl-animated-icon-link',
|
|
167
|
+
info: 'gl-animated-icon-info',
|
|
168
|
+
warning: 'gl-animated-icon-warning',
|
|
169
|
+
danger: 'gl-animated-icon-danger',
|
|
170
|
+
success: 'gl-animated-icon-success'
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Maps badge variants to their corresponding icon variants.
|
|
175
|
+
* Used by GlSingleStat to ensure icons match the semantic meaning of their badge variant.
|
|
176
|
+
*/
|
|
177
|
+
const badgeVariantToIconVariantMap = {
|
|
178
|
+
neutral: 'default',
|
|
179
|
+
info: 'info',
|
|
180
|
+
success: 'success',
|
|
181
|
+
warning: 'warning',
|
|
182
|
+
danger: 'danger',
|
|
183
|
+
tier: 'default'
|
|
184
|
+
};
|
|
185
|
+
const linkVariantInline = 'inline';
|
|
186
|
+
const linkVariantMeta = 'meta';
|
|
187
|
+
const linkVariantMention = 'mention';
|
|
188
|
+
const linkVariantMentionCurrent = 'mentionCurrent';
|
|
189
|
+
const linkVariantUnstyled = 'unstyled';
|
|
190
|
+
const linkVariantOptions = {
|
|
191
|
+
[linkVariantInline]: 'gl-link-inline',
|
|
192
|
+
[linkVariantMeta]: 'gl-link-meta',
|
|
193
|
+
[linkVariantMention]: 'gl-link-mention',
|
|
194
|
+
[linkVariantMentionCurrent]: 'gl-link-mention-current',
|
|
195
|
+
[linkVariantUnstyled]: ''
|
|
196
|
+
};
|
|
197
|
+
const triggerVariantOptions = {
|
|
198
|
+
click: 'click',
|
|
199
|
+
hover: 'hover',
|
|
200
|
+
focus: 'focus'
|
|
201
|
+
};
|
|
202
|
+
const tooltipPlacements = {
|
|
203
|
+
top: 'top',
|
|
204
|
+
left: 'left',
|
|
205
|
+
right: 'right',
|
|
206
|
+
bottom: 'bottom'
|
|
207
|
+
};
|
|
208
|
+
const popoverPlacements = {
|
|
209
|
+
top: 'top',
|
|
210
|
+
right: 'right',
|
|
211
|
+
bottom: 'bottom',
|
|
212
|
+
left: 'left'
|
|
213
|
+
};
|
|
214
|
+
const stackedPresentationOptions = {
|
|
215
|
+
stacked: 'stacked',
|
|
216
|
+
tiled: 'tiled'
|
|
217
|
+
};
|
|
218
|
+
const alignOptions = {
|
|
219
|
+
left: 'left',
|
|
220
|
+
center: 'center',
|
|
221
|
+
right: 'right',
|
|
222
|
+
fill: 'fill'
|
|
223
|
+
};
|
|
224
|
+
const alertVariantOptions = {
|
|
225
|
+
success: 'success',
|
|
226
|
+
warning: 'warning',
|
|
227
|
+
danger: 'danger',
|
|
228
|
+
info: 'info',
|
|
229
|
+
tip: 'tip'
|
|
230
|
+
};
|
|
231
|
+
const alertVariantIconMap = {
|
|
232
|
+
success: 'check-circle',
|
|
233
|
+
warning: 'warning',
|
|
234
|
+
danger: 'error',
|
|
235
|
+
info: 'information-o',
|
|
236
|
+
tip: 'bulb'
|
|
237
|
+
};
|
|
238
|
+
const colorThemes = {
|
|
239
|
+
indigo: 'theme-indigo-900',
|
|
240
|
+
'light-indigo': 'theme-indigo-700',
|
|
241
|
+
blue: 'theme-blue-900',
|
|
242
|
+
'light-blue': 'theme-blue-700',
|
|
243
|
+
green: 'theme-green-900',
|
|
244
|
+
'light-green': 'theme-green-700',
|
|
245
|
+
red: 'theme-red-900',
|
|
246
|
+
'light-red': 'theme-red-700',
|
|
247
|
+
dark: 'gray-900',
|
|
248
|
+
light: 'gray-700'
|
|
249
|
+
};
|
|
250
|
+
const modalButtonDefaults = {
|
|
251
|
+
actionPrimary: {
|
|
252
|
+
variant: 'confirm',
|
|
253
|
+
category: 'primary'
|
|
254
|
+
},
|
|
255
|
+
actionSecondary: {
|
|
256
|
+
variant: 'confirm',
|
|
257
|
+
category: 'secondary'
|
|
258
|
+
},
|
|
259
|
+
actionCancel: {
|
|
260
|
+
variant: 'default'
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
const tabsButtonDefaults = {
|
|
264
|
+
actionPrimary: {
|
|
265
|
+
variant: 'confirm',
|
|
266
|
+
category: 'primary'
|
|
267
|
+
},
|
|
268
|
+
actionSecondary: {
|
|
269
|
+
variant: 'default',
|
|
270
|
+
category: 'secondary'
|
|
271
|
+
},
|
|
272
|
+
actionTertiary: {
|
|
273
|
+
variant: 'default'
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
const tokenVariants = ['default', 'search-type', 'search-value'];
|
|
277
|
+
const resizeDebounceTime = 200;
|
|
278
|
+
|
|
279
|
+
// Datetime constants
|
|
280
|
+
const defaultDateFormat = 'YYYY-MM-DD';
|
|
281
|
+
const bannerVariants = ['promotion', 'introduction'];
|
|
282
|
+
const maxZIndex = 10;
|
|
283
|
+
const modalSizeOptions = {
|
|
284
|
+
sm: 'sm',
|
|
285
|
+
md: 'md',
|
|
286
|
+
lg: 'lg'
|
|
287
|
+
};
|
|
288
|
+
const focusableTags = ['INPUT', 'TEXTAREA', 'A', 'BUTTON', 'SELECT'];
|
|
289
|
+
const keyboard = {
|
|
290
|
+
escape: 'Escape',
|
|
291
|
+
backspace: 'Backspace',
|
|
292
|
+
delete: 'Delete',
|
|
293
|
+
left: 'Left',
|
|
294
|
+
arrowLeft: 'ArrowLeft',
|
|
295
|
+
right: 'Right',
|
|
296
|
+
arrowRight: 'ArrowRight',
|
|
297
|
+
home: 'Home',
|
|
298
|
+
end: 'End',
|
|
299
|
+
tab: 'Tab'
|
|
300
|
+
};
|
|
301
|
+
const truncateOptions = POSITION;
|
|
302
|
+
const formInputWidths = {
|
|
303
|
+
xs: 'xs',
|
|
304
|
+
sm: 'sm',
|
|
305
|
+
md: 'md',
|
|
306
|
+
lg: 'lg',
|
|
307
|
+
xl: 'xl',
|
|
308
|
+
'(unset or null)': null
|
|
309
|
+
};
|
|
310
|
+
const toggleLabelPosition = {
|
|
311
|
+
hidden: 'hidden',
|
|
312
|
+
left: 'left',
|
|
313
|
+
top: 'top'
|
|
314
|
+
};
|
|
315
|
+
const tooltipActionEvents = ['open', 'close', 'enable', 'disable'];
|
|
316
|
+
const drawerVariants = {
|
|
317
|
+
default: 'default',
|
|
318
|
+
sidebar: 'sidebar'
|
|
319
|
+
};
|
|
320
|
+
const loadingIconSizes = {
|
|
321
|
+
'sm (16x16)': 'sm',
|
|
322
|
+
'md (24x24)': 'md',
|
|
323
|
+
'lg (32x32)': 'lg',
|
|
324
|
+
'xl (64x64)': 'xl'
|
|
325
|
+
};
|
|
326
|
+
const loadingIconVariants = {
|
|
327
|
+
spinner: 'spinner',
|
|
328
|
+
dots: 'dots'
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
export { COMMA, CONTRAST_LEVELS, HEX_REGEX, LEFT_MOUSE_BUTTON, alertVariantIconMap, alertVariantOptions, alignOptions, animatedIconVariantOptions, avatarShapeOptions, avatarSizeOptions, avatarsInlineSizeOptions, badgeForButtonOptions, badgeIconSizeOptions, badgeSizeOptions, badgeVariantOptions, badgeVariantToIconVariantMap, bannerVariants, breadCrumbSizeOptions, buttonCategoryOptions, buttonSizeOptions, buttonVariantOptions, colorThemes, datepickerWidthOptionsMap, defaultDateFormat, drawerVariants, dropdownAllowedAutoPlacements, dropdownItemVariantOptions, dropdownPlacements, dropdownVariantOptions, focusableTags, formInputWidths, formStateOptions, iconSizeOptions, iconVariantOptions, keyboard, labelColorOptions, linkVariantInline, linkVariantMention, linkVariantMentionCurrent, linkVariantMeta, linkVariantOptions, linkVariantUnstyled, loadingIconSizes, loadingIconVariants, maxZIndex, modalButtonDefaults, modalSizeOptions, popoverPlacements, progressBarVariantOptions, resizeDebounceTime, stackedPresentationOptions, tabsButtonDefaults, targetOptions, toggleLabelPosition, tokenVariants, tooltipActionEvents, tooltipPlacements, triggerVariantOptions, truncateOptions, variantCssColorMap, viewModeOptions };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const getRepeatingValue = index => {
|
|
2
|
+
const values = [100, 500, 400, 200, 100, 800, 400, 500, 600, 300, 800, 900, 110, 700, 400, 300, 500, 300, 400, 600, 700];
|
|
3
|
+
return index < values.length ? values[index] : values[index % values.length];
|
|
4
|
+
};
|
|
5
|
+
const generateTimeSeries = () => new Array(100).fill(0).map((el, i) => [new Date(2018, 0, i), getRepeatingValue(i)]);
|
|
6
|
+
|
|
7
|
+
// takes an element and a list and `intersperses' that element between the elements of the list.
|
|
8
|
+
// (',' ['a', 'b', 'c']) -> ['a', ',', 'b', ',', 'c']
|
|
9
|
+
const intersperse = (separator, items) => {
|
|
10
|
+
const [head, ...rest] = items;
|
|
11
|
+
const separatorFactory = typeof separator === 'function' ? separator : () => separator;
|
|
12
|
+
return [head, ...rest.flatMap(item => [separatorFactory(), item], rest)];
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
// inserts a value at a given index into an array
|
|
16
|
+
// (1, 2, [1, 3, 4]) -> [1, 2, 3, 4]
|
|
17
|
+
const insert = (index, newItem, items) => [...items.slice(0, index), newItem, ...items.slice(index)];
|
|
18
|
+
|
|
19
|
+
export { generateTimeSeries, insert, intersperse };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// These utility methods come from the Gitlab repo; app/assets/javascripts/lib/utils/datetime_utility.js
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This method allows you to create new Date instance from existing
|
|
5
|
+
* date instance without keeping the reference.
|
|
6
|
+
*
|
|
7
|
+
* @param {Date} date
|
|
8
|
+
*/
|
|
9
|
+
const newDate = date => date instanceof Date ? new Date(date.getTime()) : new Date();
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Computes the difference between 2 date objects.
|
|
13
|
+
*
|
|
14
|
+
* @param {Date} a the start date
|
|
15
|
+
* @param {Date} b the end date
|
|
16
|
+
* @example
|
|
17
|
+
* // returns 5
|
|
18
|
+
* getDayDifference(new Date('2020-08-10'), new Date('2020-08-15'));
|
|
19
|
+
* @returns {Number} Number of days between the 2 dates
|
|
20
|
+
*/
|
|
21
|
+
const getDayDifference = (a, b) => {
|
|
22
|
+
const millisecondsPerDay = 1000 * 60 * 60 * 24;
|
|
23
|
+
const date1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());
|
|
24
|
+
const date2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate());
|
|
25
|
+
return Math.floor((date2 - date1) / millisecondsPerDay);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Subtracts a given number of days from a given date and returns the new date.
|
|
30
|
+
*
|
|
31
|
+
* @param {Date} date the date that we will substract days from
|
|
32
|
+
* @param {Number} daysInPast number of days that are subtracted from a given date
|
|
33
|
+
* @example
|
|
34
|
+
* // returns Mon Aug 10 2020 00:00:00
|
|
35
|
+
* getDateInPast(new Date('2020-08-15'), 5);
|
|
36
|
+
* @returns {Date} Date in past as Date object
|
|
37
|
+
*/
|
|
38
|
+
const getDateInPast = (date, daysInPast) => new Date(newDate(date).setDate(date.getDate() - daysInPast));
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Adds a given number of days to a given date and returns the new date.
|
|
42
|
+
*
|
|
43
|
+
* @param {Date} date the date that we will add days to
|
|
44
|
+
* @param {Number} daysInFuture number of days that are added to a given date
|
|
45
|
+
* @example
|
|
46
|
+
* // returns Mon Aug 15 2020 00:00:00
|
|
47
|
+
* getDateInFuture(new Date('2020-08-10'), 5);
|
|
48
|
+
* @returns {Date} Date in future as Date object
|
|
49
|
+
*/
|
|
50
|
+
const getDateInFuture = (date, daysInFuture) => new Date(newDate(date).setDate(date.getDate() + daysInFuture));
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Are the given two dates equal
|
|
54
|
+
*
|
|
55
|
+
* @param {Date} date1
|
|
56
|
+
* @param {Date} date2
|
|
57
|
+
* @returns {Boolean}
|
|
58
|
+
*/
|
|
59
|
+
const areDatesEqual = (date1, date2) => Boolean(date1 && date2 && new Date(date1).getTime() === new Date(date2).getTime());
|
|
60
|
+
|
|
61
|
+
export { areDatesEqual, getDateInFuture, getDateInPast, getDayDifference, newDate };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Performs a deep, type-coercing equality check between two values.
|
|
3
|
+
*
|
|
4
|
+
* Unlike strict equality (`===`) or lodash's `isEqual`, this function:
|
|
5
|
+
* - Compares objects and arrays by structure, not reference
|
|
6
|
+
* - Coerces types before comparing primitives (e.g. `123` equals `'123'`)
|
|
7
|
+
* - Compares Date objects by timestamp
|
|
8
|
+
* - Compares File objects by inherited properties (name, size, type, lastModified)
|
|
9
|
+
*
|
|
10
|
+
* Used in form components (radio, checkbox) to detect meaningful value changes
|
|
11
|
+
* in watchers, avoiding redundant event emissions when values are loosely equivalent.
|
|
12
|
+
*
|
|
13
|
+
* @param {*} a - First value to compare
|
|
14
|
+
* @param {*} b - Second value to compare
|
|
15
|
+
* @returns {boolean} Whether the two values are loosely equal
|
|
16
|
+
*/
|
|
17
|
+
function looseEqual(a, b) {
|
|
18
|
+
if (a === b) {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
let aValidType = a instanceof Date;
|
|
22
|
+
let bValidType = b instanceof Date;
|
|
23
|
+
if (aValidType || bValidType) {
|
|
24
|
+
return aValidType && bValidType ? a.getTime() === b.getTime() : false;
|
|
25
|
+
}
|
|
26
|
+
aValidType = Array.isArray(a);
|
|
27
|
+
bValidType = Array.isArray(b);
|
|
28
|
+
if (aValidType || bValidType) {
|
|
29
|
+
if (!aValidType || !bValidType || a.length !== b.length) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
// Compare arrays element by element
|
|
33
|
+
// Uses a for loop to handle sparse arrays (array.every doesn't handle sparse)
|
|
34
|
+
let equal = true;
|
|
35
|
+
for (let i = 0; equal && i < a.length; i += 1) {
|
|
36
|
+
equal = looseEqual(a[i], b[i]);
|
|
37
|
+
}
|
|
38
|
+
return equal;
|
|
39
|
+
}
|
|
40
|
+
aValidType = a !== null && typeof a === 'object';
|
|
41
|
+
bValidType = b !== null && typeof b === 'object';
|
|
42
|
+
if (aValidType || bValidType) {
|
|
43
|
+
if (!aValidType || !bValidType) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
const aKeysCount = Object.keys(a).length;
|
|
47
|
+
const bKeysCount = Object.keys(b).length;
|
|
48
|
+
if (aKeysCount !== bKeysCount) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
// Intentionally iterates inherited properties to compare complex types
|
|
52
|
+
// like File objects where properties are on the prototype
|
|
53
|
+
// eslint-disable-next-line guard-for-in
|
|
54
|
+
for (const key in a) {
|
|
55
|
+
const aHasKey = Object.prototype.hasOwnProperty.call(a, key);
|
|
56
|
+
const bHasKey = Object.prototype.hasOwnProperty.call(b, key);
|
|
57
|
+
if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return String(a) === String(b);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Finds the first index in an array where the element is loosely equal to the given value.
|
|
67
|
+
*
|
|
68
|
+
* Works like `Array.prototype.indexOf`, but uses {@link looseEqual} for comparison
|
|
69
|
+
* instead of strict equality.
|
|
70
|
+
*
|
|
71
|
+
* @param {Array} array - The array to search
|
|
72
|
+
* @param {*} value - The value to find
|
|
73
|
+
* @returns {number} The index of the first loosely matching element, or -1 if not found
|
|
74
|
+
*/
|
|
75
|
+
function looseIndexOf(array, value) {
|
|
76
|
+
for (let i = 0; i < array.length; i += 1) {
|
|
77
|
+
if (looseEqual(array[i], value)) {
|
|
78
|
+
return i;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return -1;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export { looseEqual, looseIndexOf };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalizes a single option into a standard { value, text, html, disabled } shape.
|
|
3
|
+
*/
|
|
4
|
+
function normalizeOption(option) {
|
|
5
|
+
if (option !== null && typeof option === 'object') {
|
|
6
|
+
const {
|
|
7
|
+
value,
|
|
8
|
+
text,
|
|
9
|
+
html,
|
|
10
|
+
disabled
|
|
11
|
+
} = option;
|
|
12
|
+
return {
|
|
13
|
+
value: value === undefined ? text : value,
|
|
14
|
+
text: String(text),
|
|
15
|
+
html,
|
|
16
|
+
disabled: Boolean(disabled)
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
value: option,
|
|
21
|
+
text: String(option),
|
|
22
|
+
disabled: false
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Normalizes an options array into a consistent format for rendering.
|
|
28
|
+
*
|
|
29
|
+
* Each option can be a primitive (string, number) or an object with
|
|
30
|
+
* `{ value, text, html, disabled }` properties. Primitives are converted
|
|
31
|
+
* to `{ value, text, disabled: false }`. For objects, `value` defaults to
|
|
32
|
+
* `text` when omitted and `disabled` defaults to `false`.
|
|
33
|
+
*
|
|
34
|
+
* @param {Array<string|number|{value?: *, text: string, html?: string, disabled?: boolean}>} options
|
|
35
|
+
* The raw options array to normalize.
|
|
36
|
+
* @returns {Array<{value: *, text: string, html?: string, disabled: boolean}>}
|
|
37
|
+
* The normalized options, or an empty array if the input is not an array.
|
|
38
|
+
*/
|
|
39
|
+
function normalizeOptions(options) {
|
|
40
|
+
if (Array.isArray(options)) {
|
|
41
|
+
return options.map(option => normalizeOption(option));
|
|
42
|
+
}
|
|
43
|
+
return [];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export { normalizeOptions };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { escape } from 'lodash-es';
|
|
2
|
+
import { i18n } from '../config';
|
|
3
|
+
|
|
4
|
+
const defaultPluralHandler = (n, singleValue, pluralValue) => {
|
|
5
|
+
const value = n === 1 ? singleValue : pluralValue;
|
|
6
|
+
return value.replace(/%d/g, n);
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Marks a label as translatable and pluralized.
|
|
11
|
+
*
|
|
12
|
+
* @param {*} key Translation key to be leveraged by the consumer to provide a generic translation at configuration time.
|
|
13
|
+
* @param {*} singularValue The singular value to be relied on if the consumer doesn't have translation capabilities.
|
|
14
|
+
* @param {*} pluralValue The plural value to be relied on if the consumer doesn't have translation capabilities.
|
|
15
|
+
* @returns {function} A function that takes a number and returns the pluralized translated label.
|
|
16
|
+
*/
|
|
17
|
+
const translatePlural = (key, singularValue, pluralValue) => {
|
|
18
|
+
if (i18n[key]) {
|
|
19
|
+
return i18n[key];
|
|
20
|
+
}
|
|
21
|
+
return x => defaultPluralHandler(x, singularValue, pluralValue);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Very limited implementation of sprintf supporting only named parameters.
|
|
26
|
+
* Copied from the GitLab repo: https://gitlab.com/gitlab-org/gitlab/-/blob/0dff8b02accb3dccbf6cd31236834c37013aad59/app/assets/javascripts/locale/sprintf.js.
|
|
27
|
+
* @param {string} input - (translated) text with parameters (e.g. '%{num_users} users use us')
|
|
28
|
+
* @param {Object.<string, string|number>} [parameters] - object mapping parameter names to values (e.g. { num_users: 5 })
|
|
29
|
+
* @param {boolean} [escapeParameters=true] - whether parameter values should be escaped (see https://lodash.com/docs/4.17.15#escape)
|
|
30
|
+
* @returns {string} the text with parameters replaces (e.g. '5 users use us')
|
|
31
|
+
* @see https://ruby-doc.org/core-2.3.3/Kernel.html#method-i-sprintf
|
|
32
|
+
* @see https://gitlab.com/gitlab-org/gitlab-foss/issues/37992
|
|
33
|
+
*/
|
|
34
|
+
function sprintf(input, parameters) {
|
|
35
|
+
let escapeParameters = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
36
|
+
let output = input;
|
|
37
|
+
output = output.replace(/%+/g, '%');
|
|
38
|
+
if (parameters) {
|
|
39
|
+
const mappedParameters = new Map(Object.entries(parameters));
|
|
40
|
+
mappedParameters.forEach((key, parameterName) => {
|
|
41
|
+
const parameterValue = mappedParameters.get(parameterName);
|
|
42
|
+
const escapedParameterValue = escapeParameters ? escape(parameterValue) : parameterValue;
|
|
43
|
+
// Pass the param value as a function to ignore special replacement patterns like $` and $'.
|
|
44
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#syntax
|
|
45
|
+
output = output.replace(new RegExp(`%{${parameterName}}`, 'g'), () => escapedParameterValue);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
return output;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Mark a label as translatable.
|
|
53
|
+
*
|
|
54
|
+
* @param {string} key Translation key to be leveraged by the consumer to provide a generic translation at configuration time.
|
|
55
|
+
* @param {string} defaultValue A fallback value to be relied on if the consumer doesn't have translation capabilities.
|
|
56
|
+
* @param {Object.<string, string|number>} [parameters] - Optional object mapping parameter names to values for sprintf substitution.
|
|
57
|
+
* @returns {string} The translated label.
|
|
58
|
+
*/
|
|
59
|
+
const translate = (key, defaultValue, parameters) => {
|
|
60
|
+
var _i18n$key;
|
|
61
|
+
const translatedValue = (_i18n$key = i18n[key]) !== null && _i18n$key !== void 0 ? _i18n$key : defaultValue;
|
|
62
|
+
return parameters ? sprintf(translatedValue, parameters) : translatedValue;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export { sprintf, translate, translatePlural };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import Vue from 'vue';
|
|
2
|
+
|
|
3
|
+
// Fragment will be available only in Vue.js 3
|
|
4
|
+
const {
|
|
5
|
+
Fragment,
|
|
6
|
+
Comment,
|
|
7
|
+
Text
|
|
8
|
+
} = Vue;
|
|
9
|
+
function isVnodeEmpty(vnode) {
|
|
10
|
+
if (!vnode || Comment && vnode.type === Comment) {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
if (Text && vnode.type === Text && !vnode.children.trim()) {
|
|
14
|
+
// Vue.js 3 text string is located in the children
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
if (Array.isArray(vnode)) {
|
|
18
|
+
// eslint-disable-next-line unicorn/no-array-callback-reference
|
|
19
|
+
return vnode.every(isVnodeEmpty);
|
|
20
|
+
}
|
|
21
|
+
if (Fragment && vnode.type === Fragment) {
|
|
22
|
+
// Vue.js 3 fragment, check children
|
|
23
|
+
// eslint-disable-next-line unicorn/no-array-callback-reference
|
|
24
|
+
return vnode.children.every(isVnodeEmpty);
|
|
25
|
+
}
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
function isSlotEmpty(vueInstance, slot, slotArgs) {
|
|
29
|
+
var _vueInstance$$scopedS, _vueInstance$$scopedS2;
|
|
30
|
+
const slotContent = (_vueInstance$$scopedS = (_vueInstance$$scopedS2 = vueInstance.$scopedSlots)[slot]) === null || _vueInstance$$scopedS === void 0 ? void 0 : _vueInstance$$scopedS.call(_vueInstance$$scopedS2, slotArgs);
|
|
31
|
+
return isVnodeEmpty(slotContent);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { isSlotEmpty, isVnodeEmpty };
|