@magicgol/polyjuice 0.24.1 → 0.24.2

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magicgol/polyjuice",
3
- "version": "0.24.1",
3
+ "version": "0.24.2",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -15,6 +15,7 @@ $palette: (
15
15
  'defender': #89f4a1,
16
16
  'midfielder': #8fc6f9,
17
17
  'forward': #f58383,
18
+ 'bench': #bbb,
18
19
  // LIVE
19
20
  'online': #00b669,
20
21
  'offline': #ea7203,
@@ -20,7 +20,17 @@ export default {
20
20
  },
21
21
  theme: {
22
22
  control: { type: 'select' },
23
- options: [null, 'club', 'rating', 'goalkeeper', 'defender', 'midfielder', 'forward', 'transparent'],
23
+ options: [
24
+ null,
25
+ 'club',
26
+ 'rating',
27
+ 'goalkeeper',
28
+ 'defender',
29
+ 'midfielder',
30
+ 'forward',
31
+ 'bench',
32
+ 'transparent',
33
+ ],
24
34
  defaultValue: null
25
35
  },
26
36
  footer: {
@@ -25,7 +25,16 @@ export default {
25
25
  type: String,
26
26
  default: null,
27
27
  validator: function (value) {
28
- return ['club', 'rating', 'goalkeeper', 'defender', 'midfielder', 'forward', 'transparent'].indexOf(value) !== -1;
28
+ return [
29
+ 'club',
30
+ 'rating',
31
+ 'goalkeeper',
32
+ 'defender',
33
+ 'midfielder',
34
+ 'forward',
35
+ 'bench',
36
+ 'transparent',
37
+ ].indexOf(value) !== -1;
29
38
  },
30
39
  }
31
40
  },
@@ -40,6 +49,7 @@ export default {
40
49
  'mg-v-card--theme-defender': this.theme === 'defender',
41
50
  'mg-v-card--theme-midfielder': this.theme === 'midfielder',
42
51
  'mg-v-card--theme-forward': this.theme === 'forward',
52
+ 'mg-v-card--theme-bench': this.theme === 'bench',
43
53
  'mg-v-card--theme-transparent': this.theme === 'transparent',
44
54
  };
45
55
  },
@@ -90,6 +100,10 @@ export default {
90
100
  background-color: map-get($palette, 'forward');
91
101
  }
92
102
 
103
+ &-bench {
104
+ background-color: map-get($palette, 'bench');
105
+ }
106
+
93
107
  &-transparent {
94
108
  background: rgba(255, 255, 255, 0.95) !important;
95
109
  box-shadow: none;
@@ -5,8 +5,8 @@
5
5
  >
6
6
  <!-- FOOTBALLER NAME -->
7
7
  <div
8
- class="flex-fill text-truncate"
9
- v-bind:class="{'text-right': inverted, 'order-1': !inverted}"
8
+ class="d-flex flex-fill text-truncate"
9
+ :class="{'text-right': inverted, 'order-1': !inverted, 'flex-row': !isLarge, 'flex-column': isLarge}"
10
10
  >
11
11
  <div class="text-truncate">
12
12
  <!-- LAST NAME ONLY -->
@@ -17,11 +17,14 @@
17
17
  <!-- end of LAST NAME ONLY -->
18
18
  <!-- FULL NAME -->
19
19
  <span v-else-if="hasName">
20
- <span class="mg-h-footballer-strong">{{ lastname }}</span>, <span>{{ firstname }}</span>
21
- </span>
20
+ <span class="mg-h-footballer-strong">{{ lastname }}</span>, <span>{{ firstname }}</span>
21
+ </span>
22
22
  <span v-else>&ndash;</span>
23
23
  </div>
24
- <div class="mg-h-footballer-subtext text-uppercase"><slot></slot></div>
24
+ <div
25
+ v-if="slotVisibility"
26
+ class="mg-h-footballer-subtext text-uppercase"
27
+ ><span v-if="!isLarge" class="mx-2">-</span><slot></slot></div>
25
28
  </div>
26
29
  <!-- end of FOOTBALLER NAME -->
27
30
  <!-- ROLE BADGE -->
@@ -83,11 +86,17 @@ export default {
83
86
  'mg-h-footballer--size-large': this.size === 'large',
84
87
  };
85
88
  },
89
+ isLarge () {
90
+ return this.size === 'large';
91
+ },
86
92
  hasOnlyLastname() {
87
93
  return this.lastname != null && this.firstname == null;
88
94
  },
89
95
  hasName () {
90
96
  return this.lastname != null || this.firstname != null;
97
+ },
98
+ slotVisibility() {
99
+ return 'default' in this.$slots && !!this.$slots.default;
91
100
  }
92
101
  },
93
102
 
@@ -121,11 +130,15 @@ export default {
121
130
  &--disabled {
122
131
  opacity: 0.6;
123
132
  cursor: not-allowed !important;
133
+
134
+ .mg-h-footballer-subtext {
135
+ text-decoration: line-through;
136
+ }
124
137
  }
125
138
 
126
139
  &--size {
127
140
  &-normal {
128
- font-size: 0.75rem;
141
+ font-size: 0.875rem;
129
142
  }
130
143
 
131
144
  &-large {
@@ -19,4 +19,8 @@ import {ColorItem, ColorPalette, Meta} from '@storybook/addon-docs';
19
19
  title="Forward"
20
20
  colors={{'Froly': '#f58383'}}
21
21
  />
22
+ <ColorItem
23
+ title="Bench"
24
+ colors={{'Silver': '#bbb'}}
25
+ />
22
26
  </ColorPalette>