@gitlab/ui 37.0.0 → 37.3.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 (95) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/components/base/drawer/drawer.documentation.js +1 -1
  3. package/dist/components/base/form/form_input_group/form_input_group.documentation.js +2 -26
  4. package/dist/components/base/form/form_input_group/form_input_group.js +7 -0
  5. package/dist/components/base/loading_icon/loading_icon.js +1 -1
  6. package/dist/components/base/pagination/pagination.js +23 -2
  7. package/dist/components/base/path/data.js +2 -1
  8. package/dist/components/base/path/path.js +14 -7
  9. package/dist/components/base/tabs/tab/tab.js +4 -0
  10. package/dist/components/base/tabs/tabs/tabs.documentation.js +2 -14
  11. package/dist/components/base/tabs/tabs/tabs.js +8 -0
  12. package/dist/components/charts/legend/legend.js +12 -0
  13. package/dist/directives/safe_html/safe_html.documentation.js +1 -1
  14. package/dist/directives/safe_link/safe_link.documentation.js +2 -3
  15. package/dist/index.css +1 -1
  16. package/dist/index.css.map +1 -1
  17. package/dist/utility_classes.css +1 -1
  18. package/dist/utility_classes.css.map +1 -1
  19. package/documentation/components_documentation.js +0 -2
  20. package/documentation/documented_stories.js +6 -0
  21. package/package.json +1 -1
  22. package/src/components/base/drawer/drawer.documentation.js +1 -1
  23. package/src/components/base/form/form_input_group/form_input_group.documentation.js +0 -28
  24. package/src/components/base/form/form_input_group/form_input_group.md +0 -4
  25. package/src/components/base/form/form_input_group/form_input_group.stories.js +84 -62
  26. package/src/components/base/form/form_input_group/form_input_group.vue +9 -0
  27. package/src/components/base/loading_icon/loading_icon.vue +1 -1
  28. package/src/components/base/pagination/pagination.spec.js +12 -2
  29. package/src/components/base/pagination/pagination.vue +23 -6
  30. package/src/components/base/path/__snapshots__/path.spec.js.snap +6 -0
  31. package/src/components/base/path/data.js +1 -0
  32. package/src/components/base/path/path.scss +6 -1
  33. package/src/components/base/path/path.spec.js +20 -0
  34. package/src/components/base/path/path.vue +18 -7
  35. package/src/components/base/tabs/tab/tab.vue +4 -0
  36. package/src/components/base/tabs/tabs/tabs.documentation.js +0 -12
  37. package/src/components/base/tabs/tabs/tabs.md +2 -7
  38. package/src/components/base/tabs/tabs/tabs.stories.js +219 -161
  39. package/src/components/base/tabs/tabs/tabs.vue +6 -0
  40. package/src/components/charts/legend/legend.stories.js +22 -15
  41. package/src/components/charts/legend/legend.vue +9 -0
  42. package/src/directives/safe_html/safe_html.md +0 -4
  43. package/src/directives/safe_html/safe_html.stories.js +53 -44
  44. package/src/directives/safe_link/safe_link.documentation.js +0 -1
  45. package/src/directives/safe_link/safe_link.md +0 -4
  46. package/src/directives/safe_link/safe_link.stories.js +31 -30
  47. package/src/scss/utilities.scss +8 -0
  48. package/src/scss/utility-mixins/background.scss +4 -0
  49. package/dist/components/base/form/form_input_group/examples/form_input_group.basic.example.js +0 -38
  50. package/dist/components/base/form/form_input_group/examples/form_input_group.predefined_options.example.js +0 -54
  51. package/dist/components/base/form/form_input_group/examples/form_input_group.predefined_reactive.example.js +0 -55
  52. package/dist/components/base/form/form_input_group/examples/form_input_group.reactive.example.js +0 -48
  53. package/dist/components/base/form/form_input_group/examples/index.js +0 -27
  54. package/dist/components/base/tabs/tab/examples/index.js +0 -13
  55. package/dist/components/base/tabs/tab/examples/tab.basic.example.js +0 -38
  56. package/dist/components/base/tabs/tab/tab.documentation.js +0 -18
  57. package/dist/components/base/tabs/tabs/examples/index.js +0 -60
  58. package/dist/components/base/tabs/tabs/examples/tabs.basic.example.js +0 -38
  59. package/dist/components/base/tabs/tabs/examples/tabs.contentless_tab.example.js +0 -38
  60. package/dist/components/base/tabs/tabs/examples/tabs.counterbadges.example.js +0 -38
  61. package/dist/components/base/tabs/tabs/examples/tabs.custom_title.example.js +0 -38
  62. package/dist/components/base/tabs/tabs/examples/tabs.disabled.example.js +0 -38
  63. package/dist/components/base/tabs/tabs/examples/tabs.justified.example.js +0 -38
  64. package/dist/components/base/tabs/tabs/examples/tabs.no_tabs.example.js +0 -38
  65. package/dist/components/base/tabs/tabs/examples/tabs.scrollable.example.js +0 -47
  66. package/dist/components/base/tabs/tabs/examples/tabs.styles_only.example.js +0 -38
  67. package/dist/components/charts/legend/examples/index.js +0 -22
  68. package/dist/components/charts/legend/examples/legend.basic.example.js +0 -93
  69. package/dist/components/charts/legend/examples/legend.toggled.example.js +0 -100
  70. package/dist/components/charts/legend/legend.documentation.js +0 -21
  71. package/src/components/base/form/form_input_group/examples/form_input_group.basic.example.vue +0 -10
  72. package/src/components/base/form/form_input_group/examples/form_input_group.predefined_options.example.vue +0 -25
  73. package/src/components/base/form/form_input_group/examples/form_input_group.predefined_reactive.example.vue +0 -32
  74. package/src/components/base/form/form_input_group/examples/form_input_group.reactive.example.vue +0 -25
  75. package/src/components/base/form/form_input_group/examples/index.js +0 -32
  76. package/src/components/base/tabs/tab/examples/index.js +0 -15
  77. package/src/components/base/tabs/tab/examples/tab.basic.example.vue +0 -5
  78. package/src/components/base/tabs/tab/tab.documentation.js +0 -16
  79. package/src/components/base/tabs/tab/tab.md +0 -3
  80. package/src/components/base/tabs/tab/tab.stories.js +0 -12
  81. package/src/components/base/tabs/tabs/examples/index.js +0 -72
  82. package/src/components/base/tabs/tabs/examples/tabs.basic.example.vue +0 -6
  83. package/src/components/base/tabs/tabs/examples/tabs.contentless_tab.example.vue +0 -17
  84. package/src/components/base/tabs/tabs/examples/tabs.counterbadges.example.vue +0 -28
  85. package/src/components/base/tabs/tabs/examples/tabs.custom_title.example.vue +0 -9
  86. package/src/components/base/tabs/tabs/examples/tabs.disabled.example.vue +0 -7
  87. package/src/components/base/tabs/tabs/examples/tabs.justified.example.vue +0 -6
  88. package/src/components/base/tabs/tabs/examples/tabs.no_tabs.example.vue +0 -8
  89. package/src/components/base/tabs/tabs/examples/tabs.scrollable.example.vue +0 -20
  90. package/src/components/base/tabs/tabs/examples/tabs.styles_only.example.vue +0 -22
  91. package/src/components/charts/legend/examples/index.js +0 -27
  92. package/src/components/charts/legend/examples/legend.basic.example.vue +0 -55
  93. package/src/components/charts/legend/examples/legend.toggled.example.vue +0 -60
  94. package/src/components/charts/legend/legend.documentation.js +0 -19
  95. package/src/components/charts/legend/legend.md +0 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ # [37.3.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v37.2.0...v37.3.0) (2022-03-03)
2
+
3
+
4
+ ### Features
5
+
6
+ * **css:** Add gl-bg-purple-50 util class ([29acbbb](https://gitlab.com/gitlab-org/gitlab-ui/commit/29acbbbe7726f763b0e7ba86dc4de74db45a545e))
7
+
8
+ # [37.2.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v37.1.0...v37.2.0) (2022-03-03)
9
+
10
+
11
+ ### Features
12
+
13
+ * **GlPath:** allow changing selected index programmatically ([d711441](https://gitlab.com/gitlab-org/gitlab-ui/commit/d71144162363ae62ff4d1aeb3ee3dc956bd04108))
14
+
15
+ # [37.1.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v37.0.0...v37.1.0) (2022-02-28)
16
+
17
+
18
+ ### Features
19
+
20
+ * **GlPagination:** Add aria-current="page" on active page ([58b8993](https://gitlab.com/gitlab-org/gitlab-ui/commit/58b89935c32845406d85ce5898c501908e25d8ff))
21
+
1
22
  # [37.0.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v36.7.1...v37.0.0) (2022-02-22)
2
23
 
3
24
 
@@ -1,7 +1,7 @@
1
1
  var description = "The drawer is used to show more information about a certain resource in the UI and potentially\nhandle actions on the information.\n\n### By default\n\n```html\n<gl-drawer :open=\"open\" @close=\"close\">\n <template #header>Your Title</template>\n <template>\n ...children\n </template>\n</gl-drawer>\n```\n\n- `v-bind:open` will be a boolean you will pass to `gl-drawer` and `@close` is a listener that will\nbe a function that will toggle open to `false`.\n";
2
2
 
3
3
  var drawer_documentation = {
4
- followsDesignSystem: false,
4
+ followsDesignSystem: true,
5
5
  description
6
6
  };
7
7
 
@@ -1,32 +1,8 @@
1
- import examples from './examples';
2
-
3
- var description = "# Form Group Input\n\n<!-- STORY -->\n\nThe `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";
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";
4
2
 
5
3
  var form_input_group_documentation = {
6
4
  followsDesignSystem: false,
7
- description,
8
- examples,
9
- bootstrapComponent: 'b-form-input',
10
- propsInfo: {
11
- 'select-on-click': {
12
- type: Boolean,
13
- additionalInfo: 'Automatically selects the content of the input field on click'
14
- },
15
- 'predefined-options': {
16
- type: Array,
17
- additionalInfo: 'Array of options. Each option should have `name` and `value` information: {name: "Foo", value: "Bar"})'
18
- }
19
- },
20
- slots: [{
21
- name: 'default',
22
- description: 'Allows replacement of default input field.'
23
- }, {
24
- name: 'prepend',
25
- description: 'Is rendered in front of the input field.'
26
- }, {
27
- name: 'append',
28
- description: 'Is rendered after the input field.'
29
- }]
5
+ description
30
6
  };
31
7
 
32
8
  export default form_input_group_documentation;
@@ -16,11 +16,18 @@ var script = {
16
16
  },
17
17
  mixins: [InputGroupMixin],
18
18
  props: {
19
+ /**
20
+ * Automatically selects the content of the input field on click.
21
+ */
19
22
  selectOnClick: {
20
23
  type: Boolean,
21
24
  required: false,
22
25
  default: false
23
26
  },
27
+
28
+ /**
29
+ * Array of options. Each option should have `name` and `value` information: {name: "Foo", value: "Bar"})
30
+ */
24
31
  predefinedOptions: {
25
32
  type: Array,
26
33
  required: false,
@@ -67,7 +67,7 @@ var script = {
67
67
  const __vue_script__ = script;
68
68
 
69
69
  /* template */
70
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c(_vm.rootElementType,{tag:"component",staticClass:"gl-spinner-container",attrs:{"role":"status"}},[_c('span',{staticClass:"align-text-bottom",class:_vm.cssClasses,attrs:{"aria-label":_vm.label}})])};
70
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c(_vm.rootElementType,{tag:"component",staticClass:"gl-spinner-container",attrs:{"role":"status"}},[_c('span',{staticClass:"gl-vertical-align-text-bottom!",class:_vm.cssClasses,attrs:{"aria-label":_vm.label}})])};
71
71
  var __vue_staticRenderFns__ = [];
72
72
 
73
73
  /* style */
@@ -277,6 +277,26 @@ var script = {
277
277
 
278
278
  nextPageIsDisabled() {
279
279
  return this.pageIsDisabled(this.value + 1);
280
+ },
281
+
282
+ prevPageAriaLabel() {
283
+ return this.prevPageIsDisabled ? false : this.labelPrevPage || this.labelPage(this.value - 1);
284
+ },
285
+
286
+ nextPageAriaLabel() {
287
+ return this.nextPageIsDisabled ? false : this.labelNextPage || this.labelPage(this.value + 1);
288
+ },
289
+
290
+ prevPageHref() {
291
+ if (this.prevPageIsDisabled) return false;
292
+ if (this.isLinkBased) return this.linkGen(this.value - 1);
293
+ return '#';
294
+ },
295
+
296
+ nextPageHref() {
297
+ if (this.nextPageIsDisabled) return false;
298
+ if (this.isLinkBased) return this.linkGen(this.value + 1);
299
+ return '#';
280
300
  }
281
301
 
282
302
  },
@@ -313,6 +333,7 @@ var script = {
313
333
 
314
334
  if (isActivePage) {
315
335
  attrs.class.push('active');
336
+ attrs['aria-current'] = 'page';
316
337
  } // Disable previous and/or next buttons if needed
317
338
 
318
339
 
@@ -391,13 +412,13 @@ const __vue_script__ = script;
391
412
  var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.isVisible)?_c('ul',{staticClass:"pagination gl-pagination text-nowrap",class:_vm.wrapperClasses,attrs:{"role":"navigation","aria-label":"Pagination"}},[_c('li',{staticClass:"page-item",class:{
392
413
  disabled: _vm.prevPageIsDisabled,
393
414
  'flex-fill': _vm.isFillAlign,
394
- }},[_c(_vm.prevPageIsDisabled ? 'span' : 'a',{tag:"component",staticClass:"gl-link page-link prev-page-item gl-display-flex",attrs:{"aria-disabled":_vm.prevPageIsDisabled,"aria-label":_vm.labelPrevPage || _vm.labelPage(_vm.value - 1),"href":_vm.isLinkBased ? _vm.linkGen(_vm.value - 1) : '#'},on:{"click":function($event){return _vm.handlePrevious($event, _vm.value - 1)}}},[_vm._t("previous",[_c('gl-icon',{attrs:{"name":"chevron-left"}}),_vm._v(" "),_c('span',[_vm._v(_vm._s(_vm.prevText))])],null,{ page: _vm.value - 1, disabled: _vm.prevPageIsDisabled })],2)],1),_vm._v(" "),_vm._l((_vm.visibleItems),function(item){return _c('li',{key:item.key,staticClass:"page-item",class:{
415
+ },attrs:{"aria-hidden":_vm.prevPageIsDisabled}},[_c(_vm.prevPageIsDisabled ? 'span' : 'a',{tag:"component",staticClass:"gl-link page-link prev-page-item gl-display-flex",attrs:{"aria-label":_vm.prevPageAriaLabel,"href":_vm.prevPageHref},on:{"click":function($event){return _vm.handlePrevious($event, _vm.value - 1)}}},[_vm._t("previous",[_c('gl-icon',{attrs:{"name":"chevron-left"}}),_vm._v(" "),_c('span',[_vm._v(_vm._s(_vm.prevText))])],null,{ page: _vm.value - 1, disabled: _vm.prevPageIsDisabled })],2)],1),_vm._v(" "),_vm._l((_vm.visibleItems),function(item){return _c('li',{key:item.key,staticClass:"page-item",class:{
395
416
  disabled: item.disabled,
396
417
  'flex-fill': _vm.isFillAlign,
397
418
  }},[_c(item.component,_vm._g(_vm._b({tag:"component",staticClass:"page-link",attrs:{"size":"md","aria-disabled":item.disabled}},'component',item.attrs,false),item.listeners),[_vm._t(item.slot,[_vm._v(_vm._s(item.content))],null,item.slotData)],2)],1)}),_vm._v(" "),_c('li',{staticClass:"page-item",class:{
398
419
  disabled: _vm.nextPageIsDisabled,
399
420
  'flex-fill': _vm.isFillAlign,
400
- }},[_c(_vm.nextPageIsDisabled ? 'span' : 'a',{tag:"component",staticClass:"gl-link page-link next-page-item gl-display-flex",attrs:{"aria-disabled":_vm.nextPageIsDisabled,"aria-label":_vm.labelNextPage || _vm.labelPage(_vm.value + 1),"href":_vm.isLinkBased ? _vm.linkGen(_vm.value + 1) : '#'},on:{"click":function($event){return _vm.handleNext($event, _vm.value + 1)}}},[_vm._t("next",[_c('span',[_vm._v(_vm._s(_vm.nextText))]),_vm._v(" "),_c('gl-icon',{attrs:{"name":"chevron-right"}})],null,{ page: _vm.value + 1, disabled: _vm.nextPageIsDisabled })],2)],1)],2):_vm._e()};
421
+ },attrs:{"aria-hidden":_vm.nextPageIsDisabled}},[_c(_vm.nextPageIsDisabled ? 'span' : 'a',{tag:"component",staticClass:"gl-link page-link next-page-item gl-display-flex",attrs:{"aria-label":_vm.nextPageAriaLabel,"href":_vm.nextPageHref},on:{"click":function($event){return _vm.handleNext($event, _vm.value + 1)}}},[_vm._t("next",[_c('span',[_vm._v(_vm._s(_vm.nextText))]),_vm._v(" "),_c('gl-icon',{attrs:{"name":"chevron-right"}})],null,{ page: _vm.value + 1, disabled: _vm.nextPageIsDisabled })],2)],1)],2):_vm._e()};
401
422
  var __vue_staticRenderFns__ = [];
402
423
 
403
424
  /* style */
@@ -21,7 +21,8 @@ const mockPathItems = [{
21
21
  metric: '7d'
22
22
  }, {
23
23
  title: 'Eighth',
24
- metric: '8d'
24
+ metric: '8d',
25
+ disabled: true
25
26
  }, {
26
27
  title: 'Ninth',
27
28
  metric: '9d'
@@ -21,9 +21,10 @@ var script = {
21
21
  * A list of path items in the form:
22
22
  * ```
23
23
  * {
24
- * title: String, required
25
- * metric: Any, optional
26
- * icon: String, optional
24
+ * title: String, required
25
+ * metric: Any, optional
26
+ * icon: String, optional
27
+ * disabled: Boolean, optional
27
28
  * }
28
29
  * ```
29
30
  */
@@ -88,10 +89,16 @@ var script = {
88
89
  }
89
90
 
90
91
  },
92
+ watch: {
93
+ items: {
94
+ immediate: true,
95
+
96
+ handler(items) {
97
+ const selectedIndex = items.findIndex(item => item.selected);
98
+ this.selectedIndex = selectedIndex > 0 ? selectedIndex : 0;
99
+ }
91
100
 
92
- mounted() {
93
- const selectedIndex = this.items.findIndex(item => item.selected);
94
- this.selectedIndex = selectedIndex > 0 ? selectedIndex : 0;
101
+ }
95
102
  },
96
103
 
97
104
  beforeCreate() {
@@ -174,7 +181,7 @@ var script = {
174
181
  const __vue_script__ = script;
175
182
 
176
183
  /* template */
177
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:"gl-resize-observer-directive",rawName:"v-gl-resize-observer-directive",value:(_vm.handleResize),expression:"handleResize"}],staticClass:"gl-path-nav",style:({ '--path-bg-color': _vm.backgroundColor }),attrs:{"data-testid":"gl-path-nav"}},[_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.displayScrollLeft),expression:"displayScrollLeft"}],staticClass:"gl-path-fade gl-path-fade-left"},[_c('button',{staticClass:"gl-clear-icon-button",attrs:{"aria-label":"Scroll left"},on:{"click":_vm.scrollPathLeft}},[_c('gl-icon',{attrs:{"size":32,"name":"chevron-left"}})],1)]),_vm._v(" "),_c('ul',{ref:"pathNavList",staticClass:"gl-path-nav-list"},_vm._l((_vm.items),function(item,index){return _c('li',{key:index,ref:"pathListItems",refInFor:true,staticClass:"gl-path-nav-list-item",attrs:{"id":_vm.pathId(index)}},[_c('button',{class:_vm.pathItemClass(index),on:{"click":function($event){return _vm.onItemClicked(index)}}},[(_vm.shouldDisplayIcon(item.icon))?_c('gl-icon',{staticClass:"gl-mr-2",attrs:{"name":item.icon,"data-testid":"gl-path-item-icon"}}):_vm._e(),_vm._v("\n "+_vm._s(item.title)),(item.metric)?_c('span',{staticClass:"gl-font-weight-normal gl-pl-2"},[_vm._v(_vm._s(item.metric))]):_vm._e()],1),_vm._v(" "),_vm._t("default",null,{"pathItem":item,"pathId":_vm.pathId(index)})],2)}),0),_vm._v(" "),_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.displayScrollRight),expression:"displayScrollRight"}],staticClass:"gl-path-fade gl-path-fade-right"},[_c('button',{staticClass:"gl-clear-icon-button",attrs:{"aria-label":"Scroll right"},on:{"click":_vm.scrollPathRight}},[_c('gl-icon',{attrs:{"size":32,"name":"chevron-right"}})],1)])])};
184
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{directives:[{name:"gl-resize-observer-directive",rawName:"v-gl-resize-observer-directive",value:(_vm.handleResize),expression:"handleResize"}],staticClass:"gl-path-nav",style:({ '--path-bg-color': _vm.backgroundColor }),attrs:{"data-testid":"gl-path-nav"}},[_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.displayScrollLeft),expression:"displayScrollLeft"}],staticClass:"gl-path-fade gl-path-fade-left"},[_c('button',{staticClass:"gl-clear-icon-button",attrs:{"aria-label":"Scroll left"},on:{"click":_vm.scrollPathLeft}},[_c('gl-icon',{attrs:{"size":32,"name":"chevron-left"}})],1)]),_vm._v(" "),_c('ul',{ref:"pathNavList",staticClass:"gl-path-nav-list"},_vm._l((_vm.items),function(item,index){return _c('li',{key:index,ref:"pathListItems",refInFor:true,staticClass:"gl-path-nav-list-item",attrs:{"id":_vm.pathId(index)}},[_c('button',{class:_vm.pathItemClass(index),attrs:{"category":item.disabled ? 'tertiary' : undefined,"disabled":item.disabled},on:{"click":function($event){return _vm.onItemClicked(index)}}},[(_vm.shouldDisplayIcon(item.icon))?_c('gl-icon',{staticClass:"gl-mr-2",attrs:{"name":item.icon,"data-testid":"gl-path-item-icon"}}):_vm._e(),_vm._v("\n "+_vm._s(item.title)),(item.metric)?_c('span',{staticClass:"gl-font-weight-normal gl-pl-2"},[_vm._v(_vm._s(item.metric))]):_vm._e()],1),_vm._v(" "),_vm._t("default",null,{"pathItem":item,"pathId":_vm.pathId(index)})],2)}),0),_vm._v(" "),_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.displayScrollRight),expression:"displayScrollRight"}],staticClass:"gl-path-fade gl-path-fade-right"},[_c('button',{staticClass:"gl-clear-icon-button",attrs:{"aria-label":"Scroll right"},on:{"click":_vm.scrollPathRight}},[_c('gl-icon',{attrs:{"size":32,"name":"chevron-right"}})],1)])])};
178
185
  var __vue_staticRenderFns__ = [];
179
186
 
180
187
  /* style */
@@ -15,6 +15,10 @@ var script = {
15
15
  required: false,
16
16
  default: ''
17
17
  },
18
+
19
+ /**
20
+ * Query string parameter value to use when `gl-tabs` `sync-active-tab-with-query-params` prop is set to `true`.
21
+ */
18
22
  queryParamValue: {
19
23
  type: String,
20
24
  required: false,
@@ -1,20 +1,8 @@
1
- import examples from './examples';
2
-
3
- var description = "# Tabs\n\n<!-- STORY -->\n## Usage\n\nTabs are used to divide content into meaningful, related sections. Tabs allow users to focus on one\nspecific view at a time while maintaining sight of all the relevant content options available. Each\ntab, when active, will reveal it’s own unique content.\n\n## Using the component Vue\n\n~~~js\n<gl-tabs>\n <gl-tab title=\"Tab 1\">\n Tab panel 1\n </gl-tab>\n <gl-tab title=\"Tab 2\">\n Tab panel 2\n </gl-tab>\n</gl-tabs>\n~~~\n\n## Using the component HTML\n\n~~~js\n<div class=\"tabs gl-tabs\">\n <ul role=\"tablist\" class=\"nav gl-tabs-nav\">\n <li role=\"presentation\" class=\"nav-item\">\n <a\n role=\"tab\"\n target=\"_self\"\n href=\"#\"\n class=\"nav-link gl-tab-nav-item gl-tab-nav-item-active gl-tab-nav-item-active-indigo\"\n >Tab 1</a>\n </li>\n <li role=\"presentation\" class=\"nav-item\">\n <a role=\"tab\" target=\"_self\" href=\"#\" class=\"nav-link gl-tab-nav-item\">Tab 2</a>\n </li>\n </ul>\n <div class=\"tab-content gl-tab-content\">\n <div role=\"tabpanel\" class=\"tab-pane gl-tab-content active\">Tab panel 1</div>\n <div role=\"tabpanel\" class=\"tab-pane gl-tab-content\">Tab panel 2</div>\n </div>\n</div>\n~~~\n\n## Adding Action Buttons to the Tabs\n\nTabs start and end slot can be populated via props: `action-primary`, `action-secondary` and\n`action-tertiary`. These props allow you to handle how a primary, secondary and tertiary button will\nbehave and look. The props receive an object as such:\n\n~~~js\n{\n text: 'Save Changes',\n attributes: [\n { variant: 'info' },\n { disabled: this.someState },\n { class: 'some-class' },\n ...\n ]\n}\n~~~\n\n## Scrollable tab buttons\n\nBy default, `GlTab` will wrap tab buttons when they overflow the container. To\nenable horizontally scrolling for the tab buttons, use the `GlScrollableTabs`\ncomponent. This is a separate Vue component because of some limitations:\n\n- The action props (e.g., `action-primary`) are not respected in `GlScrollableTabs`. At the\n moment, BootstrapVue does not provide a reliable way for us to achieve this desired combination.\n\n`GlScrollableTabs` composes `GlTabs` and passes through every listener, slot, or prop (with the above\nexceptions).\n\n~~~html\n<gl-scrollable-tabs>\n <gl-tab v-for=\"tab in tabs\" :key=\"tab.key\" :title=\"tab.title\"> {{ tab.content }} </gl-tab>\n</gl-scrollable-tabs>\n~~~\n";
1
+ var description = "Tabs are used to divide content into meaningful, related sections. Tabs allow users to focus on one\nspecific view at a time while maintaining sight of all the relevant content options available. Each\ntab, when active, will reveal it’s own unique content.\n\n## Using the component Vue\n\n~~~html\n<gl-tabs>\n <gl-tab title=\"Tab 1\">\n Tab panel 1\n </gl-tab>\n <gl-tab title=\"Tab 2\">\n Tab panel 2\n </gl-tab>\n</gl-tabs>\n~~~\n\n## Using the component HTML\n\n~~~html\n<div class=\"tabs gl-tabs\">\n <ul role=\"tablist\" class=\"nav gl-tabs-nav\">\n <li role=\"presentation\" class=\"nav-item\">\n <a\n role=\"tab\"\n target=\"_self\"\n href=\"#\"\n class=\"nav-link gl-tab-nav-item gl-tab-nav-item-active gl-tab-nav-item-active-indigo\"\n >Tab 1</a>\n </li>\n <li role=\"presentation\" class=\"nav-item\">\n <a role=\"tab\" target=\"_self\" href=\"#\" class=\"nav-link gl-tab-nav-item\">Tab 2</a>\n </li>\n </ul>\n <div class=\"tab-content gl-tab-content\">\n <div role=\"tabpanel\" class=\"tab-pane gl-tab-content active\">Tab panel 1</div>\n <div role=\"tabpanel\" class=\"tab-pane gl-tab-content\">Tab panel 2</div>\n </div>\n</div>\n~~~\n\n## Adding Action Buttons to the Tabs\n\nTabs start and end slot can be populated via props: `action-primary`, `action-secondary` and\n`action-tertiary`. These props allow you to handle how a primary, secondary and tertiary button will\nbehave and look. The props receive an object as such:\n\n~~~js\n{\n text: 'Save Changes',\n attributes: [\n { variant: 'info' },\n { disabled: this.someState },\n { class: 'some-class' },\n ...\n ]\n}\n~~~\n\n## Scrollable tab buttons\n\nBy default, `GlTab` will wrap tab buttons when they overflow the container. To\nenable horizontally scrolling for the tab buttons, use the `GlScrollableTabs`\ncomponent. This is a separate Vue component because of some limitations:\n\n- The action props (e.g., `action-primary`) are not respected in `GlScrollableTabs`. At the\n moment, BootstrapVue does not provide a reliable way for us to achieve this desired combination.\n\n`GlScrollableTabs` composes `GlTabs` and passes through every listener, slot, or prop (with the above\nexceptions).\n\n~~~html\n<gl-scrollable-tabs>\n <gl-tab v-for=\"tab in tabs\" :key=\"tab.key\" :title=\"tab.title\"> {{ tab.content }} </gl-tab>\n</gl-scrollable-tabs>\n~~~\n";
4
2
 
5
3
  var tabs_documentation = {
6
4
  description,
7
- examples,
8
- bootstrapComponent: 'b-tabs',
9
- followsDesignSystem: true,
10
- propsInfo: {
11
- syncActiveTabWithQueryParams: {
12
- additionalInfo: 'Sync active tab with query string parameters. Allows for deep linking into specific tabs.'
13
- },
14
- queryParamName: {
15
- additionalInfo: 'Name to use for query string parameter.'
16
- }
17
- }
5
+ followsDesignSystem: true
18
6
  };
19
7
 
20
8
  export default tabs_documentation;
@@ -45,11 +45,19 @@ var script = {
45
45
  required: false,
46
46
  default: false
47
47
  },
48
+
49
+ /**
50
+ * Sync active tab with query string parameters. Allows for deep linking into specific tabs.
51
+ */
48
52
  syncActiveTabWithQueryParams: {
49
53
  type: Boolean,
50
54
  required: false,
51
55
  default: false
52
56
  },
57
+
58
+ /**
59
+ * Name to use for query string parameter.
60
+ */
53
61
  queryParamName: {
54
62
  type: String,
55
63
  required: false,
@@ -37,6 +37,10 @@ var script = {
37
37
  required: false,
38
38
  default: () => ({})
39
39
  },
40
+
41
+ /**
42
+ * Text for data average (overridden by prop if needed for internationalization)
43
+ */
40
44
  averageText: {
41
45
  type: String,
42
46
  required: false,
@@ -52,11 +56,19 @@ var script = {
52
56
  required: false,
53
57
  default: LEGEND_MIN_TEXT
54
58
  },
59
+
60
+ /**
61
+ * Text for max amount (overridden by prop if needed for internationalization)
62
+ */
55
63
  maxText: {
56
64
  type: String,
57
65
  required: false,
58
66
  default: LEGEND_MAX_TEXT
59
67
  },
68
+
69
+ /**
70
+ * Sets the display layout
71
+ */
60
72
  layout: {
61
73
  type: String,
62
74
  required: false,
@@ -1,4 +1,4 @@
1
- var description = "# Safe Html\n\nA Vue Directive to sanitize HTML to avoid any XSS vulnerabilities.\n\n<!-- STORY -->\n\n## Usage\n\nThis directive can be used to sanitize HTML code which may contain user input, to prevent cross-site\nscripting (XSS) vulnerabilities.\n\nUnder the hood, it uses [DOMPurify](https://github.com/cure53/DOMPurify) to sanitize the provided HTML.\n\nDOMPurify will strip out dangerous HTML and will keep the safe HTML. You can refer complete list of\n[tags][1] and [attributes][2] allowed by DOMPurify.\n\n[1]: https://github.com/cure53/DOMPurify/blob/main/src/tags.js\n[2]: https://github.com/cure53/DOMPurify/blob/main/src/attrs.js\n\n## Example\n\n```html\n<script>\nimport { GlSafeHtmlDirective as SafeHtml } from '@gitlab/ui';\n\nexport default {\n directives: {\n SafeHtml,\n },\n data() {\n return {\n rawHtml: \"Hello! <script>alert('XSS')</script>\",\n };\n },\n};\n</script>\n\n<template>\n <div v-safe-html=\"rawHtml\"></div>\n</template>\n```\n\n## Advanced configuration\n\n```js\n// It allows only <b> tags\nconst config = { ALLOWED_TAGS: ['b'] };\n\n// It doesn't allow any html tags\nconst config = { ALLOWED_TAGS: [] };\n```\n\n```html\n<div v-safe-html:[config]=\"rawHtml\"></div>\n```\n\nFor advanced configuration options, please refer to [DOMPurify's documentation](https://github.com/cure53/DOMPurify#can-i-configure-dompurify).\n\n### Notes\n\n1. `target` attribute is not allowed by default - See <https://gitlab.com/gitlab-org/gitlab-ui/-/issues/1427>.\n1. To know more about other tips & caveats - See <https://gitlab.com/groups/gitlab-org/-/epics/4273#caveats>.\n";
1
+ var description = "A Vue Directive to sanitize HTML to avoid any XSS vulnerabilities.\n\n## Usage\n\nThis directive can be used to sanitize HTML code which may contain user input, to prevent cross-site\nscripting (XSS) vulnerabilities.\n\nUnder the hood, it uses [DOMPurify](https://github.com/cure53/DOMPurify) to sanitize the provided HTML.\n\nDOMPurify will strip out dangerous HTML and will keep the safe HTML. You can refer complete list of\n[tags][1] and [attributes][2] allowed by DOMPurify.\n\n[1]: https://github.com/cure53/DOMPurify/blob/main/src/tags.js\n[2]: https://github.com/cure53/DOMPurify/blob/main/src/attrs.js\n\n## Example\n\n```html\n<script>\nimport { GlSafeHtmlDirective as SafeHtml } from '@gitlab/ui';\n\nexport default {\n directives: {\n SafeHtml,\n },\n data() {\n return {\n rawHtml: \"Hello! <script>alert('XSS')</script>\",\n };\n },\n};\n</script>\n\n<template>\n <div v-safe-html=\"rawHtml\"></div>\n</template>\n```\n\n## Advanced configuration\n\n```js\n// It allows only <b> tags\nconst config = { ALLOWED_TAGS: ['b'] };\n\n// It doesn't allow any html tags\nconst config = { ALLOWED_TAGS: [] };\n```\n\n```html\n<div v-safe-html:[config]=\"rawHtml\"></div>\n```\n\nFor advanced configuration options, please refer to [DOMPurify's documentation](https://github.com/cure53/DOMPurify#can-i-configure-dompurify).\n\n### Notes\n\n1. `target` attribute is not allowed by default - See <https://gitlab.com/gitlab-org/gitlab-ui/-/issues/1427>.\n1. To know more about other tips & caveats - See <https://gitlab.com/groups/gitlab-org/-/epics/4273#caveats>.\n";
2
2
 
3
3
  var safe_html_documentation = {
4
4
  followsDesignSystem: false,
@@ -1,9 +1,8 @@
1
- var description = "# Safe Link Directive\n\nA Vue directive to make the hyperlinks secure by default.\n\n<!-- STORY -->\n\n## Security measures\n\n### rel\n\nWhen setting target to `_blank`, the rel attribute gets set automatically to `noopener noreferrer`,\nthis is done to avoid the `window.opener` [API exploit]. If you set the `rel` attribute manually,\nthis will overwrite the aforementioned logic.\n\n### href\n\nThis directive enforces \"safe\" URLs. What this means is that, if the provided `href`\ndoesn't point to a safe protocol (one of `http:`, `https:`, `mailto:` or `ftp:`), then it is\nreplaced with `about:blank` to prevent [URL injections].\n\n```html\n<script>\nimport { GlSafeLinkDirective as SafeLink } from '@gitlab/ui';\n\nexport default {\n data() {\n return {\n url: 'javascript:alert(1)',\n };\n },\n directives: { SafeLink },\n};\n</script>\n<template>\n <a v-safe-link href=\"url\" target=\"_blank\">Click</a>\n <!-- Renders to: <a href=\"about:blank\" target=\"_blank\">Click</a> -->\n</template>\n```\n\n[API exploit]: https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/\n[URL injections]: https://vuejs.org/v2/guide/security.html#Injecting-URLs\n";
1
+ var description = "A Vue directive to make the hyperlinks secure by default.\n\n## Security measures\n\n### rel\n\nWhen setting target to `_blank`, the rel attribute gets set automatically to `noopener noreferrer`,\nthis is done to avoid the `window.opener` [API exploit]. If you set the `rel` attribute manually,\nthis will overwrite the aforementioned logic.\n\n### href\n\nThis directive enforces \"safe\" URLs. What this means is that, if the provided `href`\ndoesn't point to a safe protocol (one of `http:`, `https:`, `mailto:` or `ftp:`), then it is\nreplaced with `about:blank` to prevent [URL injections].\n\n```html\n<script>\nimport { GlSafeLinkDirective as SafeLink } from '@gitlab/ui';\n\nexport default {\n data() {\n return {\n url: 'javascript:alert(1)',\n };\n },\n directives: { SafeLink },\n};\n</script>\n<template>\n <a v-safe-link href=\"url\" target=\"_blank\">Click</a>\n <!-- Renders to: <a href=\"about:blank\" target=\"_blank\">Click</a> -->\n</template>\n```\n\n[API exploit]: https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/\n[URL injections]: https://vuejs.org/v2/guide/security.html#Injecting-URLs\n";
2
2
 
3
3
  var safe_link_documentation = {
4
4
  followsDesignSystem: false,
5
- description,
6
- examples: false
5
+ description
7
6
  };
8
7
 
9
8
  export default safe_link_documentation;