@magicgol/polyjuice 0.55.2 → 0.56.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.
- package/package.json +1 -1
- package/src/components/context/footballer/horizontal-footballer/HFootballer.vue +5 -3
- package/src/components/context/footballer/horizontal-footballer-card/HFootballerCard.vue +1 -1
- package/src/components/context/team/badge/TeamBadge.stories.js +21 -0
- package/src/components/context/team/badge/TeamBadge.vue +46 -0
package/package.json
CHANGED
@@ -20,7 +20,6 @@
|
|
20
20
|
<span v-else-if="hasName">
|
21
21
|
<span class="mg-h-footballer-strong">{{ lastname }}</span>, <span>{{ firstname }}</span>
|
22
22
|
</span>
|
23
|
-
<span v-else>–</span>
|
24
23
|
</div>
|
25
24
|
<div
|
26
25
|
v-if="slotVisibility"
|
@@ -29,7 +28,10 @@
|
|
29
28
|
</div>
|
30
29
|
<!-- end of FOOTBALLER NAME -->
|
31
30
|
<!-- ROLE BADGE -->
|
32
|
-
<div
|
31
|
+
<div
|
32
|
+
v-bind:class="{'pl-2': inverted, 'pr-2': !inverted}"
|
33
|
+
v-if="role"
|
34
|
+
>
|
33
35
|
<mg-role-badge
|
34
36
|
:role="role"
|
35
37
|
:size="size"
|
@@ -67,7 +69,7 @@ export default {
|
|
67
69
|
type: String,
|
68
70
|
default: null,
|
69
71
|
validator: function (value) {
|
70
|
-
return ['P', 'D', 'C', 'A'].indexOf(value) !== -1;
|
72
|
+
return ['P', 'D', 'C', 'A', 'U'].indexOf(value) !== -1;
|
71
73
|
},
|
72
74
|
},
|
73
75
|
firstname: {
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import MgTeamBadge from './TeamBadge.vue';
|
2
|
+
|
3
|
+
// More on default export: https://storybook.js.org/docs/vue/writing-stories/introduction#default-export
|
4
|
+
export default {
|
5
|
+
title: 'Context/Team/Badge/Team Badge',
|
6
|
+
component: MgTeamBadge,
|
7
|
+
// More on argTypes: https://storybook.js.org/docs/vue/api/argtypes
|
8
|
+
};
|
9
|
+
|
10
|
+
// More on component templates: https://storybook.js.org/docs/vue/writing-stories/introduction#using-args
|
11
|
+
const Template = (args, { argTypes }) => ({
|
12
|
+
props: Object.keys(argTypes),
|
13
|
+
components: { MgTeamBadge },
|
14
|
+
template: `<mg-team-badge v-bind="$props"><template v-if="${'default' in args}" v-slot>${args.default}</template></mg-team-badge>`,
|
15
|
+
});
|
16
|
+
|
17
|
+
export const Default = Template.bind({});
|
18
|
+
// More on args: https://storybook.js.org/docs/vue/writing-stories/args
|
19
|
+
Default.args = {
|
20
|
+
colors: ['#fff', '#f00']
|
21
|
+
};
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<template>
|
2
|
+
<div
|
3
|
+
class="d-inline-flex text-center rounded-circle justify-content-center align-items-center overflow-hidden"
|
4
|
+
:class="classes"
|
5
|
+
>
|
6
|
+
<div
|
7
|
+
v-for="color in colors"
|
8
|
+
:key="color"
|
9
|
+
:style="{'backgroundColor': color, 'width': width}"
|
10
|
+
class="h-100"
|
11
|
+
></div>
|
12
|
+
</div>
|
13
|
+
</template>
|
14
|
+
|
15
|
+
<script>
|
16
|
+
export default {
|
17
|
+
name: 'mg-team-badge',
|
18
|
+
|
19
|
+
props: {
|
20
|
+
colors: {
|
21
|
+
type: Array,
|
22
|
+
default: () => [],
|
23
|
+
}
|
24
|
+
},
|
25
|
+
|
26
|
+
computed: {
|
27
|
+
classes() {
|
28
|
+
return {
|
29
|
+
'mg-team-badge': true,
|
30
|
+
};
|
31
|
+
},
|
32
|
+
width () {
|
33
|
+
return (1 / this.colors.length * 100) + '%';
|
34
|
+
}
|
35
|
+
},
|
36
|
+
};
|
37
|
+
</script>
|
38
|
+
|
39
|
+
<style lang="scss">
|
40
|
+
.mg-team-badge {
|
41
|
+
border: 1px solid #efefef;
|
42
|
+
height: 1.125rem;
|
43
|
+
width: 1.125rem;
|
44
|
+
min-width: 1.125rem;
|
45
|
+
}
|
46
|
+
</style>
|