@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,217 @@
|
|
|
1
|
+
import GlToken from '../token/token';
|
|
2
|
+
import { stopEvent } from '../../../utils/utils';
|
|
3
|
+
import GlFilteredSearchTokenSegment from './filtered_search_token_segment';
|
|
4
|
+
import { termTokenDefinition, match, tokenToOption, INTENT_ACTIVATE_PREVIOUS, TOKEN_CLOSE_SELECTOR, TERM_TOKEN_TYPE } from './filtered_search_utils';
|
|
5
|
+
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
6
|
+
|
|
7
|
+
var script = {
|
|
8
|
+
name: 'GlFilteredSearchTerm',
|
|
9
|
+
components: {
|
|
10
|
+
GlFilteredSearchTokenSegment,
|
|
11
|
+
GlToken
|
|
12
|
+
},
|
|
13
|
+
inject: ['termsAsTokens'],
|
|
14
|
+
inheritAttrs: false,
|
|
15
|
+
props: {
|
|
16
|
+
/**
|
|
17
|
+
* Tokens available for this filtered search instance.
|
|
18
|
+
*/
|
|
19
|
+
availableTokens: {
|
|
20
|
+
type: Array,
|
|
21
|
+
required: true
|
|
22
|
+
},
|
|
23
|
+
/**
|
|
24
|
+
* Determines if the term is being edited or not.
|
|
25
|
+
*/
|
|
26
|
+
active: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
required: false,
|
|
29
|
+
default: false
|
|
30
|
+
},
|
|
31
|
+
/**
|
|
32
|
+
* Current term value.
|
|
33
|
+
*/
|
|
34
|
+
value: {
|
|
35
|
+
type: Object,
|
|
36
|
+
required: false,
|
|
37
|
+
default: () => ({
|
|
38
|
+
data: ''
|
|
39
|
+
})
|
|
40
|
+
},
|
|
41
|
+
placeholder: {
|
|
42
|
+
type: String,
|
|
43
|
+
required: false,
|
|
44
|
+
default: ''
|
|
45
|
+
},
|
|
46
|
+
/**
|
|
47
|
+
* HTML attributes to add to the search input.
|
|
48
|
+
*/
|
|
49
|
+
searchInputAttributes: {
|
|
50
|
+
type: Object,
|
|
51
|
+
required: false,
|
|
52
|
+
default: () => ({})
|
|
53
|
+
},
|
|
54
|
+
/**
|
|
55
|
+
* If this is the last token.
|
|
56
|
+
*/
|
|
57
|
+
isLastToken: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
required: false,
|
|
60
|
+
default: false
|
|
61
|
+
},
|
|
62
|
+
/**
|
|
63
|
+
* The current `value` (tokens) of the ancestor GlFilteredSearch component.
|
|
64
|
+
*/
|
|
65
|
+
currentValue: {
|
|
66
|
+
type: Array,
|
|
67
|
+
required: false,
|
|
68
|
+
default: () => []
|
|
69
|
+
},
|
|
70
|
+
cursorPosition: {
|
|
71
|
+
type: String,
|
|
72
|
+
required: false,
|
|
73
|
+
default: 'end',
|
|
74
|
+
validator: value => ['start', 'end'].includes(value)
|
|
75
|
+
},
|
|
76
|
+
/**
|
|
77
|
+
* The title of the text search option. Ignored unless termsAsTokens is enabled.
|
|
78
|
+
*/
|
|
79
|
+
searchTextOptionLabel: {
|
|
80
|
+
type: String,
|
|
81
|
+
required: false,
|
|
82
|
+
default: termTokenDefinition.title
|
|
83
|
+
},
|
|
84
|
+
viewOnly: {
|
|
85
|
+
type: Boolean,
|
|
86
|
+
required: false,
|
|
87
|
+
default: false
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
computed: {
|
|
91
|
+
showInput() {
|
|
92
|
+
return this.termsAsTokens() || Boolean(this.placeholder) || this.isLastToken;
|
|
93
|
+
},
|
|
94
|
+
showToken() {
|
|
95
|
+
return this.termsAsTokens() && Boolean(this.value.data);
|
|
96
|
+
},
|
|
97
|
+
suggestedTokens() {
|
|
98
|
+
if (this.viewOnly) {
|
|
99
|
+
return [];
|
|
100
|
+
}
|
|
101
|
+
const tokens = this.availableTokens.filter(token => {
|
|
102
|
+
if (typeof token.match === 'function') {
|
|
103
|
+
return token.match.call(null, {
|
|
104
|
+
query: this.value.data,
|
|
105
|
+
title: token.title,
|
|
106
|
+
defaultMatcher: match
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
return match(token.title, this.value.data);
|
|
110
|
+
});
|
|
111
|
+
if (this.termsAsTokens() && this.value.data) {
|
|
112
|
+
tokens.push({
|
|
113
|
+
...termTokenDefinition,
|
|
114
|
+
title: this.searchTextOptionLabel
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// eslint-disable-next-line unicorn/no-array-callback-reference
|
|
119
|
+
return tokens.map(tokenToOption);
|
|
120
|
+
},
|
|
121
|
+
internalValue: {
|
|
122
|
+
get() {
|
|
123
|
+
return this.value.data;
|
|
124
|
+
},
|
|
125
|
+
set(data) {
|
|
126
|
+
/**
|
|
127
|
+
* Emitted when the token changes its value.
|
|
128
|
+
*
|
|
129
|
+
* @event input
|
|
130
|
+
* @type {object} dataObj Object containing the update value.
|
|
131
|
+
*/
|
|
132
|
+
this.$emit('input', {
|
|
133
|
+
data
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
eventListeners() {
|
|
138
|
+
return this.viewOnly ? {} : {
|
|
139
|
+
mousedown: this.stopMousedownOnCloseButton,
|
|
140
|
+
close: this.destroyByClose
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
methods: {
|
|
145
|
+
onBackspace() {
|
|
146
|
+
/**
|
|
147
|
+
* Emitted when token value is empty and backspace is pressed.
|
|
148
|
+
* Includes user intent to activate previous token.
|
|
149
|
+
*
|
|
150
|
+
* @event destroy
|
|
151
|
+
* @type {object} details The user intent
|
|
152
|
+
*/
|
|
153
|
+
this.$emit('destroy', {
|
|
154
|
+
intent: INTENT_ACTIVATE_PREVIOUS
|
|
155
|
+
});
|
|
156
|
+
},
|
|
157
|
+
stopMousedownOnCloseButton(event) {
|
|
158
|
+
if (event.target.closest(TOKEN_CLOSE_SELECTOR)) {
|
|
159
|
+
stopEvent(event);
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
destroyByClose() {
|
|
163
|
+
this.$emit('destroy');
|
|
164
|
+
},
|
|
165
|
+
onComplete(type) {
|
|
166
|
+
if (type === TERM_TOKEN_TYPE) {
|
|
167
|
+
// We've completed this term token
|
|
168
|
+
this.$emit('complete');
|
|
169
|
+
} else {
|
|
170
|
+
// We're changing the current token type
|
|
171
|
+
this.$emit('replace', {
|
|
172
|
+
type
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
/* script */
|
|
180
|
+
const __vue_script__ = script;
|
|
181
|
+
|
|
182
|
+
/* template */
|
|
183
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-filtered-search-term gl-h-auto",attrs:{"data-testid":"filtered-search-term"}},[_c('gl-filtered-search-token-segment',{ref:"segment",staticClass:"gl-filtered-search-term-token",attrs:{"is-term":"","active":_vm.active,"cursor-position":_vm.cursorPosition,"search-input-attributes":_vm.searchInputAttributes,"is-last-token":_vm.isLastToken,"current-value":_vm.currentValue,"view-only":_vm.viewOnly,"options":_vm.suggestedTokens},on:{"activate":function($event){return _vm.$emit('activate')},"deactivate":function($event){return _vm.$emit('deactivate')},"complete":_vm.onComplete,"backspace":_vm.onBackspace,"submit":function($event){return _vm.$emit('submit')},"split":function($event){return _vm.$emit('split', $event)},"previous":function($event){return _vm.$emit('previous')},"next":function($event){return _vm.$emit('next')}},scopedSlots:_vm._u([{key:"view",fn:function(ref){
|
|
184
|
+
var label = ref.label;
|
|
185
|
+
return [(_vm.showToken)?_c('gl-token',_vm._g({class:{ 'gl-cursor-pointer': !_vm.viewOnly },attrs:{"view-only":_vm.viewOnly}},_vm.eventListeners),[_vm._v(_vm._s(_vm.value.data))]):(_vm.showInput)?_c('input',_vm._b({staticClass:"gl-filtered-search-term-input",attrs:{"placeholder":_vm.placeholder,"aria-label":label,"readonly":_vm.viewOnly,"disabled":_vm.viewOnly,"data-testid":"filtered-search-term-input"},on:{"focusin":function($event){return _vm.$emit('activate')},"focusout":function($event){return _vm.$emit('deactivate')}}},'input',_vm.searchInputAttributes,false)):[_vm._v(_vm._s(_vm.value.data))]]}}]),model:{value:(_vm.internalValue),callback:function ($$v) {_vm.internalValue=$$v;},expression:"internalValue"}})],1)};
|
|
186
|
+
var __vue_staticRenderFns__ = [];
|
|
187
|
+
|
|
188
|
+
/* style */
|
|
189
|
+
const __vue_inject_styles__ = undefined;
|
|
190
|
+
/* scoped */
|
|
191
|
+
const __vue_scope_id__ = undefined;
|
|
192
|
+
/* module identifier */
|
|
193
|
+
const __vue_module_identifier__ = undefined;
|
|
194
|
+
/* functional template */
|
|
195
|
+
const __vue_is_functional_template__ = false;
|
|
196
|
+
/* style inject */
|
|
197
|
+
|
|
198
|
+
/* style inject SSR */
|
|
199
|
+
|
|
200
|
+
/* style inject shadow dom */
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
const __vue_component__ = /*#__PURE__*/__vue_normalize__(
|
|
205
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
206
|
+
__vue_inject_styles__,
|
|
207
|
+
__vue_script__,
|
|
208
|
+
__vue_scope_id__,
|
|
209
|
+
__vue_is_functional_template__,
|
|
210
|
+
__vue_module_identifier__,
|
|
211
|
+
false,
|
|
212
|
+
undefined,
|
|
213
|
+
undefined,
|
|
214
|
+
undefined
|
|
215
|
+
);
|
|
216
|
+
|
|
217
|
+
export { __vue_component__ as default };
|
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
import { cloneDeep, isEqual } from 'lodash-es';
|
|
2
|
+
import GlToken from '../token/token';
|
|
3
|
+
import { stopEvent } from '../../../utils/utils';
|
|
4
|
+
import GlFilteredSearchTokenSegment from './filtered_search_token_segment';
|
|
5
|
+
import { tokenToOption, createTerm, TOKEN_CLOSE_SELECTOR } from './filtered_search_utils';
|
|
6
|
+
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
7
|
+
|
|
8
|
+
const SEGMENT_TITLE = 'TYPE';
|
|
9
|
+
const SEGMENT_OPERATOR = 'OPERATOR';
|
|
10
|
+
const SEGMENT_DATA = 'DATA';
|
|
11
|
+
const DEFAULT_OPERATORS = [{
|
|
12
|
+
value: '=',
|
|
13
|
+
description: 'is',
|
|
14
|
+
default: true
|
|
15
|
+
}, {
|
|
16
|
+
value: '!=',
|
|
17
|
+
description: 'is not'
|
|
18
|
+
}];
|
|
19
|
+
var script = {
|
|
20
|
+
name: 'GlFilteredSearchToken',
|
|
21
|
+
// FIXME: temporary workaround to ensure compatibility with @vue/compat
|
|
22
|
+
__v_skip: true,
|
|
23
|
+
components: {
|
|
24
|
+
GlToken,
|
|
25
|
+
GlFilteredSearchTokenSegment
|
|
26
|
+
},
|
|
27
|
+
inheritAttrs: false,
|
|
28
|
+
props: {
|
|
29
|
+
availableTokens: {
|
|
30
|
+
type: Array,
|
|
31
|
+
required: false,
|
|
32
|
+
default: () => []
|
|
33
|
+
},
|
|
34
|
+
/**
|
|
35
|
+
* Token configuration with available operators and options.
|
|
36
|
+
*/
|
|
37
|
+
config: {
|
|
38
|
+
type: Object,
|
|
39
|
+
required: false,
|
|
40
|
+
default: () => ({})
|
|
41
|
+
},
|
|
42
|
+
/**
|
|
43
|
+
* Determines if the token is being edited or not.
|
|
44
|
+
*/
|
|
45
|
+
active: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
required: false,
|
|
48
|
+
default: false
|
|
49
|
+
},
|
|
50
|
+
multiSelectValues: {
|
|
51
|
+
type: Array,
|
|
52
|
+
required: false,
|
|
53
|
+
default: () => []
|
|
54
|
+
},
|
|
55
|
+
/**
|
|
56
|
+
* Current token value.
|
|
57
|
+
*/
|
|
58
|
+
value: {
|
|
59
|
+
type: Object,
|
|
60
|
+
required: false,
|
|
61
|
+
default: () => ({
|
|
62
|
+
operator: '',
|
|
63
|
+
data: ''
|
|
64
|
+
})
|
|
65
|
+
},
|
|
66
|
+
/**
|
|
67
|
+
* Display operators' descriptions instead of their values (e.g., "is" instead of "=").
|
|
68
|
+
*/
|
|
69
|
+
showFriendlyText: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
required: false,
|
|
72
|
+
default: false
|
|
73
|
+
},
|
|
74
|
+
cursorPosition: {
|
|
75
|
+
type: String,
|
|
76
|
+
required: false,
|
|
77
|
+
default: 'end',
|
|
78
|
+
validator: value => ['start', 'end'].includes(value)
|
|
79
|
+
},
|
|
80
|
+
viewOnly: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
required: false,
|
|
83
|
+
default: false
|
|
84
|
+
},
|
|
85
|
+
dataSegmentInputAttributes: {
|
|
86
|
+
type: Object,
|
|
87
|
+
required: false,
|
|
88
|
+
default: () => ({})
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
data() {
|
|
92
|
+
return {
|
|
93
|
+
activeSegment: null,
|
|
94
|
+
tokenValue: cloneDeep(this.value),
|
|
95
|
+
intendedCursorPosition: this.cursorPosition
|
|
96
|
+
};
|
|
97
|
+
},
|
|
98
|
+
computed: {
|
|
99
|
+
operators() {
|
|
100
|
+
return this.config.operators || DEFAULT_OPERATORS;
|
|
101
|
+
},
|
|
102
|
+
tokenEmpty() {
|
|
103
|
+
var _this$tokenValue$data;
|
|
104
|
+
return ((_this$tokenValue$data = this.tokenValue.data) === null || _this$tokenValue$data === void 0 ? void 0 : _this$tokenValue$data.length) === 0;
|
|
105
|
+
},
|
|
106
|
+
hasDataOrDataSegmentIsCurrentlyActive() {
|
|
107
|
+
const hasData = !this.tokenEmpty;
|
|
108
|
+
return hasData || this.isSegmentActive(SEGMENT_DATA);
|
|
109
|
+
},
|
|
110
|
+
availableTokensWithSelf() {
|
|
111
|
+
return [this.config, ...this.availableTokens.filter(token => token !== this.config)].map(
|
|
112
|
+
// eslint-disable-next-line unicorn/no-array-callback-reference
|
|
113
|
+
tokenToOption);
|
|
114
|
+
},
|
|
115
|
+
operatorDescription() {
|
|
116
|
+
const operator = this.operators.find(op => op.value === this.tokenValue.operator);
|
|
117
|
+
return this.showFriendlyText ? operator === null || operator === void 0 ? void 0 : operator.description : operator === null || operator === void 0 ? void 0 : operator.value;
|
|
118
|
+
},
|
|
119
|
+
eventListeners() {
|
|
120
|
+
return this.viewOnly ? {} : {
|
|
121
|
+
mousedown: this.stopMousedownOnCloseButton,
|
|
122
|
+
close: this.destroyByClose
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
segments: {
|
|
127
|
+
SEGMENT_TITLE,
|
|
128
|
+
SEGMENT_DATA,
|
|
129
|
+
SEGMENT_OPERATOR
|
|
130
|
+
},
|
|
131
|
+
watch: {
|
|
132
|
+
tokenValue: {
|
|
133
|
+
deep: true,
|
|
134
|
+
handler(newValue) {
|
|
135
|
+
/**
|
|
136
|
+
* Emitted when the token changes its value.
|
|
137
|
+
*
|
|
138
|
+
* @event input
|
|
139
|
+
* @type {object} dataObj Object containing the update value.
|
|
140
|
+
*/
|
|
141
|
+
this.$emit('input', newValue);
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
value: {
|
|
145
|
+
handler(newValue, oldValue) {
|
|
146
|
+
if (isEqual(newValue === null || newValue === void 0 ? void 0 : newValue.data, oldValue === null || oldValue === void 0 ? void 0 : oldValue.data) && (newValue === null || newValue === void 0 ? void 0 : newValue.operator) === (oldValue === null || oldValue === void 0 ? void 0 : oldValue.operator)) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
this.tokenValue = cloneDeep(newValue);
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
active: {
|
|
153
|
+
immediate: true,
|
|
154
|
+
handler(tokenIsActive) {
|
|
155
|
+
if (tokenIsActive) {
|
|
156
|
+
this.intendedCursorPosition = this.cursorPosition;
|
|
157
|
+
if (!this.activeSegment) {
|
|
158
|
+
this.activateSegment(this.tokenEmpty ? SEGMENT_OPERATOR : SEGMENT_DATA);
|
|
159
|
+
}
|
|
160
|
+
} else {
|
|
161
|
+
this.activeSegment = null;
|
|
162
|
+
|
|
163
|
+
// restore multi select values if we have them
|
|
164
|
+
// otherwise destroy the token
|
|
165
|
+
if (this.config.multiSelect) {
|
|
166
|
+
this.$emit('input', {
|
|
167
|
+
...this.tokenValue,
|
|
168
|
+
data: this.multiSelectValues || ''
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
if (this.tokenEmpty && this.multiSelectValues.length === 0) {
|
|
172
|
+
/**
|
|
173
|
+
* Emitted when token is about to be destroyed.
|
|
174
|
+
*
|
|
175
|
+
* @event destroy
|
|
176
|
+
*/
|
|
177
|
+
this.$emit('destroy');
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
created() {
|
|
184
|
+
if (!('operator' in this.tokenValue)) {
|
|
185
|
+
if (this.operators.length === 1) {
|
|
186
|
+
const operator = this.operators[0].value;
|
|
187
|
+
this.$emit('input', {
|
|
188
|
+
...this.tokenValue,
|
|
189
|
+
operator
|
|
190
|
+
});
|
|
191
|
+
this.activeSegment = SEGMENT_DATA;
|
|
192
|
+
} else {
|
|
193
|
+
this.$emit('input', {
|
|
194
|
+
...this.tokenValue,
|
|
195
|
+
operator: ''
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
methods: {
|
|
201
|
+
activateSegment(segment) {
|
|
202
|
+
if (this.viewOnly) return;
|
|
203
|
+
this.activeSegment = segment;
|
|
204
|
+
if (!this.active) {
|
|
205
|
+
/**
|
|
206
|
+
* Emitted when this term token is clicked.
|
|
207
|
+
*
|
|
208
|
+
* @event activate
|
|
209
|
+
*/
|
|
210
|
+
this.$emit('activate');
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
getAdditionalSegmentClasses(segment) {
|
|
214
|
+
if (this.viewOnly) {
|
|
215
|
+
return 'gl-cursor-text';
|
|
216
|
+
}
|
|
217
|
+
return {
|
|
218
|
+
'gl-cursor-pointer': !this.isSegmentActive(segment)
|
|
219
|
+
};
|
|
220
|
+
},
|
|
221
|
+
isSegmentActive(segment) {
|
|
222
|
+
return this.active && this.activeSegment === segment;
|
|
223
|
+
},
|
|
224
|
+
replaceWithTermIfEmpty() {
|
|
225
|
+
if (this.tokenValue.operator === '' && this.tokenEmpty) {
|
|
226
|
+
/**
|
|
227
|
+
* Emitted when this token is converted to another type
|
|
228
|
+
* @property {object} token Replacement token configuration
|
|
229
|
+
*/
|
|
230
|
+
this.$emit('replace', createTerm(this.config.title));
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
replaceToken(newType) {
|
|
234
|
+
const newTokenConfig = this.availableTokens.find(_ref => {
|
|
235
|
+
let {
|
|
236
|
+
type
|
|
237
|
+
} = _ref;
|
|
238
|
+
return type === newType;
|
|
239
|
+
});
|
|
240
|
+
if (newTokenConfig === this.config) {
|
|
241
|
+
this.$nextTick(() => {
|
|
242
|
+
/**
|
|
243
|
+
* Emitted when this term token will lose its focus.
|
|
244
|
+
*
|
|
245
|
+
* @event deactivate
|
|
246
|
+
*/
|
|
247
|
+
this.$emit('deactivate');
|
|
248
|
+
});
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
if (newTokenConfig) {
|
|
252
|
+
const isCompatible = this.config.dataType && this.config.dataType === newTokenConfig.dataType;
|
|
253
|
+
this.$emit('replace', {
|
|
254
|
+
type: newTokenConfig.type,
|
|
255
|
+
value: isCompatible ? this.tokenValue : {
|
|
256
|
+
data: ''
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
handleOperatorKeydown(evt, _ref2) {
|
|
262
|
+
let {
|
|
263
|
+
inputValue,
|
|
264
|
+
suggestedValue,
|
|
265
|
+
applySuggestion
|
|
266
|
+
} = _ref2;
|
|
267
|
+
const {
|
|
268
|
+
key
|
|
269
|
+
} = evt;
|
|
270
|
+
if (key === ' ' || key === 'Spacebar') {
|
|
271
|
+
applySuggestion(suggestedValue);
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
const potentialValue = `${inputValue}${key}`;
|
|
275
|
+
if (key.length === 1 && !this.operators.find(_ref3 => {
|
|
276
|
+
let {
|
|
277
|
+
value
|
|
278
|
+
} = _ref3;
|
|
279
|
+
return value.startsWith(potentialValue);
|
|
280
|
+
})) {
|
|
281
|
+
if (this.tokenEmpty) {
|
|
282
|
+
applySuggestion(suggestedValue);
|
|
283
|
+
} else {
|
|
284
|
+
evt.preventDefault();
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
activateDataSegment() {
|
|
289
|
+
if (this.config.multiSelect) {
|
|
290
|
+
this.$emit('input', {
|
|
291
|
+
...this.tokenValue,
|
|
292
|
+
data: ''
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
this.activateSegment(this.$options.segments.SEGMENT_DATA);
|
|
296
|
+
},
|
|
297
|
+
activatePreviousOperatorSegment() {
|
|
298
|
+
this.activateSegment(this.$options.segments.SEGMENT_OPERATOR);
|
|
299
|
+
this.intendedCursorPosition = 'end';
|
|
300
|
+
},
|
|
301
|
+
activatePreviousTitleSegment() {
|
|
302
|
+
this.activateSegment(this.$options.segments.SEGMENT_TITLE);
|
|
303
|
+
this.intendedCursorPosition = 'end';
|
|
304
|
+
},
|
|
305
|
+
activateNextDataSegment() {
|
|
306
|
+
this.activateDataSegment();
|
|
307
|
+
this.intendedCursorPosition = 'start';
|
|
308
|
+
},
|
|
309
|
+
activateNextOperatorSegment() {
|
|
310
|
+
this.activateSegment(this.$options.segments.SEGMENT_OPERATOR);
|
|
311
|
+
this.intendedCursorPosition = 'start';
|
|
312
|
+
},
|
|
313
|
+
handleComplete(value) {
|
|
314
|
+
/**
|
|
315
|
+
* Emitted when the token entry has been completed.
|
|
316
|
+
*
|
|
317
|
+
* @event complete
|
|
318
|
+
*/
|
|
319
|
+
this.$emit('complete', value);
|
|
320
|
+
},
|
|
321
|
+
stopMousedownOnCloseButton(event) {
|
|
322
|
+
if (event.target.closest(TOKEN_CLOSE_SELECTOR)) {
|
|
323
|
+
stopEvent(event);
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
destroyByClose() {
|
|
327
|
+
this.$emit('destroy');
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
/* script */
|
|
333
|
+
const __vue_script__ = script;
|
|
334
|
+
|
|
335
|
+
/* template */
|
|
336
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-filtered-search-token",class:{
|
|
337
|
+
'gl-filtered-search-token-active': _vm.active,
|
|
338
|
+
'gl-filtered-search-token-hover': !_vm.viewOnly,
|
|
339
|
+
'gl-cursor-default': _vm.viewOnly,
|
|
340
|
+
},attrs:{"data-testid":"filtered-search-token"}},[_c('gl-filtered-search-token-segment',{key:"title-segment",attrs:{"value":_vm.config.segmentTitle || _vm.config.title,"active":_vm.isSegmentActive(_vm.$options.segments.SEGMENT_TITLE),"cursor-position":_vm.intendedCursorPosition,"options":_vm.availableTokensWithSelf,"view-only":_vm.viewOnly},on:{"activate":function($event){return _vm.activateSegment(_vm.$options.segments.SEGMENT_TITLE)},"deactivate":function($event){return _vm.$emit('deactivate')},"complete":_vm.replaceToken,"backspace":function($event){return _vm.$emit('destroy')},"submit":function($event){return _vm.$emit('submit')},"previous":function($event){return _vm.$emit('previous')},"next":_vm.activateNextOperatorSegment},scopedSlots:_vm._u([{key:"view",fn:function(ref){
|
|
341
|
+
var inputValue = ref.inputValue;
|
|
342
|
+
return [_c('gl-token',{staticClass:"gl-filtered-search-token-type",class:_vm.getAdditionalSegmentClasses(_vm.$options.segments.SEGMENT_TITLE),attrs:{"view-only":""}},[_vm._v("\n "+_vm._s(inputValue)+"\n ")])]}}])}),_vm._v(" "),_c('gl-filtered-search-token-segment',{key:"operator-segment",attrs:{"active":_vm.isSegmentActive(_vm.$options.segments.SEGMENT_OPERATOR),"cursor-position":_vm.intendedCursorPosition,"options":_vm.operators,"option-text-field":"value","custom-input-keydown-handler":_vm.handleOperatorKeydown,"view-only":_vm.viewOnly},on:{"activate":function($event){return _vm.activateSegment(_vm.$options.segments.SEGMENT_OPERATOR)},"backspace":_vm.replaceWithTermIfEmpty,"complete":function($event){return _vm.activateSegment(_vm.$options.segments.SEGMENT_DATA)},"deactivate":function($event){return _vm.$emit('deactivate')},"previous":_vm.activatePreviousTitleSegment,"next":_vm.activateNextDataSegment},scopedSlots:_vm._u([{key:"view",fn:function(){return [_c('gl-token',{staticClass:"gl-filtered-search-token-operator",class:_vm.getAdditionalSegmentClasses(_vm.$options.segments.SEGMENT_OPERATOR),attrs:{"variant":"search-value","view-only":""}},[_vm._v("\n "+_vm._s(_vm.operatorDescription)+"\n ")])]},proxy:true},{key:"option",fn:function(ref){
|
|
343
|
+
var option = ref.option;
|
|
344
|
+
return [_c('div',{staticClass:"gl-flex"},[_vm._v("\n "+_vm._s(_vm.showFriendlyText ? option.description : option.value)+"\n "),(option.description)?_c('span',{staticClass:"gl-filtered-search-token-operator-description"},[_vm._v("\n "+_vm._s(_vm.showFriendlyText ? option.value : option.description)+"\n ")]):_vm._e()])]}}]),model:{value:(_vm.tokenValue.operator),callback:function ($$v) {_vm.$set(_vm.tokenValue, "operator", $$v);},expression:"tokenValue.operator"}}),_vm._v(" "),(_vm.hasDataOrDataSegmentIsCurrentlyActive)?_c('gl-filtered-search-token-segment',{key:"data-segment",attrs:{"active":_vm.isSegmentActive(_vm.$options.segments.SEGMENT_DATA),"cursor-position":_vm.intendedCursorPosition,"multi-select":_vm.config.multiSelect,"options":_vm.config.options,"view-only":_vm.viewOnly,"search-input-attributes":_vm.dataSegmentInputAttributes},on:{"activate":_vm.activateDataSegment,"backspace":function($event){return _vm.activateSegment(_vm.$options.segments.SEGMENT_OPERATOR)},"complete":_vm.handleComplete,"select":function($event){return _vm.$emit('select', $event)},"submit":function($event){return _vm.$emit('submit')},"deactivate":function($event){return _vm.$emit('deactivate')},"split":function($event){return _vm.$emit('split', $event)},"previous":_vm.activatePreviousOperatorSegment,"next":function($event){return _vm.$emit('next')}},scopedSlots:_vm._u([{key:"before-input",fn:function(scope){return [_vm._t("before-data-segment-input",null,null,scope)]}},{key:"input",fn:function(scope){return [_vm._t("data-segment-input",null,null,scope)]}},{key:"suggestions",fn:function(){return [_vm._t("suggestions")]},proxy:true},{key:"view",fn:function(ref){
|
|
345
|
+
var inputValue = ref.inputValue;
|
|
346
|
+
return [_vm._t("view-token",function(){return [_c('gl-token',_vm._g({staticClass:"gl-filtered-search-token-data",class:_vm.getAdditionalSegmentClasses(_vm.$options.segments.SEGMENT_DATA),attrs:{"variant":"search-value","view-only":_vm.viewOnly}},_vm.eventListeners),[_c('span',{staticClass:"gl-filtered-search-token-data-content"},[_vm._t("view",function(){return [_vm._v(_vm._s(inputValue))]},null,{ inputValue: inputValue })],2)])]},null,{
|
|
347
|
+
inputValue: inputValue,
|
|
348
|
+
listeners: _vm.eventListeners,
|
|
349
|
+
cssClasses: Object.assign({}, {'gl-filtered-search-token-data': true},
|
|
350
|
+
_vm.getAdditionalSegmentClasses(_vm.$options.segments.SEGMENT_DATA)),
|
|
351
|
+
})]}}],null,true),model:{value:(_vm.tokenValue.data),callback:function ($$v) {_vm.$set(_vm.tokenValue, "data", $$v);},expression:"tokenValue.data"}}):_vm._e()],1)};
|
|
352
|
+
var __vue_staticRenderFns__ = [];
|
|
353
|
+
|
|
354
|
+
/* style */
|
|
355
|
+
const __vue_inject_styles__ = undefined;
|
|
356
|
+
/* scoped */
|
|
357
|
+
const __vue_scope_id__ = undefined;
|
|
358
|
+
/* module identifier */
|
|
359
|
+
const __vue_module_identifier__ = undefined;
|
|
360
|
+
/* functional template */
|
|
361
|
+
const __vue_is_functional_template__ = false;
|
|
362
|
+
/* style inject */
|
|
363
|
+
|
|
364
|
+
/* style inject SSR */
|
|
365
|
+
|
|
366
|
+
/* style inject shadow dom */
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
const __vue_component__ = /*#__PURE__*/__vue_normalize__(
|
|
371
|
+
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
372
|
+
__vue_inject_styles__,
|
|
373
|
+
__vue_script__,
|
|
374
|
+
__vue_scope_id__,
|
|
375
|
+
__vue_is_functional_template__,
|
|
376
|
+
__vue_module_identifier__,
|
|
377
|
+
false,
|
|
378
|
+
undefined,
|
|
379
|
+
undefined,
|
|
380
|
+
undefined
|
|
381
|
+
);
|
|
382
|
+
|
|
383
|
+
export { __vue_component__ as default };
|