@eturnity/eturnity_reusable_components 1.1.13 → 1.1.16
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<container>
|
|
3
|
-
<input-wrapper :alignItems="alignItems">
|
|
3
|
+
<input-wrapper :alignItems="alignItems" :hasLabel="label && label.length">
|
|
4
4
|
<label-wrapper v-if="label">
|
|
5
5
|
<input-label>{{ label }}</input-label>
|
|
6
6
|
<info-text
|
|
@@ -83,14 +83,18 @@ const InputContainer = styled("textarea", inputProps)`
|
|
|
83
83
|
}
|
|
84
84
|
`
|
|
85
85
|
|
|
86
|
-
const inputAttrs = { alignItems: String }
|
|
86
|
+
const inputAttrs = { alignItems: String, hasLabel: Boolean }
|
|
87
87
|
const InputWrapper = styled("div", inputAttrs)`
|
|
88
88
|
position: relative;
|
|
89
89
|
display: grid;
|
|
90
90
|
align-items: center;
|
|
91
91
|
gap: 14px;
|
|
92
92
|
grid-template-columns: ${(props) =>
|
|
93
|
-
props.
|
|
93
|
+
!props.hasLabel
|
|
94
|
+
? "1fr"
|
|
95
|
+
: props.alignItems === "vertical"
|
|
96
|
+
? "1fr"
|
|
97
|
+
: "auto 1fr"};
|
|
94
98
|
`
|
|
95
99
|
|
|
96
100
|
const ErrorMessage = styled.div`
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<page-container @click="toggleButton()">
|
|
3
|
-
<button-container>
|
|
3
|
+
<button-container ref="dropdownItem">
|
|
4
4
|
<dot-item />
|
|
5
5
|
<dot-item />
|
|
6
6
|
<dot-item />
|
|
7
7
|
</button-container>
|
|
8
|
-
<dropdown-container
|
|
8
|
+
<dropdown-container
|
|
9
|
+
v-if="isOpen"
|
|
10
|
+
@click.stop
|
|
11
|
+
:top="getItemLocation('top')"
|
|
12
|
+
:right="getItemLocation('right')"
|
|
13
|
+
:containerWidth="childOpen ? 420 : 220"
|
|
14
|
+
>
|
|
9
15
|
<loading-container v-if="isLoading">
|
|
10
16
|
<spinner />
|
|
11
17
|
</loading-container>
|
|
@@ -148,12 +154,13 @@ const DotItem = styled.div`
|
|
|
148
154
|
border-radius: 50%;
|
|
149
155
|
`
|
|
150
156
|
|
|
151
|
-
const
|
|
157
|
+
const dropdownAttrs = { top: Number, right: Number, containerWidth: Number }
|
|
158
|
+
const DropdownContainer = styled("div", dropdownAttrs)`
|
|
152
159
|
z-index: 99;
|
|
153
160
|
height: 200px;
|
|
154
|
-
|
|
161
|
+
top: ${(props) => props.top + "px"};
|
|
162
|
+
left: ${(props) => props.right - props.containerWidth + "px"};
|
|
155
163
|
position: absolute;
|
|
156
|
-
right: 20px;
|
|
157
164
|
display: grid;
|
|
158
165
|
grid-template-columns: auto auto;
|
|
159
166
|
`
|
|
@@ -283,6 +290,14 @@ export default {
|
|
|
283
290
|
document.removeEventListener("click", this.clickOutside)
|
|
284
291
|
}
|
|
285
292
|
},
|
|
293
|
+
getItemLocation(value) {
|
|
294
|
+
let ref = this.$refs.dropdownItem
|
|
295
|
+
let location = ref.$el.getBoundingClientRect()[value]
|
|
296
|
+
if (value === "top") {
|
|
297
|
+
location = location + window.scrollY
|
|
298
|
+
}
|
|
299
|
+
return location
|
|
300
|
+
},
|
|
286
301
|
hasChildren(item) {
|
|
287
302
|
return !!item.children && !!item.children.length
|
|
288
303
|
},
|