@gitlab/ui 49.0.1 → 49.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/components/base/accordion/accordion.js +2 -8
  3. package/dist/components/base/accordion/accordion_item.js +0 -14
  4. package/dist/components/base/alert/alert.js +4 -22
  5. package/dist/components/base/avatar/avatar.js +0 -7
  6. package/dist/components/base/avatar_labeled/avatar_labeled.js +0 -2
  7. package/dist/components/base/avatars_inline/avatars_inline.js +2 -10
  8. package/dist/components/base/badge/badge.js +0 -8
  9. package/dist/components/base/banner/banner.js +0 -10
  10. package/dist/components/base/breadcrumb/breadcrumb.js +0 -12
  11. package/dist/components/base/breadcrumb/breadcrumb_item.js +0 -2
  12. package/dist/components/base/broadcast_message/broadcast_message.js +0 -3
  13. package/dist/components/base/button/button.js +0 -11
  14. package/dist/components/base/card/card.js +1 -2
  15. package/dist/components/base/datepicker/datepicker.js +7 -42
  16. package/dist/components/base/daterange_picker/daterange_picker.js +0 -23
  17. package/dist/components/base/drawer/drawer.js +0 -13
  18. package/dist/components/base/dropdown/dropdown.js +3 -17
  19. package/dist/components/base/dropdown/dropdown_item.js +2 -8
  20. package/dist/components/base/filtered_search/common_story_options.js +1 -2
  21. package/dist/components/base/filtered_search/filtered_search.js +9 -61
  22. package/dist/components/base/filtered_search/filtered_search_suggestion.js +0 -6
  23. package/dist/components/base/filtered_search/filtered_search_suggestion_list.js +0 -16
  24. package/dist/components/base/filtered_search/filtered_search_term.js +0 -9
  25. package/dist/components/base/filtered_search/filtered_search_token.js +10 -49
  26. package/dist/components/base/filtered_search/filtered_search_token_segment.js +3 -56
  27. package/dist/components/base/filtered_search/filtered_search_utils.js +7 -24
  28. package/dist/components/base/form/form_checkbox/form_checkbox.js +0 -2
  29. package/dist/components/base/form/form_checkbox_tree/checkbox_tree_node.js +0 -4
  30. package/dist/components/base/form/form_checkbox_tree/form_checkbox_tree.js +0 -10
  31. package/dist/components/base/form/form_checkbox_tree/models/node.js +1 -10
  32. package/dist/components/base/form/form_checkbox_tree/models/tree.js +16 -37
  33. package/dist/components/base/form/form_combobox/form_combobox.js +2 -36
  34. package/dist/components/base/form/form_group/form_group.js +2 -7
  35. package/dist/components/base/form/form_input/form_input.js +2 -8
  36. package/dist/components/base/form/form_input_group/form_input_group.js +0 -5
  37. package/dist/components/base/form/form_input_group/form_input_group_mixin.js +0 -8
  38. package/dist/components/base/form/form_radio_group/form_radio_group.js +0 -2
  39. package/dist/components/base/form/form_select/form_select.js +0 -3
  40. package/dist/components/base/form/form_textarea/form_textarea.js +2 -7
  41. package/dist/components/base/icon/icon.js +4 -14
  42. package/dist/components/base/infinite_scroll/infinite_scroll.js +7 -21
  43. package/dist/components/base/keyset_pagination/keyset_pagination.js +0 -9
  44. package/dist/components/base/label/label.js +0 -12
  45. package/dist/components/base/loading_icon/loading_icon.js +7 -10
  46. package/dist/components/base/markdown/markdown.js +1 -0
  47. package/dist/components/base/modal/modal.js +7 -27
  48. package/dist/components/base/new_dropdowns/base_dropdown/base_dropdown.js +0 -25
  49. package/dist/components/base/new_dropdowns/constants.js +4 -2
  50. package/dist/components/base/new_dropdowns/listbox/listbox.js +0 -63
  51. package/dist/components/base/new_dropdowns/listbox/listbox_group.js +0 -2
  52. package/dist/components/base/new_dropdowns/listbox/listbox_item.js +0 -5
  53. package/dist/components/base/new_dropdowns/listbox/utils.js +0 -7
  54. package/dist/components/base/paginated_list/paginated_list.js +0 -15
  55. package/dist/components/base/pagination/pagination.js +14 -72
  56. package/dist/components/base/path/path.js +0 -29
  57. package/dist/components/base/popover/popover.js +0 -5
  58. package/dist/components/base/search_box_by_click/search_box_by_click.js +1 -26
  59. package/dist/components/base/search_box_by_type/search_box_by_type.js +2 -12
  60. package/dist/components/base/segmented_control/segmented_control.js +0 -10
  61. package/dist/components/base/skeleton_loader/skeleton_loader.js +0 -19
  62. package/dist/components/base/skeleton_loading/skeleton_loading.js +0 -3
  63. package/dist/components/base/sorting/sorting.js +1 -9
  64. package/dist/components/base/sorting/sorting_item.js +4 -6
  65. package/dist/components/base/table/table.js +0 -4
  66. package/dist/components/base/tabs/tab/tab.js +2 -6
  67. package/dist/components/base/tabs/tabs/scrollable_tabs.js +0 -21
  68. package/dist/components/base/tabs/tabs/tabs.js +8 -33
  69. package/dist/components/base/toast/toast.js +3 -15
  70. package/dist/components/base/toggle/toggle.js +0 -18
  71. package/dist/components/base/token/token.js +0 -4
  72. package/dist/components/base/token_selector/token_container.js +0 -24
  73. package/dist/components/base/token_selector/token_selector.js +10 -61
  74. package/dist/components/base/token_selector/token_selector_dropdown.js +4 -32
  75. package/dist/components/charts/area/area.js +8 -32
  76. package/dist/components/charts/bar/bar.js +7 -19
  77. package/dist/components/charts/chart/chart.js +1 -22
  78. package/dist/components/charts/column/column.js +8 -18
  79. package/dist/components/charts/discrete_scatter/discrete_scatter.js +2 -13
  80. package/dist/components/charts/gauge/gauge.js +0 -15
  81. package/dist/components/charts/heatmap/heatmap.js +3 -16
  82. package/dist/components/charts/legend/legend.js +2 -24
  83. package/dist/components/charts/line/line.js +8 -34
  84. package/dist/components/charts/series_label/series_label.js +0 -12
  85. package/dist/components/charts/single_stat/single_stat.js +0 -8
  86. package/dist/components/charts/sparkline/sparkline.js +1 -16
  87. package/dist/components/charts/stacked_column/stacked_column.js +8 -26
  88. package/dist/components/charts/tooltip/tooltip.js +0 -6
  89. package/dist/components/mixins/button_mixin.js +0 -1
  90. package/dist/components/mixins/safe_link_mixin.js +0 -1
  91. package/dist/components/mixins/toolbox_mixin.js +0 -1
  92. package/dist/components/mixins/tooltip_mixin.js +1 -2
  93. package/dist/components/regions/empty_state/empty_state.js +0 -12
  94. package/dist/components/utilities/animated_number/animated_number.js +0 -16
  95. package/dist/components/utilities/friendly_wrap/friendly_wrap.js +0 -3
  96. package/dist/components/utilities/intersection_observer/intersection_observer.js +0 -7
  97. package/dist/components/utilities/intersperse/intersperse.js +3 -9
  98. package/dist/components/utilities/sprintf/sprintf.js +9 -23
  99. package/dist/components/utilities/truncate/truncate.js +0 -10
  100. package/dist/config.js +3 -4
  101. package/dist/directives/hover_load/hover_load.js +2 -8
  102. package/dist/directives/outside/get_event_like_time_stamp.js +4 -2
  103. package/dist/directives/outside/outside.js +5 -20
  104. package/dist/directives/resize_observer/resize_observer.js +0 -10
  105. package/dist/directives/safe_html/safe_html.js +5 -6
  106. package/dist/directives/safe_link/mock_data.js +1 -1
  107. package/dist/directives/safe_link/safe_link.js +0 -13
  108. package/dist/utils/breakpoints.js +0 -3
  109. package/dist/utils/charts/config.js +29 -42
  110. package/dist/utils/charts/constants.js +8 -8
  111. package/dist/utils/charts/mock_data.js +2 -2
  112. package/dist/utils/charts/story_config.js +1 -1
  113. package/dist/utils/charts/theme.js +1 -3
  114. package/dist/utils/charts/utils.js +2 -6
  115. package/dist/utils/constants.js +10 -7
  116. package/dist/utils/data_utils.js +5 -4
  117. package/dist/utils/datetime_utility.js +4 -4
  118. package/dist/utils/number_utils.js +7 -11
  119. package/dist/utils/stories_utils.js +1 -1
  120. package/dist/utils/story_decorators/container.js +0 -1
  121. package/dist/utils/string_utils.js +0 -14
  122. package/dist/utils/test_utils.js +3 -2
  123. package/dist/utils/use_fake_date.js +0 -4
  124. package/dist/utils/use_mock_intersection_observer.js +4 -19
  125. package/dist/utils/utils.js +5 -14
  126. package/package.json +3 -3
  127. package/src/components/base/pagination/pagination.vue +2 -2
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [49.0.2](https://gitlab.com/gitlab-org/gitlab-ui/compare/v49.0.1...v49.0.2) (2022-10-25)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **GlPagination:** move attributes to root element ([def3d02](https://gitlab.com/gitlab-org/gitlab-ui/commit/def3d02878019c792b962c7632385e208d3c3fb8))
7
+
1
8
  ## [49.0.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v49.0.0...v49.0.1) (2022-10-24)
2
9
 
3
10
 
@@ -3,18 +3,15 @@ import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
3
3
 
4
4
  var script = {
5
5
  name: 'GlAccordion',
6
-
7
6
  provide() {
8
- const accordionId = _uniqueId('accordion-set-'); // temporary fix for this issue: https://gitlab.com/gitlab-org/gitlab-ui/-/merge_requests/2019#note_514671251
7
+ const accordionId = _uniqueId('accordion-set-');
8
+ // temporary fix for this issue: https://gitlab.com/gitlab-org/gitlab-ui/-/merge_requests/2019#note_514671251
9
9
  // MR for the upstream pending: https://github.com/vuejs/apollo/pull/1153
10
-
11
-
12
10
  return {
13
11
  defaultHeaderLevel: () => this.headerLevel,
14
12
  accordionSetId: () => this.autoCollapse && accordionId
15
13
  };
16
14
  },
17
-
18
15
  props: {
19
16
  /*
20
17
  When true, will have the effect of closing other accordion items when one accordion item is visible.
@@ -24,18 +21,15 @@ var script = {
24
21
  required: false,
25
22
  default: false
26
23
  },
27
-
28
24
  /*
29
25
  The header tag used in the accordion (h1/h2/h3/h4/h5/h6). This overrides the value provided by GlAccordion. For accessibility this should be set to an appropriate value in the context where the accordion is used.
30
26
  */
31
27
  headerLevel: {
32
28
  type: Number,
33
29
  required: true,
34
-
35
30
  validator(value) {
36
31
  return value > 0 && value <= 6;
37
32
  }
38
-
39
33
  }
40
34
  }
41
35
  };
@@ -27,7 +27,6 @@ var script = {
27
27
  type: String,
28
28
  required: true
29
29
  },
30
-
31
30
  /*
32
31
  Used to set the title of accordion link when the content is visible
33
32
  */
@@ -36,7 +35,6 @@ var script = {
36
35
  default: null,
37
36
  required: false
38
37
  },
39
-
40
38
  /*
41
39
  When set, it will ensure the accordion item is initially visible
42
40
  */
@@ -45,7 +43,6 @@ var script = {
45
43
  default: false,
46
44
  required: false
47
45
  },
48
-
49
46
  /*
50
47
  The header tag used in the accordion (h1/h2/h3/h4/h5/h6). This overrides the value provided by GlAccordion. For accessibility this should be set to an appropriate value in the context where the accordion is used.,
51
48
  */
@@ -53,13 +50,10 @@ var script = {
53
50
  type: Number,
54
51
  required: false,
55
52
  default: null,
56
-
57
53
  validator(value) {
58
54
  return value > 0 && value <= 6;
59
55
  }
60
-
61
56
  },
62
-
63
57
  /**
64
58
  * Additional CSS class(es) to be applied to the header.
65
59
  */
@@ -69,41 +63,33 @@ var script = {
69
63
  default: ''
70
64
  }
71
65
  },
72
-
73
66
  data() {
74
67
  return {
75
68
  accordionItemId: _uniqueId('accordion-item-'),
76
69
  isVisible: this.visible
77
70
  };
78
71
  },
79
-
80
72
  computed: {
81
73
  headerComponent() {
82
74
  const level = this.headerLevel || this.defaultHeaderLevel();
83
75
  return `h${level}`;
84
76
  },
85
-
86
77
  accordion() {
87
78
  return this.accordionSetId() || undefined;
88
79
  },
89
-
90
80
  icon() {
91
81
  return this.isVisible ? 'chevron-down' : 'chevron-right';
92
82
  },
93
-
94
83
  buttonTitle() {
95
84
  return this.isVisible && this.titleVisible ? this.titleVisible : this.title;
96
85
  }
97
-
98
86
  },
99
87
  watch: {
100
88
  isVisible: {
101
89
  immediate: true,
102
-
103
90
  handler(isVisible) {
104
91
  this.$emit('input', isVisible);
105
92
  }
106
-
107
93
  }
108
94
  }
109
95
  };
@@ -17,7 +17,6 @@ var script = {
17
17
  required: false,
18
18
  default: ''
19
19
  },
20
-
21
20
  /**
22
21
  * Controls the dismiss button's visibility.
23
22
  */
@@ -26,7 +25,6 @@ var script = {
26
25
  required: false,
27
26
  default: true
28
27
  },
29
-
30
28
  /**
31
29
  * Shows icon based on variant.
32
30
  */
@@ -35,7 +33,6 @@ var script = {
35
33
  required: false,
36
34
  default: true
37
35
  },
38
-
39
36
  /**
40
37
  * Dismiss button's aria-label.
41
38
  */
@@ -50,7 +47,6 @@ var script = {
50
47
  default: alertVariantOptions.info,
51
48
  validator: value => Object.keys(alertVariantOptions).includes(value)
52
49
  },
53
-
54
50
  /**
55
51
  * If provided, renders the primary button as a link.
56
52
  */
@@ -59,7 +55,6 @@ var script = {
59
55
  required: false,
60
56
  default: ''
61
57
  },
62
-
63
58
  /**
64
59
  * If provided, renders a primary action button.
65
60
  */
@@ -68,7 +63,6 @@ var script = {
68
63
  required: false,
69
64
  default: ''
70
65
  },
71
-
72
66
  /**
73
67
  * If provided, renders the secondary button as a link.
74
68
  */
@@ -77,7 +71,6 @@ var script = {
77
71
  required: false,
78
72
  default: ''
79
73
  },
80
-
81
74
  /**
82
75
  * If provided, renders a secondary action button.
83
76
  */
@@ -97,27 +90,21 @@ var script = {
97
90
  if ([alertVariantOptions.danger, alertVariantOptions.warning].includes(this.variant)) {
98
91
  return 'assertive';
99
92
  }
100
-
101
93
  return 'polite';
102
94
  },
103
-
104
95
  role() {
105
96
  if ([alertVariantOptions.danger, alertVariantOptions.warning, alertVariantOptions.success].includes(this.variant)) {
106
97
  return 'alert';
107
98
  }
108
-
109
99
  return 'status';
110
100
  },
111
-
112
101
  iconName() {
113
102
  return alertVariantIconMap[this.variant];
114
103
  },
115
-
116
104
  shouldRenderActions() {
117
105
  // eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
118
106
  return Boolean(this.$slots.actions || this.actionButtons.length);
119
107
  },
120
-
121
108
  actionButtons() {
122
109
  return [{
123
110
  text: this.primaryButtonText,
@@ -141,24 +128,22 @@ var script = {
141
128
  }
142
129
  }].reduce((acc, actionButton) => {
143
130
  if (!actionButton.text) return acc;
144
- const attrs = { ...actionButton.attrs
131
+ const attrs = {
132
+ ...actionButton.attrs
145
133
  };
146
-
147
134
  if (!attrs.href) {
148
135
  delete attrs.href;
149
136
  }
150
-
151
- acc.push({ ...actionButton,
137
+ acc.push({
138
+ ...actionButton,
152
139
  attrs
153
140
  });
154
141
  return acc;
155
142
  }, []);
156
143
  },
157
-
158
144
  variantClass() {
159
145
  return `gl-alert-${this.variant}`;
160
146
  }
161
-
162
147
  },
163
148
  methods: {
164
149
  primaryButtonClicked(event) {
@@ -170,7 +155,6 @@ var script = {
170
155
  */
171
156
  this.$emit('primaryAction', event);
172
157
  },
173
-
174
158
  secondaryButtonClicked(event) {
175
159
  /**
176
160
  * Emitted when the secondary action button is clicked.
@@ -180,7 +164,6 @@ var script = {
180
164
  */
181
165
  this.$emit('secondaryAction', event);
182
166
  },
183
-
184
167
  onDismiss() {
185
168
  /**
186
169
  * Emitted when the dismiss button is clicked.
@@ -190,7 +173,6 @@ var script = {
190
173
  */
191
174
  this.$emit('dismiss');
192
175
  }
193
-
194
176
  }
195
177
  };
196
178
 
@@ -34,12 +34,10 @@ var script = {
34
34
  const sizes = _isNumber(value) ? [value] : Object.values(value);
35
35
  const areValidSizes = sizes.every(size => {
36
36
  const isValidSize = avatarSizeOptions.includes(size);
37
-
38
37
  if (!isValidSize) {
39
38
  /* eslint-disable-next-line no-console */
40
39
  console.error(`Avatar size should be one of [${avatarSizeOptions}], received: ${size}`);
41
40
  }
42
-
43
41
  return isValidSize;
44
42
  });
45
43
  return areValidSizes;
@@ -56,7 +54,6 @@ var script = {
56
54
  if (_isNumber(this.size)) {
57
55
  return `gl-avatar-s${this.size}`;
58
56
  }
59
-
60
57
  const {
61
58
  default: defaultSize,
62
59
  ...nonDefaultSizes
@@ -66,11 +63,9 @@ var script = {
66
63
  return `gl-${breakpoint}-avatar-s${size}`;
67
64
  })];
68
65
  },
69
-
70
66
  isCircle() {
71
67
  return this.shape === avatarShapeOptions.circle;
72
68
  },
73
-
74
69
  identiconBackgroundClass() {
75
70
  /*
76
71
  * Gets a number between 1-7 depending on the 'entityId'.
@@ -79,11 +74,9 @@ var script = {
79
74
  const type = this.entityId % IDENTICON_BG_COUNT + 1;
80
75
  return `gl-avatar-identicon-bg${type}`;
81
76
  },
82
-
83
77
  identiconText() {
84
78
  return getAvatarChar(this.entityName);
85
79
  }
86
-
87
80
  }
88
81
  };
89
82
 
@@ -32,11 +32,9 @@ var script = {
32
32
  hasLabelLink() {
33
33
  return Boolean(this.labelLink);
34
34
  },
35
-
36
35
  hasSubLabelLink() {
37
36
  return Boolean(this.subLabelLink);
38
37
  }
39
-
40
38
  }
41
39
  };
42
40
 
@@ -49,43 +49,36 @@ var script = {
49
49
  hiddenAvatars() {
50
50
  return this.avatars.slice(this.maxVisible);
51
51
  },
52
-
53
52
  collapsable() {
54
53
  return this.hiddenAvatars.length > 0;
55
54
  },
56
-
57
55
  visibleAvatars() {
58
56
  return this.collapsed ? this.avatars.slice(0, this.maxVisible) : this.avatars;
59
57
  },
60
-
61
58
  containerSizeStyles() {
62
59
  return {
63
60
  width: `${this.avatarSize * this.visibleAvatars.length}px`,
64
61
  height: `${this.avatarSize}px`
65
62
  };
66
63
  },
67
-
68
64
  badgeSize() {
69
65
  return this.avatarSize === 24 ? 'md' : 'lg';
70
66
  },
71
-
72
67
  badgeLabel() {
73
68
  return `+${this.hiddenAvatars.length}`;
74
69
  },
75
-
76
70
  badgeTooltipTitle() {
77
71
  if (!this.badgeTooltipProp) {
78
72
  return '';
79
73
  }
74
+ const tooltipTitle = this.hiddenAvatars.map(avatar => _get(avatar, this.badgeTooltipProp, '').trim()).join(', ');
80
75
 
81
- const tooltipTitle = this.hiddenAvatars.map(avatar => _get(avatar, this.badgeTooltipProp, '').trim()).join(', '); // truncate will append '...'
76
+ // truncate will append '...'
82
77
  // we need to take these extra 3 characters into account in badgeTooltipMaxChars
83
-
84
78
  return this.badgeTooltipMaxChars ? _truncate(tooltipTitle, {
85
79
  length: this.badgeTooltipMaxChars
86
80
  }) : tooltipTitle;
87
81
  }
88
-
89
82
  },
90
83
  methods: {
91
84
  calcAvatarPosition(avatarIndex) {
@@ -96,7 +89,6 @@ var script = {
96
89
  zIndex: this.maxVisible + (avatarIndex - 1)
97
90
  };
98
91
  }
99
-
100
92
  }
101
93
  };
102
94
 
@@ -17,28 +17,22 @@ var script = {
17
17
  size: {
18
18
  type: String,
19
19
  default: badgeSizeOptions.md,
20
-
21
20
  validator(value) {
22
21
  return badgeSizeOptions[value] !== undefined;
23
22
  },
24
-
25
23
  required: false
26
24
  },
27
-
28
25
  /**
29
26
  * The variant of the badge.
30
27
  */
31
28
  variant: {
32
29
  type: String,
33
30
  default: badgeVariantOptions.muted,
34
-
35
31
  validator(value) {
36
32
  return badgeVariantOptions[value] !== undefined;
37
33
  },
38
-
39
34
  required: false
40
35
  },
41
-
42
36
  /**
43
37
  * The icon to show next to the text
44
38
  */
@@ -53,11 +47,9 @@ var script = {
53
47
  // eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
54
48
  return Boolean(this.icon && Object.keys(this.$slots).length === 0);
55
49
  },
56
-
57
50
  role() {
58
51
  return this.hasIconOnly ? 'img' : undefined;
59
52
  }
60
-
61
53
  }
62
54
  };
63
55
 
@@ -17,7 +17,6 @@ var script = {
17
17
  type: String,
18
18
  required: true
19
19
  },
20
-
21
20
  /**
22
21
  * Text for the submit button.
23
22
  */
@@ -25,7 +24,6 @@ var script = {
25
24
  type: String,
26
25
  required: true
27
26
  },
28
-
29
27
  /**
30
28
  * Link for the submit button.
31
29
  */
@@ -34,7 +32,6 @@ var script = {
34
32
  required: false,
35
33
  default: null
36
34
  },
37
-
38
35
  /**
39
36
  * The illustration's URL.
40
37
  */
@@ -43,7 +40,6 @@ var script = {
43
40
  required: false,
44
41
  default: null
45
42
  },
46
-
47
43
  /**
48
44
  * The variant of the banner.
49
45
  */
@@ -51,13 +47,10 @@ var script = {
51
47
  type: String,
52
48
  required: false,
53
49
  default: bannerVariants[0],
54
-
55
50
  validator(value) {
56
51
  return bannerVariants.includes(value);
57
52
  }
58
-
59
53
  },
60
-
61
54
  /**
62
55
  * Removes the border for banners embedded in content.
63
56
  */
@@ -71,7 +64,6 @@ var script = {
71
64
  isIntroducing() {
72
65
  return this.variant === bannerVariants[1];
73
66
  }
74
-
75
67
  },
76
68
  methods: {
77
69
  handleClose() {
@@ -83,7 +75,6 @@ var script = {
83
75
  */
84
76
  this.$emit('close');
85
77
  },
86
-
87
78
  primaryButtonClicked() {
88
79
  /**
89
80
  * Emitted when the primary action button is clicked.
@@ -93,7 +84,6 @@ var script = {
93
84
  */
94
85
  this.$emit('primary');
95
86
  }
96
-
97
87
  }
98
88
  };
99
89
 
@@ -37,39 +37,31 @@ var script = {
37
37
  }
38
38
  }
39
39
  },
40
-
41
40
  data() {
42
41
  return {
43
42
  isListCollapsed: true
44
43
  };
45
44
  },
46
-
47
45
  computed: {
48
46
  breadcrumbsSize() {
49
47
  return this.items.length;
50
48
  },
51
-
52
49
  hasCollapsible() {
53
50
  return this.breadcrumbsSize > COLLAPSE_AT_SIZE;
54
51
  },
55
-
56
52
  nonCollapsibleIndices() {
57
53
  return [0, this.breadcrumbsSize - 1, this.breadcrumbsSize - 2];
58
54
  }
59
-
60
55
  },
61
56
  methods: {
62
57
  isFirstItem(index) {
63
58
  return index === 0;
64
59
  },
65
-
66
60
  isLastItem(index) {
67
61
  return index === this.breadcrumbsSize - 1;
68
62
  },
69
-
70
63
  expandBreadcrumbs() {
71
64
  this.isListCollapsed = false;
72
-
73
65
  try {
74
66
  this.$refs.firstItem[0].querySelector('a').focus();
75
67
  } catch (e) {
@@ -77,19 +69,15 @@ var script = {
77
69
  console.error(`Failed to set focus on the first breadcrumb item.`);
78
70
  }
79
71
  },
80
-
81
72
  showCollapsedBreadcrumbsExpander(index) {
82
73
  return index === 0 && this.hasCollapsible && this.isListCollapsed;
83
74
  },
84
-
85
75
  isItemCollapsed(index) {
86
76
  return this.hasCollapsible && this.isListCollapsed && !this.nonCollapsibleIndices.includes(index);
87
77
  },
88
-
89
78
  getAriaCurrentAttr(index) {
90
79
  return this.isLastItem(index) ? 'page' : false;
91
80
  }
92
-
93
81
  }
94
82
  };
95
83
 
@@ -26,11 +26,9 @@ var script = {
26
26
  type: [String, Boolean],
27
27
  required: false,
28
28
  default: false,
29
-
30
29
  validator(value) {
31
30
  return [false, 'page'].indexOf(value) !== -1;
32
31
  }
33
-
34
32
  }
35
33
  }
36
34
  };
@@ -17,7 +17,6 @@ var script = {
17
17
  required: false,
18
18
  default: 'bullhorn'
19
19
  },
20
-
21
20
  /**
22
21
  * The dismiss button's label, it is visible in mobile viewports and used for the button's aria-label attribute.
23
22
  */
@@ -26,7 +25,6 @@ var script = {
26
25
  required: false,
27
26
  default: 'Dismiss'
28
27
  },
29
-
30
28
  /**
31
29
  * The theme's name to use, this should correspond to the user's selected theme in GitLab.
32
30
  */
@@ -47,7 +45,6 @@ var script = {
47
45
  */
48
46
  this.$emit('dismiss');
49
47
  }
50
-
51
48
  }
52
49
  };
53
50
 
@@ -68,50 +68,39 @@ var script = {
68
68
  hasIcon() {
69
69
  return this.icon !== '';
70
70
  },
71
-
72
71
  hasIconOnly() {
73
72
  // eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
74
73
  return Object.keys(this.$slots).length === 0 && this.hasIcon;
75
74
  },
76
-
77
75
  isButtonDisabled() {
78
76
  return this.disabled || this.loading;
79
77
  },
80
-
81
78
  buttonClasses() {
82
79
  const classes = ['gl-button'];
83
80
  const nonCategoryVariants = [buttonVariantOptions.dashed, buttonVariantOptions.link, buttonVariantOptions.reset];
84
-
85
81
  if (!nonCategoryVariants.includes(this.variant) && this.category !== buttonCategoryOptions.primary) {
86
82
  classes.push(`btn-${this.variant}-${this.category}`);
87
83
  }
88
-
89
84
  classes.push({
90
85
  'btn-icon': this.hasIconOnly,
91
86
  'button-ellipsis-horizontal': this.hasIconOnly && this.icon === 'ellipsis_h',
92
87
  selected: this.selected
93
88
  });
94
-
95
89
  if (this.label) {
96
90
  classes.push('btn', 'btn-label', `btn-${this.buttonSize}`);
97
91
  }
98
-
99
92
  return classes;
100
93
  },
101
-
102
94
  buttonSize() {
103
95
  return buttonSizeOptionsMap[this.size];
104
96
  }
105
-
106
97
  },
107
-
108
98
  mounted() {
109
99
  // eslint-disable-next-line @gitlab/vue-prefer-dollar-scopedslots
110
100
  if (!this.$slots.default && !this.$attrs['aria-label'] && !this.$props.label) {
111
101
  logWarning('[gl-button]: Accessible name missing. Please add inner text or aria-label.');
112
102
  }
113
103
  }
114
-
115
104
  };
116
105
 
117
106
  /* script */
@@ -1,6 +1,7 @@
1
1
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
2
2
 
3
3
  //
4
+
4
5
  var script = {
5
6
  props: {
6
7
  /**
@@ -11,7 +12,6 @@ var script = {
11
12
  required: false,
12
13
  default: ''
13
14
  },
14
-
15
15
  /**
16
16
  * Additional CSS class(es) to be applied to the body.
17
17
  */
@@ -20,7 +20,6 @@ var script = {
20
20
  required: false,
21
21
  default: ''
22
22
  },
23
-
24
23
  /**
25
24
  * Additional CSS class(es) to be applied to the footer.
26
25
  */