@eturnity/eturnity_reusable_components 1.2.21 → 1.2.22-3d-master.4
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 +2 -3
- package/src/App.vue +75 -53
- package/src/assets/icons/error_icon copy.png +0 -0
- package/src/assets/svgIcons/base_layer.svg +3 -0
- package/src/assets/svgIcons/{bookmaker.svg → duplicate-3.svg} +0 -0
- package/src/assets/svgIcons/map_icon.svg +1 -1
- package/src/assets/svgIcons/margin_tool.svg +6 -0
- package/src/assets/svgIcons/obstacle_tool.svg +7 -11
- package/src/assets/svgIcons/redo.svg +6 -0
- package/src/assets/svgIcons/roof_layer.svg +3 -0
- package/src/assets/svgIcons/undo.svg +6 -0
- package/src/assets/theme.js +2 -0
- package/src/components/errorMessage/index.vue +62 -0
- package/src/components/icon/index.vue +13 -21
- package/src/components/iconWrapper/index.vue +116 -0
- package/src/components/infoText/index.vue +68 -53
- package/src/components/inputs/inputNumber/index.vue +120 -25
- package/src/components/inputs/inputText/index.vue +12 -10
- package/src/components/inputs/radioButton/index.vue +39 -32
- package/src/components/inputs/searchInput/index.vue +1 -2
- package/src/components/inputs/textAreaInput/index.vue +7 -2
- package/src/components/inputs/toggle/index.vue +2 -2
- package/src/components/pageSubtitle/index.vue +4 -8
- package/src/components/pageTitle/index.vue +4 -12
- package/src/components/tables/mainTable/index.vue +3 -8
- package/src/components/threeDots/index.vue +27 -36
- package/src/helpers/numberConverter.js +5 -0
- package/src/main.js +0 -2
- package/src/assets/svgIcons/cross.svg +0 -4
- package/src/assets/svgIcons/transfer.svg +0 -4
- package/src/components/projectMarker/index.vue +0 -285
|
@@ -1,285 +0,0 @@
|
|
|
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>
|