@gitlab/ui 39.3.0 → 39.4.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.
Files changed (254) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/components/base/modal/modal.js +14 -2
  3. package/dist/components/base/new_dropdowns/base_dropdown/base_dropdown.js +240 -0
  4. package/dist/components/base/new_dropdowns/constants.js +20 -0
  5. package/dist/components/base/new_dropdowns/listbox/listbox.js +381 -0
  6. package/dist/components/base/new_dropdowns/listbox/listbox_item.js +77 -0
  7. package/dist/index.css +1 -1
  8. package/dist/index.css.map +1 -1
  9. package/dist/index.js +2 -0
  10. package/dist/utility_classes.css +1 -1
  11. package/dist/utility_classes.css.map +1 -1
  12. package/dist/utils/utils.js +24 -1
  13. package/package.json +6 -12
  14. package/scss_to_js/scss_variables.js +1 -0
  15. package/scss_to_js/scss_variables.json +5 -0
  16. package/src/components/base/avatar_labeled/avatar_labeled.stories.js +2 -1
  17. package/src/components/base/avatar_link/avatar_link.stories.js +2 -3
  18. package/src/components/base/breadcrumb/breadcrumb.md +1 -1
  19. package/src/components/base/breadcrumb/breadcrumb.stories.js +2 -1
  20. package/src/components/base/broadcast_message/broadcast_message.scss +1 -1
  21. package/src/components/base/button/button.scss +1 -1
  22. package/src/components/base/dropdown/dropdown.scss +10 -3
  23. package/src/components/base/dropdown/dropdown_item.scss +1 -0
  24. package/src/components/base/modal/modal.spec.js +20 -0
  25. package/src/components/base/modal/modal.vue +14 -1
  26. package/src/components/base/new_dropdowns/base_dropdown/base_dropdown.spec.js +171 -0
  27. package/src/components/base/new_dropdowns/base_dropdown/base_dropdown.vue +221 -0
  28. package/src/components/base/new_dropdowns/constants.js +22 -0
  29. package/src/components/base/new_dropdowns/listbox/listbox.md +71 -0
  30. package/src/components/base/new_dropdowns/listbox/listbox.spec.js +236 -0
  31. package/src/components/base/new_dropdowns/listbox/listbox.stories.js +276 -0
  32. package/src/components/base/new_dropdowns/listbox/listbox.vue +348 -0
  33. package/src/components/base/new_dropdowns/listbox/listbox_item.spec.js +104 -0
  34. package/src/components/base/new_dropdowns/listbox/listbox_item.vue +59 -0
  35. package/src/index.js +4 -0
  36. package/src/scss/utilities.scss +8 -0
  37. package/src/scss/utility-mixins/color.scss +4 -0
  38. package/src/scss/variables.scss +1 -0
  39. package/src/utils/utils.js +18 -0
  40. package/src/utils/utils.spec.js +41 -1
  41. package/dist/components/base/accordion/accordion.documentation.js +0 -8
  42. package/dist/components/base/accordion/accordion_item.documentation.js +0 -7
  43. package/dist/components/base/alert/alert.documentation.js +0 -13
  44. package/dist/components/base/avatar/avatar.documentation.js +0 -8
  45. package/dist/components/base/avatar_labeled/avatar_labeled.documentation.js +0 -8
  46. package/dist/components/base/avatar_link/avatar_link.documentation.js +0 -8
  47. package/dist/components/base/avatars_inline/avatars_inline.documentation.js +0 -13
  48. package/dist/components/base/badge/badge.documentation.js +0 -8
  49. package/dist/components/base/banner/banner.documentation.js +0 -8
  50. package/dist/components/base/breadcrumb/breadcrumb.documentation.js +0 -8
  51. package/dist/components/base/broadcast_message/broadcast_message.documentation.js +0 -8
  52. package/dist/components/base/button/button.documentation.js +0 -24
  53. package/dist/components/base/button_group/button_group.documentation.js +0 -8
  54. package/dist/components/base/card/card.documentation.js +0 -13
  55. package/dist/components/base/carousel/carousel.documentation.js +0 -8
  56. package/dist/components/base/collapse/collapse.documentation.js +0 -7
  57. package/dist/components/base/datepicker/datepicker.documentation.js +0 -7
  58. package/dist/components/base/daterange_picker/daterange_picker.documentation.js +0 -8
  59. package/dist/components/base/drawer/drawer.documentation.js +0 -8
  60. package/dist/components/base/dropdown/dropdown.documentation.js +0 -8
  61. package/dist/components/base/dropdown/dropdown_item.documentation.js +0 -7
  62. package/dist/components/base/filtered_search/filtered_search.documentation.js +0 -13
  63. package/dist/components/base/filtered_search/filtered_search_suggestion.documentation.js +0 -7
  64. package/dist/components/base/filtered_search/filtered_search_suggestion_list.documentation.js +0 -7
  65. package/dist/components/base/filtered_search/filtered_search_term.documentation.js +0 -12
  66. package/dist/components/base/filtered_search/filtered_search_token.documentation.js +0 -12
  67. package/dist/components/base/filtered_search/filtered_search_token_segment.documentation.js +0 -12
  68. package/dist/components/base/form/form.documentation.js +0 -7
  69. package/dist/components/base/form/form_checkbox/form_checkbox.documentation.js +0 -8
  70. package/dist/components/base/form/form_checkbox_tree/form_checkbox_tree.documentation.js +0 -12
  71. package/dist/components/base/form/form_combobox/form_combobox.documentation.js +0 -13
  72. package/dist/components/base/form/form_group/form_group.documentation.js +0 -7
  73. package/dist/components/base/form/form_input/form_input.documentation.js +0 -8
  74. package/dist/components/base/form/form_input_group/form_input_group.documentation.js +0 -8
  75. package/dist/components/base/form/form_radio/form_radio.documentation.js +0 -8
  76. package/dist/components/base/form/form_radio_group/form_radio_group.documentation.js +0 -8
  77. package/dist/components/base/form/form_select/form_select.documentation.js +0 -8
  78. package/dist/components/base/form/form_text/form_text.documentation.js +0 -14
  79. package/dist/components/base/form/form_textarea/form_textarea.documentation.js +0 -7
  80. package/dist/components/base/form/input_group_text/input_group_text.documentation.js +0 -12
  81. package/dist/components/base/icon/icon.documentation.js +0 -8
  82. package/dist/components/base/infinite_scroll/examples/index.js +0 -49
  83. package/dist/components/base/infinite_scroll/examples/infinite_scroll.all_items.example.js +0 -49
  84. package/dist/components/base/infinite_scroll/examples/infinite_scroll.basic.example.js +0 -62
  85. package/dist/components/base/infinite_scroll/examples/infinite_scroll.finite_total_items.example.js +0 -72
  86. package/dist/components/base/infinite_scroll/examples/infinite_scroll.large_fetched_items.example.js +0 -62
  87. package/dist/components/base/infinite_scroll/examples/infinite_scroll.reverse.example.js +0 -63
  88. package/dist/components/base/infinite_scroll/examples/infinite_scroll.small_fetched_items.example.js +0 -62
  89. package/dist/components/base/infinite_scroll/examples/infinite_scroll.two_way.example.js +0 -94
  90. package/dist/components/base/infinite_scroll/infinite_scroll.documentation.js +0 -8
  91. package/dist/components/base/keyset_pagination/keyset_pagination.documentation.js +0 -13
  92. package/dist/components/base/label/label.documentation.js +0 -8
  93. package/dist/components/base/link/link.documentation.js +0 -7
  94. package/dist/components/base/loading_icon/loading_icon.documentation.js +0 -8
  95. package/dist/components/base/markdown/markdown.documentation.js +0 -12
  96. package/dist/components/base/modal/modal.documentation.js +0 -8
  97. package/dist/components/base/nav/nav.documentation.js +0 -12
  98. package/dist/components/base/navbar/navbar.documentation.js +0 -12
  99. package/dist/components/base/paginated_list/paginated_list.documentation.js +0 -7
  100. package/dist/components/base/pagination/pagination.documentation.js +0 -8
  101. package/dist/components/base/path/path.documentation.js +0 -8
  102. package/dist/components/base/popover/popover.documentation.js +0 -5
  103. package/dist/components/base/search_box_by_click/search_box_by_click.documentation.js +0 -8
  104. package/dist/components/base/search_box_by_type/search_box_by_type.documentation.js +0 -8
  105. package/dist/components/base/segmented_control/segmented_control.documentation.js +0 -8
  106. package/dist/components/base/skeleton_loader/skeleton_loader.documentation.js +0 -13
  107. package/dist/components/base/skeleton_loading/skeleton_loading.documentation.js +0 -7
  108. package/dist/components/base/sorting/sorting.documentation.js +0 -7
  109. package/dist/components/base/sorting/sorting_item.documentation.js +0 -8
  110. package/dist/components/base/table/table.documentation.js +0 -8
  111. package/dist/components/base/table_lite/table_lite.documentation.js +0 -13
  112. package/dist/components/base/tabs/tabs/tabs.documentation.js +0 -8
  113. package/dist/components/base/toast/toast.documentation.js +0 -8
  114. package/dist/components/base/toggle/toggle.documentation.js +0 -13
  115. package/dist/components/base/token/token.documentation.js +0 -5
  116. package/dist/components/base/token_selector/token_selector.documentation.js +0 -12
  117. package/dist/components/base/tooltip/tooltip.documentation.js +0 -8
  118. package/dist/components/charts/area/area.documentation.js +0 -5
  119. package/dist/components/charts/bar/bar.documentation.js +0 -8
  120. package/dist/components/charts/chart/chart.documentation.js +0 -7
  121. package/dist/components/charts/column/column.documentation.js +0 -5
  122. package/dist/components/charts/discrete_scatter/discrete_scatter.documentation.js +0 -5
  123. package/dist/components/charts/gauge/gauge.documentation.js +0 -12
  124. package/dist/components/charts/heatmap/heatmap.documentation.js +0 -8
  125. package/dist/components/charts/line/line.documentation.js +0 -8
  126. package/dist/components/charts/series_label/series_label.documentation.js +0 -7
  127. package/dist/components/charts/single_stat/single_stat.documentation.js +0 -7
  128. package/dist/components/charts/sparkline/sparkline.documentation.js +0 -8
  129. package/dist/components/charts/stacked_column/stacked_column.documentation.js +0 -8
  130. package/dist/components/charts/tooltip/tooltip.documentation.js +0 -8
  131. package/dist/components/editors/rich_text_editor/rich_text_editor.documentation.js +0 -12
  132. package/dist/components/regions/dashboard_skeleton/dashboard_skeleton.documentation.js +0 -7
  133. package/dist/components/regions/empty_state/empty_state.documentation.js +0 -7
  134. package/dist/components/utilities/animated_number/animated_number.documentation.js +0 -13
  135. package/dist/components/utilities/friendly_wrap/friendly_wrap.documentation.js +0 -7
  136. package/dist/components/utilities/intersection_observer/intersection_observer.documentation.js +0 -12
  137. package/dist/components/utilities/intersperse/intersperse.documentation.js +0 -8
  138. package/dist/components/utilities/sprintf/sprintf.documentation.js +0 -8
  139. package/dist/components/utilities/truncate/truncate.documentation.js +0 -7
  140. package/dist/directives/hover_load/hover_load.documentation.js +0 -13
  141. package/dist/directives/outside/outside.documentation.js +0 -13
  142. package/dist/directives/resize_observer/resize_observer.documentation.js +0 -8
  143. package/dist/directives/safe_html/safe_html.documentation.js +0 -8
  144. package/dist/directives/safe_link/safe_link.documentation.js +0 -8
  145. package/documentation/all_components.js +0 -8
  146. package/documentation/components/component_documentation_generator.vue +0 -321
  147. package/documentation/components/example_display.vue +0 -231
  148. package/documentation/components/example_explorer.vue +0 -63
  149. package/documentation/components_documentation.js +0 -111
  150. package/documentation/index.js +0 -8
  151. package/src/components/base/accordion/accordion.documentation.js +0 -6
  152. package/src/components/base/accordion/accordion_item.documentation.js +0 -5
  153. package/src/components/base/alert/alert.documentation.js +0 -6
  154. package/src/components/base/avatar/avatar.documentation.js +0 -6
  155. package/src/components/base/avatar_labeled/avatar_labeled.documentation.js +0 -6
  156. package/src/components/base/avatar_link/avatar_link.documentation.js +0 -6
  157. package/src/components/base/avatars_inline/avatars_inline.documentation.js +0 -6
  158. package/src/components/base/badge/badge.documentation.js +0 -6
  159. package/src/components/base/banner/banner.documentation.js +0 -6
  160. package/src/components/base/breadcrumb/breadcrumb.documentation.js +0 -6
  161. package/src/components/base/broadcast_message/broadcast_message.documentation.js +0 -6
  162. package/src/components/base/button/button.documentation.js +0 -24
  163. package/src/components/base/button_group/button_group.documentation.js +0 -6
  164. package/src/components/base/card/card.documentation.js +0 -6
  165. package/src/components/base/carousel/carousel.documentation.js +0 -6
  166. package/src/components/base/collapse/collapse.documentation.js +0 -5
  167. package/src/components/base/datepicker/datepicker.documentation.js +0 -5
  168. package/src/components/base/daterange_picker/daterange_picker.documentation.js +0 -6
  169. package/src/components/base/drawer/drawer.documentation.js +0 -6
  170. package/src/components/base/dropdown/dropdown.documentation.js +0 -6
  171. package/src/components/base/dropdown/dropdown_item.documentation.js +0 -5
  172. package/src/components/base/filtered_search/filtered_search.documentation.js +0 -6
  173. package/src/components/base/filtered_search/filtered_search_suggestion.documentation.js +0 -5
  174. package/src/components/base/filtered_search/filtered_search_suggestion_list.documentation.js +0 -5
  175. package/src/components/base/filtered_search/filtered_search_term.documentation.js +0 -5
  176. package/src/components/base/filtered_search/filtered_search_token.documentation.js +0 -5
  177. package/src/components/base/filtered_search/filtered_search_token_segment.documentation.js +0 -5
  178. package/src/components/base/form/form.documentation.js +0 -5
  179. package/src/components/base/form/form_checkbox/form_checkbox.documentation.js +0 -6
  180. package/src/components/base/form/form_checkbox_tree/form_checkbox_tree.documentation.js +0 -5
  181. package/src/components/base/form/form_combobox/form_combobox.documentation.js +0 -6
  182. package/src/components/base/form/form_group/form_group.documentation.js +0 -5
  183. package/src/components/base/form/form_input/form_input.documentation.js +0 -6
  184. package/src/components/base/form/form_input_group/form_input_group.documentation.js +0 -6
  185. package/src/components/base/form/form_radio/form_radio.documentation.js +0 -6
  186. package/src/components/base/form/form_radio_group/form_radio_group.documentation.js +0 -6
  187. package/src/components/base/form/form_select/form_select.documentation.js +0 -6
  188. package/src/components/base/form/form_text/form_text.documentation.js +0 -7
  189. package/src/components/base/form/form_textarea/form_textarea.documentation.js +0 -5
  190. package/src/components/base/form/input_group_text/input_group_text.documentation.js +0 -5
  191. package/src/components/base/icon/icon.documentation.js +0 -6
  192. package/src/components/base/infinite_scroll/examples/index.js +0 -57
  193. package/src/components/base/infinite_scroll/examples/infinite_scroll.all_items.example.vue +0 -25
  194. package/src/components/base/infinite_scroll/examples/infinite_scroll.basic.example.vue +0 -43
  195. package/src/components/base/infinite_scroll/examples/infinite_scroll.finite_total_items.example.vue +0 -44
  196. package/src/components/base/infinite_scroll/examples/infinite_scroll.large_fetched_items.example.vue +0 -43
  197. package/src/components/base/infinite_scroll/examples/infinite_scroll.reverse.example.vue +0 -46
  198. package/src/components/base/infinite_scroll/examples/infinite_scroll.small_fetched_items.example.vue +0 -43
  199. package/src/components/base/infinite_scroll/examples/infinite_scroll.two_way.example.vue +0 -75
  200. package/src/components/base/infinite_scroll/infinite_scroll.documentation.js +0 -6
  201. package/src/components/base/keyset_pagination/keyset_pagination.documentation.js +0 -6
  202. package/src/components/base/label/label.documentation.js +0 -6
  203. package/src/components/base/link/link.documentation.js +0 -5
  204. package/src/components/base/loading_icon/loading_icon.documentation.js +0 -6
  205. package/src/components/base/markdown/markdown.documentation.js +0 -5
  206. package/src/components/base/modal/modal.documentation.js +0 -6
  207. package/src/components/base/nav/nav.documentation.js +0 -5
  208. package/src/components/base/navbar/navbar.documentation.js +0 -5
  209. package/src/components/base/paginated_list/paginated_list.documentation.js +0 -5
  210. package/src/components/base/pagination/pagination.documentation.js +0 -6
  211. package/src/components/base/path/path.documentation.js +0 -6
  212. package/src/components/base/popover/popover.documentation.js +0 -3
  213. package/src/components/base/search_box_by_click/search_box_by_click.documentation.js +0 -6
  214. package/src/components/base/search_box_by_type/search_box_by_type.documentation.js +0 -6
  215. package/src/components/base/segmented_control/segmented_control.documentation.js +0 -6
  216. package/src/components/base/skeleton_loader/skeleton_loader.documentation.js +0 -6
  217. package/src/components/base/skeleton_loading/skeleton_loading.documentation.js +0 -5
  218. package/src/components/base/sorting/sorting.documentation.js +0 -5
  219. package/src/components/base/sorting/sorting_item.documentation.js +0 -6
  220. package/src/components/base/table/table.documentation.js +0 -6
  221. package/src/components/base/table_lite/table_lite.documentation.js +0 -6
  222. package/src/components/base/tabs/tabs/tabs.documentation.js +0 -6
  223. package/src/components/base/toast/toast.documentation.js +0 -6
  224. package/src/components/base/toggle/toggle.documentation.js +0 -6
  225. package/src/components/base/token/token.documentation.js +0 -3
  226. package/src/components/base/token_selector/token_selector.documentation.js +0 -5
  227. package/src/components/base/tooltip/tooltip.documentation.js +0 -6
  228. package/src/components/charts/area/area.documentation.js +0 -3
  229. package/src/components/charts/bar/bar.documentation.js +0 -6
  230. package/src/components/charts/chart/chart.documentation.js +0 -5
  231. package/src/components/charts/column/column.documentation.js +0 -3
  232. package/src/components/charts/discrete_scatter/discrete_scatter.documentation.js +0 -3
  233. package/src/components/charts/gauge/gauge.documentation.js +0 -5
  234. package/src/components/charts/heatmap/heatmap.documentation.js +0 -6
  235. package/src/components/charts/line/line.documentation.js +0 -6
  236. package/src/components/charts/series_label/series_label.documentation.js +0 -5
  237. package/src/components/charts/single_stat/single_stat.documentation.js +0 -5
  238. package/src/components/charts/sparkline/sparkline.documentation.js +0 -6
  239. package/src/components/charts/stacked_column/stacked_column.documentation.js +0 -6
  240. package/src/components/charts/tooltip/tooltip.documentation.js +0 -6
  241. package/src/components/editors/rich_text_editor/rich_text_editor.documentation.js +0 -5
  242. package/src/components/regions/dashboard_skeleton/dashboard_skeleton.documentation.js +0 -5
  243. package/src/components/regions/empty_state/empty_state.documentation.js +0 -5
  244. package/src/components/utilities/animated_number/animated_number.documentation.js +0 -6
  245. package/src/components/utilities/friendly_wrap/friendly_wrap.documentation.js +0 -5
  246. package/src/components/utilities/intersection_observer/intersection_observer.documentation.js +0 -5
  247. package/src/components/utilities/intersperse/intersperse.documentation.js +0 -6
  248. package/src/components/utilities/sprintf/sprintf.documentation.js +0 -6
  249. package/src/components/utilities/truncate/truncate.documentation.js +0 -5
  250. package/src/directives/hover_load/hover_load.documentation.js +0 -6
  251. package/src/directives/outside/outside.documentation.js +0 -6
  252. package/src/directives/resize_observer/resize_observer.documentation.js +0 -6
  253. package/src/directives/safe_html/safe_html.documentation.js +0 -6
  254. package/src/directives/safe_link/safe_link.documentation.js +0 -6
package/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ # [39.4.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v39.3.2...v39.4.0) (2022-04-28)
2
+
3
+
4
+ ### Features
5
+
6
+ * **GlListbox:** create listbox component ([dcc7eae](https://gitlab.com/gitlab-org/gitlab-ui/commit/dcc7eae54db81de1c922857c990f89ceb0e1c694))
7
+
8
+ ## [39.3.2](https://gitlab.com/gitlab-org/gitlab-ui/compare/v39.3.1...v39.3.2) (2022-04-27)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **GlButton:** Fix button text color in dark mode ([61267e3](https://gitlab.com/gitlab-org/gitlab-ui/commit/61267e3ce3c80d0592e5fe7e6458c86ab6ff3979))
14
+
15
+ ## [39.3.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v39.3.0...v39.3.1) (2022-04-26)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **GlModal:** Ensure modal dialog has an accessible name ([5b35a67](https://gitlab.com/gitlab-org/gitlab-ui/commit/5b35a6757c510740191d336b14eeed71886a2066))
21
+
1
22
  # [39.3.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v39.2.1...v39.3.0) (2022-04-26)
2
23
 
3
24
 
@@ -1,6 +1,6 @@
1
1
  import { BModal } from 'bootstrap-vue/esm/index.js';
2
2
  import { modalSizeOptions, modalButtonDefaults, focusableTags, COMMA } from '../../../utils/constants';
3
- import { focusFirstFocusableElement } from '../../../utils/utils';
3
+ import { logWarning, focusFirstFocusableElement } from '../../../utils/utils';
4
4
  import CloseButton from '../../shared_components/close_button/close_button';
5
5
  import GlButton from '../button/button';
6
6
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
@@ -73,6 +73,11 @@ var script = {
73
73
  type: Boolean,
74
74
  required: false,
75
75
  default: false
76
+ },
77
+ ariaLabel: {
78
+ type: String,
79
+ required: false,
80
+ default: ''
76
81
  }
77
82
  },
78
83
  computed: {
@@ -89,6 +94,13 @@ var script = {
89
94
  }
90
95
 
91
96
  },
97
+
98
+ mounted() {
99
+ if (!this.ariaLabel && !this.title) {
100
+ logWarning('[gl-modal]: Accessible name for modal missing. Please add title prop or aria-label.');
101
+ }
102
+ },
103
+
92
104
  methods: {
93
105
  show() {
94
106
  this.$refs.modal.show();
@@ -165,7 +177,7 @@ var script = {
165
177
  const __vue_script__ = script;
166
178
 
167
179
  /* template */
168
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-modal',_vm._g(_vm._b({ref:"modal",attrs:{"id":_vm.modalId,"title-tag":_vm.titleTag,"size":_vm.size,"visible":_vm.visible,"lazy":"","modal-class":['gl-modal', _vm.modalClass]},on:{"shown":_vm.setFocus,"ok":_vm.primary,"cancel":_vm.canceled,"change":function($event){return _vm.$emit('change', $event)}},scopedSlots:_vm._u([{key:"default",fn:function(){return [_vm._t("default")]},proxy:true},{key:"modal-header",fn:function(){return [_vm._t("modal-header",[_c('h4',{staticClass:"modal-title"},[_vm._t("modal-title",[_vm._v(_vm._s(_vm.title))])],2)]),_vm._v(" "),_c('close-button',{ref:"close-button",attrs:{"label":_vm.dismissLabel},on:{"click":_vm.close}})]},proxy:true},(_vm.shouldRenderModalOk)?{key:"modal-ok",fn:function(){return [_vm._t("modal-ok")]},proxy:true}:null,(_vm.shouldRenderModalCancel)?{key:"modal-cancel",fn:function(){return [_vm._t("modal-cancel")]},proxy:true}:null,(_vm.shouldRenderModalFooter)?{key:"modal-footer",fn:function(){return [_vm._t("modal-footer",[(_vm.actionCancel)?_c('gl-button',_vm._b({staticClass:"js-modal-action-cancel",on:{"click":_vm.cancel}},'gl-button',_vm.buttonBinding(_vm.actionCancel, 'actionCancel'),false),[_vm._v("\n "+_vm._s(_vm.actionCancel.text)+"\n ")]):_vm._e(),_vm._v(" "),(_vm.actionSecondary)?_c('gl-button',_vm._b({staticClass:"js-modal-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.actionPrimary)?_c('gl-button',_vm._b({staticClass:"js-modal-action-primary",on:{"click":_vm.ok}},'gl-button',_vm.buttonBinding(_vm.actionPrimary, 'actionPrimary'),false),[_vm._v("\n "+_vm._s(_vm.actionPrimary.text)+"\n ")]):_vm._e()])]},proxy:true}:null],null,true)},'b-modal',_vm.$attrs,false),_vm.$listeners))};
180
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-modal',_vm._g(_vm._b({ref:"modal",attrs:{"id":_vm.modalId,"title-tag":_vm.titleTag,"size":_vm.size,"visible":_vm.visible,"aria-label":_vm.ariaLabel || _vm.title,"lazy":"","modal-class":['gl-modal', _vm.modalClass]},on:{"shown":_vm.setFocus,"ok":_vm.primary,"cancel":_vm.canceled,"change":function($event){return _vm.$emit('change', $event)}},scopedSlots:_vm._u([{key:"default",fn:function(){return [_vm._t("default")]},proxy:true},{key:"modal-header",fn:function(){return [_vm._t("modal-header",[_c('h4',{staticClass:"modal-title"},[_vm._t("modal-title",[_vm._v(_vm._s(_vm.title))])],2)]),_vm._v(" "),_c('close-button',{ref:"close-button",attrs:{"label":_vm.dismissLabel},on:{"click":_vm.close}})]},proxy:true},(_vm.shouldRenderModalOk)?{key:"modal-ok",fn:function(){return [_vm._t("modal-ok")]},proxy:true}:null,(_vm.shouldRenderModalCancel)?{key:"modal-cancel",fn:function(){return [_vm._t("modal-cancel")]},proxy:true}:null,(_vm.shouldRenderModalFooter)?{key:"modal-footer",fn:function(){return [_vm._t("modal-footer",[(_vm.actionCancel)?_c('gl-button',_vm._b({staticClass:"js-modal-action-cancel",on:{"click":_vm.cancel}},'gl-button',_vm.buttonBinding(_vm.actionCancel, 'actionCancel'),false),[_vm._v("\n "+_vm._s(_vm.actionCancel.text)+"\n ")]):_vm._e(),_vm._v(" "),(_vm.actionSecondary)?_c('gl-button',_vm._b({staticClass:"js-modal-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.actionPrimary)?_c('gl-button',_vm._b({staticClass:"js-modal-action-primary",on:{"click":_vm.ok}},'gl-button',_vm.buttonBinding(_vm.actionPrimary, 'actionPrimary'),false),[_vm._v("\n "+_vm._s(_vm.actionPrimary.text)+"\n ")]):_vm._e()])]},proxy:true}:null],null,true)},'b-modal',_vm.$attrs,false),_vm.$listeners))};
169
181
  var __vue_staticRenderFns__ = [];
170
182
 
171
183
  /* style */
@@ -0,0 +1,240 @@
1
+ import { createPopper } from '@popperjs/core';
2
+ import { buttonCategoryOptions, dropdownVariantOptions, buttonSizeOptions } from '../../../../utils/constants';
3
+ import { POPPER_CONFIG, GL_DROPDOWN_SHOWN, GL_DROPDOWN_HIDDEN } from '../constants';
4
+ import GlButton from '../../button/button';
5
+ import GlIcon from '../../icon/icon';
6
+ import { OutsideDirective } from '../../../../directives/outside/outside';
7
+ import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
8
+
9
+ var script = {
10
+ components: {
11
+ GlButton,
12
+ GlIcon
13
+ },
14
+ directives: {
15
+ Outside: OutsideDirective
16
+ },
17
+ props: {
18
+ toggleText: {
19
+ type: String,
20
+ required: false,
21
+ default: ''
22
+ },
23
+ textSrOnly: {
24
+ type: Boolean,
25
+ required: false,
26
+ default: false
27
+ },
28
+ category: {
29
+ type: String,
30
+ required: false,
31
+ default: buttonCategoryOptions.primary,
32
+ validator: value => Object.keys(buttonCategoryOptions).includes(value)
33
+ },
34
+ variant: {
35
+ type: String,
36
+ required: false,
37
+ default: dropdownVariantOptions.default,
38
+ validator: value => Object.keys(dropdownVariantOptions).includes(value)
39
+ },
40
+ size: {
41
+ type: String,
42
+ required: false,
43
+ default: buttonSizeOptions.medium,
44
+ validator: value => Object.keys(buttonSizeOptions).includes(value)
45
+ },
46
+ icon: {
47
+ type: String,
48
+ required: false,
49
+ default: ''
50
+ },
51
+ disabled: {
52
+ type: Boolean,
53
+ required: false,
54
+ default: false
55
+ },
56
+ loading: {
57
+ type: Boolean,
58
+ required: false,
59
+ default: false
60
+ },
61
+ toggleClass: {
62
+ type: [String, Array, Object],
63
+ required: false,
64
+ default: null
65
+ },
66
+ noCaret: {
67
+ type: Boolean,
68
+ required: false,
69
+ default: false
70
+ },
71
+
72
+ /**
73
+ * Right align dropdown menu with respect to the toggle button
74
+ */
75
+ right: {
76
+ type: Boolean,
77
+ required: false,
78
+ default: false
79
+ },
80
+ // ARIA props
81
+ ariaHaspopup: {
82
+ type: [String, Boolean],
83
+ required: false,
84
+ default: false,
85
+ validator: value => {
86
+ return ['menu', 'listbox', 'tree', 'grid', 'dialog', true, false].includes(value);
87
+ }
88
+ },
89
+
90
+ /**
91
+ * Id that will be referenced by `aria-labelledby` attribute of the dropdown content`
92
+ */
93
+ toggleId: {
94
+ type: String,
95
+ required: true
96
+ },
97
+
98
+ /**
99
+ * The `aria-labelledby` attribute value for the toggle `button`
100
+ */
101
+ ariaLabelledby: {
102
+ type: String,
103
+ required: false,
104
+ default: null
105
+ }
106
+ },
107
+
108
+ data() {
109
+ return {
110
+ visible: false
111
+ };
112
+ },
113
+
114
+ computed: {
115
+ isIconOnly() {
116
+ var _this$toggleText;
117
+
118
+ return Boolean(this.icon && (!((_this$toggleText = this.toggleText) !== null && _this$toggleText !== void 0 && _this$toggleText.length) || this.textSrOnly));
119
+ },
120
+
121
+ isIconWithText() {
122
+ var _this$toggleText2;
123
+
124
+ return Boolean(this.icon && ((_this$toggleText2 = this.toggleText) === null || _this$toggleText2 === void 0 ? void 0 : _this$toggleText2.length) && !this.textSrOnly);
125
+ },
126
+
127
+ toggleButtonClasses() {
128
+ return [this.toggleClass, {
129
+ 'gl-dropdown-toggle': true,
130
+ 'dropdown-toggle': true,
131
+ 'dropdown-icon-only': this.isIconOnly,
132
+ 'dropdown-icon-text': this.isIconWithText,
133
+ 'dropdown-toggle-no-caret': this.noCaret
134
+ }];
135
+ },
136
+
137
+ toggleLabelledBy() {
138
+ return this.ariaLabelledby ? `${this.ariaLabelledby} ${this.toggleId}` : this.toggleId;
139
+ },
140
+
141
+ popperConfig() {
142
+ return {
143
+ placement: this.right ? 'bottom-end' : 'bottom-start',
144
+ ...POPPER_CONFIG
145
+ };
146
+ }
147
+
148
+ },
149
+
150
+ updated() {
151
+ if (this.visible) {
152
+ var _this$popper;
153
+
154
+ (_this$popper = this.popper) === null || _this$popper === void 0 ? void 0 : _this$popper.update();
155
+ }
156
+ },
157
+
158
+ mounted() {
159
+ this.$nextTick(() => {
160
+ this.popper = createPopper(this.$refs.toggle.$el, this.$refs.content, this.popperConfig);
161
+ });
162
+ },
163
+
164
+ beforeDestroy() {
165
+ this.popper.destroy();
166
+ },
167
+
168
+ methods: {
169
+ toggle() {
170
+ this.visible = !this.visible;
171
+
172
+ if (this.visible) {
173
+ this.popper.update();
174
+ this.$emit(GL_DROPDOWN_SHOWN);
175
+ } else {
176
+ this.$emit(GL_DROPDOWN_HIDDEN);
177
+ }
178
+ },
179
+
180
+ close() {
181
+ if (!this.visible) {
182
+ return;
183
+ }
184
+
185
+ this.toggle();
186
+ },
187
+
188
+ closeAndFocus() {
189
+ if (!this.visible) {
190
+ return;
191
+ }
192
+
193
+ this.toggle();
194
+ this.focusToggle();
195
+ },
196
+
197
+ focusToggle() {
198
+ this.$refs.toggle.$el.focus();
199
+ }
200
+
201
+ }
202
+ };
203
+
204
+ /* script */
205
+ const __vue_script__ = script;
206
+
207
+ /* template */
208
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:"outside",rawName:"v-outside",value:(_vm.close),expression:"close"}],staticClass:"gl-new-dropdown dropdown btn-group"},[_c('gl-button',{ref:"toggle",class:_vm.toggleButtonClasses,attrs:{"id":_vm.toggleId,"data-testid":"base-dropdown-toggle","icon":_vm.icon,"category":_vm.category,"variant":_vm.variant,"size":_vm.size,"disabled":_vm.disabled,"loading":_vm.loading,"aria-haspopup":_vm.ariaHaspopup,"aria-expanded":_vm.visible,"aria-labelledby":_vm.toggleLabelledBy},on:{"click":_vm.toggle}},[_c('span',{staticClass:"gl-new-dropdown-button-text",class:{ 'gl-sr-only': _vm.textSrOnly }},[_vm._v("\n "+_vm._s(_vm.toggleText)+"\n ")]),_vm._v(" "),(!_vm.noCaret)?_c('gl-icon',{staticClass:"gl-button-icon dropdown-chevron",attrs:{"name":"chevron-down"}}):_vm._e()],1),_vm._v(" "),_c('div',{ref:"content",staticClass:"dropdown-menu",class:{ show: _vm.visible },attrs:{"data-testid":"base-dropdown-menu"},on:{"keydown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"esc",27,$event.key,["Esc","Escape"])){ return null; }$event.stopPropagation();$event.preventDefault();return _vm.closeAndFocus($event)}}},[_c('div',{staticClass:"gl-new-dropdown-inner"},[_vm._t("default")],2)])],1)};
209
+ var __vue_staticRenderFns__ = [];
210
+
211
+ /* style */
212
+ const __vue_inject_styles__ = undefined;
213
+ /* scoped */
214
+ const __vue_scope_id__ = undefined;
215
+ /* module identifier */
216
+ const __vue_module_identifier__ = undefined;
217
+ /* functional template */
218
+ const __vue_is_functional_template__ = false;
219
+ /* style inject */
220
+
221
+ /* style inject SSR */
222
+
223
+ /* style inject shadow dom */
224
+
225
+
226
+
227
+ const __vue_component__ = __vue_normalize__(
228
+ { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
229
+ __vue_inject_styles__,
230
+ __vue_script__,
231
+ __vue_scope_id__,
232
+ __vue_is_functional_template__,
233
+ __vue_module_identifier__,
234
+ false,
235
+ undefined,
236
+ undefined,
237
+ undefined
238
+ );
239
+
240
+ export default __vue_component__;
@@ -0,0 +1,20 @@
1
+ const POPPER_CONFIG = {
2
+ modifiers: [{
3
+ name: 'offset',
4
+ options: {
5
+ offset: [0, 4]
6
+ }
7
+ }]
8
+ }; // base dropdown events
9
+
10
+ const GL_DROPDOWN_SHOWN = 'shown';
11
+ const GL_DROPDOWN_HIDDEN = 'hidden'; // KEY Codes
12
+
13
+ const HOME = 'Home';
14
+ const END = 'End';
15
+ const ARROW_UP = 'ArrowUp';
16
+ const ARROW_DOWN = 'ArrowDown';
17
+ const ENTER = 'Enter';
18
+ const SPACE = 'Space';
19
+
20
+ export { ARROW_DOWN, ARROW_UP, END, ENTER, GL_DROPDOWN_HIDDEN, GL_DROPDOWN_SHOWN, HOME, POPPER_CONFIG, SPACE };