@magicgol/polyjuice 0.33.8 → 0.34.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.33.8",
3
+ "version": "0.34.2",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -39,3 +39,10 @@ Default.args = {
39
39
  light: 'green',
40
40
  default: '300',
41
41
  };
42
+
43
+ export const HTML = Template.bind({});
44
+ // More on args: https://storybook.js.org/docs/vue/writing-stories/args
45
+ HTML.args = {
46
+ light: 'green',
47
+ default: '<div>Per Utente</div><div><span>91</span><span>/</span><span>50</span></div>',
48
+ };
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div
3
3
  class="d-inline-flex bg-white align-items-center px-3"
4
- :class="classes"
4
+ :class="[classes, {'py-1': stretched}]"
5
5
  >
6
6
  <div><slot></slot></div>
7
7
  </div>
@@ -19,6 +19,11 @@ export default {
19
19
  return ['red', 'yellow', 'green'].indexOf(value) !== -1;
20
20
  },
21
21
  },
22
+
23
+ stretched: {
24
+ type: Boolean,
25
+ default: false,
26
+ },
22
27
  },
23
28
 
24
29
  computed: {
@@ -39,11 +44,7 @@ export default {
39
44
 
40
45
  .mg-traffic-light {
41
46
  border: 2px solid;
42
- border-radius: 50px;
43
- font-family: 'Ubuntu', sans-serif;
44
- font-size: 1.3125rem;
45
- font-weight: 500;
46
- height: 2.25rem;
47
+ border-radius: 15px;
47
48
 
48
49
  &--error {
49
50
  border-color: map-get($palette, 'error');
@@ -2,11 +2,19 @@
2
2
  <div
3
3
  :class="classes"
4
4
  >
5
- <div class="mg-selection-box-content fixed-bottom p-2">
6
- <div class="bg-white rounded w-100 h-100 p-2">
7
- <div class="mg-selection-box-title text-center"><slot></slot></div>
5
+ <div
6
+ v-if="expanded"
7
+ class="mg-selection-box-curtain h-50 w-100 position-fixed"
8
+ @click="onClickOutside"
9
+ ></div>
10
+ <div class="mg-selection-box-content fixed-bottom px-3 py-2">
11
+ <div class="d-flex flex-column bg-white rounded w-100 h-100 px-3 py-2">
12
+ <div class="mg-selection-box-title text-uppercase text-center"><slot></slot></div>
8
13
  <div><slot name="summary"></slot></div>
9
- <div v-if="expanded"><slot name="detail"></slot></div>
14
+ <div
15
+ class="flex-fill"
16
+ v-if="expanded"
17
+ ><slot name="detail"></slot></div>
10
18
  <div class="d-flex align-items-center mt-2">
11
19
  <div class="w-50 text-center">
12
20
  <slot name="cancel"></slot>
@@ -49,12 +57,23 @@ export default {
49
57
  document.body.classList.remove('overflow-hidden');
50
58
  }
51
59
  }
60
+ },
61
+
62
+ methods: {
63
+ onClickOutside () {
64
+ this.$emit('click-outside');
65
+ }
52
66
  }
53
67
  };
54
68
  </script>
55
69
 
56
70
  <style lang="scss">
57
71
  .mg-selection-box {
72
+ &-curtain {
73
+ left: 0;
74
+ top: 0;
75
+ }
76
+
58
77
  &-shadow {
59
78
  height: 7.5rem;
60
79
  }
@@ -76,8 +95,14 @@ export default {
76
95
  &--expanded {
77
96
  background-color: rgba(0, 0, 0, 0.7);
78
97
  height: 100%;
98
+ left: 0;
79
99
  position: fixed;
100
+ top: 0;
80
101
  width: 100%;
102
+
103
+ .mg-selection-box-content {
104
+ height: 50%;
105
+ }
81
106
  }
82
107
  }
83
108
  </style>