@gitlab/ui 41.4.0 → 41.5.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.
- package/CHANGELOG.md +7 -0
- package/dist/components/base/avatar_labeled/avatar_labeled.js +1 -1
- package/package.json +1 -1
- package/src/components/base/avatar_labeled/avatar_labeled.spec.js +9 -0
- package/src/components/base/avatar_labeled/avatar_labeled.stories.js +20 -1
- package/src/components/base/avatar_labeled/avatar_labeled.vue +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [41.5.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v41.4.0...v41.5.0) (2022-06-06)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **GlAvatarLabeled:** Add default slot ([ba69571](https://gitlab.com/gitlab-org/gitlab-ui/commit/ba69571945032ef5e27a49da40444180b786a651))
|
|
7
|
+
|
|
1
8
|
# [41.4.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v41.3.0...v41.4.0) (2022-06-06)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -44,7 +44,7 @@ var script = {
|
|
|
44
44
|
const __vue_script__ = script;
|
|
45
45
|
|
|
46
46
|
/* template */
|
|
47
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-avatar-labeled"},[_c('gl-avatar',_vm._g(_vm._b({attrs:{"alt":""}},'gl-avatar',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),_c('div',{staticClass:"gl-avatar-labeled-labels gl-text-left!"},[_c('div',{staticClass:"gl-display-flex gl-flex-wrap gl-align-items-center gl-text-left! gl-mx-n1 gl-my-n1"},[(_vm.hasLabelLink)?_c('gl-link',{staticClass:"gl-avatar-link",attrs:{"href":_vm.labelLink}},[_c('span',{staticClass:"gl-avatar-labeled-label"},[_vm._v(_vm._s(_vm.label))])]):_c('span',{staticClass:"gl-avatar-labeled-label"},[_vm._v(_vm._s(_vm.label))]),_vm._v(" "),_vm._t("meta")],2),_vm._v(" "),(_vm.hasSubLabelLink)?_c('gl-link',{staticClass:"gl-avatar-link",attrs:{"href":_vm.subLabelLink}},[_c('span',{staticClass:"gl-avatar-labeled-sublabel"},[_vm._v(_vm._s(_vm.subLabel))])]):_c('span',{staticClass:"gl-avatar-labeled-sublabel"},[_vm._v(_vm._s(_vm.subLabel))])],
|
|
47
|
+
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"gl-avatar-labeled"},[_c('gl-avatar',_vm._g(_vm._b({attrs:{"alt":""}},'gl-avatar',_vm.$attrs,false),_vm.$listeners)),_vm._v(" "),_c('div',{staticClass:"gl-avatar-labeled-labels gl-text-left!"},[_c('div',{staticClass:"gl-display-flex gl-flex-wrap gl-align-items-center gl-text-left! gl-mx-n1 gl-my-n1"},[(_vm.hasLabelLink)?_c('gl-link',{staticClass:"gl-avatar-link",attrs:{"href":_vm.labelLink}},[_c('span',{staticClass:"gl-avatar-labeled-label"},[_vm._v(_vm._s(_vm.label))])]):_c('span',{staticClass:"gl-avatar-labeled-label"},[_vm._v(_vm._s(_vm.label))]),_vm._v(" "),_vm._t("meta")],2),_vm._v(" "),(_vm.hasSubLabelLink)?_c('gl-link',{staticClass:"gl-avatar-link",attrs:{"href":_vm.subLabelLink}},[_c('span',{staticClass:"gl-avatar-labeled-sublabel"},[_vm._v(_vm._s(_vm.subLabel))])]):_c('span',{staticClass:"gl-avatar-labeled-sublabel"},[_vm._v(_vm._s(_vm.subLabel))]),_vm._v(" "),_vm._t("default")],2)],1)};
|
|
48
48
|
var __vue_staticRenderFns__ = [];
|
|
49
49
|
|
|
50
50
|
/* style */
|
package/package.json
CHANGED
|
@@ -49,6 +49,15 @@ describe('avatar labeled', () => {
|
|
|
49
49
|
expect(wrapper.find('[data-testid="user-meta"]').exists()).toBe(true);
|
|
50
50
|
});
|
|
51
51
|
|
|
52
|
+
it('displays `default` slot', () => {
|
|
53
|
+
buildWrapper(
|
|
54
|
+
{ label, subLabel },
|
|
55
|
+
{ default: '<span data-testid="default-slot">Foo Bar</span>' }
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
expect(wrapper.find('[data-testid="default-slot"]').exists()).toBe(true);
|
|
59
|
+
});
|
|
60
|
+
|
|
52
61
|
describe('with label links', () => {
|
|
53
62
|
beforeEach(() => {
|
|
54
63
|
buildWrapper({ label, subLabel, labelLink: 'http://label', subLabelLink: 'http://subLabel' });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Vue from 'vue';
|
|
2
|
-
import { GlAvatarLabeled, GlBadge } from '../../../index';
|
|
2
|
+
import { GlAvatarLabeled, GlBadge, GlButton } from '../../../index';
|
|
3
3
|
import { GlTooltipDirective } from '../../../directives/tooltip';
|
|
4
4
|
import { avatarSizeOptions, avatarShapeOptions, tooltipPlacements } from '../../../utils/constants';
|
|
5
5
|
import avatarPath from '../../../../static/img/avatar.png';
|
|
@@ -90,6 +90,25 @@ export const WithBadges = (args, { argTypes }) => ({
|
|
|
90
90
|
});
|
|
91
91
|
WithBadges.args = generateProps();
|
|
92
92
|
|
|
93
|
+
export const WithDefaultSlot = (args, { argTypes }) => ({
|
|
94
|
+
components: { GlAvatarLabeled, GlButton },
|
|
95
|
+
props: Object.keys(argTypes),
|
|
96
|
+
template: `
|
|
97
|
+
<gl-avatar-labeled
|
|
98
|
+
:shape="shape"
|
|
99
|
+
:size="size"
|
|
100
|
+
:src="src"
|
|
101
|
+
:label="label"
|
|
102
|
+
:sub-label="subLabel"
|
|
103
|
+
>
|
|
104
|
+
<template>
|
|
105
|
+
<gl-button class="gl-mt-3 gl-align-self-start" size="small">Follow</gl-button>
|
|
106
|
+
</template>
|
|
107
|
+
</gl-avatar-labeled>
|
|
108
|
+
`,
|
|
109
|
+
});
|
|
110
|
+
WithDefaultSlot.args = generateProps({ size: 64 });
|
|
111
|
+
|
|
93
112
|
export default {
|
|
94
113
|
title: 'base/avatar/labeled',
|
|
95
114
|
component: GlAvatarLabeled,
|
|
@@ -56,6 +56,8 @@ export default {
|
|
|
56
56
|
<span class="gl-avatar-labeled-sublabel">{{ subLabel }}</span>
|
|
57
57
|
</gl-link>
|
|
58
58
|
<span v-else class="gl-avatar-labeled-sublabel">{{ subLabel }}</span>
|
|
59
|
+
<!-- @slot Add additional information below the avatar label. -->
|
|
60
|
+
<slot></slot>
|
|
59
61
|
</div>
|
|
60
62
|
</div>
|
|
61
63
|
</template>
|