@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,58 +0,0 @@
|
|
|
1
|
-
import uniqueId from 'lodash/uniqueId';
|
|
2
|
-
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
3
|
-
|
|
4
|
-
var script = {
|
|
5
|
-
name: 'GlListboxGroup',
|
|
6
|
-
props: {
|
|
7
|
-
name: {
|
|
8
|
-
type: String,
|
|
9
|
-
required: true
|
|
10
|
-
},
|
|
11
|
-
textSrOnly: {
|
|
12
|
-
type: Boolean,
|
|
13
|
-
required: false,
|
|
14
|
-
default: false
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
created() {
|
|
18
|
-
this.nameId = uniqueId('gl-listbox-group-');
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
/* script */
|
|
23
|
-
const __vue_script__ = script;
|
|
24
|
-
|
|
25
|
-
/* template */
|
|
26
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('ul',{staticClass:"gl-mb-0 gl-pl-0",attrs:{"role":"group","aria-labelledby":_vm.nameId}},[_c('li',{staticClass:"gl-pl-4 gl-pt-3 gl-pb-2 gl-font-sm gl-font-weight-bold",class:{ 'gl-sr-only': _vm.textSrOnly },attrs:{"id":_vm.nameId,"role":"presentation"}},[_vm._t("group-label",function(){return [_vm._v(_vm._s(_vm.name))]})],2),_vm._v(" "),_vm._t("default")],2)};
|
|
27
|
-
var __vue_staticRenderFns__ = [];
|
|
28
|
-
|
|
29
|
-
/* style */
|
|
30
|
-
const __vue_inject_styles__ = undefined;
|
|
31
|
-
/* scoped */
|
|
32
|
-
const __vue_scope_id__ = undefined;
|
|
33
|
-
/* module identifier */
|
|
34
|
-
const __vue_module_identifier__ = undefined;
|
|
35
|
-
/* functional template */
|
|
36
|
-
const __vue_is_functional_template__ = false;
|
|
37
|
-
/* style inject */
|
|
38
|
-
|
|
39
|
-
/* style inject SSR */
|
|
40
|
-
|
|
41
|
-
/* style inject shadow dom */
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const __vue_component__ = __vue_normalize__(
|
|
46
|
-
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
47
|
-
__vue_inject_styles__,
|
|
48
|
-
__vue_script__,
|
|
49
|
-
__vue_scope_id__,
|
|
50
|
-
__vue_is_functional_template__,
|
|
51
|
-
__vue_module_identifier__,
|
|
52
|
-
false,
|
|
53
|
-
undefined,
|
|
54
|
-
undefined,
|
|
55
|
-
undefined
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
export default __vue_component__;
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import GlIcon from '../../icon/icon';
|
|
2
|
-
import { ENTER, SPACE } from '../constants';
|
|
3
|
-
import { stopEvent } from '../../../../utils/utils';
|
|
4
|
-
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
5
|
-
|
|
6
|
-
var script = {
|
|
7
|
-
name: 'GlListboxItem',
|
|
8
|
-
components: {
|
|
9
|
-
GlIcon
|
|
10
|
-
},
|
|
11
|
-
props: {
|
|
12
|
-
isSelected: {
|
|
13
|
-
type: Boolean,
|
|
14
|
-
default: false,
|
|
15
|
-
required: false
|
|
16
|
-
},
|
|
17
|
-
isFocused: {
|
|
18
|
-
type: Boolean,
|
|
19
|
-
default: false,
|
|
20
|
-
required: false
|
|
21
|
-
},
|
|
22
|
-
isCheckCentered: {
|
|
23
|
-
type: Boolean,
|
|
24
|
-
required: false,
|
|
25
|
-
default: false
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
computed: {
|
|
29
|
-
checkedClasses() {
|
|
30
|
-
if (this.isCheckCentered) {
|
|
31
|
-
return '';
|
|
32
|
-
}
|
|
33
|
-
return 'gl-mt-3 gl-align-self-start';
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
methods: {
|
|
37
|
-
toggleSelection() {
|
|
38
|
-
this.$emit('select', !this.isSelected);
|
|
39
|
-
},
|
|
40
|
-
onKeydown(event) {
|
|
41
|
-
const {
|
|
42
|
-
code
|
|
43
|
-
} = event;
|
|
44
|
-
if (code === ENTER || code === SPACE) {
|
|
45
|
-
stopEvent(event);
|
|
46
|
-
this.toggleSelection();
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
/* script */
|
|
53
|
-
const __vue_script__ = script;
|
|
54
|
-
|
|
55
|
-
/* template */
|
|
56
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('li',{staticClass:"gl-new-dropdown-item",attrs:{"role":"option","tabindex":_vm.isFocused ? 0 : -1,"aria-selected":_vm.isSelected},on:{"click":_vm.toggleSelection,"keydown":_vm.onKeydown}},[_c('span',{staticClass:"gl-new-dropdown-item-content"},[_c('gl-icon',{class:[
|
|
57
|
-
'gl-new-dropdown-item-check-icon',
|
|
58
|
-
{ 'gl-visibility-hidden': !_vm.isSelected },
|
|
59
|
-
_vm.checkedClasses ],attrs:{"name":"mobile-issue-close","data-testid":"dropdown-item-checkbox"}}),_vm._v(" "),_c('span',{staticClass:"gl-new-dropdown-item-text-wrapper"},[_vm._t("default")],2)],1)])};
|
|
60
|
-
var __vue_staticRenderFns__ = [];
|
|
61
|
-
|
|
62
|
-
/* style */
|
|
63
|
-
const __vue_inject_styles__ = undefined;
|
|
64
|
-
/* scoped */
|
|
65
|
-
const __vue_scope_id__ = undefined;
|
|
66
|
-
/* module identifier */
|
|
67
|
-
const __vue_module_identifier__ = undefined;
|
|
68
|
-
/* functional template */
|
|
69
|
-
const __vue_is_functional_template__ = false;
|
|
70
|
-
/* style inject */
|
|
71
|
-
|
|
72
|
-
/* style inject SSR */
|
|
73
|
-
|
|
74
|
-
/* style inject shadow dom */
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
const __vue_component__ = __vue_normalize__(
|
|
79
|
-
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
80
|
-
__vue_inject_styles__,
|
|
81
|
-
__vue_script__,
|
|
82
|
-
__vue_scope_id__,
|
|
83
|
-
__vue_is_functional_template__,
|
|
84
|
-
__vue_module_identifier__,
|
|
85
|
-
false,
|
|
86
|
-
undefined,
|
|
87
|
-
undefined,
|
|
88
|
-
undefined
|
|
89
|
-
);
|
|
90
|
-
|
|
91
|
-
export default __vue_component__;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import GlClearIconButton from '../../../shared_components/clear_icon_button/clear_icon_button';
|
|
2
|
-
import GlIcon from '../../icon/icon';
|
|
3
|
-
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
4
|
-
|
|
5
|
-
var script = {
|
|
6
|
-
name: 'GlListboxSearchInput',
|
|
7
|
-
components: {
|
|
8
|
-
GlClearIconButton,
|
|
9
|
-
GlIcon
|
|
10
|
-
},
|
|
11
|
-
model: {
|
|
12
|
-
prop: 'value',
|
|
13
|
-
event: 'input'
|
|
14
|
-
},
|
|
15
|
-
props: {
|
|
16
|
-
/**
|
|
17
|
-
* If provided, used as value of search input
|
|
18
|
-
*/
|
|
19
|
-
value: {
|
|
20
|
-
type: String,
|
|
21
|
-
required: false,
|
|
22
|
-
default: ''
|
|
23
|
-
},
|
|
24
|
-
/**
|
|
25
|
-
* Search input placeholder text and aria-label
|
|
26
|
-
*/
|
|
27
|
-
placeholder: {
|
|
28
|
-
type: String,
|
|
29
|
-
required: false,
|
|
30
|
-
default: 'Search'
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
computed: {
|
|
34
|
-
hasValue() {
|
|
35
|
-
return Boolean(this.value.length);
|
|
36
|
-
},
|
|
37
|
-
inputListeners() {
|
|
38
|
-
return {
|
|
39
|
-
...this.$listeners,
|
|
40
|
-
input: event => {
|
|
41
|
-
this.$emit('input', event.target.value);
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
methods: {
|
|
47
|
-
clearInput() {
|
|
48
|
-
this.$emit('input', '');
|
|
49
|
-
this.focusInput();
|
|
50
|
-
},
|
|
51
|
-
focusInput() {
|
|
52
|
-
this.$refs.input.focus();
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
/* script */
|
|
58
|
-
const __vue_script__ = script;
|
|
59
|
-
|
|
60
|
-
/* template */
|
|
61
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-listbox-search"},[_c('gl-icon',{staticClass:"gl-listbox-search-icon",attrs:{"name":"search-sm","size":12}}),_vm._v(" "),_c('input',_vm._g({ref:"input",staticClass:"gl-listbox-search-input",attrs:{"type":"search","aria-label":_vm.placeholder,"placeholder":_vm.placeholder},domProps:{"value":_vm.value}},_vm.inputListeners)),_vm._v(" "),(_vm.hasValue)?_c('gl-clear-icon-button',{staticClass:"gl-listbox-search-clear-button",on:{"click":function($event){$event.stopPropagation();return _vm.clearInput.apply(null, arguments)}}}):_vm._e()],1)};
|
|
62
|
-
var __vue_staticRenderFns__ = [];
|
|
63
|
-
|
|
64
|
-
/* style */
|
|
65
|
-
const __vue_inject_styles__ = undefined;
|
|
66
|
-
/* scoped */
|
|
67
|
-
const __vue_scope_id__ = undefined;
|
|
68
|
-
/* module identifier */
|
|
69
|
-
const __vue_module_identifier__ = undefined;
|
|
70
|
-
/* functional template */
|
|
71
|
-
const __vue_is_functional_template__ = false;
|
|
72
|
-
/* style inject */
|
|
73
|
-
|
|
74
|
-
/* style inject SSR */
|
|
75
|
-
|
|
76
|
-
/* style inject shadow dom */
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const __vue_component__ = __vue_normalize__(
|
|
81
|
-
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
82
|
-
__vue_inject_styles__,
|
|
83
|
-
__vue_script__,
|
|
84
|
-
__vue_scope_id__,
|
|
85
|
-
__vue_is_functional_template__,
|
|
86
|
-
__vue_module_identifier__,
|
|
87
|
-
false,
|
|
88
|
-
undefined,
|
|
89
|
-
undefined,
|
|
90
|
-
undefined
|
|
91
|
-
);
|
|
92
|
-
|
|
93
|
-
export default __vue_component__;
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
const mockOptions = [{
|
|
2
|
-
value: 'prod',
|
|
3
|
-
text: 'Product'
|
|
4
|
-
}, {
|
|
5
|
-
value: 'ppl',
|
|
6
|
-
text: 'People'
|
|
7
|
-
}, {
|
|
8
|
-
value: 'fin',
|
|
9
|
-
text: 'Finance'
|
|
10
|
-
}, {
|
|
11
|
-
value: 'leg',
|
|
12
|
-
text: 'Legal'
|
|
13
|
-
}, {
|
|
14
|
-
value: 'eng',
|
|
15
|
-
text: 'Engineering'
|
|
16
|
-
}, {
|
|
17
|
-
value: 'sales',
|
|
18
|
-
text: 'Sales'
|
|
19
|
-
}, {
|
|
20
|
-
value: 'marketing',
|
|
21
|
-
text: 'Marketing'
|
|
22
|
-
}, {
|
|
23
|
-
value: 'acc',
|
|
24
|
-
text: 'Accounting'
|
|
25
|
-
}, {
|
|
26
|
-
value: 'hr',
|
|
27
|
-
text: 'Human Resource Management'
|
|
28
|
-
}, {
|
|
29
|
-
value: 'rnd',
|
|
30
|
-
text: 'Research and Development'
|
|
31
|
-
}, {
|
|
32
|
-
value: 'cust',
|
|
33
|
-
text: 'Customer Service'
|
|
34
|
-
}, {
|
|
35
|
-
value: 'sup',
|
|
36
|
-
text: 'Support'
|
|
37
|
-
}];
|
|
38
|
-
const mockOptionsValues = mockOptions.map(_ref => {
|
|
39
|
-
let {
|
|
40
|
-
value
|
|
41
|
-
} = _ref;
|
|
42
|
-
return value;
|
|
43
|
-
});
|
|
44
|
-
const mockGroups = [{
|
|
45
|
-
text: 'Branches',
|
|
46
|
-
options: [{
|
|
47
|
-
text: 'main',
|
|
48
|
-
value: 'main'
|
|
49
|
-
}, {
|
|
50
|
-
text: 'feature-123',
|
|
51
|
-
value: 'feature-123'
|
|
52
|
-
}]
|
|
53
|
-
}, {
|
|
54
|
-
text: 'Tags',
|
|
55
|
-
options: [{
|
|
56
|
-
text: 'v1.0',
|
|
57
|
-
value: 'v1.0'
|
|
58
|
-
}, {
|
|
59
|
-
text: 'v2.0',
|
|
60
|
-
value: 'v2.0'
|
|
61
|
-
}, {
|
|
62
|
-
text: 'v2.1',
|
|
63
|
-
value: 'v2.1'
|
|
64
|
-
}]
|
|
65
|
-
}];
|
|
66
|
-
const mockGroupOptionsValues = mockGroups.map(group => group.options).flat().map(_ref2 => {
|
|
67
|
-
let {
|
|
68
|
-
value
|
|
69
|
-
} = _ref2;
|
|
70
|
-
return value;
|
|
71
|
-
});
|
|
72
|
-
const mockGroupsWithTextSrOnly = [{
|
|
73
|
-
text: 'Default',
|
|
74
|
-
options: [{
|
|
75
|
-
text: 'main',
|
|
76
|
-
value: 'main'
|
|
77
|
-
}, {
|
|
78
|
-
text: 'development',
|
|
79
|
-
value: 'development'
|
|
80
|
-
}],
|
|
81
|
-
textSrOnly: true
|
|
82
|
-
}, {
|
|
83
|
-
text: 'Feature branches',
|
|
84
|
-
options: [{
|
|
85
|
-
text: 'feature/add-avatar',
|
|
86
|
-
value: 'add'
|
|
87
|
-
}, {
|
|
88
|
-
text: 'feature/improve-panel',
|
|
89
|
-
value: 'improve'
|
|
90
|
-
}]
|
|
91
|
-
}, {
|
|
92
|
-
text: 'Bugfix branches',
|
|
93
|
-
options: [{
|
|
94
|
-
text: 'fix/border-of-avatar',
|
|
95
|
-
value: 'fix-border'
|
|
96
|
-
}, {
|
|
97
|
-
text: 'fix/radius-panel',
|
|
98
|
-
value: 'fix-radius'
|
|
99
|
-
}]
|
|
100
|
-
}];
|
|
101
|
-
const mockUsers = [{
|
|
102
|
-
value: 'mikegreiling',
|
|
103
|
-
text: 'Mike Greiling',
|
|
104
|
-
secondaryText: '@mikegreiling',
|
|
105
|
-
icon: 'foo'
|
|
106
|
-
}, {
|
|
107
|
-
value: 'ohoral',
|
|
108
|
-
text: 'Olena Horal-Koretska',
|
|
109
|
-
secondaryText: '@ohoral',
|
|
110
|
-
icon: 'bar'
|
|
111
|
-
}, {
|
|
112
|
-
value: 'markian',
|
|
113
|
-
text: 'Mark Florian',
|
|
114
|
-
secondaryText: '@markian',
|
|
115
|
-
icon: 'bin'
|
|
116
|
-
}];
|
|
117
|
-
|
|
118
|
-
export { mockGroupOptionsValues, mockGroups, mockGroupsWithTextSrOnly, mockOptions, mockOptionsValues, mockUsers };
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import isNumber from 'lodash/isNumber';
|
|
2
|
-
import isString from 'lodash/isString';
|
|
3
|
-
|
|
4
|
-
const isOption = item => Boolean(item) && (isString(item.value) || isNumber(item.value));
|
|
5
|
-
|
|
6
|
-
// eslint-disable-next-line unicorn/no-array-callback-reference
|
|
7
|
-
const isGroup = function () {
|
|
8
|
-
let {
|
|
9
|
-
options
|
|
10
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
11
|
-
return Array.isArray(options) && options.every(isOption);
|
|
12
|
-
};
|
|
13
|
-
const hasNoDuplicates = array => array.length === new Set(array).size;
|
|
14
|
-
const flattenedOptions = items => items.flatMap(item => isOption(item) ? item : item.options);
|
|
15
|
-
|
|
16
|
-
// eslint-disable-next-line unicorn/no-array-callback-reference
|
|
17
|
-
const isAllOptionsOrAllGroups = items => items.every(isOption) || items.every(isGroup);
|
|
18
|
-
const hasUniqueValues = items => hasNoDuplicates(flattenedOptions(items).map(_ref => {
|
|
19
|
-
let {
|
|
20
|
-
value
|
|
21
|
-
} = _ref;
|
|
22
|
-
return value;
|
|
23
|
-
}));
|
|
24
|
-
|
|
25
|
-
// eslint-disable-next-line unicorn/no-array-callback-reference
|
|
26
|
-
const hasUniqueGroups = items => hasNoDuplicates(items.filter(isGroup).map(_ref2 => {
|
|
27
|
-
let {
|
|
28
|
-
text
|
|
29
|
-
} = _ref2;
|
|
30
|
-
return text;
|
|
31
|
-
}));
|
|
32
|
-
const itemsValidator = items => isAllOptionsOrAllGroups(items) && hasUniqueValues(items) && hasUniqueGroups(items);
|
|
33
|
-
|
|
34
|
-
export { flattenedOptions, isOption, itemsValidator };
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import GlPagination from '../pagination/pagination';
|
|
2
|
-
import GlSearchBoxByType from '../search_box_by_type/search_box_by_type';
|
|
3
|
-
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
4
|
-
|
|
5
|
-
var script = {
|
|
6
|
-
name: 'GlPaginatedList',
|
|
7
|
-
components: {
|
|
8
|
-
GlSearchBoxByType,
|
|
9
|
-
GlPagination
|
|
10
|
-
},
|
|
11
|
-
props: {
|
|
12
|
-
list: {
|
|
13
|
-
type: Array,
|
|
14
|
-
required: true
|
|
15
|
-
},
|
|
16
|
-
perPage: {
|
|
17
|
-
type: Number,
|
|
18
|
-
required: false,
|
|
19
|
-
default: 10
|
|
20
|
-
},
|
|
21
|
-
page: {
|
|
22
|
-
type: Number,
|
|
23
|
-
required: false,
|
|
24
|
-
default: 1
|
|
25
|
-
},
|
|
26
|
-
filterable: {
|
|
27
|
-
type: Boolean,
|
|
28
|
-
required: false,
|
|
29
|
-
default: true
|
|
30
|
-
},
|
|
31
|
-
itemKey: {
|
|
32
|
-
type: String,
|
|
33
|
-
required: false,
|
|
34
|
-
default: 'id'
|
|
35
|
-
},
|
|
36
|
-
filter: {
|
|
37
|
-
type: [String, Function],
|
|
38
|
-
required: false,
|
|
39
|
-
default: 'id'
|
|
40
|
-
},
|
|
41
|
-
emptyMessage: {
|
|
42
|
-
type: String,
|
|
43
|
-
required: false,
|
|
44
|
-
default: 'There are currently no items in this list.'
|
|
45
|
-
},
|
|
46
|
-
emptySearchMessage: {
|
|
47
|
-
type: String,
|
|
48
|
-
required: false,
|
|
49
|
-
default: 'Sorry, your filter produced no results.'
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
data() {
|
|
53
|
-
return {
|
|
54
|
-
pageIndex: this.page,
|
|
55
|
-
queryStr: ''
|
|
56
|
-
};
|
|
57
|
-
},
|
|
58
|
-
computed: {
|
|
59
|
-
filteredList() {
|
|
60
|
-
if (typeof this.filter === 'function') {
|
|
61
|
-
return this.list.filter(listItem => this.filter(listItem, this.queryStr));
|
|
62
|
-
}
|
|
63
|
-
return this.list.filter(listItem => listItem[this.filter].toLowerCase().includes(this.queryStr.toLowerCase()));
|
|
64
|
-
},
|
|
65
|
-
paginatedList() {
|
|
66
|
-
const offset = (this.pageIndex - 1) * this.perPage;
|
|
67
|
-
return this.filteredList.slice(offset, offset + this.perPage);
|
|
68
|
-
},
|
|
69
|
-
pageInfo() {
|
|
70
|
-
return {
|
|
71
|
-
perPage: this.perPage,
|
|
72
|
-
total: this.filterTotal,
|
|
73
|
-
page: this.pageIndex
|
|
74
|
-
};
|
|
75
|
-
},
|
|
76
|
-
total() {
|
|
77
|
-
return this.list.length;
|
|
78
|
-
},
|
|
79
|
-
filterTotal() {
|
|
80
|
-
return this.filteredList.length;
|
|
81
|
-
},
|
|
82
|
-
/**
|
|
83
|
-
* Determine if the original list had 0 items
|
|
84
|
-
*
|
|
85
|
-
* @return {Boolean} - If we started with an empty list
|
|
86
|
-
*
|
|
87
|
-
*/
|
|
88
|
-
zeroTotal() {
|
|
89
|
-
return this.total === 0;
|
|
90
|
-
},
|
|
91
|
-
/**
|
|
92
|
-
* Determine if our search yields an empty list
|
|
93
|
-
*
|
|
94
|
-
* @return {Boolean} - If we have an empty search list
|
|
95
|
-
*
|
|
96
|
-
*/
|
|
97
|
-
zeroSearchResults() {
|
|
98
|
-
return this.total > 0 && this.filterTotal === 0;
|
|
99
|
-
},
|
|
100
|
-
/**
|
|
101
|
-
* Determine if we originally had 0 results or 0 search results
|
|
102
|
-
*
|
|
103
|
-
* @return {Boolean} - If we have an empty search list
|
|
104
|
-
*
|
|
105
|
-
*/
|
|
106
|
-
emptyList() {
|
|
107
|
-
return this.zeroTotal || this.zeroSearchResults;
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
watch: {
|
|
111
|
-
/**
|
|
112
|
-
* In GitLab UI storybook, when a user changes the page knob,
|
|
113
|
-
* we update the current page index.
|
|
114
|
-
*
|
|
115
|
-
* @param {Number} newPage - A string param
|
|
116
|
-
* @return {undefined} - Nothing is returned
|
|
117
|
-
*
|
|
118
|
-
*/
|
|
119
|
-
page(newPage) {
|
|
120
|
-
this.pageIndex = newPage;
|
|
121
|
-
},
|
|
122
|
-
/**
|
|
123
|
-
* In GitLab UI storybook, when a user changes the perPage knob,
|
|
124
|
-
* we reset the paginated list to the first page.
|
|
125
|
-
*
|
|
126
|
-
* @return {undefined} - Nothing is returned
|
|
127
|
-
*
|
|
128
|
-
*/
|
|
129
|
-
perPage() {
|
|
130
|
-
this.pageIndex = 1;
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
methods: {
|
|
134
|
-
change(page) {
|
|
135
|
-
this.pageIndex = page;
|
|
136
|
-
},
|
|
137
|
-
query(queryStr) {
|
|
138
|
-
this.pageIndex = 1;
|
|
139
|
-
this.queryStr = queryStr;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
/* script */
|
|
145
|
-
const __vue_script__ = script;
|
|
146
|
-
|
|
147
|
-
/* template */
|
|
148
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('div',{staticClass:"row-content-block second-block d-sm-flex justify-content-between flex-row-reverse"},[_vm._t("header"),_vm._v(" "),(_vm.filterable)?_c('gl-search-box-by-type',{on:{"input":_vm.query}}):_vm._e()],2),_vm._v(" "),_vm._t("subheader"),_vm._v(" "),_c('ul',{staticClass:"list-group list-group-flush list-unstyled"},_vm._l((_vm.paginatedList),function(listItem){return _c('li',{key:listItem[_vm.itemKey],staticClass:"list-group-item"},[_vm._t("default",function(){return [_vm._v(_vm._s(listItem.id))]},{"listItem":listItem,"query":_vm.queryStr})],2)}),0),_vm._v(" "),(!_vm.emptyList)?_c('gl-pagination',_vm._b({staticClass:"d-flex justify-content-center prepend-top-default",attrs:{"per-page":_vm.pageInfo.perPage,"value":_vm.pageInfo.page,"total-items":_vm.pageInfo.total},on:{"input":_vm.change}},'gl-pagination',_vm.$attrs,false)):_vm._e(),_vm._v(" "),(_vm.emptyList)?_c('div',{staticClass:"bs-callout bs-callout-warning mt-3 empty-message",class:{ 'empty-message': _vm.zeroTotal, 'empty-search': _vm.zeroSearchResults }},[_vm._v(_vm._s(_vm.zeroTotal ? _vm.emptyMessage : _vm.emptySearchMessage))]):_vm._e()],2)};
|
|
149
|
-
var __vue_staticRenderFns__ = [];
|
|
150
|
-
|
|
151
|
-
/* style */
|
|
152
|
-
const __vue_inject_styles__ = undefined;
|
|
153
|
-
/* scoped */
|
|
154
|
-
const __vue_scope_id__ = undefined;
|
|
155
|
-
/* module identifier */
|
|
156
|
-
const __vue_module_identifier__ = undefined;
|
|
157
|
-
/* functional template */
|
|
158
|
-
const __vue_is_functional_template__ = false;
|
|
159
|
-
/* style inject */
|
|
160
|
-
|
|
161
|
-
/* style inject SSR */
|
|
162
|
-
|
|
163
|
-
/* style inject shadow dom */
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
const __vue_component__ = __vue_normalize__(
|
|
168
|
-
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
169
|
-
__vue_inject_styles__,
|
|
170
|
-
__vue_script__,
|
|
171
|
-
__vue_scope_id__,
|
|
172
|
-
__vue_is_functional_template__,
|
|
173
|
-
__vue_module_identifier__,
|
|
174
|
-
false,
|
|
175
|
-
undefined,
|
|
176
|
-
undefined,
|
|
177
|
-
undefined
|
|
178
|
-
);
|
|
179
|
-
|
|
180
|
-
export default __vue_component__;
|