@gitlab/ui 39.3.0 → 39.3.1

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 (219) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/components/base/modal/modal.js +14 -2
  3. package/package.json +4 -11
  4. package/src/components/base/modal/modal.spec.js +20 -0
  5. package/src/components/base/modal/modal.vue +14 -1
  6. package/dist/components/base/accordion/accordion.documentation.js +0 -8
  7. package/dist/components/base/accordion/accordion_item.documentation.js +0 -7
  8. package/dist/components/base/alert/alert.documentation.js +0 -13
  9. package/dist/components/base/avatar/avatar.documentation.js +0 -8
  10. package/dist/components/base/avatar_labeled/avatar_labeled.documentation.js +0 -8
  11. package/dist/components/base/avatar_link/avatar_link.documentation.js +0 -8
  12. package/dist/components/base/avatars_inline/avatars_inline.documentation.js +0 -13
  13. package/dist/components/base/badge/badge.documentation.js +0 -8
  14. package/dist/components/base/banner/banner.documentation.js +0 -8
  15. package/dist/components/base/breadcrumb/breadcrumb.documentation.js +0 -8
  16. package/dist/components/base/broadcast_message/broadcast_message.documentation.js +0 -8
  17. package/dist/components/base/button/button.documentation.js +0 -24
  18. package/dist/components/base/button_group/button_group.documentation.js +0 -8
  19. package/dist/components/base/card/card.documentation.js +0 -13
  20. package/dist/components/base/carousel/carousel.documentation.js +0 -8
  21. package/dist/components/base/collapse/collapse.documentation.js +0 -7
  22. package/dist/components/base/datepicker/datepicker.documentation.js +0 -7
  23. package/dist/components/base/daterange_picker/daterange_picker.documentation.js +0 -8
  24. package/dist/components/base/drawer/drawer.documentation.js +0 -8
  25. package/dist/components/base/dropdown/dropdown.documentation.js +0 -8
  26. package/dist/components/base/dropdown/dropdown_item.documentation.js +0 -7
  27. package/dist/components/base/filtered_search/filtered_search.documentation.js +0 -13
  28. package/dist/components/base/filtered_search/filtered_search_suggestion.documentation.js +0 -7
  29. package/dist/components/base/filtered_search/filtered_search_suggestion_list.documentation.js +0 -7
  30. package/dist/components/base/filtered_search/filtered_search_term.documentation.js +0 -12
  31. package/dist/components/base/filtered_search/filtered_search_token.documentation.js +0 -12
  32. package/dist/components/base/filtered_search/filtered_search_token_segment.documentation.js +0 -12
  33. package/dist/components/base/form/form.documentation.js +0 -7
  34. package/dist/components/base/form/form_checkbox/form_checkbox.documentation.js +0 -8
  35. package/dist/components/base/form/form_checkbox_tree/form_checkbox_tree.documentation.js +0 -12
  36. package/dist/components/base/form/form_combobox/form_combobox.documentation.js +0 -13
  37. package/dist/components/base/form/form_group/form_group.documentation.js +0 -7
  38. package/dist/components/base/form/form_input/form_input.documentation.js +0 -8
  39. package/dist/components/base/form/form_input_group/form_input_group.documentation.js +0 -8
  40. package/dist/components/base/form/form_radio/form_radio.documentation.js +0 -8
  41. package/dist/components/base/form/form_radio_group/form_radio_group.documentation.js +0 -8
  42. package/dist/components/base/form/form_select/form_select.documentation.js +0 -8
  43. package/dist/components/base/form/form_text/form_text.documentation.js +0 -14
  44. package/dist/components/base/form/form_textarea/form_textarea.documentation.js +0 -7
  45. package/dist/components/base/form/input_group_text/input_group_text.documentation.js +0 -12
  46. package/dist/components/base/icon/icon.documentation.js +0 -8
  47. package/dist/components/base/infinite_scroll/examples/index.js +0 -49
  48. package/dist/components/base/infinite_scroll/examples/infinite_scroll.all_items.example.js +0 -49
  49. package/dist/components/base/infinite_scroll/examples/infinite_scroll.basic.example.js +0 -62
  50. package/dist/components/base/infinite_scroll/examples/infinite_scroll.finite_total_items.example.js +0 -72
  51. package/dist/components/base/infinite_scroll/examples/infinite_scroll.large_fetched_items.example.js +0 -62
  52. package/dist/components/base/infinite_scroll/examples/infinite_scroll.reverse.example.js +0 -63
  53. package/dist/components/base/infinite_scroll/examples/infinite_scroll.small_fetched_items.example.js +0 -62
  54. package/dist/components/base/infinite_scroll/examples/infinite_scroll.two_way.example.js +0 -94
  55. package/dist/components/base/infinite_scroll/infinite_scroll.documentation.js +0 -8
  56. package/dist/components/base/keyset_pagination/keyset_pagination.documentation.js +0 -13
  57. package/dist/components/base/label/label.documentation.js +0 -8
  58. package/dist/components/base/link/link.documentation.js +0 -7
  59. package/dist/components/base/loading_icon/loading_icon.documentation.js +0 -8
  60. package/dist/components/base/markdown/markdown.documentation.js +0 -12
  61. package/dist/components/base/modal/modal.documentation.js +0 -8
  62. package/dist/components/base/nav/nav.documentation.js +0 -12
  63. package/dist/components/base/navbar/navbar.documentation.js +0 -12
  64. package/dist/components/base/paginated_list/paginated_list.documentation.js +0 -7
  65. package/dist/components/base/pagination/pagination.documentation.js +0 -8
  66. package/dist/components/base/path/path.documentation.js +0 -8
  67. package/dist/components/base/popover/popover.documentation.js +0 -5
  68. package/dist/components/base/search_box_by_click/search_box_by_click.documentation.js +0 -8
  69. package/dist/components/base/search_box_by_type/search_box_by_type.documentation.js +0 -8
  70. package/dist/components/base/segmented_control/segmented_control.documentation.js +0 -8
  71. package/dist/components/base/skeleton_loader/skeleton_loader.documentation.js +0 -13
  72. package/dist/components/base/skeleton_loading/skeleton_loading.documentation.js +0 -7
  73. package/dist/components/base/sorting/sorting.documentation.js +0 -7
  74. package/dist/components/base/sorting/sorting_item.documentation.js +0 -8
  75. package/dist/components/base/table/table.documentation.js +0 -8
  76. package/dist/components/base/table_lite/table_lite.documentation.js +0 -13
  77. package/dist/components/base/tabs/tabs/tabs.documentation.js +0 -8
  78. package/dist/components/base/toast/toast.documentation.js +0 -8
  79. package/dist/components/base/toggle/toggle.documentation.js +0 -13
  80. package/dist/components/base/token/token.documentation.js +0 -5
  81. package/dist/components/base/token_selector/token_selector.documentation.js +0 -12
  82. package/dist/components/base/tooltip/tooltip.documentation.js +0 -8
  83. package/dist/components/charts/area/area.documentation.js +0 -5
  84. package/dist/components/charts/bar/bar.documentation.js +0 -8
  85. package/dist/components/charts/chart/chart.documentation.js +0 -7
  86. package/dist/components/charts/column/column.documentation.js +0 -5
  87. package/dist/components/charts/discrete_scatter/discrete_scatter.documentation.js +0 -5
  88. package/dist/components/charts/gauge/gauge.documentation.js +0 -12
  89. package/dist/components/charts/heatmap/heatmap.documentation.js +0 -8
  90. package/dist/components/charts/line/line.documentation.js +0 -8
  91. package/dist/components/charts/series_label/series_label.documentation.js +0 -7
  92. package/dist/components/charts/single_stat/single_stat.documentation.js +0 -7
  93. package/dist/components/charts/sparkline/sparkline.documentation.js +0 -8
  94. package/dist/components/charts/stacked_column/stacked_column.documentation.js +0 -8
  95. package/dist/components/charts/tooltip/tooltip.documentation.js +0 -8
  96. package/dist/components/editors/rich_text_editor/rich_text_editor.documentation.js +0 -12
  97. package/dist/components/regions/dashboard_skeleton/dashboard_skeleton.documentation.js +0 -7
  98. package/dist/components/regions/empty_state/empty_state.documentation.js +0 -7
  99. package/dist/components/utilities/animated_number/animated_number.documentation.js +0 -13
  100. package/dist/components/utilities/friendly_wrap/friendly_wrap.documentation.js +0 -7
  101. package/dist/components/utilities/intersection_observer/intersection_observer.documentation.js +0 -12
  102. package/dist/components/utilities/intersperse/intersperse.documentation.js +0 -8
  103. package/dist/components/utilities/sprintf/sprintf.documentation.js +0 -8
  104. package/dist/components/utilities/truncate/truncate.documentation.js +0 -7
  105. package/dist/directives/hover_load/hover_load.documentation.js +0 -13
  106. package/dist/directives/outside/outside.documentation.js +0 -13
  107. package/dist/directives/resize_observer/resize_observer.documentation.js +0 -8
  108. package/dist/directives/safe_html/safe_html.documentation.js +0 -8
  109. package/dist/directives/safe_link/safe_link.documentation.js +0 -8
  110. package/documentation/all_components.js +0 -8
  111. package/documentation/components/component_documentation_generator.vue +0 -321
  112. package/documentation/components/example_display.vue +0 -231
  113. package/documentation/components/example_explorer.vue +0 -63
  114. package/documentation/components_documentation.js +0 -111
  115. package/documentation/index.js +0 -8
  116. package/src/components/base/accordion/accordion.documentation.js +0 -6
  117. package/src/components/base/accordion/accordion_item.documentation.js +0 -5
  118. package/src/components/base/alert/alert.documentation.js +0 -6
  119. package/src/components/base/avatar/avatar.documentation.js +0 -6
  120. package/src/components/base/avatar_labeled/avatar_labeled.documentation.js +0 -6
  121. package/src/components/base/avatar_link/avatar_link.documentation.js +0 -6
  122. package/src/components/base/avatars_inline/avatars_inline.documentation.js +0 -6
  123. package/src/components/base/badge/badge.documentation.js +0 -6
  124. package/src/components/base/banner/banner.documentation.js +0 -6
  125. package/src/components/base/breadcrumb/breadcrumb.documentation.js +0 -6
  126. package/src/components/base/broadcast_message/broadcast_message.documentation.js +0 -6
  127. package/src/components/base/button/button.documentation.js +0 -24
  128. package/src/components/base/button_group/button_group.documentation.js +0 -6
  129. package/src/components/base/card/card.documentation.js +0 -6
  130. package/src/components/base/carousel/carousel.documentation.js +0 -6
  131. package/src/components/base/collapse/collapse.documentation.js +0 -5
  132. package/src/components/base/datepicker/datepicker.documentation.js +0 -5
  133. package/src/components/base/daterange_picker/daterange_picker.documentation.js +0 -6
  134. package/src/components/base/drawer/drawer.documentation.js +0 -6
  135. package/src/components/base/dropdown/dropdown.documentation.js +0 -6
  136. package/src/components/base/dropdown/dropdown_item.documentation.js +0 -5
  137. package/src/components/base/filtered_search/filtered_search.documentation.js +0 -6
  138. package/src/components/base/filtered_search/filtered_search_suggestion.documentation.js +0 -5
  139. package/src/components/base/filtered_search/filtered_search_suggestion_list.documentation.js +0 -5
  140. package/src/components/base/filtered_search/filtered_search_term.documentation.js +0 -5
  141. package/src/components/base/filtered_search/filtered_search_token.documentation.js +0 -5
  142. package/src/components/base/filtered_search/filtered_search_token_segment.documentation.js +0 -5
  143. package/src/components/base/form/form.documentation.js +0 -5
  144. package/src/components/base/form/form_checkbox/form_checkbox.documentation.js +0 -6
  145. package/src/components/base/form/form_checkbox_tree/form_checkbox_tree.documentation.js +0 -5
  146. package/src/components/base/form/form_combobox/form_combobox.documentation.js +0 -6
  147. package/src/components/base/form/form_group/form_group.documentation.js +0 -5
  148. package/src/components/base/form/form_input/form_input.documentation.js +0 -6
  149. package/src/components/base/form/form_input_group/form_input_group.documentation.js +0 -6
  150. package/src/components/base/form/form_radio/form_radio.documentation.js +0 -6
  151. package/src/components/base/form/form_radio_group/form_radio_group.documentation.js +0 -6
  152. package/src/components/base/form/form_select/form_select.documentation.js +0 -6
  153. package/src/components/base/form/form_text/form_text.documentation.js +0 -7
  154. package/src/components/base/form/form_textarea/form_textarea.documentation.js +0 -5
  155. package/src/components/base/form/input_group_text/input_group_text.documentation.js +0 -5
  156. package/src/components/base/icon/icon.documentation.js +0 -6
  157. package/src/components/base/infinite_scroll/examples/index.js +0 -57
  158. package/src/components/base/infinite_scroll/examples/infinite_scroll.all_items.example.vue +0 -25
  159. package/src/components/base/infinite_scroll/examples/infinite_scroll.basic.example.vue +0 -43
  160. package/src/components/base/infinite_scroll/examples/infinite_scroll.finite_total_items.example.vue +0 -44
  161. package/src/components/base/infinite_scroll/examples/infinite_scroll.large_fetched_items.example.vue +0 -43
  162. package/src/components/base/infinite_scroll/examples/infinite_scroll.reverse.example.vue +0 -46
  163. package/src/components/base/infinite_scroll/examples/infinite_scroll.small_fetched_items.example.vue +0 -43
  164. package/src/components/base/infinite_scroll/examples/infinite_scroll.two_way.example.vue +0 -75
  165. package/src/components/base/infinite_scroll/infinite_scroll.documentation.js +0 -6
  166. package/src/components/base/keyset_pagination/keyset_pagination.documentation.js +0 -6
  167. package/src/components/base/label/label.documentation.js +0 -6
  168. package/src/components/base/link/link.documentation.js +0 -5
  169. package/src/components/base/loading_icon/loading_icon.documentation.js +0 -6
  170. package/src/components/base/markdown/markdown.documentation.js +0 -5
  171. package/src/components/base/modal/modal.documentation.js +0 -6
  172. package/src/components/base/nav/nav.documentation.js +0 -5
  173. package/src/components/base/navbar/navbar.documentation.js +0 -5
  174. package/src/components/base/paginated_list/paginated_list.documentation.js +0 -5
  175. package/src/components/base/pagination/pagination.documentation.js +0 -6
  176. package/src/components/base/path/path.documentation.js +0 -6
  177. package/src/components/base/popover/popover.documentation.js +0 -3
  178. package/src/components/base/search_box_by_click/search_box_by_click.documentation.js +0 -6
  179. package/src/components/base/search_box_by_type/search_box_by_type.documentation.js +0 -6
  180. package/src/components/base/segmented_control/segmented_control.documentation.js +0 -6
  181. package/src/components/base/skeleton_loader/skeleton_loader.documentation.js +0 -6
  182. package/src/components/base/skeleton_loading/skeleton_loading.documentation.js +0 -5
  183. package/src/components/base/sorting/sorting.documentation.js +0 -5
  184. package/src/components/base/sorting/sorting_item.documentation.js +0 -6
  185. package/src/components/base/table/table.documentation.js +0 -6
  186. package/src/components/base/table_lite/table_lite.documentation.js +0 -6
  187. package/src/components/base/tabs/tabs/tabs.documentation.js +0 -6
  188. package/src/components/base/toast/toast.documentation.js +0 -6
  189. package/src/components/base/toggle/toggle.documentation.js +0 -6
  190. package/src/components/base/token/token.documentation.js +0 -3
  191. package/src/components/base/token_selector/token_selector.documentation.js +0 -5
  192. package/src/components/base/tooltip/tooltip.documentation.js +0 -6
  193. package/src/components/charts/area/area.documentation.js +0 -3
  194. package/src/components/charts/bar/bar.documentation.js +0 -6
  195. package/src/components/charts/chart/chart.documentation.js +0 -5
  196. package/src/components/charts/column/column.documentation.js +0 -3
  197. package/src/components/charts/discrete_scatter/discrete_scatter.documentation.js +0 -3
  198. package/src/components/charts/gauge/gauge.documentation.js +0 -5
  199. package/src/components/charts/heatmap/heatmap.documentation.js +0 -6
  200. package/src/components/charts/line/line.documentation.js +0 -6
  201. package/src/components/charts/series_label/series_label.documentation.js +0 -5
  202. package/src/components/charts/single_stat/single_stat.documentation.js +0 -5
  203. package/src/components/charts/sparkline/sparkline.documentation.js +0 -6
  204. package/src/components/charts/stacked_column/stacked_column.documentation.js +0 -6
  205. package/src/components/charts/tooltip/tooltip.documentation.js +0 -6
  206. package/src/components/editors/rich_text_editor/rich_text_editor.documentation.js +0 -5
  207. package/src/components/regions/dashboard_skeleton/dashboard_skeleton.documentation.js +0 -5
  208. package/src/components/regions/empty_state/empty_state.documentation.js +0 -5
  209. package/src/components/utilities/animated_number/animated_number.documentation.js +0 -6
  210. package/src/components/utilities/friendly_wrap/friendly_wrap.documentation.js +0 -5
  211. package/src/components/utilities/intersection_observer/intersection_observer.documentation.js +0 -5
  212. package/src/components/utilities/intersperse/intersperse.documentation.js +0 -6
  213. package/src/components/utilities/sprintf/sprintf.documentation.js +0 -6
  214. package/src/components/utilities/truncate/truncate.documentation.js +0 -5
  215. package/src/directives/hover_load/hover_load.documentation.js +0 -6
  216. package/src/directives/outside/outside.documentation.js +0 -6
  217. package/src/directives/resize_observer/resize_observer.documentation.js +0 -6
  218. package/src/directives/safe_html/safe_html.documentation.js +0 -6
  219. package/src/directives/safe_link/safe_link.documentation.js +0 -6
@@ -1,8 +0,0 @@
1
- var description = "The `GlFormInputGroup` component allows one to build more advanced text\ninput fields than generic `GlFormInput` when one needs that flexibility.\nBasic usage of the component:\n\n```html\n<div>\n <gl-form-input-group>\n <template #prepend>\n <!-- Content to prepend your text input field -->\n </template>\n <template #append>\n <!-- Content to append your text input field -->\n </template>\n </gl-form-input-group>\n</div>\n```\n\nOne can use any other component (custom or `<gl-*>`) in both slots or\nnot to use the slots at all. In the latter, the component will fallback\nto simple `GlFormInput`.\n\n## Predefined options\n\nSometimes custom text input from the user isn't desired. Instead, the\nuser should pick one of the predefined options that will automatically\npopulate the input field. Typically, such cases will also include an\nactionable button (like **Copy**) put into the `append` slot.\n\nTo achieve this effect, the `GlFormInputGroup` component accepts an\narray of options in the form of `predefinedOptions` param. For example:\n\n```javascript\nconst optionValues = [\n { name: 'Option #1', value: 'Option #1 is selected!' },\n { name: 'Option #2', value: 'Option #2 is selected!' },\n];\n...\n<gl-form-input-group :predefined-options=\"optionValues\" />\n```\n\nThis will tell `GlFormInputGroup` to render a dropdown in the `prepend`\nslot with all of the supplied options' `name`s. When one of the options\nis selected, the input field is automatically populated with the\noption's `value`. Check the \"Examples\" section below for \"With\npredefined options\" example.\n\n### Pro tips\n\nRead some useful tips below about specific usage of the component.\n\n### Readonly input\n\nOften you want to make sure user doesn't mess up the predefined content\npasted into the input field. In this case, you can set `readonly`\nparam to `true`. You can play with `Readonly` knob on the right.\n\n### Preselect the text to copy\n\nIf you set the `readonly` param on the `GlFormInputGroup` component,\nusers will still be able to manually select the text and copy it.\nHowever, it's more user-friendly to preselect the text for the users if\nthey click anywhere in the input field. This can be achieved by setting\nthe `select-on-click` param to `true`. You can play with\n`Select text on click` knob on the right. Even better, try enabling\n`Readonly`, `Select text on click`, and `Switch to predefined input`\naltogether. And, probably, remove `Prepend text`. Or leave it. It's your\ncall. :)\n";
2
-
3
- var form_input_group_documentation = {
4
- followsDesignSystem: false,
5
- description
6
- };
7
-
8
- export default form_input_group_documentation;
@@ -1,8 +0,0 @@
1
- var description = "`GlFormRadio` components can be used directly, or via a `GlFormRadioGroup`.\n\nBelow is an example which demonstrates the direct approach. For examples using\n`GlFormRadioGroup`, see the documentation for that component.\n\n```html\n<script>\n export default {\n data() {\n return {\n selected: 'yes',\n };\n },\n };\n</script>\n\n<template>\n <div>\n <gl-form-radio v-model=\"selected\" value=\"yes\">Yes</gl-form-radio>\n <gl-form-radio v-model=\"selected\" value=\"no\">No</gl-form-radio>\n </div>\n</template>\n```\n";
2
-
3
- var form_radio_documentation = {
4
- description,
5
- followsDesignSystem: true
6
- };
7
-
8
- export default form_radio_documentation;
@@ -1,8 +0,0 @@
1
- var description = "The `GlFormRadioGroup` component provides an alternative and sometimes more\ncompact way of setting up a group of `GlFormRadio` components.\n\n## Usage\n\n`GlFormRadioGroup` can be used in a few ways to build a group of `GlFormRadio`\ncomponents: implicitly, explicitly, or a mix of both.\n\nBelow is an example which demonstrates all three approaches, written such that\nall of them produce the same visual result.\n\n```html\n<script>\nexport default {\n data() {\n return {\n selected: 'one',\n options: [\n {\n value: 'one',\n text: 'One',\n },\n {\n value: 'two',\n text: 'Two',\n },\n {\n value: 'three',\n text: 'Three',\n },\n ],\n };\n },\n};\n</script>\n\n<template>\n <div>\n <!-- Implicit -->\n <gl-form-radio-group v-model=\"selected\" :options=\"options\" name=\"implicit\" />\n\n <!-- Explicit -->\n <gl-form-radio-group v-model=\"selected\" name=\"explicit\">\n <gl-form-radio value=\"one\">One</gl-form-radio>\n <gl-form-radio value=\"two\">Two</gl-form-radio>\n <gl-form-radio value=\"three\">Three</gl-form-radio>\n </gl-form-radio-group>\n\n <!-- Mixed -->\n <gl-form-radio-group v-model=\"selected\" :options=\"[options[1]]\" name=\"mixed\">\n <template #first>\n <gl-form-radio value=\"one\">One</gl-form-radio>\n </template>\n <gl-form-radio value=\"three\">Three</gl-form-radio>\n </gl-form-radio-group>\n </div>\n</template>\n```\n\n## Stacked\n\nBy default, the GitLab Design guide mandates the `<gl-form-radio-group>` be `stacked` by default and\nis non-changeable at this time.\n";
2
-
3
- var form_radio_group_documentation = {
4
- description,
5
- followsDesignSystem: true
6
- };
7
-
8
- export default form_radio_group_documentation;
@@ -1,8 +0,0 @@
1
- var description = "Form select component used to select from group of options in a form.\n";
2
-
3
- var form_select_documentation = {
4
- description,
5
- followDesignSystem: true
6
- };
7
-
8
- export default form_select_documentation;
@@ -1,14 +0,0 @@
1
- var form_text = "# Usage\n\nThe component used to render form group descriptions. Useful for when you need\nto add additional form text elements to a form group.\n";
2
-
3
- var description = /*#__PURE__*/Object.freeze({
4
- __proto__: null,
5
- 'default': form_text
6
- });
7
-
8
- var form_text_documentation = {
9
- description,
10
- bootstrapComponent: 'b-form-text',
11
- propsInfo: {}
12
- };
13
-
14
- export default form_text_documentation;
@@ -1,7 +0,0 @@
1
- var description = "**Note:** This needs a `v-model` property to work correctly.\nSee [this issue](https://github.com/bootstrap-vue/bootstrap-vue/issues/1915) on Bootstrap Vue for\nmore information.\n";
2
-
3
- var form_textarea_documentation = {
4
- description
5
- };
6
-
7
- export default form_textarea_documentation;
@@ -1,12 +0,0 @@
1
- var input_group_text = "### Under the hood\n\nUses [`BInputGroupText`](https://bootstrap-vue.org/docs/components/input-group#comp-ref-b-input-group-text)\nfrom Vue Boostrap\n";
2
-
3
- var description = /*#__PURE__*/Object.freeze({
4
- __proto__: null,
5
- 'default': input_group_text
6
- });
7
-
8
- var input_group_text_documentation = {
9
- description
10
- };
11
-
12
- export default input_group_text_documentation;
@@ -1,8 +0,0 @@
1
- var description = "## Usage\n\nThe Icon component can be used to render any svg within the @gitlab/svgs icon sprites.\n\n### Accessibility\n\n`gl-icon` icons are hidden from screen readers by default, as usages of icons are commonly decorative.\n\nIf the icon is not decorative, add an `aria-label` attribute to `gl-icon` to give it an accessible name.\nThis label is read out by screen readers.\n\nIf the icon is clickable, use `gl-button` instead of `gl-icon` because a clickable element should\nsemantically be a button.\n\n```html\n<!-- icon, which is hidden from screen readers by default -->\n<gl-icon name=\"rocket\" />\n\n<!-- icon, which has an accessible name \"Confidential issue\" that is read out by screen readers -->\n<gl-icon name=\"eye-slash\" :aria-label=\"__('Confidential issue')\" />\n\n<!-- clickable icon, which is borderless and padding-less -->\n<gl-button icon=\"close\" category=\"tertiary\" class=\"gl-p-0!\" aria-label=\"Close\" />\n```\n\nFor more information about icons within GitLab, visit the\n[GitLab accessibility guidelines](https://docs.gitlab.com/ee/development/fe_guide/accessibility#icons).\n";
2
-
3
- var icon_documentation = {
4
- followsDesignSystem: true,
5
- description
6
- };
7
-
8
- export default icon_documentation;
@@ -1,49 +0,0 @@
1
- import InfiniteScrollAllItemsExample from './infinite_scroll.all_items.example';
2
- import InfiniteScrollBasicExample from './infinite_scroll.basic.example';
3
- import InfiniteScrollWithFiniteTotalItemsExample from './infinite_scroll.finite_total_items.example';
4
- import InfiniteScrollWithLargeNumberOfFetchedItemsExample from './infinite_scroll.large_fetched_items.example';
5
- import InfiniteScrollReverseExample from './infinite_scroll.reverse.example';
6
- import InfiniteScrollWithSmallNumberOfFetchedItemsExample from './infinite_scroll.small_fetched_items.example';
7
- import InfiniteScrollTwoWayExample from './infinite_scroll.two_way.example';
8
-
9
- var index = [{
10
- name: 'Basic',
11
- items: [{
12
- id: 'infinite-scroll-basic',
13
- name: 'Basic',
14
- description: 'Basic Infinite Scroll',
15
- component: InfiniteScrollBasicExample
16
- }, {
17
- id: 'infinite-scroll-with-finite-total-items',
18
- name: 'Fixed items',
19
- description: 'With finite total items',
20
- component: InfiniteScrollWithFiniteTotalItemsExample
21
- }, {
22
- id: 'infinite-scroll-small-fetched-items',
23
- name: 'With a small number of fetched items',
24
- description: 'Infinite Scroll with small number of fetched items',
25
- component: InfiniteScrollWithSmallNumberOfFetchedItemsExample
26
- }, {
27
- id: 'infinite-scroll-large-fetched-items',
28
- name: 'With a large number of fetched items',
29
- description: 'Infinite Scroll with large number of fetched items',
30
- component: InfiniteScrollWithLargeNumberOfFetchedItemsExample
31
- }, {
32
- id: 'infinite-scroll-all-items',
33
- name: 'Showing all items',
34
- description: 'Infinite Scroll with all items',
35
- component: InfiniteScrollAllItemsExample
36
- }, {
37
- id: 'infinite-scroll-reverse',
38
- name: 'Reversed',
39
- description: 'Infinite Scroll with items added at the top',
40
- component: InfiniteScrollReverseExample
41
- }, {
42
- id: 'infinite-scroll-two-way',
43
- name: 'Two way Infinite Scroll',
44
- description: 'Infinite Scroll with items added in two directions',
45
- component: InfiniteScrollTwoWayExample
46
- }]
47
- }];
48
-
49
- export default index;
@@ -1,49 +0,0 @@
1
- import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
2
-
3
- const FETCHED_ITEMS = 5;
4
- var script = {
5
- data() {
6
- return {
7
- fetchedItems: FETCHED_ITEMS
8
- };
9
- }
10
-
11
- };
12
-
13
- /* script */
14
- const __vue_script__ = script;
15
-
16
- /* template */
17
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-infinite-scroll',{attrs:{"fetched-items":_vm.fetchedItems},scopedSlots:_vm._u([{key:"items",fn:function(){return [_c('ul',{staticClass:"list-group list-group-flushed list-unstyled"},_vm._l((_vm.fetchedItems),function(item){return _c('li',{key:item,staticClass:"list-group-item"},[_vm._v("Item #"+_vm._s(item))])}),0)]},proxy:true},{key:"default",fn:function(){return [_c('div',{staticClass:"gl-mt-3"},[_c('span',[_vm._v("All items loaded")])])]},proxy:true}])})};
18
- var __vue_staticRenderFns__ = [];
19
-
20
- /* style */
21
- const __vue_inject_styles__ = undefined;
22
- /* scoped */
23
- const __vue_scope_id__ = undefined;
24
- /* module identifier */
25
- const __vue_module_identifier__ = undefined;
26
- /* functional template */
27
- const __vue_is_functional_template__ = false;
28
- /* style inject */
29
-
30
- /* style inject SSR */
31
-
32
- /* style inject shadow dom */
33
-
34
-
35
-
36
- const __vue_component__ = __vue_normalize__(
37
- { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
38
- __vue_inject_styles__,
39
- __vue_script__,
40
- __vue_scope_id__,
41
- __vue_is_functional_template__,
42
- __vue_module_identifier__,
43
- false,
44
- undefined,
45
- undefined,
46
- undefined
47
- );
48
-
49
- export default __vue_component__;
@@ -1,62 +0,0 @@
1
- import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
2
-
3
- const ITEMS_BATCH_SIZE = 20;
4
- var script = {
5
- data() {
6
- return {
7
- isLoading: false,
8
- fetchedItems: ITEMS_BATCH_SIZE,
9
- loadTimer: null
10
- };
11
- },
12
-
13
- methods: {
14
- bottomReached() {
15
- clearTimeout(this.loadTimer);
16
- this.isLoading = true;
17
- this.loadTimer = setTimeout(() => {
18
- this.fetchedItems += ITEMS_BATCH_SIZE;
19
- this.isLoading = false;
20
- }, 500);
21
- }
22
-
23
- }
24
- };
25
-
26
- /* script */
27
- const __vue_script__ = script;
28
-
29
- /* template */
30
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-infinite-scroll',{attrs:{"max-list-height":285,"fetched-items":_vm.fetchedItems},on:{"bottomReached":_vm.bottomReached},scopedSlots:_vm._u([{key:"items",fn:function(){return [_c('ul',{staticClass:"list-group list-group-flushed list-unstyled"},_vm._l((_vm.fetchedItems),function(item){return _c('li',{key:item,staticClass:"list-group-item"},[_vm._v("Item #"+_vm._s(item))])}),0)]},proxy:true},{key:"default",fn:function(){return [_c('div',{staticClass:"gl-mt-3"},[(_vm.isLoading)?_c('gl-loading-icon'):_c('span',[_vm._v(_vm._s(_vm.fetchedItems)+" items loaded")])],1)]},proxy:true}])})};
31
- var __vue_staticRenderFns__ = [];
32
-
33
- /* style */
34
- const __vue_inject_styles__ = undefined;
35
- /* scoped */
36
- const __vue_scope_id__ = undefined;
37
- /* module identifier */
38
- const __vue_module_identifier__ = undefined;
39
- /* functional template */
40
- const __vue_is_functional_template__ = false;
41
- /* style inject */
42
-
43
- /* style inject SSR */
44
-
45
- /* style inject shadow dom */
46
-
47
-
48
-
49
- const __vue_component__ = __vue_normalize__(
50
- { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
51
- __vue_inject_styles__,
52
- __vue_script__,
53
- __vue_scope_id__,
54
- __vue_is_functional_template__,
55
- __vue_module_identifier__,
56
- false,
57
- undefined,
58
- undefined,
59
- undefined
60
- );
61
-
62
- export default __vue_component__;
@@ -1,72 +0,0 @@
1
- import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
2
-
3
- const ITEMS_BATCH_SIZE = 60;
4
- const TOTAL_ITEMS = 100;
5
- var script = {
6
- data() {
7
- return {
8
- totalItems: TOTAL_ITEMS,
9
- isLoading: false,
10
- fetchedItems: ITEMS_BATCH_SIZE,
11
- loadTimer: null
12
- };
13
- },
14
-
15
- methods: {
16
- bottomReached() {
17
- clearTimeout(this.loadTimer);
18
-
19
- if (this.fetchedItems < TOTAL_ITEMS) {
20
- this.isLoading = true;
21
- this.loadTimer = setTimeout(() => {
22
- this.fetchedItems += ITEMS_BATCH_SIZE;
23
-
24
- if (this.fetchedItems > TOTAL_ITEMS) {
25
- this.fetchedItems = TOTAL_ITEMS;
26
- }
27
-
28
- this.isLoading = false;
29
- }, 500);
30
- }
31
- }
32
-
33
- }
34
- };
35
-
36
- /* script */
37
- const __vue_script__ = script;
38
-
39
- /* template */
40
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-infinite-scroll',{attrs:{"max-list-height":285,"fetched-items":_vm.fetchedItems,"total-items":_vm.totalItems},on:{"bottomReached":_vm.bottomReached},scopedSlots:_vm._u([{key:"items",fn:function(){return [_c('ul',{staticClass:"list-group list-group-flushed list-unstyled"},_vm._l((_vm.fetchedItems),function(item){return _c('li',{key:item,staticClass:"list-group-item"},[_vm._v("Item #"+_vm._s(item))])}),0)]},proxy:true}])})};
41
- var __vue_staticRenderFns__ = [];
42
-
43
- /* style */
44
- const __vue_inject_styles__ = undefined;
45
- /* scoped */
46
- const __vue_scope_id__ = undefined;
47
- /* module identifier */
48
- const __vue_module_identifier__ = undefined;
49
- /* functional template */
50
- const __vue_is_functional_template__ = false;
51
- /* style inject */
52
-
53
- /* style inject SSR */
54
-
55
- /* style inject shadow dom */
56
-
57
-
58
-
59
- const __vue_component__ = __vue_normalize__(
60
- { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
61
- __vue_inject_styles__,
62
- __vue_script__,
63
- __vue_scope_id__,
64
- __vue_is_functional_template__,
65
- __vue_module_identifier__,
66
- false,
67
- undefined,
68
- undefined,
69
- undefined
70
- );
71
-
72
- export default __vue_component__;
@@ -1,62 +0,0 @@
1
- import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
2
-
3
- const ITEMS_BATCH_SIZE = 1200;
4
- var script = {
5
- data() {
6
- return {
7
- isLoading: false,
8
- fetchedItems: ITEMS_BATCH_SIZE,
9
- loadTimer: null
10
- };
11
- },
12
-
13
- methods: {
14
- bottomReached() {
15
- clearTimeout(this.loadTimer);
16
- this.isLoading = true;
17
- this.loadTimer = setTimeout(() => {
18
- this.fetchedItems += ITEMS_BATCH_SIZE;
19
- this.isLoading = false;
20
- }, 500);
21
- }
22
-
23
- }
24
- };
25
-
26
- /* script */
27
- const __vue_script__ = script;
28
-
29
- /* template */
30
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-infinite-scroll',{attrs:{"max-list-height":285,"fetched-items":_vm.fetchedItems},on:{"bottomReached":_vm.bottomReached},scopedSlots:_vm._u([{key:"items",fn:function(){return [_c('ul',{staticClass:"list-group list-group-flushed list-unstyled"},_vm._l((_vm.fetchedItems),function(item){return _c('li',{key:item,staticClass:"list-group-item"},[_vm._v("Item #"+_vm._s(item))])}),0)]},proxy:true},{key:"default",fn:function(){return [_c('div',{staticClass:"gl-mt-3"},[(_vm.isLoading)?_c('gl-loading-icon'):_c('span',[_vm._v("Showing "+_vm._s(_vm.fetchedItems)+" of 1000+ items")])],1)]},proxy:true}])})};
31
- var __vue_staticRenderFns__ = [];
32
-
33
- /* style */
34
- const __vue_inject_styles__ = undefined;
35
- /* scoped */
36
- const __vue_scope_id__ = undefined;
37
- /* module identifier */
38
- const __vue_module_identifier__ = undefined;
39
- /* functional template */
40
- const __vue_is_functional_template__ = false;
41
- /* style inject */
42
-
43
- /* style inject SSR */
44
-
45
- /* style inject shadow dom */
46
-
47
-
48
-
49
- const __vue_component__ = __vue_normalize__(
50
- { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
51
- __vue_inject_styles__,
52
- __vue_script__,
53
- __vue_scope_id__,
54
- __vue_is_functional_template__,
55
- __vue_module_identifier__,
56
- false,
57
- undefined,
58
- undefined,
59
- undefined
60
- );
61
-
62
- export default __vue_component__;
@@ -1,63 +0,0 @@
1
- import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
2
-
3
- const ITEMS_BATCH_SIZE = 5;
4
- const INIT_ITEMS_COUNT = 10;
5
- var script = {
6
- data() {
7
- return {
8
- isLoading: false,
9
- fetchedItems: INIT_ITEMS_COUNT,
10
- loadTimer: null
11
- };
12
- },
13
-
14
- methods: {
15
- topReached() {
16
- clearTimeout(this.loadTimer);
17
- this.isLoading = true;
18
- this.loadTimer = setTimeout(() => {
19
- this.fetchedItems += ITEMS_BATCH_SIZE;
20
- this.isLoading = false;
21
- }, 2000);
22
- }
23
-
24
- }
25
- };
26
-
27
- /* script */
28
- const __vue_script__ = script;
29
-
30
- /* template */
31
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-infinite-scroll',{attrs:{"max-list-height":285,"fetched-items":_vm.fetchedItems},on:{"topReached":_vm.topReached},scopedSlots:_vm._u([{key:"header",fn:function(){return [_c('div',{staticClass:"gl-h-6"},[(_vm.isLoading)?_c('gl-loading-icon'):_vm._e()],1)]},proxy:true},{key:"items",fn:function(){return [_c('ul',{staticClass:"list-group list-group-flushed list-unstyled"},_vm._l((_vm.fetchedItems),function(item){return _c('li',{key:item,staticClass:"list-group-item"},[_vm._v("\n Item #"+_vm._s(Math.abs(item - _vm.fetchedItems) + 1)+"\n ")])}),0)]},proxy:true},{key:"default",fn:function(){return [_c('div',{staticClass:"gl-mt-3"},[_c('span',[_vm._v(_vm._s(_vm.fetchedItems)+" items loaded, scroll up for more")])])]},proxy:true}])})};
32
- var __vue_staticRenderFns__ = [];
33
-
34
- /* style */
35
- const __vue_inject_styles__ = undefined;
36
- /* scoped */
37
- const __vue_scope_id__ = undefined;
38
- /* module identifier */
39
- const __vue_module_identifier__ = undefined;
40
- /* functional template */
41
- const __vue_is_functional_template__ = false;
42
- /* style inject */
43
-
44
- /* style inject SSR */
45
-
46
- /* style inject shadow dom */
47
-
48
-
49
-
50
- const __vue_component__ = __vue_normalize__(
51
- { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
52
- __vue_inject_styles__,
53
- __vue_script__,
54
- __vue_scope_id__,
55
- __vue_is_functional_template__,
56
- __vue_module_identifier__,
57
- false,
58
- undefined,
59
- undefined,
60
- undefined
61
- );
62
-
63
- export default __vue_component__;
@@ -1,62 +0,0 @@
1
- import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
2
-
3
- const ITEMS_BATCH_SIZE = 60;
4
- var script = {
5
- data() {
6
- return {
7
- isLoading: false,
8
- fetchedItems: ITEMS_BATCH_SIZE,
9
- loadTimer: null
10
- };
11
- },
12
-
13
- methods: {
14
- bottomReached() {
15
- clearTimeout(this.loadTimer);
16
- this.isLoading = true;
17
- this.loadTimer = setTimeout(() => {
18
- this.fetchedItems += ITEMS_BATCH_SIZE;
19
- this.isLoading = false;
20
- }, 500);
21
- }
22
-
23
- }
24
- };
25
-
26
- /* script */
27
- const __vue_script__ = script;
28
-
29
- /* template */
30
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-infinite-scroll',{attrs:{"max-list-height":285,"fetched-items":_vm.fetchedItems},on:{"bottomReached":_vm.bottomReached},scopedSlots:_vm._u([{key:"items",fn:function(){return [_c('ul',{staticClass:"list-group list-group-flushed list-unstyled"},_vm._l((_vm.fetchedItems),function(item){return _c('li',{key:item,staticClass:"list-group-item"},[_vm._v("Item #"+_vm._s(item))])}),0)]},proxy:true},{key:"default",fn:function(){return [_c('div',{staticClass:"gl-mt-3"},[(_vm.isLoading)?_c('gl-loading-icon'):_c('span',[_vm._v("Showing "+_vm._s(_vm.fetchedItems)+" of 1000+ items")])],1)]},proxy:true}])})};
31
- var __vue_staticRenderFns__ = [];
32
-
33
- /* style */
34
- const __vue_inject_styles__ = undefined;
35
- /* scoped */
36
- const __vue_scope_id__ = undefined;
37
- /* module identifier */
38
- const __vue_module_identifier__ = undefined;
39
- /* functional template */
40
- const __vue_is_functional_template__ = false;
41
- /* style inject */
42
-
43
- /* style inject SSR */
44
-
45
- /* style inject shadow dom */
46
-
47
-
48
-
49
- const __vue_component__ = __vue_normalize__(
50
- { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
51
- __vue_inject_styles__,
52
- __vue_script__,
53
- __vue_scope_id__,
54
- __vue_is_functional_template__,
55
- __vue_module_identifier__,
56
- false,
57
- undefined,
58
- undefined,
59
- undefined
60
- );
61
-
62
- export default __vue_component__;
@@ -1,94 +0,0 @@
1
- import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
2
-
3
- const ITEMS_BATCH_SIZE = 10;
4
- const INIT_ITEMS_COUNT = 20;
5
- const colors = ['Violet', 'Indigo', 'Blue', 'Green', 'Yellow', 'Orange', 'Red'];
6
- const planets = ['Mercury', 'Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn', 'Uranus', 'Neptune'];
7
- let key = 0;
8
-
9
- const createItem = () => {
10
- key += 1;
11
- return {
12
- key,
13
- content: `${colors[key % colors.length]} ${planets[key % planets.length]}`
14
- };
15
- };
16
-
17
- const createArray = num => {
18
- const res = [];
19
-
20
- for (let i = 0; i < num; i += 1) {
21
- res.push(createItem());
22
- }
23
-
24
- return res;
25
- };
26
-
27
- var script = {
28
- data() {
29
- return {
30
- isLoading: false,
31
- fetchedItems: createArray(INIT_ITEMS_COUNT),
32
- loadTimer: null
33
- };
34
- },
35
-
36
- methods: {
37
- topReached() {
38
- clearTimeout(this.loadTimer);
39
- this.isLoading = true;
40
- this.loadTimer = setTimeout(() => {
41
- this.fetchedItems.unshift(...createArray(ITEMS_BATCH_SIZE));
42
- this.isLoading = false;
43
- }, 1000);
44
- },
45
-
46
- bottomReached() {
47
- clearTimeout(this.loadTimer);
48
- this.isLoading = true;
49
- this.loadTimer = setTimeout(() => {
50
- this.fetchedItems.push(...createArray(ITEMS_BATCH_SIZE));
51
- this.isLoading = false;
52
- }, 1000);
53
- }
54
-
55
- }
56
- };
57
-
58
- /* script */
59
- const __vue_script__ = script;
60
-
61
- /* template */
62
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('gl-infinite-scroll',{attrs:{"max-list-height":285,"fetched-items":_vm.fetchedItems.length},on:{"topReached":_vm.topReached,"bottomReached":_vm.bottomReached},scopedSlots:_vm._u([{key:"items",fn:function(){return [_c('ul',{staticClass:"list-group list-group-flushed list-unstyled"},_vm._l((_vm.fetchedItems),function(item){return _c('li',{key:item.key,staticClass:"list-group-item"},[_vm._v("\n "+_vm._s(item.content)+"\n ")])}),0)]},proxy:true},{key:"default",fn:function(){return [_c('div',{staticClass:"gl-mt-3"},[(_vm.isLoading)?_c('gl-loading-icon'):_c('span',[_vm._v(_vm._s(_vm.fetchedItems.length)+" items loaded, scroll up or down for more")])],1)]},proxy:true}])})};
63
- var __vue_staticRenderFns__ = [];
64
-
65
- /* style */
66
- const __vue_inject_styles__ = undefined;
67
- /* scoped */
68
- const __vue_scope_id__ = undefined;
69
- /* module identifier */
70
- const __vue_module_identifier__ = undefined;
71
- /* functional template */
72
- const __vue_is_functional_template__ = false;
73
- /* style inject */
74
-
75
- /* style inject SSR */
76
-
77
- /* style inject shadow dom */
78
-
79
-
80
-
81
- const __vue_component__ = __vue_normalize__(
82
- { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
83
- __vue_inject_styles__,
84
- __vue_script__,
85
- __vue_scope_id__,
86
- __vue_is_functional_template__,
87
- __vue_module_identifier__,
88
- false,
89
- undefined,
90
- undefined,
91
- undefined
92
- );
93
-
94
- export default __vue_component__;
@@ -1,8 +0,0 @@
1
- var description = "## Usage\n\nThe infinite scroll component wraps around a results list and emits a message\n(`bottomReached`) when the bottom of the viewport is reached, which should trigger\na re-fetching. The `gl-infinite-scroll` component expects its parent component to\nmanage the re-fetching.\n\nAdditionally it emits a `topReached` message when the top of the viewport is reached, which\ncan be useful to load items on top of the available data. If only `topReached` is present, the\nviewport will be scrolled to the bottom the first time this component is mounted.\n\n## Public methods\n\nUseful public methods you can call via `$refs`:\n\n- `.scrollUp()`: Scrolls to the top of the container.\n- `.scrollDown()`: Scrolls to the bottom of the container.\n- `.scrollTo({ top })`: Scrolls to a number of pixels along the Y axis of the container.\n\n## Implementation Example\n\nThis is how a full implementation would look like with paginated results from GitLab's\n`projects` API.\n\nIn the component's state, initialize a `pageInfo` object:\n\n```js\npageInfo: {\n currentPage: 0,\n nextPage: 0,\n totalPages: 0,\n totalResults: 0,\n}\n```\n\nWhen fetching for the first time, set the state with the header\ninformation in the mutations:\n\n```html\nVue.set(state.pageInfo, 'currentPage', parseInt(headers['X-Page'], 10));\nVue.set(state.pageInfo, 'nextPage', parseInt(headers['X-Next-Page'], 10));\nVue.set(state.pageInfo, 'totalPages', parseInt(headers['X-Total-Pages'], 10));\nVue.set(state.pageInfo, 'totalResults', parseInt(headers['X-Total'], 10));\n```\n\n_Note: There is a function you can use for parsing integers in headers in\nGitLab called `parseIntPagination` in `common/utils.js`_\n\nEvery time `bottomReached` happens, update the state in your mutations:\n\n```js\nstate.searchResults = state.searchResults.concat(results.data);\nVue.set(state.pageInfo, 'nextPage', parseInt(headers['X-Next-Page'],10));\nVue.set(state.pageInfo, 'totalPages', parseInt(headers['X-Total-Pages'],10));\n```\n\nUse the state to fetch the next page in the actions. In this case, the `Projects`\nAPI allows us to send in a `page` parameter to fetch a certain page from the\nlist of results.\n\n```js\nexport const fetchNextPage = ({ state, dispatch }) => {\n if(state.pageInfo.currentPage < state.pageInfo.totalPages) {\n Api.projects(searchQuery, { page: state.pageInfo.nextPage })\n ...\n }\n};\n```\n\n```html\n<script>\nexportDefault {\n components: {\n GlInfiniteScroll,\n },\n computed: {\n ...mapState([\n 'pageInfo',\n 'searchResults',\n ]),\n },\n methods: {\n ...mapActions([\n 'fetchNextPage',\n ]),\n bottomReached() {\n this.fetchNextPage();\n },\n },\n}\n</script>\n<template>\n <gl-infinite-scroll\n @bottomReached=\"bottomReached\"\n :max-list-height=\"400\"\n :fetched-items=\"searchResults.length\"\n :total-items=\"totalResults\"\n >\n ...Results in a list, another component, etc ....\n </gl-infinite-scroll>\n</template>\n```\n";
2
-
3
- var infinite_scroll_documentation = {
4
- followsDesignSystem: true,
5
- description
6
- };
7
-
8
- export default infinite_scroll_documentation;
@@ -1,13 +0,0 @@
1
- var keyset_pagination = "Pagination is used to help users parse a large number of items on a page,\nwhenever there are too many results to show at once. Pagination breaks up\nresults into several pages with controls for navigating forward and backward, or\nto a specific page.\n\n## Usage\n\nThe simplest way to use `GlKeysetPagination` with a paginated GraphQL response\nis to `v-bind` to the\n[`PageInfo`](https://docs.gitlab.com/ee/api/graphql/reference/#pageinfo) type\nreturned by the endpoint:\n\n```html\n<gl-keyset-pagination v-bind=\"pageInfo\" />\n```\n\nThis is possible because the default field names of the `PageInfo` type align\nwith the `props` of this component.\n\n## Dos and don'ts\n\n**✅ Do** provide the `prevText` and `nextText` props with translatable strings.\nThe default strings (\"Prev\" and \"Next\") are hardcoded in this component and\ncan't be translated.\n\nExample:\n\n```html\n<gl-keyset-pagination v-bind=\"pageInfo\" :prev-text=\"__('Prev')\" :next-text=\"__('Next')\" />\n```\n\n**✅ Do** use this component for paginating GraphQL requests<sup>1</sup> (or any\nendpoint that uses keyset pagination).\n\n**❌ Don't** use this component for paginating REST requests<sup>1</sup> (or any\nendpoint that uses offset pagination).\n\nFor offset pagination, use the [`GlPagination`\ncomponent](/?path=/story/base-pagination--default) instead.\n\nFor more information on the difference between offset and keyset pagination see\n[our documentation on GraphQL\npagination](https://docs.gitlab.com/ee/development/graphql_guide/pagination.html).\n\n<small><sup>1</sup>There's no intrinsic reason why GraphQL endpoints can't\nsupport offset pagination (in fact, [the official\ndocumentation](https://graphql.org/learn/pagination/#pagination-and-edges) shows\nan example offset pagination implementation) or why REST endpoints can't support\nkeyset pagination. This is simply how we've chosen to implement our REST and\nGraphQL endpoints at GitLab.</small>\n\n## Pajamas reference\n\n<https://design.gitlab.com/components/pagination>\n";
2
-
3
- var description = /*#__PURE__*/Object.freeze({
4
- __proto__: null,
5
- 'default': keyset_pagination
6
- });
7
-
8
- var keyset_pagination_documentation = {
9
- description,
10
- followsDesignSystem: true
11
- };
12
-
13
- export default keyset_pagination_documentation;
@@ -1,8 +0,0 @@
1
- import description from './label';
2
-
3
- var label_documentation = {
4
- followsDesignSystem: true,
5
- description
6
- };
7
-
8
- export default label_documentation;