@magicgol/polyjuice 0.33.5 → 0.33.8

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.
@@ -15,10 +15,6 @@ module.exports = {
15
15
  html, body {
16
16
  background: #F6F9FC;
17
17
  }
18
- .mg-selection-box-content {
19
- position: absolute !important;
20
- padding: 16px !important;
21
- }
22
18
  </style>
23
19
  `),
24
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magicgol/polyjuice",
3
- "version": "0.33.5",
3
+ "version": "0.33.8",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -25,6 +25,7 @@ export default {
25
25
  .mg-badge {
26
26
  background-color: #84485E;
27
27
  font-family: 'Ubuntu', sans-serif;
28
+ font-size: 1rem;
28
29
  font-weight: 500;
29
30
  height: 2rem;
30
31
  width: 2rem;
@@ -6,7 +6,10 @@
6
6
  <div class="p-2">
7
7
  <slot></slot>
8
8
  </div>
9
- <div class="mg-filter-option-circle d-flex align-items-center justify-content-center bg-white rounded-circle">
9
+ <div
10
+ class="mg-filter-option-circle d-flex align-items-center justify-content-center bg-white rounded-circle"
11
+ @click="onClick"
12
+ >
10
13
  <svgicon name="x"></svgicon>
11
14
  </div>
12
15
  </div>
@@ -23,6 +26,12 @@ export default {
23
26
  };
24
27
  }
25
28
  },
29
+
30
+ methods: {
31
+ onClick () {
32
+ this.$emit('click');
33
+ }
34
+ }
26
35
  };
27
36
  </script>
28
37
 
@@ -39,6 +48,7 @@ export default {
39
48
  height: 2rem;
40
49
 
41
50
  &-circle {
51
+ cursor: pointer;
42
52
  height: 1.5rem;
43
53
  width: 1.5rem;
44
54
 
@@ -94,7 +94,7 @@ export default {
94
94
  return 'col-' + ((this.secondColVisibility ? 8 : 10) - this.actionsCol);
95
95
  },
96
96
  thirdColClass () {
97
- return this.actionsColVisibility ? 'col-2' : 'col-3 pr-2'
97
+ return this.actionsColVisibility ? 'col-2' : 'col-3'
98
98
  }
99
99
  },
100
100
 
@@ -17,7 +17,10 @@
17
17
  <span class="mg-checkbox-check align-middle d-inline-block position-relative"></span>
18
18
  <!-- end of THE SQUARE -->
19
19
  <!-- TEXT AS LABEL -->
20
- <span class="align-middle pl-2">
20
+ <span
21
+ v-if="slotVisibility"
22
+ class="align-middle pl-2"
23
+ >
21
24
  <slot></slot>
22
25
  </span>
23
26
  <!-- end of TEXT AS LABEL -->
@@ -48,6 +51,9 @@ export default {
48
51
  'mg-checkbox': true,
49
52
  'mg-checkbox--disabled': this.disabled,
50
53
  };
54
+ },
55
+ slotVisibility() {
56
+ return 'default' in this.$slots && !!this.$slots.default;
51
57
  }
52
58
  },
53
59
  };
@@ -20,6 +20,18 @@ export default {
20
20
  summary: 'html',
21
21
  },
22
22
  }
23
+ },
24
+ detail: {
25
+ description: "The detail Vue slot",
26
+ control: {
27
+ type: 'text',
28
+ },
29
+ table: {
30
+ category: 'Slots',
31
+ type: {
32
+ summary: 'html',
33
+ },
34
+ }
23
35
  }
24
36
  },
25
37
  };
@@ -30,6 +42,7 @@ const Template = (args, { argTypes }) => ({
30
42
  components: { MgSelectionBox, MgPrimaryButton, MgTertiaryButton },
31
43
  template: `<mg-selection-box v-bind="$props">
32
44
  <template v-if="${'default' in args}" v-slot>${args.default}</template>
45
+ <template v-if="${'detail' in args}" v-slot:detail>${args.detail}</template>
33
46
  <template v-slot:cancel>
34
47
  <mg-tertiary-button>Annulla</mg-tertiary-button>
35
48
  </template>
@@ -42,7 +55,8 @@ const Template = (args, { argTypes }) => ({
42
55
  export const Default = Template.bind({});
43
56
  // More on args: https://storybook.js.org/docs/vue/writing-stories/args
44
57
  Default.args = {
45
- default: 'this is the content'
58
+ default: 'this is the content',
59
+ detail: 'this is the detail'
46
60
  };
47
61
 
48
62
  const PaymentTemplate = (args, { argTypes }) => ({
@@ -4,7 +4,9 @@
4
4
  >
5
5
  <div class="mg-selection-box-content fixed-bottom p-2">
6
6
  <div class="bg-white rounded w-100 h-100 p-2">
7
- <div class="text-center text-uppercase"><slot></slot></div>
7
+ <div class="mg-selection-box-title text-center"><slot></slot></div>
8
+ <div><slot name="summary"></slot></div>
9
+ <div v-if="expanded"><slot name="detail"></slot></div>
8
10
  <div class="d-flex align-items-center mt-2">
9
11
  <div class="w-50 text-center">
10
12
  <slot name="cancel"></slot>
@@ -23,13 +25,31 @@
23
25
  export default {
24
26
  name: 'mg-selection-box',
25
27
 
28
+ props: {
29
+ expanded: {
30
+ type: Boolean,
31
+ default: false
32
+ }
33
+ },
34
+
26
35
  computed: {
27
36
  classes() {
28
37
  return {
29
38
  'mg-selection-box': true,
39
+ 'mg-selection-box--expanded': this.expanded === true,
30
40
  };
31
- },
41
+ }
32
42
  },
43
+
44
+ watch: {
45
+ expanded (value) {
46
+ if (value) {
47
+ document.body.classList.add('overflow-hidden');
48
+ } else {
49
+ document.body.classList.remove('overflow-hidden');
50
+ }
51
+ }
52
+ }
33
53
  };
34
54
  </script>
35
55
 
@@ -39,15 +59,25 @@ export default {
39
59
  height: 7.5rem;
40
60
  }
41
61
 
62
+ &-title {
63
+ font-size: 0.8125rem;
64
+ font-weight: 500;
65
+ }
66
+
42
67
  &-content {
43
68
  bottom: 0;
44
69
 
45
70
  > div {
46
71
  box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.3);
47
72
  font-family: 'Ubuntu', sans-serif;
48
- font-size: 0.8125rem;
49
- font-weight: 500;
50
73
  }
51
74
  }
75
+
76
+ &--expanded {
77
+ background-color: rgba(0, 0, 0, 0.7);
78
+ height: 100%;
79
+ position: fixed;
80
+ width: 100%;
81
+ }
52
82
  }
53
83
  </style>