@eturnity/eturnity_reusable_components 7.4.4-EPDM-9606 → 7.4.4-EPDM-7260.3
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 +3 -3
- package/src/App.vue +69 -73
- package/src/assets/svgIcons/consumption_tariffs.svg +43 -0
- package/src/assets/svgIcons/electricity_tariff.svg +3 -0
- package/src/assets/svgIcons/handle.svg +5 -0
- package/src/assets/svgIcons/logout.svg +3 -0
- package/src/assets/svgIcons/summer.svg +3 -0
- package/src/components/draggableInputHandle/index.vue +47 -0
- package/src/components/infoCard/index.vue +19 -21
- package/src/components/infoText/index.vue +2 -1
- package/src/components/inputs/radioButton/index.vue +5 -2
- package/src/components/inputs/select/index.vue +53 -13
- package/src/components/label/index.vue +104 -0
- package/src/components/modals/modal/index.vue +33 -12
- package/src/components/rangeSlider/Slider.vue +541 -0
- package/src/components/rangeSlider/index.vue +488 -0
- package/src/components/rangeSlider/utils/dom.js +49 -0
- package/src/components/rangeSlider/utils/fns.js +26 -0
- package/src/components/selectedOptions/index.vue +145 -0
- package/src/components/tables/mainTable/index.vue +1 -1
- package/src/components/threeDots/index.vue +52 -29
- package/src/main.js +5 -5
@@ -1,5 +1,9 @@
|
|
1
1
|
<template>
|
2
|
-
<page-container
|
2
|
+
<page-container
|
3
|
+
@click="toggleButton()"
|
4
|
+
ref="pageContainer"
|
5
|
+
:activated="isOpen"
|
6
|
+
>
|
3
7
|
<button-container ref="dropdownItem">
|
4
8
|
<dot-item />
|
5
9
|
<dot-item />
|
@@ -23,40 +27,44 @@
|
|
23
27
|
v-for="child in childOpen"
|
24
28
|
:key="child.value"
|
25
29
|
@click.stop="
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
30
|
+
onSelect({
|
31
|
+
item: child,
|
32
|
+
hasChildren: hasChildren(child)
|
33
|
+
})
|
34
|
+
"
|
31
35
|
@keyup.enter.stop="
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
36
|
+
onSelect({
|
37
|
+
item: child,
|
38
|
+
hasChildren: hasChildren(child)
|
39
|
+
})
|
40
|
+
"
|
37
41
|
>
|
38
42
|
{{ child.name }}
|
39
43
|
</option-child>
|
40
44
|
</children-container>
|
41
|
-
<options-container v-if="!isLoading">
|
45
|
+
<options-container v-if="!isLoading" :textWrap="textWrap">
|
42
46
|
<option-item
|
43
47
|
v-for="(item, index) in options"
|
44
48
|
:key="item.value"
|
49
|
+
:data-id="item.dataId"
|
45
50
|
tabindex="0"
|
46
|
-
@click.stop="
|
51
|
+
@click.stop="
|
52
|
+
onSelect({ item: item, hasChildren: hasChildren(item) })
|
53
|
+
"
|
47
54
|
@keyup.enter="
|
48
|
-
|
49
|
-
|
55
|
+
onSelect({ item: item, hasChildren: hasChildren(item) })
|
56
|
+
"
|
50
57
|
@mouseover="onItemHover({ index, item })"
|
51
58
|
:isDisabled="item.disabled"
|
59
|
+
:title="item.title"
|
52
60
|
>
|
53
61
|
<arrow-left
|
54
62
|
:hasChildren="hasChildren(item)"
|
55
63
|
v-if="hasChildren(item)"
|
56
64
|
/>
|
57
65
|
<span>
|
58
|
-
|
59
|
-
|
66
|
+
{{ item.name }}
|
67
|
+
</span>
|
60
68
|
</option-item>
|
61
69
|
</options-container>
|
62
70
|
</template>
|
@@ -68,9 +76,10 @@
|
|
68
76
|
// import ThreeDots from "@eturnity/eturnity_reusable_components/src/components/threeDots"
|
69
77
|
// To use:
|
70
78
|
// <three-dots
|
79
|
+
// :isLoading="true"
|
71
80
|
// :options="listOptions"
|
81
|
+
// @on-click="onClick($event)"
|
72
82
|
// @on-select="onSelect($event)"
|
73
|
-
// :isLoading="true"
|
74
83
|
// />
|
75
84
|
// options to pass:
|
76
85
|
// listOptions: [
|
@@ -133,7 +142,8 @@ const PageContainer = styled('div', PageContainerAttrs)`
|
|
133
142
|
width: 30px;
|
134
143
|
height: 30px;
|
135
144
|
border-radius: 4px;
|
136
|
-
background-color: ${(props) =>
|
145
|
+
background-color: ${(props) =>
|
146
|
+
props.activated ? props.theme.colors.grey5 : ''};
|
137
147
|
|
138
148
|
&:hover {
|
139
149
|
background-color: ${(props) => props.theme.colors.grey5};
|
@@ -182,19 +192,18 @@ const LoadingContainer = styled.div`
|
|
182
192
|
background: #fff;
|
183
193
|
`
|
184
194
|
|
185
|
-
const
|
195
|
+
const OptionsContainerAttrs = { textWrap: Boolean }
|
196
|
+
const OptionsContainer = styled('div', OptionsContainerAttrs)`
|
186
197
|
border: 1px solid ${(props) => props.theme.colors.grey3};
|
187
198
|
display: grid;
|
188
199
|
grid-template-columns: 1fr;
|
189
|
-
|
190
|
-
max-width: 220px;
|
191
|
-
width: max-content;
|
200
|
+
${(props) => props.textWrap ? 'width: 220px' : 'width: max-content' };
|
192
201
|
border-radius: 4px;
|
193
202
|
background-color: #fff;
|
194
203
|
max-height: 220px;
|
195
204
|
overflow: auto;
|
196
205
|
height: max-content;
|
197
|
-
white-space: normal;
|
206
|
+
${(props) => props.textWrap ? 'white-space: normal' : 'white-space: nowrap'};
|
198
207
|
`
|
199
208
|
|
200
209
|
const optionAttrs = { isDisabled: Boolean }
|
@@ -203,6 +212,8 @@ const OptionItem = styled('div', optionAttrs)`
|
|
203
212
|
cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
|
204
213
|
font-size: 13px;
|
205
214
|
position: relative;
|
215
|
+
${(props) => (props.isDisabled ? `background-color: ${ props.theme.colors.grey5 }!important` : '')};
|
216
|
+
${(props) => (props.isDisabled ? `color: ${ props.theme.colors.grey2 }` : '')};
|
206
217
|
|
207
218
|
&:hover {
|
208
219
|
background-color: #ebeef4;
|
@@ -284,6 +295,10 @@ export default {
|
|
284
295
|
isLoading: {
|
285
296
|
required: false,
|
286
297
|
default: false
|
298
|
+
},
|
299
|
+
textWrap: {
|
300
|
+
required: false,
|
301
|
+
default: true
|
287
302
|
}
|
288
303
|
},
|
289
304
|
data() {
|
@@ -317,21 +332,28 @@ export default {
|
|
317
332
|
const positionArray = this.determineElementQuarter(button, rectButton)
|
318
333
|
contextMenu.style.transform = ''
|
319
334
|
if (positionArray.includes('left')) {
|
320
|
-
contextMenu.style.left =
|
335
|
+
contextMenu.style.left =
|
336
|
+
rectButton.right - rectRelativeParent.left + 5 + 'px'
|
321
337
|
} else {
|
322
|
-
contextMenu.style.left =
|
338
|
+
contextMenu.style.left =
|
339
|
+
rectButton.left - rectRelativeParent.left - 5 + 'px'
|
323
340
|
contextMenu.style.transform = 'translateX(-100%)'
|
324
341
|
}
|
325
342
|
if (positionArray.includes('top')) {
|
326
|
-
contextMenu.style.top =
|
343
|
+
contextMenu.style.top = rectButton.top - rectRelativeParent.top + 'px'
|
327
344
|
} else {
|
328
|
-
contextMenu.style.top =
|
345
|
+
contextMenu.style.top =
|
346
|
+
rectButton.bottom - rectRelativeParent.top + 'px'
|
329
347
|
contextMenu.style.transform += ' translateY(-100%)'
|
330
348
|
}
|
331
349
|
},
|
332
350
|
findRelativeParent(element) {
|
333
351
|
while (element.parentElement) {
|
334
|
-
if (
|
352
|
+
if (
|
353
|
+
window.getComputedStyle(element.parentElement).position ===
|
354
|
+
'relative' ||
|
355
|
+
window.getComputedStyle(element.parentElement).position === 'absolute'
|
356
|
+
) {
|
335
357
|
return element.parentElement
|
336
358
|
}
|
337
359
|
element = element.parentElement
|
@@ -368,6 +390,7 @@ export default {
|
|
368
390
|
},
|
369
391
|
onSelect({ item, hasChildren }) {
|
370
392
|
if (hasChildren || item.disabled) {
|
393
|
+
this.$emit('on-click', item)
|
371
394
|
return
|
372
395
|
}
|
373
396
|
this.$emit('on-select', item)
|
package/src/main.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
import Vue from
|
2
|
-
import App from
|
3
|
-
import VueCompositionAPI from
|
1
|
+
import Vue from 'vue'
|
2
|
+
import App from './App.vue'
|
3
|
+
import VueCompositionAPI from '@vue/composition-api'
|
4
4
|
import vClickOutside from 'v-click-outside'
|
5
5
|
|
6
6
|
Vue.config.productionTip = false
|
@@ -9,5 +9,5 @@ Vue.use(VueCompositionAPI)
|
|
9
9
|
Vue.use(vClickOutside)
|
10
10
|
|
11
11
|
new Vue({
|
12
|
-
render: (h) => h(App)
|
13
|
-
}).$mount(
|
12
|
+
render: (h) => h(App)
|
13
|
+
}).$mount('#app')
|