@magicgol/polyjuice 0.33.7 → 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.
package/.storybook/main.js
CHANGED
package/package.json
CHANGED
|
@@ -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="
|
|
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>
|