@eturnity/eturnity_reusable_components 1.2.20-3d-master.0 → 1.2.21
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/babel.config.js +1 -1
- package/package.json +3 -2
- package/src/App.vue +53 -75
- package/src/assets/svgIcons/{duplicate-3.svg → bookmaker.svg} +0 -0
- package/src/assets/svgIcons/cross.svg +4 -0
- package/src/assets/svgIcons/obstacle_tool.svg +1 -1
- package/src/assets/svgIcons/transfer.svg +4 -0
- package/src/assets/theme.js +0 -2
- package/src/components/icon/index.vue +19 -11
- package/src/components/infoText/index.vue +53 -68
- package/src/components/inputs/inputNumber/index.vue +25 -120
- package/src/components/inputs/inputText/index.vue +10 -12
- package/src/components/inputs/radioButton/index.vue +32 -39
- package/src/components/inputs/searchInput/index.vue +2 -1
- package/src/components/inputs/textAreaInput/index.vue +2 -7
- package/src/components/inputs/toggle/index.vue +2 -2
- package/src/components/pageSubtitle/index.vue +8 -4
- package/src/components/pageTitle/index.vue +12 -4
- package/src/components/projectMarker/index.vue +285 -0
- package/src/components/tables/mainTable/index.vue +8 -3
- package/src/components/threeDots/index.vue +36 -27
- package/src/helpers/numberConverter.js +0 -4
- package/src/main.js +2 -0
- package/src/assets/icons/error_icon copy.png +0 -0
- package/src/assets/svgIcons/base_layer.svg +0 -3
- package/src/assets/svgIcons/margin_tool.svg +0 -4
- package/src/assets/svgIcons/redo.svg +0 -6
- package/src/assets/svgIcons/roof_layer.svg +0 -3
- package/src/assets/svgIcons/undo.svg +0 -6
- package/src/components/errorMessage/index.vue +0 -62
- package/src/components/iconWrapper/index.vue +0 -116
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<page-container :withDate="!!date">
|
|
3
|
+
<marker-container
|
|
4
|
+
v-if="markerData"
|
|
5
|
+
:backgroundColor="markerData.color"
|
|
6
|
+
:hasIcon="!!iconName"
|
|
7
|
+
:isEditionAllowed="editionAllowed"
|
|
8
|
+
:isActive="activated"
|
|
9
|
+
:cursor="cursor"
|
|
10
|
+
@click.native="editionAllowed
|
|
11
|
+
? activated = !activated
|
|
12
|
+
: ''
|
|
13
|
+
"
|
|
14
|
+
>
|
|
15
|
+
<icon
|
|
16
|
+
v-if="!!iconName"
|
|
17
|
+
:name="iconName"
|
|
18
|
+
color="white"
|
|
19
|
+
size="10px"
|
|
20
|
+
:cursor="cursor"
|
|
21
|
+
/>
|
|
22
|
+
<span>{{ markerData.translations[activeLanguage].name }}</span>
|
|
23
|
+
<dot-wrapper
|
|
24
|
+
v-if="editionAllowed"
|
|
25
|
+
class="dotContainer"
|
|
26
|
+
>
|
|
27
|
+
<dot-icon />
|
|
28
|
+
<dot-icon />
|
|
29
|
+
<dot-icon />
|
|
30
|
+
</dot-wrapper>
|
|
31
|
+
<edit-container
|
|
32
|
+
v-if="activated"
|
|
33
|
+
v-click-outside="clickOutsideActionHandler"
|
|
34
|
+
>
|
|
35
|
+
<edit-item @click.native="deleteModalOpened = !deleteModalOpened">
|
|
36
|
+
<delete-icon />
|
|
37
|
+
<div>{{ $gettext('Delete') }}</div>
|
|
38
|
+
</edit-item>
|
|
39
|
+
<edit-item @click.native="onEditClick">
|
|
40
|
+
<icon-container>
|
|
41
|
+
<icon
|
|
42
|
+
name="edit_button"
|
|
43
|
+
size="14px"
|
|
44
|
+
/>
|
|
45
|
+
</icon-container>
|
|
46
|
+
<div>{{ $gettext('Edit') }}</div>
|
|
47
|
+
</edit-item>
|
|
48
|
+
</edit-container>
|
|
49
|
+
</marker-container>
|
|
50
|
+
<date v-if="!!date">
|
|
51
|
+
{{ date }}
|
|
52
|
+
</date>
|
|
53
|
+
<modal
|
|
54
|
+
:isOpen="deleteModalOpened"
|
|
55
|
+
@on-close="closeDeleteModal"
|
|
56
|
+
:preventOutsideClose="true"
|
|
57
|
+
>
|
|
58
|
+
<modal-container>
|
|
59
|
+
<page-title :text="$gettext('delete_confirm_text')" />
|
|
60
|
+
<page-subtitle :text="$gettext('delete_confirm_subtext')" />
|
|
61
|
+
<cta-container>
|
|
62
|
+
<main-button
|
|
63
|
+
@click.native="onDelete"
|
|
64
|
+
:text="$gettext('Delete')"
|
|
65
|
+
/>
|
|
66
|
+
<main-button
|
|
67
|
+
type="cancel"
|
|
68
|
+
@click.native="closeDeleteModal"
|
|
69
|
+
:text="$gettext('Cancel')"
|
|
70
|
+
/>
|
|
71
|
+
</cta-container>
|
|
72
|
+
</modal-container>
|
|
73
|
+
</modal>
|
|
74
|
+
</page-container>
|
|
75
|
+
</template>
|
|
76
|
+
|
|
77
|
+
<script>
|
|
78
|
+
// import ThreeDots from "@eturnity/eturnity_reusable_components/src/components/projectMarker"
|
|
79
|
+
// To use:
|
|
80
|
+
// <project-marker
|
|
81
|
+
// :activeLanguage="'en-us'"
|
|
82
|
+
// :markerData="{"choice":"sold","translations":{"en-us":{"name":"Sold"}}","color":"#000"}"
|
|
83
|
+
// :isLimitedPartner="false"
|
|
84
|
+
// :isGroupSupport="false"
|
|
85
|
+
// :isEditable='false'
|
|
86
|
+
// :date="'23.07.2022'"
|
|
87
|
+
// @editHandler="onMarkerEdit($event)"
|
|
88
|
+
// @deleteHandler="onMarkerDelete($event)"
|
|
89
|
+
// />
|
|
90
|
+
|
|
91
|
+
import styled from "vue-styled-components"
|
|
92
|
+
import Icon from "../icon"
|
|
93
|
+
import Modal from '../modals/modal'
|
|
94
|
+
import PageTitle from '../pageTitle'
|
|
95
|
+
import DeleteIcon from '../deleteIcon'
|
|
96
|
+
import PageSubtitle from '../pageSubtitle'
|
|
97
|
+
import MainButton from '../buttons/mainButton'
|
|
98
|
+
|
|
99
|
+
const PageContainerAttrs = {
|
|
100
|
+
withDate: Boolean
|
|
101
|
+
}
|
|
102
|
+
const PageContainer = styled('div', PageContainerAttrs)`
|
|
103
|
+
display: flex;
|
|
104
|
+
align-items: center;
|
|
105
|
+
gap: 10px;
|
|
106
|
+
font-size: 12px;
|
|
107
|
+
line-height: 14px;
|
|
108
|
+
`
|
|
109
|
+
|
|
110
|
+
const ModalContainer = styled.div`
|
|
111
|
+
padding: 40px;
|
|
112
|
+
min-width: 500px;
|
|
113
|
+
`
|
|
114
|
+
|
|
115
|
+
const CtaContainer = styled.div`
|
|
116
|
+
display: flex;
|
|
117
|
+
gap: 20px;
|
|
118
|
+
margin-top: 30px;
|
|
119
|
+
`
|
|
120
|
+
|
|
121
|
+
const MarkerAttrs = {
|
|
122
|
+
backgroundColor: String,
|
|
123
|
+
hasIcon: Boolean,
|
|
124
|
+
isEditionAllowed: Boolean,
|
|
125
|
+
isActive: Boolean,
|
|
126
|
+
cursor: String
|
|
127
|
+
}
|
|
128
|
+
const MarkerContainer = styled('div', MarkerAttrs)`
|
|
129
|
+
display: grid;
|
|
130
|
+
grid-template-columns: ${(props) =>
|
|
131
|
+
props.hasIcon || props.isEditionAllowed ? 'auto 1fr' : '1fr'};
|
|
132
|
+
grid-gap: 5px;
|
|
133
|
+
position: relative;
|
|
134
|
+
align-items: center;
|
|
135
|
+
padding: 2px 7px;
|
|
136
|
+
color: ${(props) => props.theme.colors.white};
|
|
137
|
+
background-color: ${(props) =>
|
|
138
|
+
props.backgroundColor ? props.backgroundColor : props.theme.colors.grey3};
|
|
139
|
+
border-radius: 4px;
|
|
140
|
+
white-space: nowrap;
|
|
141
|
+
cursor: ${(props) => props.isEditionAllowed ? 'pointer' : props.cursor};
|
|
142
|
+
|
|
143
|
+
.dotContainer {
|
|
144
|
+
display: ${(props) => (props.isActive ? 'flex' : 'none')};
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
&:hover {
|
|
148
|
+
.dotContainer {
|
|
149
|
+
display: flex;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
`
|
|
153
|
+
|
|
154
|
+
const DotWrapper = styled.div`
|
|
155
|
+
display: flex;
|
|
156
|
+
gap: 2px;
|
|
157
|
+
cursor: pointer;
|
|
158
|
+
`
|
|
159
|
+
|
|
160
|
+
const DotIcon = styled.div`
|
|
161
|
+
width: 4px;
|
|
162
|
+
height: 4px;
|
|
163
|
+
border-radius: 100%;
|
|
164
|
+
background-color: ${(props) => props.theme.colors.white};
|
|
165
|
+
`
|
|
166
|
+
|
|
167
|
+
const EditContainer = styled.div`
|
|
168
|
+
position: absolute;
|
|
169
|
+
z-index: 99;
|
|
170
|
+
top: 22px;
|
|
171
|
+
display: grid;
|
|
172
|
+
background-color: ${(props) => props.theme.colors.white};
|
|
173
|
+
border: 1px solid ${(props) => props.theme.colors.grey4};
|
|
174
|
+
border-radius: 4px;
|
|
175
|
+
cursor: pointer;
|
|
176
|
+
overflow: hidden;
|
|
177
|
+
`
|
|
178
|
+
|
|
179
|
+
const EditItem = styled.div`
|
|
180
|
+
display: flex;
|
|
181
|
+
align-items: center;
|
|
182
|
+
gap: 12px;
|
|
183
|
+
color: ${(props) => props.theme.colors.black};
|
|
184
|
+
font-size: 13px;
|
|
185
|
+
padding: 4px 18px;
|
|
186
|
+
|
|
187
|
+
&:hover {
|
|
188
|
+
background-color: ${(props) => props.theme.colors.grey5};
|
|
189
|
+
}
|
|
190
|
+
`
|
|
191
|
+
|
|
192
|
+
const IconContainer = styled.div`
|
|
193
|
+
padding: 8px;
|
|
194
|
+
line-height: 0;
|
|
195
|
+
`
|
|
196
|
+
|
|
197
|
+
const Date = styled.div``
|
|
198
|
+
|
|
199
|
+
export default {
|
|
200
|
+
name: "project-marker",
|
|
201
|
+
components: {
|
|
202
|
+
PageContainer,
|
|
203
|
+
MarkerContainer,
|
|
204
|
+
DotWrapper,
|
|
205
|
+
DotIcon,
|
|
206
|
+
EditContainer,
|
|
207
|
+
EditItem,
|
|
208
|
+
DeleteIcon,
|
|
209
|
+
IconContainer,
|
|
210
|
+
Icon,
|
|
211
|
+
Modal,
|
|
212
|
+
ModalContainer,
|
|
213
|
+
CtaContainer,
|
|
214
|
+
PageTitle,
|
|
215
|
+
PageSubtitle,
|
|
216
|
+
MainButton,
|
|
217
|
+
Date
|
|
218
|
+
},
|
|
219
|
+
props: {
|
|
220
|
+
markerData: {
|
|
221
|
+
required: true
|
|
222
|
+
},
|
|
223
|
+
activeLanguage: {
|
|
224
|
+
required: true
|
|
225
|
+
},
|
|
226
|
+
date: {
|
|
227
|
+
required: false,
|
|
228
|
+
default: null
|
|
229
|
+
},
|
|
230
|
+
isEditable: {
|
|
231
|
+
required: false,
|
|
232
|
+
default: false
|
|
233
|
+
},
|
|
234
|
+
isGroupSupport: {
|
|
235
|
+
required: false,
|
|
236
|
+
default: false
|
|
237
|
+
},
|
|
238
|
+
isLimitedPartner: {
|
|
239
|
+
required: false,
|
|
240
|
+
default: false
|
|
241
|
+
},
|
|
242
|
+
cursor: {
|
|
243
|
+
required: false,
|
|
244
|
+
default: 'default'
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
data() {
|
|
248
|
+
return {
|
|
249
|
+
activated: false,
|
|
250
|
+
deleteModalOpened: false
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
computed: {
|
|
254
|
+
editionAllowed() {
|
|
255
|
+
return (this.markerData.can_be_deleted && (!this.isLimitedPartner || this.isGroupSupport)) && this.isEditable
|
|
256
|
+
},
|
|
257
|
+
iconName() {
|
|
258
|
+
if (this.markerData.choice === 'sold') {
|
|
259
|
+
return 'all_good'
|
|
260
|
+
} else if (this.markerData.choice === 'lost') {
|
|
261
|
+
return 'cross'
|
|
262
|
+
} else if (this.markerData.choice === 'transferred') {
|
|
263
|
+
return 'transfer'
|
|
264
|
+
} else {
|
|
265
|
+
return ''
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
methods: {
|
|
270
|
+
clickOutsideActionHandler() {
|
|
271
|
+
this.activated = false
|
|
272
|
+
},
|
|
273
|
+
closeDeleteModal() {
|
|
274
|
+
this.deleteModalOpened = false
|
|
275
|
+
},
|
|
276
|
+
onEditClick() {
|
|
277
|
+
this.$emit("editHandler")
|
|
278
|
+
},
|
|
279
|
+
onDelete() {
|
|
280
|
+
this.closeDeleteModal()
|
|
281
|
+
this.$emit("deleteHandler")
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
</script>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<spinner-wrapper v-if="isLoading">
|
|
9
9
|
<spinner />
|
|
10
10
|
</spinner-wrapper>
|
|
11
|
-
<table-container v-else>
|
|
11
|
+
<table-container v-else :cellPaddings="cellPaddings">
|
|
12
12
|
<slot />
|
|
13
13
|
</table-container>
|
|
14
14
|
</table-wrapper>
|
|
@@ -63,7 +63,8 @@ const SpinnerWrapper = styled.div`
|
|
|
63
63
|
justify-items: center;
|
|
64
64
|
`
|
|
65
65
|
|
|
66
|
-
const
|
|
66
|
+
const containerAttrs = { cellPaddings: String }
|
|
67
|
+
const TableContainer = styled("table", containerAttrs)`
|
|
67
68
|
width: 100%;
|
|
68
69
|
border-collapse: collapse;
|
|
69
70
|
border: none;
|
|
@@ -114,7 +115,7 @@ const TableContainer = styled.table`
|
|
|
114
115
|
}
|
|
115
116
|
|
|
116
117
|
td {
|
|
117
|
-
padding: 6px 6px 7px 4px;
|
|
118
|
+
padding: ${(props) => props.cellPaddings ? props.cellPaddings : "6px 6px 7px 4px" };
|
|
118
119
|
border-bottom: 1px solid ${(props) => props.theme.colors.grey4};
|
|
119
120
|
|
|
120
121
|
&.empty {
|
|
@@ -352,6 +353,10 @@ export default {
|
|
|
352
353
|
required: false,
|
|
353
354
|
default: true,
|
|
354
355
|
},
|
|
356
|
+
cellPaddings: {
|
|
357
|
+
required: false,
|
|
358
|
+
default: '',
|
|
359
|
+
},
|
|
355
360
|
isLoading: {
|
|
356
361
|
required: false,
|
|
357
362
|
default: false,
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
@click.stop
|
|
11
11
|
:top="getItemLocation('top')"
|
|
12
12
|
:right="getItemLocation('right')"
|
|
13
|
-
:containerWidth="childOpen ?
|
|
13
|
+
:containerWidth="childOpen ? 440 : 240"
|
|
14
|
+
ref="dropdownContainer"
|
|
14
15
|
>
|
|
15
16
|
<loading-container v-if="isLoading">
|
|
16
17
|
<spinner />
|
|
@@ -26,13 +27,13 @@
|
|
|
26
27
|
@click.stop="
|
|
27
28
|
onSelect({
|
|
28
29
|
item: child,
|
|
29
|
-
hasChildren: hasChildren(child)
|
|
30
|
+
hasChildren: hasChildren(child)
|
|
30
31
|
})
|
|
31
32
|
"
|
|
32
33
|
@keyup.enter.stop="
|
|
33
34
|
onSelect({
|
|
34
35
|
item: child,
|
|
35
|
-
hasChildren: hasChildren(child)
|
|
36
|
+
hasChildren: hasChildren(child)
|
|
36
37
|
})
|
|
37
38
|
"
|
|
38
39
|
>
|
|
@@ -51,7 +52,10 @@
|
|
|
51
52
|
@mouseover="onItemHover({ index, item })"
|
|
52
53
|
:isDisabled="item.disabled"
|
|
53
54
|
>
|
|
54
|
-
<arrow-left
|
|
55
|
+
<arrow-left
|
|
56
|
+
:hasChildren="hasChildren(item)"
|
|
57
|
+
v-if="hasChildren(item)"
|
|
58
|
+
/>
|
|
55
59
|
<span>
|
|
56
60
|
{{ item.name }}
|
|
57
61
|
</span>
|
|
@@ -117,8 +121,8 @@
|
|
|
117
121
|
// },
|
|
118
122
|
// ],
|
|
119
123
|
|
|
120
|
-
import styled from
|
|
121
|
-
import Spinner from
|
|
124
|
+
import styled from 'vue-styled-components'
|
|
125
|
+
import Spinner from '../spinner'
|
|
122
126
|
|
|
123
127
|
const PageContainer = styled.div`
|
|
124
128
|
display: grid;
|
|
@@ -155,11 +159,11 @@ const DotItem = styled.div`
|
|
|
155
159
|
`
|
|
156
160
|
|
|
157
161
|
const dropdownAttrs = { top: Number, right: Number, containerWidth: Number }
|
|
158
|
-
const DropdownContainer = styled(
|
|
162
|
+
const DropdownContainer = styled('div', dropdownAttrs)`
|
|
159
163
|
z-index: 99;
|
|
160
164
|
height: 200px;
|
|
161
|
-
top: ${(props) => props.top +
|
|
162
|
-
left: ${(props) => props.right - props.containerWidth +
|
|
165
|
+
top: ${(props) => props.top + 'px'};
|
|
166
|
+
left: ${(props) => props.right - props.containerWidth + 'px'};
|
|
163
167
|
position: absolute;
|
|
164
168
|
display: grid;
|
|
165
169
|
grid-template-columns: auto auto;
|
|
@@ -180,19 +184,21 @@ const OptionsContainer = styled.div`
|
|
|
180
184
|
border: 1px solid ${(props) => props.theme.colors.grey3};
|
|
181
185
|
display: grid;
|
|
182
186
|
grid-template-columns: 1fr;
|
|
183
|
-
min-width:
|
|
187
|
+
min-width: 220px;
|
|
188
|
+
max-width: 220px;
|
|
184
189
|
width: max-content;
|
|
185
190
|
border-radius: 4px;
|
|
186
191
|
background-color: #fff;
|
|
187
192
|
max-height: 220px;
|
|
188
193
|
overflow: auto;
|
|
189
194
|
height: max-content;
|
|
195
|
+
white-space: normal;
|
|
190
196
|
`
|
|
191
197
|
|
|
192
198
|
const optionAttrs = { isDisabled: Boolean }
|
|
193
|
-
const OptionItem = styled(
|
|
199
|
+
const OptionItem = styled('div', optionAttrs)`
|
|
194
200
|
padding: 12px;
|
|
195
|
-
cursor: ${(props) => (props.isDisabled ?
|
|
201
|
+
cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
|
|
196
202
|
font-size: 13px;
|
|
197
203
|
position: relative;
|
|
198
204
|
|
|
@@ -222,7 +228,7 @@ const OptionChild = styled.div`
|
|
|
222
228
|
`
|
|
223
229
|
|
|
224
230
|
const arrowAttrs = { hasChildren: Boolean }
|
|
225
|
-
const ArrowLeft = styled(
|
|
231
|
+
const ArrowLeft = styled('span', arrowAttrs)`
|
|
226
232
|
border: solid #9f9f9f;
|
|
227
233
|
border-width: 0 1.5px 1.5px 0;
|
|
228
234
|
display: inline-block;
|
|
@@ -230,16 +236,18 @@ const ArrowLeft = styled("span", arrowAttrs)`
|
|
|
230
236
|
margin-bottom: 1px;
|
|
231
237
|
transform: rotate(135deg);
|
|
232
238
|
margin-right: 3px;
|
|
233
|
-
visibility: ${(props) => (props.hasChildren ?
|
|
239
|
+
visibility: ${(props) => (props.hasChildren ? 'visible' : 'hidden')};
|
|
234
240
|
`
|
|
235
241
|
|
|
236
242
|
const childAttrs = { isOpen: Boolean }
|
|
237
|
-
const ChildrenContainer = styled(
|
|
243
|
+
const ChildrenContainer = styled('div', childAttrs)`
|
|
238
244
|
border: ${(props) =>
|
|
239
|
-
props.isOpen ?
|
|
245
|
+
props.isOpen ? '1px solid' + props.theme.colors.grey3 : 'none'};
|
|
240
246
|
display: grid;
|
|
241
247
|
grid-template-columns: 1fr;
|
|
242
248
|
min-width: 200px;
|
|
249
|
+
max-width: 200px;
|
|
250
|
+
white-space: normal;
|
|
243
251
|
width: max-content;
|
|
244
252
|
border-radius: 4px;
|
|
245
253
|
background-color: #fff;
|
|
@@ -250,7 +258,7 @@ const ChildrenContainer = styled("div", childAttrs)`
|
|
|
250
258
|
`
|
|
251
259
|
|
|
252
260
|
export default {
|
|
253
|
-
name:
|
|
261
|
+
name: 'three-dots',
|
|
254
262
|
components: {
|
|
255
263
|
PageContainer,
|
|
256
264
|
ButtonContainer,
|
|
@@ -262,22 +270,23 @@ export default {
|
|
|
262
270
|
ArrowLeft,
|
|
263
271
|
DropdownContainer,
|
|
264
272
|
Spinner,
|
|
265
|
-
LoadingContainer
|
|
273
|
+
LoadingContainer
|
|
266
274
|
},
|
|
267
275
|
props: {
|
|
268
276
|
options: {
|
|
269
|
-
required: true
|
|
277
|
+
required: true
|
|
270
278
|
},
|
|
271
279
|
isLoading: {
|
|
272
280
|
required: false,
|
|
273
|
-
default: false
|
|
274
|
-
}
|
|
281
|
+
default: false
|
|
282
|
+
}
|
|
275
283
|
},
|
|
276
284
|
data() {
|
|
277
285
|
return {
|
|
278
286
|
isOpen: false,
|
|
279
287
|
hoverItem: null,
|
|
280
288
|
childOpen: null,
|
|
289
|
+
containerWidth: 16
|
|
281
290
|
}
|
|
282
291
|
},
|
|
283
292
|
methods: {
|
|
@@ -285,15 +294,15 @@ export default {
|
|
|
285
294
|
this.isOpen = !this.isOpen
|
|
286
295
|
|
|
287
296
|
if (this.isOpen) {
|
|
288
|
-
document.addEventListener(
|
|
297
|
+
document.addEventListener('click', this.clickOutside)
|
|
289
298
|
} else {
|
|
290
|
-
document.removeEventListener(
|
|
299
|
+
document.removeEventListener('click', this.clickOutside)
|
|
291
300
|
}
|
|
292
301
|
},
|
|
293
302
|
getItemLocation(value) {
|
|
294
303
|
let ref = this.$refs.dropdownItem
|
|
295
304
|
let location = ref.$el.getBoundingClientRect()[value]
|
|
296
|
-
if (value ===
|
|
305
|
+
if (value === 'top') {
|
|
297
306
|
location = location + window.scrollY
|
|
298
307
|
}
|
|
299
308
|
return location
|
|
@@ -310,7 +319,7 @@ export default {
|
|
|
310
319
|
if (hasChildren || item.disabled) {
|
|
311
320
|
return
|
|
312
321
|
}
|
|
313
|
-
this.$emit(
|
|
322
|
+
this.$emit('on-select', item)
|
|
314
323
|
this.isOpen = false
|
|
315
324
|
},
|
|
316
325
|
clickOutside(event) {
|
|
@@ -318,7 +327,7 @@ export default {
|
|
|
318
327
|
return
|
|
319
328
|
}
|
|
320
329
|
this.toggleButton()
|
|
321
|
-
}
|
|
322
|
-
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
323
332
|
}
|
|
324
333
|
</script>
|
|
@@ -4,9 +4,6 @@ export const stringToNumber = ({
|
|
|
4
4
|
allowNegative
|
|
5
5
|
}) => {
|
|
6
6
|
// This is for saving. It converts our input string to a readable number
|
|
7
|
-
if (value === undefined) {
|
|
8
|
-
value = ''
|
|
9
|
-
}
|
|
10
7
|
let newVal = value.toString()
|
|
11
8
|
const selectedLang = localStorage.getItem('lang')
|
|
12
9
|
// The first replace will replace not allowed characters with a blank
|
|
@@ -94,7 +91,6 @@ export const numberToString = ({ value, numberPrecision }) => {
|
|
|
94
91
|
? 'fr-fr'
|
|
95
92
|
: localStorage.getItem('lang')
|
|
96
93
|
: 'en-US'
|
|
97
|
-
value=parseFloat(value)
|
|
98
94
|
return value.toLocaleString(selectedLang, {
|
|
99
95
|
minimumFractionDigits: numberPrecision,
|
|
100
96
|
maximumFractionDigits: numberPrecision
|
package/src/main.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import Vue from "vue"
|
|
2
2
|
import App from "./App.vue"
|
|
3
3
|
import VueCompositionAPI from "@vue/composition-api"
|
|
4
|
+
import vClickOutside from 'v-click-outside'
|
|
4
5
|
|
|
5
6
|
Vue.config.productionTip = false
|
|
6
7
|
|
|
7
8
|
Vue.use(VueCompositionAPI)
|
|
9
|
+
Vue.use(vClickOutside)
|
|
8
10
|
|
|
9
11
|
new Vue({
|
|
10
12
|
render: (h) => h(App),
|
|
Binary file
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<rect x="0.75" y="0.75" width="12.5" height="12.5" stroke="white" stroke-width="1.5"/>
|
|
3
|
-
<rect x="4.5" y="4.5" width="5" height="5" stroke="white" stroke-width="1.5"/>
|
|
4
|
-
</svg>
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<svg width="14" height="10" viewBox="0 0 14 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M4.51904 2H10.519V4H4.51904V2Z" fill="#555D61"/>
|
|
3
|
-
<path d="M4.51904 8H8.51904V10H4.51904V8Z" fill="#555D61"/>
|
|
4
|
-
<path d="M10.519 5.92321L13.4807 2.96161L10.519 0L10.519 5.92321Z" fill="#555D61"/>
|
|
5
|
-
<path d="M7.98391 8C7.29229 9.1956 5.99961 10 4.51904 10C2.3099 10 0.519043 8.20914 0.519043 6C0.519043 3.79086 2.3099 2 4.51904 2C5.99961 2 7.2923 2.8044 7.98391 4H4.51904C3.41447 4 2.51904 4.89543 2.51904 6C2.51904 7.10457 3.41447 8 4.51904 8H7.98391Z" fill="#555D61"/>
|
|
6
|
-
</svg>
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
<svg width="14" height="10" viewBox="0 0 14 10" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M9.48096 2H3.48096V4H9.48096V2Z" fill="white"/>
|
|
3
|
-
<path d="M9.48096 8H5.48096V10H9.48096V8Z" fill="white"/>
|
|
4
|
-
<path d="M3.48096 5.92321L0.519349 2.96161L3.48096 0L3.48096 5.92321Z" fill="white"/>
|
|
5
|
-
<path d="M6.01609 8C6.70771 9.1956 8.00039 10 9.48096 10C11.6901 10 13.481 8.20914 13.481 6C13.481 3.79086 11.6901 2 9.48096 2C8.00039 2 6.7077 2.8044 6.01609 4H9.48096C10.5855 4 11.481 4.89543 11.481 6C11.481 7.10457 10.5855 8 9.48096 8H6.01609Z" fill="white"/>
|
|
6
|
-
</svg>
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component-wrapper>
|
|
3
|
-
<text-overlay>
|
|
4
|
-
<slot></slot>
|
|
5
|
-
</text-overlay>
|
|
6
|
-
</component-wrapper>
|
|
7
|
-
</template>
|
|
8
|
-
|
|
9
|
-
<script>
|
|
10
|
-
// import InfoText from "@eturnity/eturnity_reusable_components/src/components/infoText"
|
|
11
|
-
//To use:
|
|
12
|
-
// <error-message
|
|
13
|
-
// alignText="right" // default is left
|
|
14
|
-
// />
|
|
15
|
-
|
|
16
|
-
import styled from 'vue-styled-components'
|
|
17
|
-
|
|
18
|
-
const TextOverlay = styled.div`
|
|
19
|
-
position: absolute;
|
|
20
|
-
top: calc(100% + 13px);
|
|
21
|
-
background: ${(props) => props.theme.colors.red};
|
|
22
|
-
padding: 10px;
|
|
23
|
-
width: max-content;
|
|
24
|
-
max-width: 100%;
|
|
25
|
-
min-width: 200px;
|
|
26
|
-
font-size: 11px;
|
|
27
|
-
font-weight: 400;
|
|
28
|
-
border-radius: 4px;
|
|
29
|
-
font-family: 'Lato-Bold', Arial;
|
|
30
|
-
z-index: 10;
|
|
31
|
-
color: ${(props) => props.theme.colors.white};
|
|
32
|
-
|
|
33
|
-
:before {
|
|
34
|
-
content: '';
|
|
35
|
-
background-color: ${(props) => props.theme.colors.red};
|
|
36
|
-
position: absolute;
|
|
37
|
-
top: 2px;
|
|
38
|
-
left: 40px;
|
|
39
|
-
height: 11px;
|
|
40
|
-
width: 11px;
|
|
41
|
-
transform-origin: center center;
|
|
42
|
-
transform: translate(-2em, -0.5em) rotate(45deg);
|
|
43
|
-
}
|
|
44
|
-
`
|
|
45
|
-
|
|
46
|
-
const ComponentWrapper = styled.div`
|
|
47
|
-
display: block;
|
|
48
|
-
`
|
|
49
|
-
|
|
50
|
-
export default {
|
|
51
|
-
name: 'info-text',
|
|
52
|
-
components: {
|
|
53
|
-
TextOverlay,
|
|
54
|
-
ComponentWrapper
|
|
55
|
-
},
|
|
56
|
-
props: {},
|
|
57
|
-
methods: {},
|
|
58
|
-
data() {
|
|
59
|
-
return {}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
</script>
|