@eturnity/eturnity_reusable_components 1.2.71 → 1.2.72
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/App.vue +1 -1
- package/src/components/dropdown/index.vue +15 -7
package/package.json
CHANGED
package/src/App.vue
CHANGED
@@ -3,8 +3,10 @@
|
|
3
3
|
<WrapperButton @click="isOpenByClick=!isOpenByClick">
|
4
4
|
<slot name="trigger"/>
|
5
5
|
</WrapperButton>
|
6
|
-
<WrapperDropdown class="dropdown-content" :class="{openDropdown:isOpenByClick && openingMode=='click'}" :
|
6
|
+
<WrapperDropdown class="dropdown-content" :class="{openDropdown:isOpenByClick && openingMode=='click'}" :justify="justify" :position="position" :width="width" :backgroundColor="backgroundColor">
|
7
|
+
<DropdownWindow :gap="gap" :backgroundColor="backgroundColor">
|
7
8
|
<slot name="dropdown"/>
|
9
|
+
</DropdownWindow>
|
8
10
|
</WrapperDropdown>
|
9
11
|
</wrapper>
|
10
12
|
</template>
|
@@ -20,7 +22,7 @@
|
|
20
22
|
|
21
23
|
import styled from 'vue-styled-components'
|
22
24
|
|
23
|
-
const wrapperAttrs = { width: String, backgroundColor:String,openingMode:String,gap:
|
25
|
+
const wrapperAttrs = { width: String, backgroundColor:String,openingMode:String,gap:String,justify:String }
|
24
26
|
const Wrapper = styled('div', wrapperAttrs)`
|
25
27
|
display: inline-block;
|
26
28
|
position: relative;
|
@@ -33,16 +35,21 @@
|
|
33
35
|
}
|
34
36
|
`
|
35
37
|
const WrapperDropdown = styled('div', wrapperAttrs)`
|
38
|
+
margin-top: 0;
|
39
|
+
display: none;
|
40
|
+
position: absolute;
|
41
|
+
z-index: 1;
|
42
|
+
${(props) => props.justify=="right"?"right:0;":""}
|
43
|
+
`
|
44
|
+
const DropdownWindow = styled('div', wrapperAttrs)`
|
36
45
|
width: ${(props) => props.width};
|
37
46
|
background-color: ${(props) => props.theme.colors[props.backgroundColor] || props.backgroundColor};
|
38
|
-
border-radius: 4px;
|
39
47
|
margin-top: ${(props) => props.gap};
|
40
|
-
|
41
|
-
position:
|
48
|
+
border-radius: 4px;
|
49
|
+
position: relative;
|
42
50
|
min-width: 160px;
|
43
51
|
box-shadow: -1px 0px 5px rgba(0, 0, 0, 0.302);
|
44
52
|
z-index: 1;
|
45
|
-
${(props) => props.justify=="right"?"right:0;":""}
|
46
53
|
`
|
47
54
|
|
48
55
|
const WrapperButton = styled('div', wrapperAttrs)`
|
@@ -54,7 +61,8 @@
|
|
54
61
|
components: {
|
55
62
|
WrapperDropdown,
|
56
63
|
WrapperButton,
|
57
|
-
Wrapper
|
64
|
+
Wrapper,
|
65
|
+
DropdownWindow
|
58
66
|
},
|
59
67
|
props: {
|
60
68
|
width: {
|