@gitlab/ui 33.1.1 → 35.1.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 (79) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/components/base/accordion/accordion.js +6 -2
  3. package/dist/components/base/accordion/accordion_item.js +2 -2
  4. package/dist/components/base/avatars_inline/avatars_inline.documentation.js +1 -1
  5. package/dist/components/base/avatars_inline/avatars_inline.js +5 -1
  6. package/dist/components/base/nav/nav.documentation.js +2 -7
  7. package/dist/components/base/tabs/tabs/tabs.documentation.js +1 -1
  8. package/dist/components/base/tabs/tabs/tabs.js +2 -12
  9. package/dist/components/utilities/truncate/truncate.documentation.js +2 -17
  10. package/dist/components/utilities/truncate/truncate.js +11 -0
  11. package/dist/index.css +1 -1
  12. package/dist/index.css.map +1 -1
  13. package/dist/utility_classes.css +1 -1
  14. package/dist/utility_classes.css.map +1 -1
  15. package/documentation/components_documentation.js +0 -2
  16. package/documentation/documented_stories.js +4 -0
  17. package/package.json +13 -13
  18. package/src/components/base/accordion/accordion.vue +5 -2
  19. package/src/components/base/accordion/accordion_item.spec.js +2 -2
  20. package/src/components/base/accordion/accordion_item.stories.js +2 -2
  21. package/src/components/base/accordion/accordion_item.vue +2 -2
  22. package/src/components/base/avatar/avatar.stories.js +8 -0
  23. package/src/components/base/avatar_labeled/avatar_labeled.stories.js +7 -0
  24. package/src/components/base/avatar_link/avatar_link.stories.js +7 -0
  25. package/src/components/base/avatars_inline/avatars_inline.md +5 -0
  26. package/src/components/base/avatars_inline/avatars_inline.spec.js +21 -1
  27. package/src/components/base/avatars_inline/avatars_inline.stories.js +23 -9
  28. package/src/components/base/avatars_inline/avatars_inline.vue +11 -1
  29. package/src/components/base/badge/badge.stories.js +114 -9
  30. package/src/components/base/broadcast_message/broadcast_message.stories.js +2 -2
  31. package/src/components/base/button/button.stories.js +11 -11
  32. package/src/components/base/dropdown/dropdown.stories.js +4 -2
  33. package/src/components/base/filtered_search/filtered_search.stories.js +11 -1
  34. package/src/components/base/filtered_search/filtered_search_suggestion.stories.js +2 -0
  35. package/src/components/base/filtered_search/filtered_search_suggestion_list.stories.js +2 -0
  36. package/src/components/base/filtered_search/filtered_search_token.stories.js +2 -0
  37. package/src/components/base/filtered_search/filtered_search_token_segment.stories.js +2 -0
  38. package/src/components/base/form/form_group/form_group.stories.js +6 -5
  39. package/src/components/base/form/form_radio_group/form_radio_group.stories.js +2 -1
  40. package/src/components/base/loading_icon/loading_icon.stories.js +1 -0
  41. package/src/components/base/modal/modal.scss +5 -2
  42. package/src/components/base/nav/nav.documentation.js +0 -4
  43. package/src/components/base/nav/nav.md +8 -5
  44. package/src/components/base/nav/nav.stories.js +52 -15
  45. package/src/components/base/pagination/pagination.stories.js +7 -0
  46. package/src/components/base/path/path.stories.js +2 -2
  47. package/src/components/base/popover/popover.stories.js +6 -0
  48. package/src/components/base/table/table.stories.js +6 -1
  49. package/src/components/base/tabs/tabs/scrollable_tabs.spec.js +0 -1
  50. package/src/components/base/tabs/tabs/tabs.md +2 -2
  51. package/src/components/base/tabs/tabs/tabs.scss +3 -115
  52. package/src/components/base/tabs/tabs/tabs.spec.js +7 -4
  53. package/src/components/base/tabs/tabs/tabs.stories.js +8 -12
  54. package/src/components/base/tabs/tabs/tabs.vue +2 -11
  55. package/src/components/base/toast/toast.stories.js +6 -4
  56. package/src/components/base/token/token.stories.js +2 -2
  57. package/src/components/base/tooltip/tooltip.stories.js +2 -1
  58. package/src/components/utilities/truncate/truncate.documentation.js +0 -14
  59. package/src/components/utilities/truncate/truncate.md +0 -4
  60. package/src/components/utilities/truncate/truncate.stories.js +37 -26
  61. package/src/components/utilities/truncate/truncate.vue +9 -0
  62. package/src/scss/utilities.scss +8 -0
  63. package/src/scss/utility-mixins/box-shadow.scss +4 -0
  64. package/dist/components/base/nav/examples/index.js +0 -13
  65. package/dist/components/base/nav/examples/nav.basic.example.js +0 -38
  66. package/dist/components/base/nav/nav_item.documentation.js +0 -13
  67. package/dist/components/base/nav/nav_item_dropdown.documentation.js +0 -14
  68. package/dist/components/utilities/truncate/examples/index.js +0 -13
  69. package/dist/components/utilities/truncate/examples/truncate.basic.example.js +0 -38
  70. package/src/components/base/nav/examples/index.js +0 -15
  71. package/src/components/base/nav/examples/nav.basic.example.vue +0 -8
  72. package/src/components/base/nav/nav_item.documentation.js +0 -6
  73. package/src/components/base/nav/nav_item.md +0 -7
  74. package/src/components/base/nav/nav_item.stories.js +0 -23
  75. package/src/components/base/nav/nav_item_dropdown.documentation.js +0 -7
  76. package/src/components/base/nav/nav_item_dropdown.md +0 -7
  77. package/src/components/base/nav/nav_item_dropdown.stories.js +0 -51
  78. package/src/components/utilities/truncate/examples/index.js +0 -15
  79. package/src/components/utilities/truncate/examples/truncate.basic.example.vue +0 -5
package/CHANGELOG.md CHANGED
@@ -1,3 +1,51 @@
1
+ # [35.1.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v35.0.0...v35.1.0) (2022-02-04)
2
+
3
+
4
+ ### Features
5
+
6
+ * **GlModal:** unbox component by removing borders ([03598c9](https://gitlab.com/gitlab-org/gitlab-ui/commit/03598c984a2df4867a8d356bf82a4e9343450275))
7
+
8
+ # [35.0.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v34.0.0...v35.0.0) (2022-01-31)
9
+
10
+
11
+ ### Features
12
+
13
+ * **GlTabs:** Apply theme via CSS custom property ([beaf2bc](https://gitlab.com/gitlab-org/gitlab-ui/commit/beaf2bc4aa9fb26f6aa212fdec614fd8d3003c47))
14
+ * **GlTabs:** Remove theme prop ([3de63e6](https://gitlab.com/gitlab-org/gitlab-ui/commit/3de63e60426052731a626330168091466d8894ba))
15
+
16
+
17
+ ### BREAKING CHANGES
18
+
19
+ * **GlTabs:** The theme prop of `GlTabs` has been removed. Instead,
20
+ the theme color is set automatically according to the
21
+ `--gl-theme-accent` CSS custom property.
22
+
23
+ Part of https://gitlab.com/gitlab-org/gitlab-ui/-/issues/1683.
24
+
25
+ # [34.0.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v33.1.2...v34.0.0) (2022-01-28)
26
+
27
+
28
+ ### Features
29
+
30
+ * **GlAvatarsInline:** Add badgeSrOnlyText prop ([bcb0d29](https://gitlab.com/gitlab-org/gitlab-ui/commit/bcb0d299e9468e13cc7d565784388e3b9585e4a0))
31
+
32
+
33
+ ### BREAKING CHANGES
34
+
35
+ * **GlAvatarsInline:** This change adds a required
36
+ property named badgeSrOnlyText that ensures
37
+ that badge displayed when avatars inline is
38
+ collapsed, provides a screen reader only
39
+ label that gives contextual information
40
+ for users that use this form factor
41
+
42
+ ## [33.1.2](https://gitlab.com/gitlab-org/gitlab-ui/compare/v33.1.1...v33.1.2) (2022-01-27)
43
+
44
+
45
+ ### Bug Fixes
46
+
47
+ * Add a workaround for GlAccordion compatibility with Vue Apollo ([55deabf](https://gitlab.com/gitlab-org/gitlab-ui/commit/55deabf3260643079e20db1ad2787980afdd8e56))
48
+
1
49
  ## [33.1.1](https://gitlab.com/gitlab-org/gitlab-ui/compare/v33.1.0...v33.1.1) (2022-01-27)
2
50
 
3
51
 
@@ -5,9 +5,13 @@ var script = {
5
5
  name: 'GlAccordion',
6
6
 
7
7
  provide() {
8
+ const accordionId = _uniqueId('accordion-set-'); // temporary fix for this issue: https://gitlab.com/gitlab-org/gitlab-ui/-/merge_requests/2019#note_514671251
9
+ // MR for the upstream pending: https://github.com/vuejs/apollo/pull/1153
10
+
11
+
8
12
  return {
9
- defaultHeaderLevel: this.headerLevel,
10
- accordionSetId: this.autoCollapse && _uniqueId('accordion-set-')
13
+ defaultHeaderLevel: () => this.headerLevel,
14
+ accordionSetId: () => this.autoCollapse && accordionId
11
15
  };
12
16
  },
13
17
 
@@ -57,12 +57,12 @@ var script = {
57
57
 
58
58
  computed: {
59
59
  headerComponent() {
60
- const level = this.headerLevel || this.defaultHeaderLevel;
60
+ const level = this.headerLevel || this.defaultHeaderLevel();
61
61
  return `h${level}`;
62
62
  },
63
63
 
64
64
  accordion() {
65
- return this.accordionSetId || undefined;
65
+ return this.accordionSetId() || undefined;
66
66
  },
67
67
 
68
68
  icon() {
@@ -1,4 +1,4 @@
1
- var avatars_inline = "Use `<avatars-inline />` to display multiple avatars organized in a single row.\n\n### Basic usage\n\nThe `avatars` property accepts an array of objects that contains the avatar properties. By default,\n`<avatars-inline />` expects each object contained in the array to have the same shape as the\nproperties of the `<avatar />` component. You can customize the display of each avatar by\noverriding the default slot:\n\n```html\n<gl-avatars-inline :avatars=\"avatars\">\n <template #avatar=\"{ avatar }\">\n <gl-avatar-link v-gl-tooltip target=\"blank\" :href=\"avatar.href\" :title=\"avatar.tooltip\">\n <gl-avatar :src=\"avatar.src\" :size=\"32\" />\n </gl-avatar-link>\n </template>\n</gl-avatars-inline>\n```\n\nIn the example above, the avatars displayed inside `<avatars-inline />` are links pointing to a URL\nstored in each avatar object. Each avatar also displays a tooltip. If you override\n`<inline-avatars />` default display, you can pass an array of objects with any desired shape to\nthe `avatars` property.\n\n### Collapsing\n\nWhen the `collapse` property value is `true` and the `maxVisible` property value is a number less\nthan the length of the `avatars` property array, `<avatars-inline>` will hide the overflown avatars\nand display a badge instead.\n\n### Supported sizes\n\n`<avatars-inline>` only supports avatars with `24` or `32` size.\n";
1
+ var avatars_inline = "Use `<avatars-inline />` to display multiple avatars organized in a single row.\n\n### Basic usage\n\nThe `avatars` property accepts an array of objects that contains the avatar properties. By default,\n`<avatars-inline />` expects each object contained in the array to have the same shape as the\nproperties of the `<avatar />` component. You can customize the display of each avatar by\noverriding the default slot:\n\n```html\n<gl-avatars-inline :avatars=\"avatars\">\n <template #avatar=\"{ avatar }\">\n <gl-avatar-link v-gl-tooltip target=\"blank\" :href=\"avatar.href\" :title=\"avatar.tooltip\">\n <gl-avatar :src=\"avatar.src\" :size=\"32\" />\n </gl-avatar-link>\n </template>\n</gl-avatars-inline>\n```\n\nIn the example above, the avatars displayed inside `<avatars-inline />` are links pointing to a URL\nstored in each avatar object. Each avatar also displays a tooltip. If you override\n`<inline-avatars />` default display, you can pass an array of objects with any desired shape to\nthe `avatars` property.\n\n### Collapsing\n\nWhen the `collapse` property value is `true` and the `maxVisible` property value is a number less\nthan the length of the `avatars` property array, `<avatars-inline>` will hide the overflown avatars\nand display a badge instead.\n\n### Badge description in screen readers\n\nThe `badgeSrOnlyText` property provides a meaningful description of the badge that appears\nwhen avatars are collapsed for screen reader users.\n\n### Supported sizes\n\n`<avatars-inline>` only supports avatars with `24` or `32` size.\n";
2
2
 
3
3
  var description = /*#__PURE__*/Object.freeze({
4
4
  __proto__: null,
@@ -30,6 +30,10 @@ var script = {
30
30
  required: false,
31
31
  default: false
32
32
  },
33
+ badgeSrOnlyText: {
34
+ type: String,
35
+ required: true
36
+ },
33
37
  badgeTooltipProp: {
34
38
  type: String,
35
39
  required: false,
@@ -100,7 +104,7 @@ var script = {
100
104
  const __vue_script__ = script;
101
105
 
102
106
  /* template */
103
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:['gl-avatars-inline', { collapsed: _vm.collapsed }],style:(_vm.containerSizeStyles)},[_vm._l((_vm.visibleAvatars),function(avatar,index){return _c('div',{key:index,staticClass:"gl-avatars-inline-child",style:(_vm.calcAvatarPosition(index))},[_vm._t("avatar",[_c('gl-avatar',_vm._b({attrs:{"size":_vm.avatarSize}},'gl-avatar',avatar,false))],{"avatar":avatar})],2)}),_vm._v(" "),(_vm.collapsed && _vm.collapsable)?_c('div',{staticClass:"gl-avatars-inline-child",style:(_vm.calcAvatarPosition(_vm.visibleAvatars.length))},[(_vm.badgeTooltipProp)?_c('gl-tooltip',{attrs:{"target":function () { return _vm.$refs.badge; }}},[_vm._v("\n "+_vm._s(_vm.badgeTooltipTitle)+"\n ")]):_vm._e(),_vm._v(" "),_c('span',{ref:"badge",class:['gl-avatars-inline-badge', _vm.badgeSize]},[_vm._v("\n "+_vm._s(_vm.badgeLabel)+"\n ")])],1):_vm._e()],2)};
107
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:['gl-avatars-inline', { collapsed: _vm.collapsed }],style:(_vm.containerSizeStyles)},[_vm._l((_vm.visibleAvatars),function(avatar,index){return _c('div',{key:index,staticClass:"gl-avatars-inline-child",style:(_vm.calcAvatarPosition(index))},[_vm._t("avatar",[_c('gl-avatar',_vm._b({attrs:{"size":_vm.avatarSize}},'gl-avatar',avatar,false))],{"avatar":avatar})],2)}),_vm._v(" "),(_vm.collapsed && _vm.collapsable)?_c('div',{staticClass:"gl-avatars-inline-child",style:(_vm.calcAvatarPosition(_vm.visibleAvatars.length))},[(_vm.badgeTooltipProp)?_c('gl-tooltip',{attrs:{"target":function () { return _vm.$refs.badge; }}},[_vm._v("\n "+_vm._s(_vm.badgeTooltipTitle)+"\n ")]):_vm._e(),_vm._v(" "),_c('span',{ref:"badge",class:['gl-avatars-inline-badge', _vm.badgeSize],attrs:{"data-testid":"collapsed-avatars-badge","aria-hidden":"true"}},[_vm._v("\n "+_vm._s(_vm.badgeLabel)+"\n ")]),_vm._v(" "),_c('span',{staticClass:"sr-only",attrs:{"data-testid":"badge-sr-only-text"}},[_vm._v(_vm._s(_vm.badgeSrOnlyText))])],1):_vm._e()],2)};
104
108
  var __vue_staticRenderFns__ = [];
105
109
 
106
110
  /* style */
@@ -1,6 +1,4 @@
1
- import examples from './examples';
2
-
3
- var nav = "# Nav\n\n<!-- STORY -->\n\n## Usage\n\nThe navigation component is built with flexbox and provides a strong foundation for building all\ntypes of navigation components.\n";
1
+ var nav = "The navigation component is built with flexbox and provides a strong foundation for building all\ntypes of navigation components.\n\n## `GlNavItem`\n\nUse `GlNavItem` to add actionable links (or router links) to your nav. `GlNavItem` wraps [`BNavItem`](https://bootstrap-vue.org/docs/components/navbar#b-nav-item).\n\n## `GlNavItemDropdown`\n\nUse `GlNavItemDropdown` to place dropdown items within your nav.\n`GlNavItemDropdown` wraps [`BNavItemDropdown`](https://bootstrap-vue.org/docs/components/navbar#b-nav-item-dropdown).\n";
4
2
 
5
3
  var description = /*#__PURE__*/Object.freeze({
6
4
  __proto__: null,
@@ -8,10 +6,7 @@ var description = /*#__PURE__*/Object.freeze({
8
6
  });
9
7
 
10
8
  var nav_documentation = {
11
- description,
12
- examples,
13
- bootstrapComponent: 'b-nav',
14
- propsInfo: {}
9
+ description
15
10
  };
16
11
 
17
12
  export default nav_documentation;
@@ -1,6 +1,6 @@
1
1
  import examples from './examples';
2
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 theme=\"indigo\">\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 theme=\"indigo\">\n <gl-tab v-for=\"tab in tabs\" :key=\"tab.key\" :title=\"tab.title\"> {{ tab.content }} </gl-tab>\n</gl-scrollable-tabs>\n~~~\n";
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";
4
4
 
5
5
  var tabs_documentation = {
6
6
  description,
@@ -1,5 +1,5 @@
1
1
  import { BTabs } from 'bootstrap-vue/esm/index.js';
2
- import { colorThemes, tabsButtonDefaults } from '../../../../utils/constants';
2
+ import { tabsButtonDefaults } from '../../../../utils/constants';
3
3
  import GlButton from '../../button/button';
4
4
  import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
5
5
 
@@ -30,12 +30,6 @@ var script = {
30
30
  default: null,
31
31
  validator: obj => validatorHelper(obj)
32
32
  },
33
- theme: {
34
- type: String,
35
- required: false,
36
- default: 'indigo',
37
- validator: value => Object.keys(colorThemes).includes(value) || value === 'gl-dark'
38
- },
39
33
  contentClass: {
40
34
  type: [String, Array, Object],
41
35
  required: false,
@@ -79,10 +73,6 @@ var script = {
79
73
  return [this.actionPrimary, this.actionSecondary, this.actionTertiary].some(Boolean);
80
74
  },
81
75
 
82
- activeItemBorderClass() {
83
- return `gl-tab-nav-item-active-${this.theme}`;
84
- },
85
-
86
76
  listeners() {
87
77
  return { ...this.$listeners,
88
78
  input: this.handleInput
@@ -216,7 +206,7 @@ var script = {
216
206
  const __vue_script__ = script;
217
207
 
218
208
  /* template */
219
- var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-tabs',_vm._g(_vm._b({ref:"bTabs",staticClass:"gl-tabs",attrs:{"no-nav-style":true,"no-fade":true,"active-nav-item-class":("gl-tab-nav-item-active " + _vm.activeItemBorderClass),"content-class":[_vm.contentClass, 'gl-tab-content'],"nav-class":[_vm.navClass, 'gl-tabs-nav'],"justified":_vm.justified,"value":_vm.activeTabIndex},scopedSlots:_vm._u([_vm._l((Object.keys(_vm.$slots)),function(slot){return {key:slot,fn:function(){return [_vm._t(slot)]},proxy:true}}),(_vm.hasActions)?{key:"tabs-start",fn:function(){return [_c('div',{staticClass:"gl-actions-tabs-start",attrs:{"data-testid":"actions-tabs-start"}},[(_vm.actionPrimary)?_c('gl-button',_vm._b({attrs:{"data-testid":"action-primary"},on:{"click":_vm.primary}},'gl-button',_vm.buttonBinding(_vm.actionPrimary, 'actionPrimary'),false),[_vm._v("\n "+_vm._s(_vm.actionPrimary.text)+"\n ")]):_vm._e(),_vm._v(" "),(_vm.actionSecondary)?_c('gl-button',_vm._b({attrs:{"data-testid":"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.actionTertiary)?_c('gl-button',_vm._b({attrs:{"data-testid":"action-tertiary"},on:{"click":_vm.tertiary}},'gl-button',_vm.buttonBinding(_vm.actionTertiary, 'actionTertiary'),false),[_vm._v("\n "+_vm._s(_vm.actionTertiary.text)+"\n ")]):_vm._e()],1)]},proxy:true}:null,(_vm.hasActions)?{key:"tabs-end",fn:function(){return [_c('div',{staticClass:"gl-actions-tabs-end",attrs:{"data-testid":"actions-tabs-end"}},[(_vm.actionPrimary)?_c('gl-button',_vm._b({attrs:{"data-testid":"action-primary"},on:{"click":_vm.primary}},'gl-button',_vm.buttonBinding(_vm.actionPrimary, 'actionPrimary'),false),[_vm._v("\n "+_vm._s(_vm.actionPrimary.text)+"\n ")]):_vm._e(),_vm._v(" "),(_vm.actionSecondary)?_c('gl-button',_vm._b({attrs:{"data-testid":"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.actionTertiary)?_c('gl-button',_vm._b({attrs:{"data-testid":"action-tertiary"},on:{"click":_vm.tertiary}},'gl-button',_vm.buttonBinding(_vm.actionTertiary, 'actionTertiary'),false),[_vm._v("\n "+_vm._s(_vm.actionTertiary.text)+"\n ")]):_vm._e()],1)]},proxy:true}:null],null,true)},'b-tabs',_vm.$attrs,false),_vm.listeners))};
209
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-tabs',_vm._g(_vm._b({ref:"bTabs",staticClass:"gl-tabs",attrs:{"no-nav-style":true,"no-fade":true,"active-nav-item-class":"gl-tab-nav-item-active","content-class":[_vm.contentClass, 'gl-tab-content'],"nav-class":[_vm.navClass, 'gl-tabs-nav'],"justified":_vm.justified,"value":_vm.activeTabIndex},scopedSlots:_vm._u([_vm._l((Object.keys(_vm.$slots)),function(slot){return {key:slot,fn:function(){return [_vm._t(slot)]},proxy:true}}),(_vm.hasActions)?{key:"tabs-start",fn:function(){return [_c('div',{staticClass:"gl-actions-tabs-start",attrs:{"data-testid":"actions-tabs-start"}},[(_vm.actionPrimary)?_c('gl-button',_vm._b({attrs:{"data-testid":"action-primary"},on:{"click":_vm.primary}},'gl-button',_vm.buttonBinding(_vm.actionPrimary, 'actionPrimary'),false),[_vm._v("\n "+_vm._s(_vm.actionPrimary.text)+"\n ")]):_vm._e(),_vm._v(" "),(_vm.actionSecondary)?_c('gl-button',_vm._b({attrs:{"data-testid":"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.actionTertiary)?_c('gl-button',_vm._b({attrs:{"data-testid":"action-tertiary"},on:{"click":_vm.tertiary}},'gl-button',_vm.buttonBinding(_vm.actionTertiary, 'actionTertiary'),false),[_vm._v("\n "+_vm._s(_vm.actionTertiary.text)+"\n ")]):_vm._e()],1)]},proxy:true}:null,(_vm.hasActions)?{key:"tabs-end",fn:function(){return [_c('div',{staticClass:"gl-actions-tabs-end",attrs:{"data-testid":"actions-tabs-end"}},[(_vm.actionPrimary)?_c('gl-button',_vm._b({attrs:{"data-testid":"action-primary"},on:{"click":_vm.primary}},'gl-button',_vm.buttonBinding(_vm.actionPrimary, 'actionPrimary'),false),[_vm._v("\n "+_vm._s(_vm.actionPrimary.text)+"\n ")]):_vm._e(),_vm._v(" "),(_vm.actionSecondary)?_c('gl-button',_vm._b({attrs:{"data-testid":"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.actionTertiary)?_c('gl-button',_vm._b({attrs:{"data-testid":"action-tertiary"},on:{"click":_vm.tertiary}},'gl-button',_vm.buttonBinding(_vm.actionTertiary, 'actionTertiary'),false),[_vm._v("\n "+_vm._s(_vm.actionTertiary.text)+"\n ")]):_vm._e()],1)]},proxy:true}:null],null,true)},'b-tabs',_vm.$attrs,false),_vm.listeners))};
220
210
  var __vue_staticRenderFns__ = [];
221
211
 
222
212
  /* style */
@@ -1,22 +1,7 @@
1
- import examples from './examples';
2
-
3
- var description = "# Truncate\n\nThe `GlTruncate` component lets you truncate the long texts with ellipsis.\n\n<!-- STORY -->\n\n> **Tip:** Try resizing the side panel for truncation.\n\n## Usage\n\n```html\n<gl-truncate :text=\"text\" :position=\"position\" />\n```\n\nBy default, the ellipsis position is at the `end`.\n\nPro Tip: Truncating long filepaths from the `middle` / `start` can help preventing the important\ninformation in the end, i.e. filenames.\n";
1
+ var description = "The `GlTruncate` component lets you truncate the long texts with ellipsis.\n\n> **Tip:** Try resizing the side panel for truncation.\n\n## Usage\n\n```html\n<gl-truncate :text=\"text\" :position=\"position\" />\n```\n\nBy default, the ellipsis position is at the `end`.\n\nPro Tip: Truncating long filepaths from the `middle` / `start` can help preventing the important\ninformation in the end, i.e. filenames.\n";
4
2
 
5
3
  var truncate_documentation = {
6
- description,
7
- examples,
8
- propsInfo: {
9
- text: {
10
- additionalInfo: 'Text to be ellipsized'
11
- },
12
- position: {
13
- additionalInfo: 'Ellipsis position',
14
- enum: 'truncateOptions'
15
- },
16
- withTooltip: {
17
- additionalInfo: 'Display the full text in a tooltip only if it is being truncated'
18
- }
19
- }
4
+ description
20
5
  };
21
6
 
22
7
  export default truncate_documentation;
@@ -10,16 +10,27 @@ var script = {
10
10
  GlResizeObserver: GlResizeObserverDirective
11
11
  },
12
12
  props: {
13
+ /**
14
+ * Text to be ellipsized
15
+ */
13
16
  text: {
14
17
  type: String,
15
18
  required: true
16
19
  },
20
+
21
+ /**
22
+ * Ellipsis position
23
+ */
17
24
  position: {
18
25
  type: String,
19
26
  required: false,
20
27
  default: POSITION.END,
21
28
  validator: value => Object.values(POSITION).includes(value)
22
29
  },
30
+
31
+ /**
32
+ * Display the full text in a tooltip only if it is being truncated
33
+ */
23
34
  withTooltip: {
24
35
  type: Boolean,
25
36
  required: false,