@eturnity/eturnity_reusable_components 7.20.0--EPDM-10564.5 → 7.20.0--EPDM-9013.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 +1 -1
- package/src/assets/svgIcons/bexio.svg +4 -0
- package/src/assets/svgIcons/clock_full.svg +3 -0
- package/src/assets/svgIcons/data_transfer.svg +3 -0
- package/src/assets/svgIcons/drag_icon.svg +8 -0
- package/src/assets/svgIcons/inclination.svg +3 -0
- package/src/assets/svgIcons/length_2d.svg +3 -0
- package/src/assets/svgIcons/length_3d.svg +5 -0
- package/src/assets/svgIcons/length_calculator.svg +3 -0
- package/src/components/filter/filterSettings.vue +17 -0
- package/src/components/filter/index.vue +11 -0
- package/src/components/icon/index.vue +35 -23
- package/src/components/inputs/checkbox/index.vue +12 -5
- package/src/components/inputs/inputNumber/index.vue +2 -6
- package/src/components/inputs/inputText/index.vue +1 -1
- package/src/components/inputs/textAreaInput/index.vue +1 -1
- package/src/components/pagination/index.vue +5 -4
- package/src/components/projectMarker/index.vue +1 -1
- package/src/components/selectedOptions/index.vue +145 -0
package/package.json
CHANGED
@@ -0,0 +1,4 @@
|
|
1
|
+
<svg width="15" height="9" viewBox="0 0 15 9" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path d="M14.462 8.46H12.894C12.7848 8.46 12.697 8.4327 12.6307 8.37809C12.5683 8.32349 12.5176 8.26108 12.4786 8.19087L10.5186 4.94378C10.4874 5.04129 10.4504 5.12514 10.4075 5.19535L8.52943 8.19087C8.48263 8.25718 8.42802 8.31958 8.36562 8.37809C8.30711 8.4327 8.2291 8.46 8.13159 8.46H6.66309L9.47138 4.10714L6.77425 0H8.34221C8.45143 0 8.52943 0.0156017 8.57624 0.0468051C8.62694 0.0741079 8.67375 0.120913 8.71665 0.18722L10.6415 3.28805C10.6805 3.19054 10.7273 3.09303 10.7819 2.99552L12.5488 0.216473C12.5917 0.142365 12.6385 0.0877595 12.6892 0.052656C12.7399 0.017552 12.8043 0 12.8823 0H14.3859L11.6654 4.04278L14.462 8.46Z" fill="#263238"/>
|
3
|
+
<path d="M3.16519 7.23137C3.45772 7.23137 3.70344 7.19627 3.90237 7.12606C4.10129 7.05585 4.25925 6.96224 4.37627 6.84523C4.49718 6.72822 4.58299 6.5917 4.63369 6.43569C4.6883 6.27967 4.7156 6.1139 4.7156 5.93838C4.7156 5.75506 4.68635 5.59124 4.62784 5.44693C4.56934 5.29871 4.47768 5.1739 4.35286 5.07249C4.22805 4.96718 4.06618 4.88722 3.86726 4.83261C3.67224 4.77801 3.43627 4.75071 3.15934 4.75071H1.57382V7.23137H3.16519ZM1.57382 1.21693V3.66249H2.82585C3.36411 3.66249 3.76975 3.56498 4.04278 3.36996C4.31971 3.17494 4.45817 2.86486 4.45817 2.43971C4.45817 1.99896 4.33336 1.68498 4.08373 1.49776C3.83411 1.31054 3.44407 1.21693 2.91361 1.21693H1.57382ZM2.91361 0C3.46747 0 3.94137 0.0526557 4.33531 0.157967C4.72925 0.263278 5.05104 0.413444 5.30066 0.608465C5.55419 0.803486 5.73946 1.03946 5.85647 1.31639C5.97349 1.59332 6.03199 1.90535 6.03199 2.25249C6.03199 2.45141 6.00274 2.64253 5.94423 2.82585C5.88573 3.00527 5.79407 3.17494 5.66925 3.33485C5.54834 3.49087 5.39232 3.63324 5.2012 3.76195C5.01398 3.89066 4.78971 3.99988 4.52838 4.08959C5.69071 4.35091 6.27187 4.97888 6.27187 5.97349C6.27187 6.33232 6.20361 6.66386 6.0671 6.96809C5.93058 7.27232 5.73166 7.5356 5.47033 7.75793C5.209 7.97635 4.88722 8.14797 4.50498 8.27278C4.12274 8.39759 3.68589 8.46 3.19444 8.46H0V0H2.91361Z" fill="#263238"/>
|
4
|
+
</svg>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M5 10C7.76142 10 10 7.76142 10 5C10 2.23858 7.76142 0 5 0C2.23858 0 0 2.23858 0 5C0 7.76142 2.23858 10 5 10ZM5.875 5.05243V2.125H4.125V5.92743L6.19061 7.47663L7.24061 6.07663L5.875 5.05243Z" fill="white"/>
|
3
|
+
</svg>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path d="M16 0H2C0.89 0 0 0.9 0 2V16C0 17.1 0.89 18 2 18H6V16H2V2H16V16H12V18H16C17.1 18 18 17.1 18 16V2C18 0.9 17.11 0 16 0ZM9 6L5 10H8V18H10V10H13L9 6Z" fill="#263238"/>
|
3
|
+
</svg>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<svg width="10" height="16" viewBox="0 0 10 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path d="M4 2C4 3.10457 3.10457 4 2 4C0.89543 4 0 3.10457 0 2C0 0.89543 0.89543 0 2 0C3.10457 0 4 0.89543 4 2Z" fill="#B2B9C5"/>
|
3
|
+
<path d="M10 2C10 3.10457 9.10457 4 8 4C6.89543 4 6 3.10457 6 2C6 0.89543 6.89543 0 8 0C9.10457 0 10 0.89543 10 2Z" fill="#B2B9C5"/>
|
4
|
+
<path d="M4 8C4 9.10457 3.10457 10 2 10C0.89543 10 0 9.10457 0 8C0 6.89543 0.89543 6 2 6C3.10457 6 4 6.89543 4 8Z" fill="#B2B9C5"/>
|
5
|
+
<path d="M10 8C10 9.10457 9.10457 10 8 10C6.89543 10 6 9.10457 6 8C6 6.89543 6.89543 6 8 6C9.10457 6 10 6.89543 10 8Z" fill="#B2B9C5"/>
|
6
|
+
<path d="M4 14C4 15.1046 3.10457 16 2 16C0.89543 16 0 15.1046 0 14C0 12.8954 0.89543 12 2 12C3.10457 12 4 12.8954 4 14Z" fill="#B2B9C5"/>
|
7
|
+
<path d="M10 14C10 15.1046 9.10457 16 8 16C6.89543 16 6 15.1046 6 14C6 12.8954 6.89543 12 8 12C9.10457 12 10 12.8954 10 14Z" fill="#B2B9C5"/>
|
8
|
+
</svg>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="12" viewBox="0 0 14 12" fill="none">
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.09548 3.62522L10.8209 1.59974L9.53978 0.508423L0.199219 11.4916H13.7992V9.80865H11.9546C11.7571 7.4083 10.7198 5.25339 9.09548 3.62522ZM10.2648 9.80859C10.0777 7.91689 9.26383 6.22054 8.00053 4.91205L3.83843 9.80864L10.2648 9.80859Z" fill="white"/>
|
3
|
+
</svg>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="10" viewBox="0 0 14 10" fill="none">
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.199219 9.85718V0.142822H1.75351L1.75352 9.85718H0.199219ZM5.38021 8.20572L2.14209 4.99999L5.38021 1.79425V4.19855L8.61833 4.19855V1.79425L11.8564 4.99999L8.61832 8.20572L8.61833 5.80142L5.38021 5.80142V8.20572ZM12.2449 0.142822V9.85718H13.7992V0.142822H12.2449Z" fill="white"/>
|
3
|
+
</svg>
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none">
|
2
|
+
<path d="M5.33336 14L0 8.66664L1.06667 7.59997L6.40003 12.9333L5.33336 14Z" fill="white"/>
|
3
|
+
<path d="M8.42227 9.97776L4.00002 9.99998L4.02224 5.57774L5.67225 7.22775L7.22781 5.67219L5.57781 4.02218L10.0001 3.99996L9.97783 8.4222L8.32782 6.7722L6.77226 8.32776L8.42227 9.97776Z" fill="white"/>
|
4
|
+
<path d="M7.59997 1.06667L12.9333 6.40003L14 5.33336L8.66664 0L7.59997 1.06667Z" fill="white"/>
|
5
|
+
</svg>
|
@@ -0,0 +1,3 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none">
|
2
|
+
<path d="M12.4444 0H1.55556C0.7 0 0 0.7 0 1.55556V12.4444C0 13.3 0.7 14 1.55556 14H12.4444C13.3 14 14 13.3 14 12.4444V1.55556C14 0.7 13.3 0 12.4444 0ZM7.80111 3.15778L8.62556 2.33333L9.72222 3.43L10.8189 2.33333L11.6433 3.15778L10.5467 4.25444L11.6433 5.35111L10.8189 6.17556L9.72222 5.08667L8.62556 6.18333L7.80111 5.35889L8.89778 4.26222L7.80111 3.15778ZM2.52778 3.67111H6.41667V4.83778H2.52778V3.67111ZM6.61111 10.1111H5.05556V11.6667H3.88889V10.1111H2.33333V8.94444H3.88889V7.38889H5.05556V8.94444H6.61111V10.1111ZM11.6667 11.0833H7.77778V9.91667H11.6667V11.0833ZM11.6667 9.13889H7.77778V7.97222H11.6667V9.13889Z" fill="#263238"/>
|
3
|
+
</svg>
|
@@ -270,6 +270,12 @@
|
|
270
270
|
:text="buttonText.cancel"
|
271
271
|
@click="$emit('on-cancel-view')"
|
272
272
|
/>
|
273
|
+
<reset-container v-if="!filterViews || !filterViews.length">
|
274
|
+
<reset-button @click="$emit('on-reset-filters')">
|
275
|
+
<icon :name="'update'" size="14px" :color="theme.colors.blue" />
|
276
|
+
<div>{{ $gettext('reset_filters') }}</div>
|
277
|
+
</reset-button>
|
278
|
+
</reset-container>
|
273
279
|
</button-container>
|
274
280
|
</container-wrapper>
|
275
281
|
</template>
|
@@ -331,6 +337,16 @@ const ButtonContainer = styled.div`
|
|
331
337
|
padding: 15px;
|
332
338
|
`
|
333
339
|
|
340
|
+
const ResetContainer = styled.div`
|
341
|
+
display: grid;
|
342
|
+
align-content: center;
|
343
|
+
margin-left: auto;
|
344
|
+
div {
|
345
|
+
margin-top: 0;
|
346
|
+
align-self: center;
|
347
|
+
}
|
348
|
+
`
|
349
|
+
|
334
350
|
const ColumnContainer = styled.div``
|
335
351
|
|
336
352
|
const DragContainer = styled.div`
|
@@ -457,6 +473,7 @@ export default {
|
|
457
473
|
DeleteIcon,
|
458
474
|
UpperContainer,
|
459
475
|
ResetButton,
|
476
|
+
ResetContainer,
|
460
477
|
VueDatePicker
|
461
478
|
},
|
462
479
|
props: {
|
@@ -70,6 +70,9 @@ export default {
|
|
70
70
|
},
|
71
71
|
settingsTranslations: {
|
72
72
|
required: false
|
73
|
+
},
|
74
|
+
closeDropdown: {
|
75
|
+
required: false
|
73
76
|
}
|
74
77
|
},
|
75
78
|
data() {
|
@@ -122,6 +125,7 @@ export default {
|
|
122
125
|
this.$emit('on-filter-view-select', item)
|
123
126
|
},
|
124
127
|
onViewDelete(item) {
|
128
|
+
this.onToggleDropdown()
|
125
129
|
this.$emit('on-filter-view-delete', item)
|
126
130
|
},
|
127
131
|
onApplyCurrentView() {
|
@@ -138,6 +142,13 @@ export default {
|
|
138
142
|
},
|
139
143
|
beforeDestroy() {
|
140
144
|
document.removeEventListener('click', this.clickOutside)
|
145
|
+
},
|
146
|
+
watch: {
|
147
|
+
closeDropdown(newVal) {
|
148
|
+
if (newVal) {
|
149
|
+
this.isDropdownOpen = false
|
150
|
+
}
|
151
|
+
}
|
141
152
|
}
|
142
153
|
}
|
143
154
|
</script>
|
@@ -1,9 +1,13 @@
|
|
1
1
|
<template>
|
2
|
-
<wrapper>
|
3
|
-
<icon-image
|
2
|
+
<wrapper :disabled="disabled" :size="size" :cursor="cursor">
|
3
|
+
<icon-image
|
4
|
+
:color="color"
|
5
|
+
:background-color="backgroundColor"
|
6
|
+
:hovered-color="hoveredColor"
|
7
|
+
>
|
4
8
|
<i v-html="icon.html" />
|
5
9
|
</icon-image>
|
6
|
-
<striked-line v-if="isStriked"></striked-line>
|
10
|
+
<striked-line v-if="isStriked" :color="color"></striked-line>
|
7
11
|
</wrapper>
|
8
12
|
</template>
|
9
13
|
|
@@ -48,27 +52,31 @@ const props = defineProps({
|
|
48
52
|
isStriked: {
|
49
53
|
required: false,
|
50
54
|
default: false
|
55
|
+
},
|
56
|
+
backgroundColor: {
|
57
|
+
required: false,
|
58
|
+
default: null
|
51
59
|
}
|
52
60
|
})
|
53
61
|
|
54
|
-
const Wrapper = styled('div'
|
62
|
+
const Wrapper = styled('div', {
|
63
|
+
size: String,
|
64
|
+
disabled: Boolean,
|
65
|
+
cursor: String
|
66
|
+
})`
|
55
67
|
display: flex;
|
56
68
|
position: relative;
|
57
69
|
align-content: center;
|
58
70
|
justify-content: center;
|
59
|
-
width: ${props.size};
|
60
|
-
height: ${props.size};
|
61
|
-
min-width: ${props.size};
|
62
|
-
min-height: ${props.size};
|
63
|
-
cursor: ${props.disabled ? 'not-allowed' : props.cursor};
|
71
|
+
width: ${(props) => props.size};
|
72
|
+
height: ${(props) => props.size};
|
73
|
+
min-width: ${(props) => props.size};
|
74
|
+
min-height: ${(props) => props.size};
|
75
|
+
cursor: ${(props) => (props.disabled ? 'not-allowed' : props.cursor)};
|
64
76
|
line-height: 0;
|
65
77
|
`
|
66
|
-
|
67
|
-
|
68
|
-
color: String,
|
69
|
-
hoveredColor: String
|
70
|
-
}
|
71
|
-
const StrikedLine = styled.div`
|
78
|
+
|
79
|
+
const StrikedLine = styled('div', { color: String })`
|
72
80
|
display: flex;
|
73
81
|
position: absolute;
|
74
82
|
bottom: 0;
|
@@ -77,29 +85,33 @@ const StrikedLine = styled.div`
|
|
77
85
|
justify-content: center;
|
78
86
|
width: 143%;
|
79
87
|
height: 8%;
|
80
|
-
background-color: ${({ theme }) => theme.colors[
|
88
|
+
background-color: ${({ theme, color }) => theme.colors[color] || color};
|
81
89
|
min-height: 0;
|
82
90
|
line-height: 0;
|
83
91
|
transform-origin: 0% 100%;
|
84
92
|
transform: rotate(-45deg);
|
85
93
|
`
|
86
|
-
const IconImage = styled
|
94
|
+
const IconImage = styled('div', {
|
95
|
+
color: String,
|
96
|
+
backgroundColor: String,
|
97
|
+
hoveredColor: String
|
98
|
+
})`
|
87
99
|
width: 100%;
|
88
100
|
svg {
|
89
101
|
width: 100%;
|
90
102
|
height: 100%;
|
91
|
-
background-color: ${(props) =>
|
92
|
-
|
103
|
+
background-color: ${(props) =>
|
104
|
+
props.backgroundColor ? props.backgroundColor : 'transparent'};
|
105
|
+
padding: ${(props) => (props.backgroundColor ? '3px' : '0')};
|
93
106
|
}
|
94
107
|
svg path {
|
95
|
-
${({ theme }) =>
|
96
|
-
props.color && `fill: ${theme.colors[props.color] || props.color};`}
|
108
|
+
${({ theme, color }) => color && `fill: ${theme.colors[color] || color};`}
|
97
109
|
}
|
98
110
|
&:hover > svg path {
|
99
|
-
${props.hoveredColor && `fill: ${props.hoveredColor};`}
|
111
|
+
${(props) => props.hoveredColor && `fill: ${props.hoveredColor};`}
|
100
112
|
}
|
101
113
|
&:hover + div {
|
102
|
-
background-color: ${props.hoveredColor};
|
114
|
+
background-color: ${(props) => props.hoveredColor};
|
103
115
|
}
|
104
116
|
`
|
105
117
|
|
@@ -3,10 +3,11 @@
|
|
3
3
|
<container
|
4
4
|
:checkColor="checkColor"
|
5
5
|
:size="size"
|
6
|
-
:hasLabel="
|
6
|
+
:hasLabel="label && !!label.length"
|
7
7
|
:backgroundColor="backgroundColor"
|
8
8
|
:isChecked="isChecked"
|
9
9
|
:isDisabled="isDisabled"
|
10
|
+
:cursorType="cursorType"
|
10
11
|
>
|
11
12
|
<input-checkbox
|
12
13
|
type="checkbox"
|
@@ -17,7 +18,7 @@
|
|
17
18
|
<check-wrapper :hasLabel="hasLabel">
|
18
19
|
<span class="checkmark"></span>
|
19
20
|
</check-wrapper>
|
20
|
-
<label-text v-if="
|
21
|
+
<label-text v-if="label && !!label.length">{{ label }}</label-text>
|
21
22
|
</container>
|
22
23
|
</component-wrapper>
|
23
24
|
</template>
|
@@ -33,6 +34,7 @@
|
|
33
34
|
// size="small"
|
34
35
|
// backgroundColor="red"
|
35
36
|
// :isDisabled="true"
|
37
|
+
// cursorType="default"
|
36
38
|
// />
|
37
39
|
import styled from 'vue3-styled-components'
|
38
40
|
|
@@ -55,7 +57,8 @@ const containerAttrs = {
|
|
55
57
|
hasLabel: Boolean,
|
56
58
|
backgroundColor: String,
|
57
59
|
isChecked: Boolean,
|
58
|
-
isDisabled: Boolean
|
60
|
+
isDisabled: Boolean,
|
61
|
+
cursorType: String
|
59
62
|
}
|
60
63
|
const Container = styled('label', containerAttrs)`
|
61
64
|
display: grid;
|
@@ -64,7 +67,7 @@ const Container = styled('label', containerAttrs)`
|
|
64
67
|
align-content: center;
|
65
68
|
color: ${(props) => props.theme.colors.black};
|
66
69
|
position: relative;
|
67
|
-
cursor: ${(props) => (props.isDisabled ? 'not-allowed' :
|
70
|
+
cursor: ${(props) => (props.isDisabled ? 'not-allowed' : props.cursorType)};
|
68
71
|
font-size: 16px;
|
69
72
|
user-select: none;
|
70
73
|
|
@@ -89,7 +92,7 @@ const Container = styled('label', containerAttrs)`
|
|
89
92
|
: props.theme.colors.green
|
90
93
|
: props.isDisabled
|
91
94
|
? props.theme.colors.lightGray
|
92
|
-
:
|
95
|
+
: props.theme.colors.white};
|
93
96
|
border-radius: 4px;
|
94
97
|
border: 1px solid
|
95
98
|
${(props) =>
|
@@ -183,6 +186,10 @@ export default {
|
|
183
186
|
dataId: {
|
184
187
|
type: String,
|
185
188
|
default: ''
|
189
|
+
},
|
190
|
+
cursorType: {
|
191
|
+
type: String,
|
192
|
+
default: 'pointer'
|
186
193
|
}
|
187
194
|
},
|
188
195
|
computed: {
|
@@ -313,8 +313,7 @@ export default {
|
|
313
313
|
return {
|
314
314
|
textInput: '',
|
315
315
|
isFocused: false,
|
316
|
-
warningIcon: warningIcon
|
317
|
-
isBlurred: false
|
316
|
+
warningIcon: warningIcon
|
318
317
|
}
|
319
318
|
},
|
320
319
|
props: {
|
@@ -549,8 +548,7 @@ export default {
|
|
549
548
|
return array
|
550
549
|
},
|
551
550
|
onInput(event) {
|
552
|
-
if (this.
|
553
|
-
this.isBlurred = false
|
551
|
+
if (!this.isFocused) {
|
554
552
|
return
|
555
553
|
}
|
556
554
|
if (event.target.value === '') {
|
@@ -567,8 +565,6 @@ export default {
|
|
567
565
|
},
|
568
566
|
onInputBlur(e) {
|
569
567
|
this.isFocused = false
|
570
|
-
// setting isBlurred so we don't trigger onInput as well
|
571
|
-
this.isBlurred = true
|
572
568
|
let value = e.target.value
|
573
569
|
let evaluatedInput = this.onEvaluateCode(e)
|
574
570
|
this.onChangeHandler(evaluatedInput ? evaluatedInput : value)
|
@@ -81,8 +81,6 @@ const paginationWrapper = styled.nav`
|
|
81
81
|
flex-wrap: wrap;
|
82
82
|
justify-content: flex-end;
|
83
83
|
align-items: center;
|
84
|
-
margin-bottom: 2px;
|
85
|
-
margin-top: 10px;
|
86
84
|
`
|
87
85
|
const paginationLink = styled.div`
|
88
86
|
display: flex;
|
@@ -92,15 +90,18 @@ const paginationLink = styled.div`
|
|
92
90
|
border-radius: 3px;
|
93
91
|
white-space: nowrap;
|
94
92
|
cursor: pointer;
|
93
|
+
color: ${(props) => props.theme.colors.brightBlue};
|
95
94
|
|
96
95
|
&.active {
|
97
|
-
color:
|
96
|
+
color: ${(props) => props.theme.colors.white};
|
98
97
|
background-color: ${(props) => props.theme.colors.brightBlue};
|
99
98
|
padding: 7px 12px;
|
100
99
|
border-radius: 4px;
|
101
100
|
}
|
102
101
|
`
|
103
|
-
const arrowText = styled.div
|
102
|
+
const arrowText = styled.div`
|
103
|
+
color: ${(props) => props.theme.colors.brightBlue};
|
104
|
+
`
|
104
105
|
const arrowIconContainer = styled.div`
|
105
106
|
margin: 0 10px;
|
106
107
|
display: flex;
|
@@ -69,7 +69,7 @@
|
|
69
69
|
</template>
|
70
70
|
|
71
71
|
<script>
|
72
|
-
// import
|
72
|
+
// import ProjectMarker from "@eturnity/eturnity_reusable_components/src/components/projectMarker"
|
73
73
|
// To use:
|
74
74
|
// <project-marker
|
75
75
|
// :activeLanguage="'en-us'"
|
@@ -0,0 +1,145 @@
|
|
1
|
+
<template>
|
2
|
+
<page-container>
|
3
|
+
<box-container>
|
4
|
+
<selected-container
|
5
|
+
>{{ numberSelected }} {{ $gettext('selected') }}</selected-container
|
6
|
+
>
|
7
|
+
<list-container v-if="optionsList.length">
|
8
|
+
<list-item
|
9
|
+
v-for="item in optionsList"
|
10
|
+
:key="item.type"
|
11
|
+
:hoverColor="item.hoverColor"
|
12
|
+
@click="$emit('on-' + item.type)"
|
13
|
+
>
|
14
|
+
{{ item.name }}
|
15
|
+
</list-item>
|
16
|
+
</list-container>
|
17
|
+
<empty-text v-if="!optionsList.length">
|
18
|
+
{{ $gettext('no_batch_actions_available') }}
|
19
|
+
</empty-text>
|
20
|
+
<icon-container @click="$emit('on-close')">
|
21
|
+
<icon
|
22
|
+
name="close_for_modals,_tool_tips"
|
23
|
+
color="white"
|
24
|
+
size="14px"
|
25
|
+
cursor="pointer"
|
26
|
+
/>
|
27
|
+
</icon-container>
|
28
|
+
</box-container>
|
29
|
+
</page-container>
|
30
|
+
</template>
|
31
|
+
|
32
|
+
<script>
|
33
|
+
// import SelectedOptions from "@eturnity/eturnity_reusable_components/src/components/selectedOptions"
|
34
|
+
// optionsList = [
|
35
|
+
// {
|
36
|
+
// type: 'export',
|
37
|
+
// name: 'Export'
|
38
|
+
// },
|
39
|
+
// {
|
40
|
+
// type: 'delete',
|
41
|
+
// name: 'Delete',
|
42
|
+
// hoverColor: 'red' // default is green
|
43
|
+
// }
|
44
|
+
// ]
|
45
|
+
// @on-${type}="function" should $emit the callback for the 'type' in the optionsList
|
46
|
+
// <selected-options
|
47
|
+
// :numberSelected="numberSelected"
|
48
|
+
// :optionsList="optionsList"
|
49
|
+
// @on-close="onCloseFunction()"
|
50
|
+
// @on-export="function()" @on-delete="function()"
|
51
|
+
// />
|
52
|
+
import styled from 'vue3-styled-components'
|
53
|
+
import Icon from '../icon'
|
54
|
+
|
55
|
+
const PageContainer = styled.div`
|
56
|
+
position: fixed;
|
57
|
+
bottom: 30px;
|
58
|
+
left: 50%;
|
59
|
+
transform: translateX(-50%);
|
60
|
+
`
|
61
|
+
|
62
|
+
const SelectedContainer = styled.div`
|
63
|
+
display: grid;
|
64
|
+
align-items: center;
|
65
|
+
height: 100%;
|
66
|
+
padding-right: 20px;
|
67
|
+
border-right: 1px solid rgba(255, 255, 255, 0.2);
|
68
|
+
`
|
69
|
+
|
70
|
+
const BoxContainer = styled.div`
|
71
|
+
display: flex;
|
72
|
+
align-items: center;
|
73
|
+
background-color: ${(props) => props.theme.colors.black};
|
74
|
+
opacity: 90%;
|
75
|
+
color: ${(props) => props.theme.colors.white};
|
76
|
+
border-radius: 4px;
|
77
|
+
padding: 8px 10px 8px 20px;
|
78
|
+
font-size: 14px;
|
79
|
+
height: 40px;
|
80
|
+
`
|
81
|
+
|
82
|
+
const ListContainer = styled.div`
|
83
|
+
padding: 0 20px;
|
84
|
+
display: flex;
|
85
|
+
gap: 20px;
|
86
|
+
color: ${(props) => props.theme.colors.white};
|
87
|
+
`
|
88
|
+
|
89
|
+
const ListAttrs = {
|
90
|
+
hoverColor: String
|
91
|
+
}
|
92
|
+
const ListItem = styled('div', ListAttrs)`
|
93
|
+
cursor: pointer;
|
94
|
+
&:hover {
|
95
|
+
color: ${(props) =>
|
96
|
+
props.hoverColor
|
97
|
+
? props.theme.colors[props.hoverColor]
|
98
|
+
: props.theme.colors.green};
|
99
|
+
}
|
100
|
+
`
|
101
|
+
|
102
|
+
const IconContainer = styled.div`
|
103
|
+
display: grid;
|
104
|
+
align-items: center;
|
105
|
+
justify-items: center;
|
106
|
+
height: 30px;
|
107
|
+
width: 30px;
|
108
|
+
cursor: pointer;
|
109
|
+
margin-left: 20px;
|
110
|
+
|
111
|
+
&:hover {
|
112
|
+
background: rgba(255, 255, 255, 0.1);
|
113
|
+
border-radius: 4px;
|
114
|
+
}
|
115
|
+
`
|
116
|
+
|
117
|
+
const EmptyText = styled.div`
|
118
|
+
color: ${(props) => props.theme.colors.white};
|
119
|
+
font-size: 13px;
|
120
|
+
padding-left: 16px;
|
121
|
+
`
|
122
|
+
|
123
|
+
export default {
|
124
|
+
name: 'selected-options',
|
125
|
+
components: {
|
126
|
+
PageContainer,
|
127
|
+
BoxContainer,
|
128
|
+
SelectedContainer,
|
129
|
+
ListContainer,
|
130
|
+
ListItem,
|
131
|
+
Icon,
|
132
|
+
IconContainer,
|
133
|
+
EmptyText
|
134
|
+
},
|
135
|
+
props: {
|
136
|
+
optionsList: {
|
137
|
+
required: true
|
138
|
+
},
|
139
|
+
numberSelected: {
|
140
|
+
required: true,
|
141
|
+
default: 0
|
142
|
+
}
|
143
|
+
}
|
144
|
+
}
|
145
|
+
</script>
|