@gitlab/ui 72.11.1 → 72.12.0
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/CHANGELOG.md +7 -0
- package/dist/tokens/css/tokens.css +1 -1
- package/dist/tokens/css/tokens.dark.css +1 -1
- package/dist/tokens/js/tokens.dark.js +1 -1
- package/dist/tokens/js/tokens.js +1 -1
- package/dist/tokens/scss/_tokens.dark.scss +1 -1
- package/dist/tokens/scss/_tokens.scss +1 -1
- package/package.json +1 -1
- package/src/internal/color_contrast/color_contrast.md +8 -0
- package/src/internal/color_contrast/color_contrast.spec.js +34 -0
- package/src/internal/color_contrast/color_contrast.stories.js +41 -0
- package/src/internal/color_contrast/color_contrast.vue +52 -0
- package/src/tokens/color.dark.tokens.stories.js +36 -22
- package/src/tokens/color.data_viz.dark.tokens.stories.js +13 -30
- package/src/tokens/color.data_viz.tokens.stories.js +13 -30
- package/src/tokens/color.theme.dark.tokens.stories.js +15 -30
- package/src/tokens/color.theme.tokens.stories.js +15 -30
- package/src/tokens/color.tokens.stories.js +36 -22
- package/src/tokens/color.transparency.tokens.stories.js +9 -12
- package/src/tokens/common_story_options.js +22 -80
- package/src/utils/constants.js +25 -0
- package/src/utils/utils.js +21 -1
- package/dist/charts.js +0 -14
- package/dist/components/base/accordion/accordion.js +0 -73
- package/dist/components/base/accordion/accordion_item.js +0 -133
- package/dist/components/base/alert/alert.js +0 -222
- package/dist/components/base/avatar/avatar.js +0 -160
- package/dist/components/base/avatar_labeled/avatar_labeled.js +0 -107
- package/dist/components/base/avatar_link/avatar_link.js +0 -47
- package/dist/components/base/avatars_inline/avatars_inline.js +0 -119
- package/dist/components/base/badge/badge.js +0 -105
- package/dist/components/base/banner/banner.js +0 -139
- package/dist/components/base/breadcrumb/breadcrumb.js +0 -122
- package/dist/components/base/breadcrumb/breadcrumb_item.js +0 -73
- package/dist/components/base/broadcast_message/broadcast_message.js +0 -112
- package/dist/components/base/broadcast_message/constants.js +0 -5
- package/dist/components/base/button/button.js +0 -151
- package/dist/components/base/button_group/button_group.js +0 -47
- package/dist/components/base/card/card.js +0 -71
- package/dist/components/base/carousel/carousel.js +0 -48
- package/dist/components/base/carousel/carousel_slide.js +0 -47
- package/dist/components/base/collapse/collapse.js +0 -59
- package/dist/components/base/datepicker/datepicker.js +0 -386
- package/dist/components/base/daterange_picker/daterange_picker.js +0 -288
- package/dist/components/base/drawer/drawer.js +0 -127
- package/dist/components/base/dropdown/dropdown.js +0 -261
- package/dist/components/base/dropdown/dropdown_divider.js +0 -48
- package/dist/components/base/dropdown/dropdown_form.js +0 -48
- package/dist/components/base/dropdown/dropdown_item.js +0 -131
- package/dist/components/base/dropdown/dropdown_section_header.js +0 -48
- package/dist/components/base/dropdown/dropdown_text.js +0 -48
- package/dist/components/base/filtered_search/common_story_options.js +0 -14
- package/dist/components/base/filtered_search/filtered_search.js +0 -388
- package/dist/components/base/filtered_search/filtered_search_suggestion.js +0 -89
- package/dist/components/base/filtered_search/filtered_search_suggestion_list.js +0 -138
- package/dist/components/base/filtered_search/filtered_search_term.js +0 -203
- package/dist/components/base/filtered_search/filtered_search_token.js +0 -384
- package/dist/components/base/filtered_search/filtered_search_token_segment.js +0 -420
- package/dist/components/base/filtered_search/filtered_search_utils.js +0 -242
- package/dist/components/base/form/form.js +0 -49
- package/dist/components/base/form/form_checkbox/form_checkbox.js +0 -78
- package/dist/components/base/form/form_checkbox/form_checkbox_group.js +0 -60
- package/dist/components/base/form/form_checkbox_tree/checkbox_tree_node.js +0 -79
- package/dist/components/base/form/form_checkbox_tree/form_checkbox_tree.js +0 -138
- package/dist/components/base/form/form_checkbox_tree/models/constants.js +0 -12
- package/dist/components/base/form/form_checkbox_tree/models/node.js +0 -51
- package/dist/components/base/form/form_checkbox_tree/models/tree.js +0 -199
- package/dist/components/base/form/form_combobox/constants.js +0 -55
- package/dist/components/base/form/form_combobox/form_combobox.js +0 -230
- package/dist/components/base/form/form_date/form_date.js +0 -143
- package/dist/components/base/form/form_fields/form_field_validator.js +0 -93
- package/dist/components/base/form/form_fields/form_fields.js +0 -214
- package/dist/components/base/form/form_fields/mappers.js +0 -13
- package/dist/components/base/form/form_fields/validators.js +0 -48
- package/dist/components/base/form/form_group/form_group.js +0 -97
- package/dist/components/base/form/form_input/form_input.js +0 -121
- package/dist/components/base/form/form_input_group/form_input_group.js +0 -108
- package/dist/components/base/form/form_input_group/form_input_group_mixin.js +0 -41
- package/dist/components/base/form/form_radio/form_radio.js +0 -65
- package/dist/components/base/form/form_radio_group/form_radio_group.js +0 -78
- package/dist/components/base/form/form_select/constants.js +0 -12
- package/dist/components/base/form/form_select/form_select.js +0 -82
- package/dist/components/base/form/form_text/form_text.js +0 -38
- package/dist/components/base/form/form_textarea/form_textarea.js +0 -112
- package/dist/components/base/form/input_group_text/input_group_text.js +0 -48
- package/dist/components/base/icon/icon.js +0 -111
- package/dist/components/base/infinite_scroll/infinite_scroll.js +0 -197
- package/dist/components/base/keyset_pagination/keyset_pagination.js +0 -151
- package/dist/components/base/label/label.js +0 -163
- package/dist/components/base/link/link.js +0 -50
- package/dist/components/base/loading_icon/loading_icon.js +0 -111
- package/dist/components/base/markdown/markdown.js +0 -52
- package/dist/components/base/modal/modal.js +0 -204
- package/dist/components/base/nav/nav.js +0 -48
- package/dist/components/base/nav/nav_item.js +0 -48
- package/dist/components/base/nav/nav_item_dropdown.js +0 -62
- package/dist/components/base/navbar/navbar.js +0 -48
- package/dist/components/base/new_dropdowns/base_dropdown/base_dropdown.js +0 -453
- package/dist/components/base/new_dropdowns/base_dropdown/constants.js +0 -4
- package/dist/components/base/new_dropdowns/constants.js +0 -21
- package/dist/components/base/new_dropdowns/disclosure/constants.js +0 -8
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown.js +0 -370
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown_group.js +0 -110
- package/dist/components/base/new_dropdowns/disclosure/disclosure_dropdown_item.js +0 -143
- package/dist/components/base/new_dropdowns/disclosure/mock_data.js +0 -147
- package/dist/components/base/new_dropdowns/disclosure/utils.js +0 -39
- package/dist/components/base/new_dropdowns/listbox/listbox.js +0 -767
- package/dist/components/base/new_dropdowns/listbox/listbox_group.js +0 -58
- package/dist/components/base/new_dropdowns/listbox/listbox_item.js +0 -91
- package/dist/components/base/new_dropdowns/listbox/listbox_search_input.js +0 -93
- package/dist/components/base/new_dropdowns/listbox/mock_data.js +0 -118
- package/dist/components/base/new_dropdowns/listbox/utils.js +0 -34
- package/dist/components/base/paginated_list/paginated_list.js +0 -180
- package/dist/components/base/pagination/pagination.js +0 -399
- package/dist/components/base/path/data.js +0 -34
- package/dist/components/base/path/path.js +0 -189
- package/dist/components/base/popover/popover.js +0 -110
- package/dist/components/base/progress_bar/progress_bar.js +0 -48
- package/dist/components/base/search_box_by_click/search_box_by_click.js +0 -235
- package/dist/components/base/search_box_by_type/search_box_by_type.js +0 -167
- package/dist/components/base/segmented_control/segmented_control.js +0 -109
- package/dist/components/base/skeleton_loader/skeleton_loader.js +0 -224
- package/dist/components/base/sorting/sorting.js +0 -171
- package/dist/components/base/sorting/sorting_item.js +0 -109
- package/dist/components/base/table/constants.js +0 -5
- package/dist/components/base/table/table.js +0 -89
- package/dist/components/base/table_lite/table_lite.js +0 -72
- package/dist/components/base/tabs/constants.js +0 -3
- package/dist/components/base/tabs/tab/tab.js +0 -83
- package/dist/components/base/tabs/tabs/scrollable_tabs.js +0 -143
- package/dist/components/base/tabs/tabs/tabs.js +0 -224
- package/dist/components/base/toast/toast.js +0 -82
- package/dist/components/base/toggle/toggle.js +0 -180
- package/dist/components/base/token/token.js +0 -85
- package/dist/components/base/token_selector/helpers.js +0 -5
- package/dist/components/base/token_selector/token_container.js +0 -165
- package/dist/components/base/token_selector/token_selector.js +0 -403
- package/dist/components/base/token_selector/token_selector_dropdown.js +0 -199
- package/dist/components/base/tooltip/tooltip.js +0 -55
- package/dist/components/charts/area/area.js +0 -311
- package/dist/components/charts/bar/bar.js +0 -253
- package/dist/components/charts/chart/chart.js +0 -215
- package/dist/components/charts/column/column.js +0 -226
- package/dist/components/charts/discrete_scatter/discrete_scatter.js +0 -203
- package/dist/components/charts/gauge/gauge.js +0 -208
- package/dist/components/charts/heatmap/heatmap.js +0 -295
- package/dist/components/charts/heatmap/index.js +0 -2
- package/dist/components/charts/legend/legend.js +0 -228
- package/dist/components/charts/line/line.js +0 -308
- package/dist/components/charts/series_label/series_label.js +0 -100
- package/dist/components/charts/single_stat/single_stat.js +0 -152
- package/dist/components/charts/sparkline/sparkline.js +0 -261
- package/dist/components/charts/stacked_column/stacked_column.js +0 -335
- package/dist/components/charts/tooltip/tooltip.js +0 -251
- package/dist/components/experimental/duo/chat/components/duo_chat_conversation/duo_chat_conversation.js +0 -83
- package/dist/components/experimental/duo/chat/components/duo_chat_loader/duo_chat_loader.js +0 -100
- package/dist/components/experimental/duo/chat/components/duo_chat_message/copy_code_element.js +0 -35
- package/dist/components/experimental/duo/chat/components/duo_chat_message/duo_chat_message.js +0 -115
- package/dist/components/experimental/duo/chat/components/duo_chat_message_sources/duo_chat_message_sources.js +0 -104
- package/dist/components/experimental/duo/chat/components/duo_chat_predefined_prompts/duo_chat_predefined_prompts.js +0 -64
- package/dist/components/experimental/duo/chat/constants.js +0 -23
- package/dist/components/experimental/duo/chat/duo_chat.js +0 -359
- package/dist/components/experimental/duo/chat/mock_data.js +0 -83
- package/dist/components/experimental/duo/user_feedback/user_feedback.js +0 -94
- package/dist/components/experimental/duo/user_feedback/user_feedback_modal.js +0 -124
- package/dist/components/experimental/experiment_badge/constants.js +0 -4
- package/dist/components/experimental/experiment_badge/experiment_badge.js +0 -107
- package/dist/components/mixins/button_mixin.js +0 -11
- package/dist/components/mixins/safe_link_mixin.js +0 -30
- package/dist/components/mixins/tooltip_mixin.js +0 -21
- package/dist/components/regions/dashboard_skeleton/dashboard_skeleton.js +0 -53
- package/dist/components/regions/empty_state/empty_state.js +0 -154
- package/dist/components/shared_components/charts/tooltip_default_format.js +0 -53
- package/dist/components/shared_components/clear_icon_button/clear_icon_button.js +0 -64
- package/dist/components/shared_components/close_button/close_button.js +0 -54
- package/dist/components/utilities/animated_number/animated_number.js +0 -131
- package/dist/components/utilities/friendly_wrap/friendly_wrap.js +0 -75
- package/dist/components/utilities/intersection_observer/intersection_observer.js +0 -88
- package/dist/components/utilities/intersperse/intersperse.js +0 -86
- package/dist/components/utilities/sprintf/sprintf.js +0 -172
- package/dist/components/utilities/truncate/constants.js +0 -7
- package/dist/components/utilities/truncate/truncate.js +0 -111
- package/dist/components/utilities/truncate_text/constants.js +0 -7
- package/dist/components/utilities/truncate_text/truncate_text.js +0 -146
- package/dist/config.js +0 -86
- package/dist/directives/collapse_toggle.js +0 -1
- package/dist/directives/hover_load/hover_load.js +0 -45
- package/dist/directives/modal.js +0 -1
- package/dist/directives/outside/get_event_like_time_stamp.js +0 -33
- package/dist/directives/outside/outside.js +0 -106
- package/dist/directives/resize_observer/resize_observer.js +0 -51
- package/dist/directives/safe_html/constants.js +0 -6
- package/dist/directives/safe_html/safe_html.js +0 -39
- package/dist/directives/safe_link/mock_data.js +0 -10
- package/dist/directives/safe_link/safe_link.js +0 -65
- package/dist/directives/tooltip.js +0 -1
- package/dist/index.css +0 -7
- package/dist/index.css.map +0 -1
- package/dist/index.js +0 -105
- package/dist/tokens/common_story_options.js +0 -109
- package/dist/utils/breakpoints.js +0 -20
- package/dist/utils/charts/config.js +0 -556
- package/dist/utils/charts/constants.js +0 -63
- package/dist/utils/charts/mock_data.js +0 -211
- package/dist/utils/charts/story_config.js +0 -42
- package/dist/utils/charts/theme.js +0 -192
- package/dist/utils/charts/utils.js +0 -54
- package/dist/utils/constants.js +0 -270
- package/dist/utils/data_utils.js +0 -21
- package/dist/utils/datetime_utility.js +0 -61
- package/dist/utils/i18n.js +0 -15
- package/dist/utils/is_slot_empty.js +0 -38
- package/dist/utils/number_utils.js +0 -124
- package/dist/utils/stories_constants.js +0 -29
- package/dist/utils/stories_utils.js +0 -13
- package/dist/utils/story_decorators/container.js +0 -16
- package/dist/utils/string_utils.js +0 -69
- package/dist/utils/svgs/svg_paths.js +0 -7
- package/dist/utils/test_utils.js +0 -33
- package/dist/utils/use_fake_date.js +0 -29
- package/dist/utils/use_mock_intersection_observer.js +0 -108
- package/dist/utils/utils.js +0 -177
- package/dist/utils.js +0 -5
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { BTab } from 'bootstrap-vue/esm/index.js';
|
|
2
|
-
import isPlainObject from 'lodash/isPlainObject';
|
|
3
|
-
import { DEFAULT_TAB_TITLE_LINK_CLASS } from '../constants';
|
|
4
|
-
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
5
|
-
|
|
6
|
-
//
|
|
7
|
-
var script = {
|
|
8
|
-
name: 'GlTab',
|
|
9
|
-
components: {
|
|
10
|
-
BTab
|
|
11
|
-
},
|
|
12
|
-
inheritAttrs: false,
|
|
13
|
-
props: {
|
|
14
|
-
titleLinkClass: {
|
|
15
|
-
type: [String, Array, Object],
|
|
16
|
-
required: false,
|
|
17
|
-
default: ''
|
|
18
|
-
},
|
|
19
|
-
/**
|
|
20
|
-
* Query string parameter value to use when `gl-tabs` `sync-active-tab-with-query-params` prop is set to `true`.
|
|
21
|
-
*/
|
|
22
|
-
queryParamValue: {
|
|
23
|
-
type: String,
|
|
24
|
-
required: false,
|
|
25
|
-
default: null
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
computed: {
|
|
29
|
-
linkClass() {
|
|
30
|
-
const {
|
|
31
|
-
titleLinkClass
|
|
32
|
-
} = this;
|
|
33
|
-
if (Array.isArray(titleLinkClass)) {
|
|
34
|
-
return [...titleLinkClass, DEFAULT_TAB_TITLE_LINK_CLASS];
|
|
35
|
-
}
|
|
36
|
-
if (isPlainObject(titleLinkClass)) {
|
|
37
|
-
return {
|
|
38
|
-
...titleLinkClass,
|
|
39
|
-
[DEFAULT_TAB_TITLE_LINK_CLASS]: true
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
return `${titleLinkClass} ${DEFAULT_TAB_TITLE_LINK_CLASS}`.trim();
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
/* script */
|
|
48
|
-
const __vue_script__ = script;
|
|
49
|
-
|
|
50
|
-
/* template */
|
|
51
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-tab',_vm._g(_vm._b({attrs:{"title-link-class":_vm.linkClass,"query-param-value":_vm.queryParamValue},scopedSlots:_vm._u([_vm._l((Object.keys(_vm.$slots)),function(slot){return {key:slot,fn:function(){return [_vm._t(slot)]},proxy:true}})],null,true)},'b-tab',_vm.$attrs,false),_vm.$listeners))};
|
|
52
|
-
var __vue_staticRenderFns__ = [];
|
|
53
|
-
|
|
54
|
-
/* style */
|
|
55
|
-
const __vue_inject_styles__ = undefined;
|
|
56
|
-
/* scoped */
|
|
57
|
-
const __vue_scope_id__ = undefined;
|
|
58
|
-
/* module identifier */
|
|
59
|
-
const __vue_module_identifier__ = undefined;
|
|
60
|
-
/* functional template */
|
|
61
|
-
const __vue_is_functional_template__ = false;
|
|
62
|
-
/* style inject */
|
|
63
|
-
|
|
64
|
-
/* style inject SSR */
|
|
65
|
-
|
|
66
|
-
/* style inject shadow dom */
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const __vue_component__ = __vue_normalize__(
|
|
71
|
-
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
72
|
-
__vue_inject_styles__,
|
|
73
|
-
__vue_script__,
|
|
74
|
-
__vue_scope_id__,
|
|
75
|
-
__vue_is_functional_template__,
|
|
76
|
-
__vue_module_identifier__,
|
|
77
|
-
false,
|
|
78
|
-
undefined,
|
|
79
|
-
undefined,
|
|
80
|
-
undefined
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
export default __vue_component__;
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import debounce from 'lodash/debounce';
|
|
2
|
-
import { GlResizeObserverDirective } from '../../../../directives/resize_observer/resize_observer';
|
|
3
|
-
import GlIcon from '../../icon/icon';
|
|
4
|
-
import GlTabs from './tabs';
|
|
5
|
-
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
6
|
-
|
|
7
|
-
const NAV_CLASS = 'gl-scrollable-tabs-nav';
|
|
8
|
-
var script = {
|
|
9
|
-
name: 'GlScrollableTabs',
|
|
10
|
-
components: {
|
|
11
|
-
GlTabs,
|
|
12
|
-
GlIcon
|
|
13
|
-
},
|
|
14
|
-
directives: {
|
|
15
|
-
GlResizeObserverDirective
|
|
16
|
-
},
|
|
17
|
-
inheritAttrs: false,
|
|
18
|
-
data() {
|
|
19
|
-
return {
|
|
20
|
-
width: 0,
|
|
21
|
-
// This is a reactive value of a child element's scrollLeft. It is not two-way bound.
|
|
22
|
-
// Do not set manually outside of "scroll" callback.
|
|
23
|
-
scrollLeft: 0,
|
|
24
|
-
navScrollWidth: 0
|
|
25
|
-
};
|
|
26
|
-
},
|
|
27
|
-
computed: {
|
|
28
|
-
navClass() {
|
|
29
|
-
const attrsNavClass = this.$attrs.navClass;
|
|
30
|
-
if (!attrsNavClass) {
|
|
31
|
-
return [NAV_CLASS];
|
|
32
|
-
}
|
|
33
|
-
if (Array.isArray(attrsNavClass)) {
|
|
34
|
-
return [NAV_CLASS, ...attrsNavClass];
|
|
35
|
-
}
|
|
36
|
-
return [NAV_CLASS, attrsNavClass];
|
|
37
|
-
},
|
|
38
|
-
displayScrollLeft() {
|
|
39
|
-
// if we have scrolled && there's overflow
|
|
40
|
-
return this.scrollLeft && this.width < this.navScrollWidth;
|
|
41
|
-
},
|
|
42
|
-
displayScrollRight() {
|
|
43
|
-
// if there's more overflow to the right
|
|
44
|
-
return this.scrollLeft + this.width < this.navScrollWidth;
|
|
45
|
-
},
|
|
46
|
-
passthroughAttrs() {
|
|
47
|
-
return Object.keys(this.$attrs).filter(key => !key.startsWith('action')).reduce((acc, key) => Object.assign(acc, {
|
|
48
|
-
[key]: this.$attrs[key]
|
|
49
|
-
}), {});
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
mounted() {
|
|
53
|
-
this.$nextTick(() => {
|
|
54
|
-
this.navScrollWidth = this.getScrollWidth();
|
|
55
|
-
});
|
|
56
|
-
this.handleNavScroll = debounce(e => {
|
|
57
|
-
this.scrollLeft = e.target.scrollLeft;
|
|
58
|
-
}, 100);
|
|
59
|
-
this.getNavContainer().addEventListener('scroll', this.handleNavScroll);
|
|
60
|
-
},
|
|
61
|
-
beforeDestroy() {
|
|
62
|
-
this.getNavContainer().removeEventListener('scroll', this.handleNavScroll);
|
|
63
|
-
},
|
|
64
|
-
updated() {
|
|
65
|
-
// Whenever tabs are added or removed we need to recalculate the reactive scrollWidth
|
|
66
|
-
this.$nextTick(() => {
|
|
67
|
-
this.navScrollWidth = this.getScrollWidth();
|
|
68
|
-
});
|
|
69
|
-
},
|
|
70
|
-
methods: {
|
|
71
|
-
handleResize(_ref) {
|
|
72
|
-
let {
|
|
73
|
-
contentRect: {
|
|
74
|
-
width
|
|
75
|
-
}
|
|
76
|
-
} = _ref;
|
|
77
|
-
this.width = width;
|
|
78
|
-
this.navScrollWidth = this.getScrollWidth();
|
|
79
|
-
},
|
|
80
|
-
scrollTabsLeft() {
|
|
81
|
-
const scrollTo = this.scrollLeft - this.width;
|
|
82
|
-
this.scrollTabs(Math.max(scrollTo, 0));
|
|
83
|
-
},
|
|
84
|
-
scrollTabsRight() {
|
|
85
|
-
const scrollTo = this.scrollLeft + this.width;
|
|
86
|
-
this.scrollTabs(Math.min(scrollTo, this.getScrollWidth() - this.width));
|
|
87
|
-
},
|
|
88
|
-
scrollTabs(scrollTo) {
|
|
89
|
-
this.getNavContainer().scrollTo({
|
|
90
|
-
left: scrollTo,
|
|
91
|
-
behavior: 'smooth'
|
|
92
|
-
});
|
|
93
|
-
this.scrollLeft = scrollTo;
|
|
94
|
-
},
|
|
95
|
-
getScrollWidth() {
|
|
96
|
-
var _this$getNavContainer;
|
|
97
|
-
return ((_this$getNavContainer = this.getNavContainer()) === null || _this$getNavContainer === void 0 ? void 0 : _this$getNavContainer.scrollWidth) || 0;
|
|
98
|
-
},
|
|
99
|
-
getNavContainer() {
|
|
100
|
-
var _this$$el;
|
|
101
|
-
return (_this$$el = this.$el) === null || _this$$el === void 0 ? void 0 : _this$$el.querySelector(`.${NAV_CLASS}`);
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
NAV_CLASS
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
/* script */
|
|
108
|
-
const __vue_script__ = script;
|
|
109
|
-
|
|
110
|
-
/* template */
|
|
111
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-tabs',_vm._g(_vm._b({directives:[{name:"gl-resize-observer-directive",rawName:"v-gl-resize-observer-directive",value:(_vm.handleResize),expression:"handleResize"}],attrs:{"nav-class":_vm.navClass},scopedSlots:_vm._u([_vm._l((Object.keys(_vm.$slots)),function(slot){return {key:slot,fn:function(){return [_vm._t(slot)]},proxy:true}}),{key:"tabs-start",fn:function(){return [_c('li',{directives:[{name:"show",rawName:"v-show",value:(_vm.displayScrollLeft),expression:"displayScrollLeft"}],staticClass:"gl-tabs-fade gl-tabs-fade-left"},[_c('button',{staticClass:"gl-tabs-fade-icon-button",attrs:{"aria-label":"Scroll left","tabindex":"-1"},on:{"click":_vm.scrollTabsLeft}},[_c('gl-icon',{attrs:{"size":16,"name":"chevron-lg-left"}})],1)])]},proxy:true},{key:"tabs-end",fn:function(){return [_c('li',{directives:[{name:"show",rawName:"v-show",value:(_vm.displayScrollRight),expression:"displayScrollRight"}],staticClass:"gl-tabs-fade gl-tabs-fade-right"},[_c('button',{staticClass:"gl-tabs-fade-icon-button",attrs:{"aria-label":"Scroll right","tabindex":"-1"},on:{"click":_vm.scrollTabsRight}},[_c('gl-icon',{attrs:{"size":16,"name":"chevron-lg-right"}})],1)])]},proxy:true}],null,true)},'gl-tabs',_vm.passthroughAttrs,false),_vm.$listeners))};
|
|
112
|
-
var __vue_staticRenderFns__ = [];
|
|
113
|
-
|
|
114
|
-
/* style */
|
|
115
|
-
const __vue_inject_styles__ = undefined;
|
|
116
|
-
/* scoped */
|
|
117
|
-
const __vue_scope_id__ = undefined;
|
|
118
|
-
/* module identifier */
|
|
119
|
-
const __vue_module_identifier__ = undefined;
|
|
120
|
-
/* functional template */
|
|
121
|
-
const __vue_is_functional_template__ = false;
|
|
122
|
-
/* style inject */
|
|
123
|
-
|
|
124
|
-
/* style inject SSR */
|
|
125
|
-
|
|
126
|
-
/* style inject shadow dom */
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
const __vue_component__ = __vue_normalize__(
|
|
131
|
-
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
132
|
-
__vue_inject_styles__,
|
|
133
|
-
__vue_script__,
|
|
134
|
-
__vue_scope_id__,
|
|
135
|
-
__vue_is_functional_template__,
|
|
136
|
-
__vue_module_identifier__,
|
|
137
|
-
false,
|
|
138
|
-
undefined,
|
|
139
|
-
undefined,
|
|
140
|
-
undefined
|
|
141
|
-
);
|
|
142
|
-
|
|
143
|
-
export default __vue_component__;
|
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
import { BTabs } from 'bootstrap-vue/esm/index.js';
|
|
2
|
-
import { tabsButtonDefaults } from '../../../../utils/constants';
|
|
3
|
-
import GlButton from '../../button/button';
|
|
4
|
-
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
5
|
-
|
|
6
|
-
//
|
|
7
|
-
const validatorHelper = obj => Object.keys(obj).every(val => val === 'text' || val === 'attributes');
|
|
8
|
-
var script = {
|
|
9
|
-
name: 'GlTabs',
|
|
10
|
-
components: {
|
|
11
|
-
BTabs,
|
|
12
|
-
GlButton
|
|
13
|
-
},
|
|
14
|
-
inheritAttrs: false,
|
|
15
|
-
props: {
|
|
16
|
-
actionPrimary: {
|
|
17
|
-
type: Object,
|
|
18
|
-
required: false,
|
|
19
|
-
default: null,
|
|
20
|
-
validator: obj => validatorHelper(obj)
|
|
21
|
-
},
|
|
22
|
-
actionSecondary: {
|
|
23
|
-
type: Object,
|
|
24
|
-
required: false,
|
|
25
|
-
default: null,
|
|
26
|
-
validator: obj => validatorHelper(obj)
|
|
27
|
-
},
|
|
28
|
-
actionTertiary: {
|
|
29
|
-
type: Object,
|
|
30
|
-
required: false,
|
|
31
|
-
default: null,
|
|
32
|
-
validator: obj => validatorHelper(obj)
|
|
33
|
-
},
|
|
34
|
-
contentClass: {
|
|
35
|
-
type: [String, Array, Object],
|
|
36
|
-
required: false,
|
|
37
|
-
default: null
|
|
38
|
-
},
|
|
39
|
-
navClass: {
|
|
40
|
-
type: [String, Array, Object],
|
|
41
|
-
required: false,
|
|
42
|
-
default: null
|
|
43
|
-
},
|
|
44
|
-
justified: {
|
|
45
|
-
type: Boolean,
|
|
46
|
-
required: false,
|
|
47
|
-
default: false
|
|
48
|
-
},
|
|
49
|
-
/**
|
|
50
|
-
* Sync active tab with query string parameters. Allows for deep linking into specific tabs.
|
|
51
|
-
*/
|
|
52
|
-
syncActiveTabWithQueryParams: {
|
|
53
|
-
type: Boolean,
|
|
54
|
-
required: false,
|
|
55
|
-
default: false
|
|
56
|
-
},
|
|
57
|
-
/**
|
|
58
|
-
* Name to use for query string parameter.
|
|
59
|
-
*/
|
|
60
|
-
queryParamName: {
|
|
61
|
-
type: String,
|
|
62
|
-
required: false,
|
|
63
|
-
default: 'tab'
|
|
64
|
-
},
|
|
65
|
-
value: {
|
|
66
|
-
type: Number,
|
|
67
|
-
required: false,
|
|
68
|
-
default: 0
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
data() {
|
|
72
|
-
return {
|
|
73
|
-
activeTabIndex: 0
|
|
74
|
-
};
|
|
75
|
-
},
|
|
76
|
-
computed: {
|
|
77
|
-
hasActions() {
|
|
78
|
-
return [this.actionPrimary, this.actionSecondary, this.actionTertiary].some(Boolean);
|
|
79
|
-
},
|
|
80
|
-
listeners() {
|
|
81
|
-
return {
|
|
82
|
-
...this.$listeners,
|
|
83
|
-
input: this.handleInput
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
watch: {
|
|
88
|
-
value: {
|
|
89
|
-
handler(newValue) {
|
|
90
|
-
if (this.activeTabIndex !== newValue) {
|
|
91
|
-
this.activeTabIndex = newValue;
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
immediate: true
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
mounted() {
|
|
98
|
-
if (this.syncActiveTabWithQueryParams) {
|
|
99
|
-
this.syncActiveTabFromQueryParams();
|
|
100
|
-
window.addEventListener('popstate', this.syncActiveTabFromQueryParams);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// Because we are manually binding `value` attribute to `b-tabs` the `input`
|
|
104
|
-
// event is no longer automatically fired when the component is mounted.
|
|
105
|
-
// To maintain parity with original `b-tabs` functionality
|
|
106
|
-
// we manually fire the `input` event when the component is mounted.
|
|
107
|
-
this.$emit('input', this.activeTabIndex);
|
|
108
|
-
},
|
|
109
|
-
destroyed() {
|
|
110
|
-
window.removeEventListener('popstate', this.syncActiveTabFromQueryParams);
|
|
111
|
-
},
|
|
112
|
-
methods: {
|
|
113
|
-
buttonBinding(prop, name) {
|
|
114
|
-
if (!prop.attributes) {
|
|
115
|
-
return tabsButtonDefaults[name];
|
|
116
|
-
}
|
|
117
|
-
return prop.attributes;
|
|
118
|
-
},
|
|
119
|
-
primary() {
|
|
120
|
-
this.$emit('primary');
|
|
121
|
-
},
|
|
122
|
-
secondary() {
|
|
123
|
-
this.$emit('secondary');
|
|
124
|
-
},
|
|
125
|
-
tertiary() {
|
|
126
|
-
this.$emit('tertiary');
|
|
127
|
-
},
|
|
128
|
-
/**
|
|
129
|
-
* When the query parameter is updated, update the active tab to match.
|
|
130
|
-
*/
|
|
131
|
-
async syncActiveTabFromQueryParams() {
|
|
132
|
-
await this.$nextTick();
|
|
133
|
-
const queryParamValue = this.getQueryParamValue();
|
|
134
|
-
const tabIndexToActivate = this.getTabs().findIndex((tab, tabIndex) => this.getTabQueryParamValue(tabIndex) === queryParamValue);
|
|
135
|
-
this.activeTabIndex = tabIndexToActivate !== -1 ? tabIndexToActivate : 0;
|
|
136
|
-
},
|
|
137
|
-
/**
|
|
138
|
-
* Returns a list of all <b-tab> instances associated with this tab control.
|
|
139
|
-
*/
|
|
140
|
-
getTabs() {
|
|
141
|
-
return this.$refs.bTabs.getTabs();
|
|
142
|
-
},
|
|
143
|
-
/**
|
|
144
|
-
* Get the value of the query param as defined by the `queryParamName` prop.
|
|
145
|
-
*/
|
|
146
|
-
getQueryParamValue() {
|
|
147
|
-
const searchParams = new URLSearchParams(window.location.search);
|
|
148
|
-
return searchParams.get(this.queryParamName);
|
|
149
|
-
},
|
|
150
|
-
/**
|
|
151
|
-
* Set the value of the query param as defined by the `queryParamName` prop.
|
|
152
|
-
* This method does nothing if the query param is already up to date.
|
|
153
|
-
*/
|
|
154
|
-
setQueryParamValueIfNecessary(tabIndex) {
|
|
155
|
-
const currentQueryParamValue = this.getQueryParamValue();
|
|
156
|
-
const newQueryParamValue = this.getTabQueryParamValue(tabIndex);
|
|
157
|
-
|
|
158
|
-
// If the current query parameter is already up-to-date,
|
|
159
|
-
// avoid creating a duplicate history entry.
|
|
160
|
-
if (tabIndex === 0 && !currentQueryParamValue || tabIndex !== 0 && currentQueryParamValue === newQueryParamValue) {
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
const searchParams = new URLSearchParams(window.location.search);
|
|
164
|
-
searchParams.set(this.queryParamName, newQueryParamValue);
|
|
165
|
-
window.history.pushState({}, '', `${window.location.pathname}?${searchParams.toString()}`);
|
|
166
|
-
},
|
|
167
|
-
/**
|
|
168
|
-
* Returns the query param value for a tab.
|
|
169
|
-
* Defaults to the tab index unless the `query-param-value` attribute is set.
|
|
170
|
-
*/
|
|
171
|
-
getTabQueryParamValue(tabIndex) {
|
|
172
|
-
const tab = this.getTabs()[tabIndex];
|
|
173
|
-
return (tab === null || tab === void 0 ? void 0 : tab.$attrs['query-param-value']) || tabIndex.toString();
|
|
174
|
-
},
|
|
175
|
-
/**
|
|
176
|
-
* Event handler for `input` event.
|
|
177
|
-
*/
|
|
178
|
-
handleInput(tabIndex) {
|
|
179
|
-
this.$emit('input', tabIndex);
|
|
180
|
-
this.activeTabIndex = tabIndex;
|
|
181
|
-
if (this.syncActiveTabWithQueryParams) {
|
|
182
|
-
this.setQueryParamValueIfNecessary(tabIndex);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
/* script */
|
|
189
|
-
const __vue_script__ = script;
|
|
190
|
-
|
|
191
|
-
/* template */
|
|
192
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-tabs',_vm._g(_vm._b({ref:"bTabs",staticClass:"gl-tabs",attrs:{"no-nav-style":true,"no-fade":true,"active-nav-item-class":"gl-tab-nav-item-active","content-class":[_vm.contentClass, 'gl-tab-content'],"nav-class":[_vm.navClass, 'gl-tabs-nav'],"justified":_vm.justified,"value":_vm.activeTabIndex},scopedSlots:_vm._u([_vm._l((Object.keys(_vm.$slots)),function(slot){return {key:slot,fn:function(){return [_vm._t(slot)]},proxy:true}}),(_vm.hasActions)?{key:"tabs-start",fn:function(){return [_c('div',{staticClass:"gl-actions-tabs-start",attrs:{"data-testid":"actions-tabs-start"}},[(_vm.actionPrimary)?_c('gl-button',_vm._b({attrs:{"data-testid":"action-primary"},on:{"click":_vm.primary}},'gl-button',_vm.buttonBinding(_vm.actionPrimary, 'actionPrimary'),false),[_vm._v("\n "+_vm._s(_vm.actionPrimary.text)+"\n ")]):_vm._e(),_vm._v(" "),(_vm.actionSecondary)?_c('gl-button',_vm._b({attrs:{"data-testid":"action-secondary"},on:{"click":_vm.secondary}},'gl-button',_vm.buttonBinding(_vm.actionSecondary, 'actionSecondary'),false),[_vm._v("\n "+_vm._s(_vm.actionSecondary.text)+"\n ")]):_vm._e(),_vm._v(" "),(_vm.actionTertiary)?_c('gl-button',_vm._b({attrs:{"data-testid":"action-tertiary"},on:{"click":_vm.tertiary}},'gl-button',_vm.buttonBinding(_vm.actionTertiary, 'actionTertiary'),false),[_vm._v("\n "+_vm._s(_vm.actionTertiary.text)+"\n ")]):_vm._e()],1)]},proxy:true}:null,(_vm.hasActions)?{key:"tabs-end",fn:function(){return [_c('div',{staticClass:"gl-actions-tabs-end",attrs:{"data-testid":"actions-tabs-end"}},[(_vm.actionPrimary)?_c('gl-button',_vm._b({attrs:{"data-testid":"action-primary"},on:{"click":_vm.primary}},'gl-button',_vm.buttonBinding(_vm.actionPrimary, 'actionPrimary'),false),[_vm._v("\n "+_vm._s(_vm.actionPrimary.text)+"\n ")]):_vm._e(),_vm._v(" "),(_vm.actionSecondary)?_c('gl-button',_vm._b({attrs:{"data-testid":"action-secondary"},on:{"click":_vm.secondary}},'gl-button',_vm.buttonBinding(_vm.actionSecondary, 'actionSecondary'),false),[_vm._v("\n "+_vm._s(_vm.actionSecondary.text)+"\n ")]):_vm._e(),_vm._v(" "),(_vm.actionTertiary)?_c('gl-button',_vm._b({attrs:{"data-testid":"action-tertiary"},on:{"click":_vm.tertiary}},'gl-button',_vm.buttonBinding(_vm.actionTertiary, 'actionTertiary'),false),[_vm._v("\n "+_vm._s(_vm.actionTertiary.text)+"\n ")]):_vm._e()],1)]},proxy:true}:null],null,true)},'b-tabs',_vm.$attrs,false),_vm.listeners))};
|
|
193
|
-
var __vue_staticRenderFns__ = [];
|
|
194
|
-
|
|
195
|
-
/* style */
|
|
196
|
-
const __vue_inject_styles__ = undefined;
|
|
197
|
-
/* scoped */
|
|
198
|
-
const __vue_scope_id__ = undefined;
|
|
199
|
-
/* module identifier */
|
|
200
|
-
const __vue_module_identifier__ = undefined;
|
|
201
|
-
/* functional template */
|
|
202
|
-
const __vue_is_functional_template__ = false;
|
|
203
|
-
/* style inject */
|
|
204
|
-
|
|
205
|
-
/* style inject SSR */
|
|
206
|
-
|
|
207
|
-
/* style inject shadow dom */
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
const __vue_component__ = __vue_normalize__(
|
|
212
|
-
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
213
|
-
__vue_inject_styles__,
|
|
214
|
-
__vue_script__,
|
|
215
|
-
__vue_scope_id__,
|
|
216
|
-
__vue_is_functional_template__,
|
|
217
|
-
__vue_module_identifier__,
|
|
218
|
-
false,
|
|
219
|
-
undefined,
|
|
220
|
-
undefined,
|
|
221
|
-
undefined
|
|
222
|
-
);
|
|
223
|
-
|
|
224
|
-
export default __vue_component__;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { ToastPlugin } from 'bootstrap-vue/esm/index.js';
|
|
2
|
-
import isFunction from 'lodash/isFunction';
|
|
3
|
-
import CloseButton from '../../shared_components/close_button/close_button';
|
|
4
|
-
|
|
5
|
-
/* eslint-disable import/no-default-export */
|
|
6
|
-
const DEFAULT_OPTIONS = {
|
|
7
|
-
autoHideDelay: 5000,
|
|
8
|
-
toastClass: 'gl-toast',
|
|
9
|
-
isStatus: true,
|
|
10
|
-
noCloseButton: true,
|
|
11
|
-
toaster: 'b-toaster-bottom-left'
|
|
12
|
-
};
|
|
13
|
-
let toastsCount = 0;
|
|
14
|
-
function renderTitle(h, toast, options) {
|
|
15
|
-
const nodes = [h(CloseButton, {
|
|
16
|
-
class: ['gl-toast-close-button', 'gl-close-btn-color-inherit'],
|
|
17
|
-
on: {
|
|
18
|
-
click: toast.hide
|
|
19
|
-
}
|
|
20
|
-
})];
|
|
21
|
-
if (options.action) {
|
|
22
|
-
nodes.splice(0, 0, h('a', {
|
|
23
|
-
role: 'button',
|
|
24
|
-
class: ['gl-toast-action'],
|
|
25
|
-
on: {
|
|
26
|
-
click: e => options.action.onClick(e, toast)
|
|
27
|
-
}
|
|
28
|
-
}, options.action.text));
|
|
29
|
-
}
|
|
30
|
-
return nodes;
|
|
31
|
-
}
|
|
32
|
-
function showToast(message) {
|
|
33
|
-
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
34
|
-
const id = `gl-toast-${toastsCount}`;
|
|
35
|
-
toastsCount += 1;
|
|
36
|
-
const hide = () => {
|
|
37
|
-
this.$bvToast.hide(id);
|
|
38
|
-
};
|
|
39
|
-
const toast = {
|
|
40
|
-
id,
|
|
41
|
-
hide
|
|
42
|
-
};
|
|
43
|
-
if (isFunction(options.onComplete)) {
|
|
44
|
-
const toastHiddenCallback = e => {
|
|
45
|
-
if (e.componentId === id) {
|
|
46
|
-
this.$root.$off('bv::toast:hidden', toastHiddenCallback);
|
|
47
|
-
options.onComplete(e);
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
this.$root.$on('bv::toast:hidden', toastHiddenCallback);
|
|
51
|
-
}
|
|
52
|
-
this.$bvToast.toast(message, {
|
|
53
|
-
...DEFAULT_OPTIONS,
|
|
54
|
-
id,
|
|
55
|
-
title: renderTitle(this.$createElement, toast, options)
|
|
56
|
-
});
|
|
57
|
-
return toast;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Note: This is not a typical Vue component and needs to be registered before instantiating a Vue app.
|
|
62
|
-
* Once registered, the toast will be globally available throughout your app.
|
|
63
|
-
*
|
|
64
|
-
* See https://gitlab-org.gitlab.io/gitlab-ui/ for detailed documentation.
|
|
65
|
-
*/
|
|
66
|
-
var toast = {
|
|
67
|
-
install(Vue) {
|
|
68
|
-
Vue.use(ToastPlugin);
|
|
69
|
-
Vue.mixin({
|
|
70
|
-
beforeCreate() {
|
|
71
|
-
if (this.$toast) {
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
this.$toast = {
|
|
75
|
-
show: showToast.bind(this)
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export default toast;
|