@eturnity/eturnity_reusable_components 1.2.19-EPDM-3412.9 → 1.2.19-EPDM-5295.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/babel.config.js +1 -1
- package/package.json +3 -2
- package/src/App.vue +104 -66
- package/src/assets/svgIcons/cross.svg +4 -0
- package/src/assets/svgIcons/transfer.svg +4 -0
- package/src/components/icon/index.vue +9 -4
- 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 +1 -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 +1 -1
- package/src/components/projectMarker/index.vue +279 -0
- package/src/components/tables/mainTable/index.vue +8 -3
- 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/components/errorMessage/index.vue +0 -62
package/babel.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eturnity/eturnity_reusable_components",
|
|
3
|
-
"version": "1.2.19-EPDM-
|
|
3
|
+
"version": "1.2.19-EPDM-5295.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vue-cli-service serve",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"core-js": "^3.6.5",
|
|
15
15
|
"vue": "^2.6.11",
|
|
16
16
|
"vue-styled-components": "^1.6.0",
|
|
17
|
-
"html-loader": "^0.5.5"
|
|
17
|
+
"html-loader": "^0.5.5",
|
|
18
|
+
"v-click-outside": "^2.1.4"
|
|
18
19
|
},
|
|
19
20
|
"devDependencies": {
|
|
20
21
|
"@storybook/addon-actions": "^6.2.8",
|
package/src/App.vue
CHANGED
|
@@ -1,97 +1,131 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<ThemeProvider :theme="getTheme()" :style="{ height: '100%' }">
|
|
3
3
|
<page-container>
|
|
4
|
+
<br />
|
|
5
|
+
<modal backdrop="dark" :isLoading="false" :isOpen="false">
|
|
6
|
+
<main-table titleText="My Table">
|
|
7
|
+
<thead>
|
|
8
|
+
<tr>
|
|
9
|
+
<th>Column 1</th>
|
|
10
|
+
<th>Column 2</th>
|
|
11
|
+
<th>Column 3</th>
|
|
12
|
+
<div />
|
|
13
|
+
</tr>
|
|
14
|
+
</thead>
|
|
15
|
+
<tbody>
|
|
16
|
+
<tr>
|
|
17
|
+
<!-- <table-dropdown
|
|
18
|
+
:colSpan="3"
|
|
19
|
+
:tableItems="getDropdownValues()"
|
|
20
|
+
@toggle-dropdown-open="toggleDropdownOpen()"
|
|
21
|
+
@item-selected="onItemSelected({ item: $event, index })"
|
|
22
|
+
:isOpen="isDropdownOpen()"
|
|
23
|
+
:optionItems="itemOptions"
|
|
24
|
+
:optionsDisplay="['display_name', 'company_item_number', 'model']"
|
|
25
|
+
/> -->
|
|
26
|
+
<td>Test</td>
|
|
27
|
+
<div class="icons-container">
|
|
28
|
+
<three-dots :options="listOptions" :isLoading="false" />
|
|
29
|
+
</div>
|
|
30
|
+
</tr>
|
|
31
|
+
</tbody>
|
|
32
|
+
</main-table>
|
|
33
|
+
</modal>
|
|
34
|
+
<row-container>
|
|
35
|
+
<div v-for='(item, index) in markersArray' :key="item.index">
|
|
36
|
+
<project-marker
|
|
37
|
+
:activeLanguage="'en-us'"
|
|
38
|
+
:markerData="item"
|
|
39
|
+
:isLimitedPartner="false"
|
|
40
|
+
:isGroupSupport="false"
|
|
41
|
+
:isEditable="true"
|
|
42
|
+
:gettext="gettext"
|
|
43
|
+
:date="'23.07.2022'"
|
|
44
|
+
@editHandler="consoleLog('edit index ' + index)"
|
|
45
|
+
@deleteHandler="consoleLog('delete id ' + item.id)"
|
|
46
|
+
/>
|
|
47
|
+
</div>
|
|
48
|
+
</row-container>
|
|
49
|
+
<br />
|
|
50
|
+
<iconCollection />
|
|
51
|
+
<br />
|
|
52
|
+
<toggle
|
|
53
|
+
@on-toggle-change="onInputChange($event)"
|
|
54
|
+
:isChecked="inputValue"
|
|
55
|
+
label="My Label Text"
|
|
56
|
+
infoTextMessage="This is my test message"
|
|
57
|
+
infoTextAlign="right"
|
|
58
|
+
labelAlign="right"
|
|
59
|
+
:disabled="false"
|
|
60
|
+
/>
|
|
4
61
|
<br />
|
|
5
62
|
<input-number
|
|
63
|
+
placeholder="Enter distance"
|
|
64
|
+
:numberPrecision="2"
|
|
6
65
|
:value="inputValue"
|
|
7
|
-
@input-change="
|
|
8
|
-
|
|
9
|
-
slotSize="50%"
|
|
10
|
-
><InputAnnexContainer>
|
|
11
|
-
<span>123m2</span>
|
|
12
|
-
<info-text size="10px" alignArrow="right" text="infoText ceci est le text"></info-text>
|
|
13
|
-
</InputAnnexContainer>
|
|
14
|
-
</input-number>
|
|
15
|
-
<input-number
|
|
16
|
-
:value="inputValue"
|
|
17
|
-
@input-change="inputValue = $event"
|
|
18
|
-
inputWidth="250px"
|
|
19
|
-
slotSize="50%"
|
|
20
|
-
:isError="true"
|
|
21
|
-
><InputAnnexContainer>
|
|
22
|
-
<span>123m2</span>
|
|
23
|
-
<info-text :style="{'justify-self': 'end'}" size="12px" alignArrow="center" text="infoText ceci est le text">This is the tooltip text</info-text>
|
|
24
|
-
</InputAnnexContainer>
|
|
25
|
-
</input-number>
|
|
66
|
+
@input-change="onInputChange($event)"
|
|
67
|
+
/>
|
|
26
68
|
<br />
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
infoTextAlign="right"
|
|
35
|
-
infoTextMessage="My info message"
|
|
36
|
-
label="Question 5"
|
|
37
|
-
alignItems="vertical"
|
|
38
|
-
inputWidth="250px"
|
|
39
|
-
minWidth="100px"
|
|
40
|
-
/>
|
|
41
|
-
<br/>
|
|
42
|
-
<input-number
|
|
43
|
-
:value="num"
|
|
44
|
-
@input-change="num = $event"
|
|
45
|
-
unitName="t"
|
|
46
|
-
id="biebie"
|
|
47
|
-
test="koko"
|
|
48
|
-
@keydown="keydownHandler"
|
|
69
|
+
<page-subtitle text="My Subtitle" infoText="My info Text" />
|
|
70
|
+
<spinner size="30px" />
|
|
71
|
+
<checkbox
|
|
72
|
+
label="Do you accept the Terms?"
|
|
73
|
+
:isChecked="true"
|
|
74
|
+
size="small"
|
|
75
|
+
:isDisabled="false"
|
|
49
76
|
/>
|
|
77
|
+
<external-button text="Click me!" minWidth="500px" />
|
|
50
78
|
</page-container>
|
|
51
79
|
</ThemeProvider>
|
|
52
80
|
</template>
|
|
53
81
|
|
|
54
82
|
<script>
|
|
55
|
-
import { ThemeProvider } from
|
|
56
|
-
import theme from
|
|
57
|
-
import styled from
|
|
58
|
-
import MainTable from
|
|
59
|
-
import ThreeDots from
|
|
60
|
-
import Toggle from
|
|
61
|
-
import InputNumber from
|
|
62
|
-
import Checkbox from
|
|
63
|
-
import PageSubtitle from
|
|
64
|
-
import Spinner from
|
|
65
|
-
import ExternalButton from
|
|
66
|
-
import
|
|
83
|
+
import { ThemeProvider } from 'vue-styled-components'
|
|
84
|
+
import theme from './assets/theme'
|
|
85
|
+
import styled from 'vue-styled-components'
|
|
86
|
+
import MainTable from '@/components/tables/mainTable'
|
|
87
|
+
import ThreeDots from '@/components/threeDots'
|
|
88
|
+
import Toggle from '@/components/inputs/toggle'
|
|
89
|
+
import InputNumber from '@/components/inputs/inputNumber'
|
|
90
|
+
import Checkbox from '@/components/inputs/checkbox'
|
|
91
|
+
import PageSubtitle from '@/components/pageSubtitle'
|
|
92
|
+
import Spinner from '@/components/spinner'
|
|
93
|
+
import ExternalButton from '@/components/buttons/externalButton'
|
|
94
|
+
import ProjectMarker from '@/components/projectMarker'
|
|
95
|
+
import iconCollection from '@/components/icon/iconCollection'
|
|
96
|
+
import Modal from '@/components/modals/modal'
|
|
67
97
|
// import TableDropdown from "@/components/tableDropdown"
|
|
68
|
-
const InputAnnexContainer = styled.div`
|
|
69
|
-
display: grid;
|
|
70
|
-
grid-template-columns: auto auto;
|
|
71
|
-
grid-gap: 10px;
|
|
72
|
-
`
|
|
73
98
|
|
|
74
99
|
const PageContainer = styled.div`
|
|
75
100
|
padding: 40px;
|
|
76
101
|
`
|
|
77
102
|
|
|
103
|
+
const RowContainer = styled.div`
|
|
104
|
+
display: inline-flex;
|
|
105
|
+
gap: 10px;
|
|
106
|
+
flex-wrap: wrap;
|
|
107
|
+
`
|
|
108
|
+
|
|
78
109
|
export default {
|
|
79
110
|
name: 'App',
|
|
80
111
|
components: {
|
|
81
112
|
ThemeProvider,
|
|
82
113
|
PageContainer,
|
|
114
|
+
MainTable,
|
|
115
|
+
ThreeDots,
|
|
116
|
+
Toggle,
|
|
83
117
|
InputNumber,
|
|
84
118
|
PageSubtitle,
|
|
85
119
|
Spinner,
|
|
86
120
|
Checkbox,
|
|
87
|
-
InputText,
|
|
88
121
|
ExternalButton,
|
|
89
|
-
iconWrapper,
|
|
90
122
|
Modal,
|
|
123
|
+
ProjectMarker,
|
|
124
|
+
iconCollection,
|
|
125
|
+
RowContainer
|
|
91
126
|
},
|
|
92
127
|
data() {
|
|
93
128
|
return {
|
|
94
|
-
num: 42,
|
|
95
129
|
inputValue: null,
|
|
96
130
|
checkedOption: 'button_1',
|
|
97
131
|
question: {
|
|
@@ -147,11 +181,15 @@ export default {
|
|
|
147
181
|
id: 4,
|
|
148
182
|
},
|
|
149
183
|
],
|
|
184
|
+
markersArray: [{"id":1180,"choice":"project-on-hold","translations":{"fr":{"name":"fr - Project on hold"},"en-us":{"name":"Project on hold"},"it-ch":{"name":"it-ch - Project on hold"},"de-ch":{"name":"de-ch - Project on hold"},"fr-be":{"name":"fr-be - Project on hold"}},"color":"#D27CCA","can_be_deleted":true}, {"id":266,"choice":"transferred","translations":{"en-us":{"name":"Transferred"},"fr":{"name":"fr - Transferred"},"de-ch":{"name":"de-ch - Transferred"},"it-ch":{"name":"it-ch - Transferred"},"fr-be":{"name":"fr-be - Transferred"}},"color":"#20A4CA","can_be_deleted":false},{"id":267,"choice":"sold","translations":{"en-us":{"name":"Sold"},"fr":{"name":"Vendu"},"de-ch":{"name":"Verkauft"},"it-ch":{"name":"Venduto"},"fr-be":{"name":"Vendu"}},"color":"#008351","can_be_deleted":false},{"id":268,"choice":"lost","translations":{"en-us":{"name":"Lost"},"fr":{"name":"Perdu"},"de-ch":{"name":"Verloren"},"it-ch":{"name":"Perso"},"fr-be":{"name":"Perdu"}},"color":"#A52019","can_be_deleted":false},{"id":1181,"choice":"project-created","translations":{"fr":{"name":"Project created"},"en-us":{"name":"Project created"},"it-ch":{"name":"Project created"},"de-ch":{"name":"Project created"},"fr-be":{"name":"Project created"}},"color":"#FDB813","can_be_deleted":true}]
|
|
150
185
|
}
|
|
151
186
|
},
|
|
152
187
|
methods: {
|
|
153
|
-
|
|
154
|
-
console.log(
|
|
188
|
+
consoleLog(data) {
|
|
189
|
+
console.log(data)
|
|
190
|
+
},
|
|
191
|
+
gettext(string) {
|
|
192
|
+
return string.toUpperCase()
|
|
155
193
|
},
|
|
156
194
|
getTheme() {
|
|
157
195
|
return theme
|
|
@@ -202,8 +240,8 @@ export default {
|
|
|
202
240
|
item = '-'
|
|
203
241
|
}
|
|
204
242
|
return item
|
|
205
|
-
}
|
|
206
|
-
}
|
|
243
|
+
},
|
|
244
|
+
},
|
|
207
245
|
}
|
|
208
246
|
</script>
|
|
209
247
|
|
|
@@ -213,4 +251,4 @@ body {
|
|
|
213
251
|
height: 100%;
|
|
214
252
|
margin: 0;
|
|
215
253
|
}
|
|
216
|
-
</style>
|
|
254
|
+
</style>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg fill="none" height="10" viewBox="0 0 10 10" width="10" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M9.87865 8.47868L8.47865 9.87868L0.121287 1.52132L1.52129 0.121318L5.69997 4.3L9.87865 8.47868Z" fill="black"/>
|
|
3
|
+
<path d="M1.5213 9.87868L0.121302 8.47868L8.47866 0.12132L9.87866 1.52132L1.5213 9.87868Z" fill="black"/>
|
|
4
|
+
</svg>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
<svg fill="none" height="10" viewBox="0 0 10 10" width="10" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M3 9.98993L3.47934e-07 6.01003L10 6.01003V7.98993L3 7.98993L3 9.98993Z" fill="black"/>
|
|
3
|
+
<path d="M7 0.0100708L10 3.98997H0L1.19209e-07 2.01007L7 2.01007V0.0100708Z" fill="black"/>
|
|
4
|
+
</svg>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<wrapper :isDisabled="isDisabled" :size="size">
|
|
2
|
+
<wrapper :isDisabled="isDisabled" :size="size" :cursor="cursor">
|
|
3
3
|
<icon-image
|
|
4
4
|
:size="size"
|
|
5
5
|
:color="color"
|
|
@@ -23,12 +23,13 @@
|
|
|
23
23
|
|
|
24
24
|
import styled from 'vue-styled-components'
|
|
25
25
|
|
|
26
|
-
const wrapperAttrs = { isDisabled: Boolean, size: String }
|
|
26
|
+
const wrapperAttrs = { isDisabled: Boolean, size: String, cursor: String }
|
|
27
27
|
const Wrapper = styled('div', wrapperAttrs)`
|
|
28
28
|
display: inline-block;
|
|
29
29
|
width: ${(props) => props.size};
|
|
30
30
|
height: ${(props) => props.size};
|
|
31
|
-
cursor: ${(props) => (props.isDisabled ? 'not-allowed' :
|
|
31
|
+
cursor: ${(props) => (props.isDisabled ? 'not-allowed' : props.cursor)};
|
|
32
|
+
line-height: 0;
|
|
32
33
|
`
|
|
33
34
|
const IconImageProps = { color: String, hoveredColor: String, size: String }
|
|
34
35
|
const IconImage = styled('div', IconImageProps)`
|
|
@@ -68,10 +69,14 @@ export default {
|
|
|
68
69
|
size: {
|
|
69
70
|
required: false,
|
|
70
71
|
default: '30px'
|
|
72
|
+
},
|
|
73
|
+
cursor: {
|
|
74
|
+
required: false,
|
|
75
|
+
default: 'pointer'
|
|
71
76
|
}
|
|
72
77
|
},
|
|
73
78
|
data() {
|
|
74
79
|
return {}
|
|
75
80
|
}
|
|
76
81
|
}
|
|
77
|
-
</script>
|
|
82
|
+
</script>
|
|
@@ -1,25 +1,34 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<component-wrapper>
|
|
3
|
-
<icon-wrapper
|
|
3
|
+
<icon-wrapper>
|
|
4
4
|
<icon-img
|
|
5
5
|
:isActive="showInfo"
|
|
6
6
|
:size="size"
|
|
7
7
|
:borderColor="borderColor"
|
|
8
8
|
@click.prevent="toggleShowInfo()"
|
|
9
|
-
@mouseenter="
|
|
10
|
-
@mouseleave="
|
|
9
|
+
@mouseenter="toggleShowInfo()"
|
|
10
|
+
@mouseleave="toggleShowInfo()"
|
|
11
11
|
>
|
|
12
|
-
<
|
|
12
|
+
<svg
|
|
13
|
+
class="img-icon"
|
|
14
|
+
:width="size"
|
|
15
|
+
:height="size"
|
|
16
|
+
viewBox="0 0 24 24"
|
|
17
|
+
fill="none"
|
|
18
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
19
|
+
>
|
|
20
|
+
<path
|
|
21
|
+
class="img-icon"
|
|
22
|
+
d="M20.4853 3.51469C18.2188 1.24823 15.2053 0 12 0C8.79469 0 5.78123 1.24823 3.51469 3.51469C1.24823 5.78123 0 8.79469 0 12C0 15.2053 1.24823 18.2188 3.51469 20.4853C5.78123 22.7518 8.79469 24 12 24C15.2053 24 18.2188 22.7518 20.4853 20.4853C22.7518 18.2188 24 15.2053 24 12C24 8.79469 22.7518 5.78123 20.4853 3.51469ZM12 3.28125C13.4216 3.28125 14.5781 4.4378 14.5781 5.85938C14.5781 7.28095 13.4216 8.4375 12 8.4375C10.5784 8.4375 9.42188 7.28095 9.42188 5.85938C9.42188 4.4378 10.5784 3.28125 12 3.28125ZM15.2812 19.6875H8.71875V18.2812H10.125V11.9167H8.71875V10.5104H13.875V18.2812H15.2812V19.6875Z"
|
|
23
|
+
fill="#D5D5D5"
|
|
24
|
+
/>
|
|
25
|
+
</svg>
|
|
13
26
|
</icon-img>
|
|
14
27
|
<text-overlay
|
|
15
28
|
v-if="showInfo"
|
|
16
29
|
:borderColor="borderColor"
|
|
17
30
|
:alignText="alignText"
|
|
18
|
-
|
|
19
|
-
:halfComputedTextInfoWidth="halfComputedTextInfoWidth"
|
|
20
|
-
:alignArrow="alignArrow"
|
|
21
|
-
:iconSize="size"
|
|
22
|
-
><slot />
|
|
31
|
+
>
|
|
23
32
|
{{ text }}
|
|
24
33
|
</text-overlay>
|
|
25
34
|
</icon-wrapper>
|
|
@@ -35,23 +44,22 @@
|
|
|
35
44
|
// size="20"
|
|
36
45
|
// alignText="right" // default is left
|
|
37
46
|
// />
|
|
38
|
-
import theme from '../../assets/theme.js'
|
|
39
|
-
import styled from 'vue-styled-components'
|
|
40
|
-
import icon from '../icon'
|
|
41
47
|
|
|
42
|
-
|
|
43
|
-
|
|
48
|
+
import styled from "vue-styled-components"
|
|
49
|
+
|
|
50
|
+
const IconWrapper = styled.div`
|
|
51
|
+
position: relative;
|
|
52
|
+
`
|
|
53
|
+
|
|
54
|
+
const textAttrs = { borderColor: String, alignText: String }
|
|
55
|
+
const TextOverlay = styled("div", textAttrs)`
|
|
44
56
|
position: absolute;
|
|
45
|
-
top:
|
|
46
|
-
${(props) => (props.
|
|
47
|
-
|
|
48
|
-
: props.alignArrow === 'center'
|
|
49
|
-
? 'left: calc((-'+props.width+' + '+props.iconSize+') /2 + 2px)'
|
|
50
|
-
: 'right: calc('+props.iconSize+' /2 - 17px)')};
|
|
51
|
-
text-align: ${(props) => props.alignText};
|
|
57
|
+
top: 26px;
|
|
58
|
+
right: ${(props) => (props.alignText === "left" ? "-10px" : "inherit")};
|
|
59
|
+
left: ${(props) => (props.alignText === "left" ? "inherit" : "-10px")};
|
|
52
60
|
background: ${(props) => props.theme.colors.black};
|
|
53
61
|
padding: 10px;
|
|
54
|
-
width:
|
|
62
|
+
width: max-content;
|
|
55
63
|
max-width: 400px;
|
|
56
64
|
font-size: 13px;
|
|
57
65
|
font-weight: 400;
|
|
@@ -60,13 +68,12 @@ const TextOverlay = styled('div', textAttrs)`
|
|
|
60
68
|
color: ${(props) => props.theme.colors.white};
|
|
61
69
|
|
|
62
70
|
:before {
|
|
63
|
-
content:
|
|
71
|
+
content: "";
|
|
64
72
|
background-color: ${(props) => props.theme.colors.black};
|
|
65
73
|
position: absolute;
|
|
66
74
|
top: 2px;
|
|
67
|
-
${(props) => (props.
|
|
68
|
-
props.
|
|
69
|
-
'right:-13px;')};
|
|
75
|
+
right: ${(props) => (props.alignText === "left" ? "-12px" : "inherit")};
|
|
76
|
+
left: ${(props) => (props.alignText === "left" ? "inherit" : "40px")};
|
|
70
77
|
height: 8px;
|
|
71
78
|
width: 8px;
|
|
72
79
|
transform-origin: center center;
|
|
@@ -75,15 +82,18 @@ const TextOverlay = styled('div', textAttrs)`
|
|
|
75
82
|
`
|
|
76
83
|
|
|
77
84
|
const iconAttrs = { isActive: Boolean, size: String, borderColor: String }
|
|
78
|
-
|
|
79
|
-
const IconWrapper = styled('div', iconAttrs)`
|
|
80
|
-
position: relative;
|
|
81
|
-
top: 1px;
|
|
82
|
-
height: ${(props) => props.size};
|
|
83
|
-
`
|
|
84
|
-
const IconImg = styled('div', iconAttrs)`
|
|
85
|
+
const IconImg = styled("div", iconAttrs)`
|
|
85
86
|
cursor: pointer;
|
|
86
|
-
height: ${(props) => props.size};
|
|
87
|
+
height: ${(props) => props.size + "px"};
|
|
88
|
+
|
|
89
|
+
.img-icon {
|
|
90
|
+
fill: ${(props) =>
|
|
91
|
+
props.isActive
|
|
92
|
+
? props.borderColor
|
|
93
|
+
? props.borderColor
|
|
94
|
+
: props.theme.colors.secondary
|
|
95
|
+
: props.theme.colors.mediumGray};
|
|
96
|
+
}
|
|
87
97
|
`
|
|
88
98
|
|
|
89
99
|
const ComponentWrapper = styled.div`
|
|
@@ -91,51 +101,38 @@ const ComponentWrapper = styled.div`
|
|
|
91
101
|
`
|
|
92
102
|
|
|
93
103
|
export default {
|
|
94
|
-
name:
|
|
104
|
+
name: "info-text",
|
|
95
105
|
components: {
|
|
96
106
|
IconWrapper,
|
|
97
107
|
TextOverlay,
|
|
98
108
|
ComponentWrapper,
|
|
99
109
|
IconImg,
|
|
100
|
-
icon
|
|
101
110
|
},
|
|
102
111
|
props: {
|
|
103
112
|
text: {
|
|
104
|
-
required:
|
|
113
|
+
required: true,
|
|
105
114
|
},
|
|
106
115
|
borderColor: {
|
|
107
116
|
required: false,
|
|
108
|
-
default: null
|
|
117
|
+
default: null,
|
|
109
118
|
},
|
|
110
119
|
size: {
|
|
111
120
|
required: false,
|
|
112
|
-
default:
|
|
121
|
+
default: "20",
|
|
113
122
|
},
|
|
114
123
|
alignText: {
|
|
115
124
|
required: false,
|
|
116
|
-
default:
|
|
117
|
-
},
|
|
118
|
-
alignArrow:{
|
|
119
|
-
required:false,
|
|
120
|
-
default:'center'
|
|
121
|
-
},
|
|
122
|
-
openTrigger:{
|
|
123
|
-
required:false,
|
|
124
|
-
default: 'onClick'
|
|
125
|
+
default: "left", // "left" or "right"
|
|
125
126
|
},
|
|
126
|
-
width:{
|
|
127
|
-
required:false,
|
|
128
|
-
default:'165px'
|
|
129
|
-
}
|
|
130
127
|
},
|
|
131
128
|
methods: {
|
|
132
129
|
toggleShowInfo() {
|
|
133
130
|
this.showInfo = !this.showInfo
|
|
134
131
|
|
|
135
132
|
if (this.showInfo) {
|
|
136
|
-
document.addEventListener(
|
|
133
|
+
document.addEventListener("click", this.clickOutside)
|
|
137
134
|
} else {
|
|
138
|
-
document.removeEventListener(
|
|
135
|
+
document.removeEventListener("click", this.clickOutside)
|
|
139
136
|
}
|
|
140
137
|
},
|
|
141
138
|
clickOutside(event) {
|
|
@@ -143,24 +140,12 @@ export default {
|
|
|
143
140
|
return
|
|
144
141
|
}
|
|
145
142
|
this.toggleShowInfo()
|
|
146
|
-
}
|
|
143
|
+
},
|
|
147
144
|
},
|
|
148
145
|
data() {
|
|
149
146
|
return {
|
|
150
147
|
showInfo: false,
|
|
151
148
|
}
|
|
152
149
|
},
|
|
153
|
-
computed: {
|
|
154
|
-
iconColor() {
|
|
155
|
-
return this.isActive
|
|
156
|
-
? this.borderColor
|
|
157
|
-
? this.borderColor
|
|
158
|
-
: theme.colors.secondary
|
|
159
|
-
: theme.colors.mediumGray
|
|
160
|
-
},
|
|
161
|
-
halfComputedTextInfoWidth() {
|
|
162
|
-
return parseInt(this.width)/2;
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
150
|
}
|
|
166
|
-
</script>
|
|
151
|
+
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<container
|
|
2
|
+
<container>
|
|
3
3
|
<label-wrapper v-if="labelText">
|
|
4
4
|
<label-text>
|
|
5
5
|
{{ labelText }}
|
|
@@ -8,19 +8,17 @@
|
|
|
8
8
|
v-if="labelInfoText"
|
|
9
9
|
:text="labelInfoText"
|
|
10
10
|
borderColor="#ccc"
|
|
11
|
-
size="
|
|
11
|
+
size="13"
|
|
12
12
|
:alignText="labelInfoAlign"
|
|
13
13
|
/>
|
|
14
14
|
</label-wrapper>
|
|
15
15
|
<input-wrapper>
|
|
16
16
|
<input-container
|
|
17
|
-
v-bind="$attrs"
|
|
18
17
|
ref="inputField1"
|
|
19
18
|
:hasUnit="unitName && !!unitName.length"
|
|
20
|
-
:placeholder="
|
|
19
|
+
:placeholder="placeholder"
|
|
21
20
|
:isError="isError"
|
|
22
21
|
:inputWidth="inputWidth"
|
|
23
|
-
:inputHeight="inputHeight"
|
|
24
22
|
:minWidth="minWidth"
|
|
25
23
|
:value="formatWithCurrency(value)"
|
|
26
24
|
@blur="onInputBlur($event)"
|
|
@@ -32,25 +30,13 @@
|
|
|
32
30
|
:textAlign="textAlign"
|
|
33
31
|
:fontSize="fontSize"
|
|
34
32
|
:fontColor="fontColor"
|
|
35
|
-
v-on="$listeners"
|
|
36
|
-
:hasSlot="hasSlot"
|
|
37
|
-
:slotSize="slotSize"
|
|
38
33
|
/>
|
|
39
|
-
<slot-container v-if="hasSlot" :slotSize="slotSize" :isError="isError">
|
|
40
|
-
<slot></slot>
|
|
41
|
-
</slot-container>
|
|
42
|
-
|
|
43
34
|
<unit-container
|
|
44
|
-
v-if="unitName && showLinearUnitName
|
|
35
|
+
v-if="unitName && showLinearUnitName"
|
|
45
36
|
:hasLength="!!textInput.length"
|
|
46
37
|
:isError="isError"
|
|
47
38
|
>{{ unitName }}</unit-container
|
|
48
39
|
>
|
|
49
|
-
<icon
|
|
50
|
-
v-if="(isError || inputIcon) && !showLinearUnitName"
|
|
51
|
-
:class="inputIconImageClass"
|
|
52
|
-
:src="isError ? warningIcon : inputIconImage"
|
|
53
|
-
/>
|
|
54
40
|
</input-wrapper>
|
|
55
41
|
<error-message v-if="isError">{{ errorMessage }}</error-message>
|
|
56
42
|
</container>
|
|
@@ -88,8 +74,11 @@ import {
|
|
|
88
74
|
numberToString
|
|
89
75
|
} from '../../../helpers/numberConverter'
|
|
90
76
|
import InfoText from '../../infoText'
|
|
91
|
-
|
|
92
|
-
|
|
77
|
+
|
|
78
|
+
const Container = styled.div`
|
|
79
|
+
width: 100%;
|
|
80
|
+
position: relative;
|
|
81
|
+
`
|
|
93
82
|
|
|
94
83
|
const inputProps = {
|
|
95
84
|
isError: Boolean,
|
|
@@ -100,17 +89,8 @@ const inputProps = {
|
|
|
100
89
|
noBorder: Boolean,
|
|
101
90
|
textAlign: String,
|
|
102
91
|
fontSize: String,
|
|
103
|
-
fontColor: String
|
|
104
|
-
hasSlot: Boolean,
|
|
105
|
-
slotSize: String,
|
|
106
|
-
inputHeight:String
|
|
92
|
+
fontColor: String
|
|
107
93
|
}
|
|
108
|
-
|
|
109
|
-
const Container = styled('div', inputProps)`
|
|
110
|
-
width: ${(props) => (props.inputWidth ? props.inputWidth : '100%')};
|
|
111
|
-
position: relative;
|
|
112
|
-
`
|
|
113
|
-
|
|
114
94
|
const InputContainer = styled('input', inputProps)`
|
|
115
95
|
border: ${(props) =>
|
|
116
96
|
props.isError
|
|
@@ -118,15 +98,8 @@ const InputContainer = styled('input', inputProps)`
|
|
|
118
98
|
: props.noBorder
|
|
119
99
|
? 'none'
|
|
120
100
|
: '1px solid ' + props.theme.colors.mediumGray};
|
|
121
|
-
padding
|
|
122
|
-
|
|
123
|
-
padding-left: 10px;
|
|
124
|
-
padding-right: ${(props) =>
|
|
125
|
-
props.slotSize
|
|
126
|
-
? 'calc(' + props.slotSize + ' + 10px)'
|
|
127
|
-
: props.hasUnit
|
|
128
|
-
? '40px'
|
|
129
|
-
: '5px'};
|
|
101
|
+
padding: ${(props) =>
|
|
102
|
+
props.hasUnit ? '11px 40px 11px 10px' : '11px 5px 11px 10px'};
|
|
130
103
|
border-radius: 4px;
|
|
131
104
|
text-align: ${(props) => props.textAlign};
|
|
132
105
|
cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'auto')};
|
|
@@ -142,7 +115,7 @@ const InputContainer = styled('input', inputProps)`
|
|
|
142
115
|
background-color: ${(props) =>
|
|
143
116
|
props.isDisabled ? props.theme.colors.grey5 : '#fff'};
|
|
144
117
|
box-sizing: border-box;
|
|
145
|
-
|
|
118
|
+
|
|
146
119
|
&::placeholder {
|
|
147
120
|
color: ${(props) =>
|
|
148
121
|
props.isError ? props.theme.colors.red : props.theme.colors.darkGray};
|
|
@@ -152,15 +125,6 @@ const InputContainer = styled('input', inputProps)`
|
|
|
152
125
|
outline: none;
|
|
153
126
|
}
|
|
154
127
|
`
|
|
155
|
-
const IconProps = {
|
|
156
|
-
inputIconHeight: String
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
const Icon = styled('img', IconProps)`
|
|
160
|
-
position: absolute;
|
|
161
|
-
right: 10px;
|
|
162
|
-
top: 2px;
|
|
163
|
-
`
|
|
164
128
|
|
|
165
129
|
const InputWrapper = styled.span`
|
|
166
130
|
position: relative;
|
|
@@ -178,7 +142,6 @@ const UnitContainer = styled('span', inputProps)`
|
|
|
178
142
|
right: 10px;
|
|
179
143
|
top: 0;
|
|
180
144
|
padding-left: 10px;
|
|
181
|
-
text-align: right;
|
|
182
145
|
color: ${(props) =>
|
|
183
146
|
props.isError
|
|
184
147
|
? props.theme.colors.red
|
|
@@ -187,27 +150,11 @@ const UnitContainer = styled('span', inputProps)`
|
|
|
187
150
|
: props.theme.colors.mediumGray};
|
|
188
151
|
`
|
|
189
152
|
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
${(props) =>
|
|
194
|
-
props.isError
|
|
195
|
-
? props.theme.colors.red
|
|
196
|
-
: props.hasLength
|
|
197
|
-
? props.theme.colors.black
|
|
198
|
-
: props.theme.colors.mediumGray};
|
|
153
|
+
const ErrorMessage = styled.div`
|
|
154
|
+
font-size: 14px;
|
|
155
|
+
color: ${(props) => props.theme.colors.red};
|
|
199
156
|
position: absolute;
|
|
200
|
-
|
|
201
|
-
props.slotSize ? 'calc(' + props.slotSize + ' - 10px)' : 'fit-content'};
|
|
202
|
-
right: 10px;
|
|
203
|
-
top: 0;
|
|
204
|
-
padding-left: 10px;
|
|
205
|
-
color: ${(props) =>
|
|
206
|
-
props.isError
|
|
207
|
-
? props.theme.colors.red
|
|
208
|
-
: props.hasLength
|
|
209
|
-
? props.theme.colors.black
|
|
210
|
-
: props.theme.colors.mediumGray};
|
|
157
|
+
top: calc(100% + 1px);
|
|
211
158
|
`
|
|
212
159
|
|
|
213
160
|
const LabelWrapper = styled.div`
|
|
@@ -231,16 +178,12 @@ export default {
|
|
|
231
178
|
ErrorMessage,
|
|
232
179
|
LabelWrapper,
|
|
233
180
|
LabelText,
|
|
234
|
-
InfoText
|
|
235
|
-
Icon,
|
|
236
|
-
SlotContainer
|
|
181
|
+
InfoText
|
|
237
182
|
},
|
|
238
|
-
inheritAttrs: false,
|
|
239
183
|
data() {
|
|
240
184
|
return {
|
|
241
185
|
textInput: '',
|
|
242
|
-
isFocused: false
|
|
243
|
-
warningIcon: warningIcon,
|
|
186
|
+
isFocused: false
|
|
244
187
|
}
|
|
245
188
|
},
|
|
246
189
|
props: {
|
|
@@ -260,10 +203,6 @@ export default {
|
|
|
260
203
|
required: false,
|
|
261
204
|
default: null
|
|
262
205
|
},
|
|
263
|
-
inputHeight:{
|
|
264
|
-
required:false,
|
|
265
|
-
default:null
|
|
266
|
-
},
|
|
267
206
|
value: {
|
|
268
207
|
required: true,
|
|
269
208
|
default: null
|
|
@@ -314,7 +253,7 @@ export default {
|
|
|
314
253
|
},
|
|
315
254
|
labelInfoAlign: {
|
|
316
255
|
required: false,
|
|
317
|
-
default: '
|
|
256
|
+
default: 'right'
|
|
318
257
|
},
|
|
319
258
|
minNumber: {
|
|
320
259
|
required: false,
|
|
@@ -327,41 +266,11 @@ export default {
|
|
|
327
266
|
numberToStringEnabled: {
|
|
328
267
|
required: false,
|
|
329
268
|
default: true
|
|
330
|
-
},
|
|
331
|
-
inputIcon: {
|
|
332
|
-
require: false,
|
|
333
|
-
type: Boolean,
|
|
334
|
-
default: false
|
|
335
|
-
},
|
|
336
|
-
inputIconImage: {
|
|
337
|
-
require: false,
|
|
338
|
-
type: String,
|
|
339
|
-
default: ''
|
|
340
|
-
},
|
|
341
|
-
inputIconImageClass: {
|
|
342
|
-
require: false,
|
|
343
|
-
type: Array,
|
|
344
|
-
default: () => []
|
|
345
|
-
},
|
|
346
|
-
slotSize: {
|
|
347
|
-
required: false
|
|
348
|
-
}
|
|
349
|
-
},
|
|
350
|
-
computed: {
|
|
351
|
-
displayedPlaceholder() {
|
|
352
|
-
if (this.placeholder) return this.placeholder
|
|
353
|
-
return `${this.minNumber || 0} ${this.unitName ? this.unitName : ''}`
|
|
354
|
-
},
|
|
355
|
-
hasSlot() {
|
|
356
|
-
return !!this.$slots.default
|
|
357
|
-
},
|
|
358
|
-
computedSlotSize() {
|
|
359
|
-
return this.slotSize || this.$slots['default'][0].elm.clientWidth
|
|
360
269
|
}
|
|
361
270
|
},
|
|
362
271
|
methods: {
|
|
363
272
|
onChangeHandler(event) {
|
|
364
|
-
if (isNaN(event)
|
|
273
|
+
if (isNaN(event)) {
|
|
365
274
|
event = this.minNumber || this.minNumber === 0 ? this.minNumber : event
|
|
366
275
|
}
|
|
367
276
|
this.$emit('input-change', event)
|
|
@@ -396,8 +305,6 @@ export default {
|
|
|
396
305
|
value: evaluated,
|
|
397
306
|
numberPrecision: this.numberPrecision
|
|
398
307
|
})
|
|
399
|
-
}else if(typeof evaluated === 'number'){
|
|
400
|
-
evaluated=evaluated.toFixed(this.numberPrecision)
|
|
401
308
|
}
|
|
402
309
|
return evaluated
|
|
403
310
|
},
|
|
@@ -414,11 +321,11 @@ export default {
|
|
|
414
321
|
})
|
|
415
322
|
}
|
|
416
323
|
let adjustedMinValue =
|
|
417
|
-
|
|
418
|
-
?
|
|
324
|
+
value && value.length
|
|
325
|
+
? value
|
|
419
326
|
: this.minNumber || this.minNumber === 0
|
|
420
327
|
? this.minNumber
|
|
421
|
-
: ''
|
|
328
|
+
: ''
|
|
422
329
|
this.$emit('input-blur', adjustedMinValue)
|
|
423
330
|
},
|
|
424
331
|
focusInput() {
|
|
@@ -429,7 +336,6 @@ export default {
|
|
|
429
336
|
this.$nextTick(() => {
|
|
430
337
|
this.$refs.inputField1.$el.select()
|
|
431
338
|
})
|
|
432
|
-
this.$emit('input-focus')
|
|
433
339
|
},
|
|
434
340
|
formatWithCurrency(value) {
|
|
435
341
|
let adjustedMinValue =
|
|
@@ -446,7 +352,6 @@ export default {
|
|
|
446
352
|
})
|
|
447
353
|
: adjustedMinValue
|
|
448
354
|
let unit = this.showLinearUnitName ? '' : this.unitName
|
|
449
|
-
//return input + ' ' + unit
|
|
450
355
|
return input + ' ' + unit
|
|
451
356
|
} else if (!adjustedMinValue && adjustedMinValue !== 0) {
|
|
452
357
|
return ''
|
|
@@ -482,4 +387,4 @@ export default {
|
|
|
482
387
|
}
|
|
483
388
|
}
|
|
484
389
|
}
|
|
485
|
-
</script>
|
|
390
|
+
</script>
|
|
@@ -10,11 +10,10 @@
|
|
|
10
10
|
v-if="infoTextMessage"
|
|
11
11
|
:text="infoTextMessage"
|
|
12
12
|
borderColor="#ccc"
|
|
13
|
-
:size="fontSize ? fontSize : '
|
|
13
|
+
:size="fontSize ? fontSize : '16'"
|
|
14
14
|
:alignText="infoTextAlign"
|
|
15
15
|
/>
|
|
16
16
|
</label-wrapper>
|
|
17
|
-
<input-error-wrapper>
|
|
18
17
|
<input-container
|
|
19
18
|
:placeholder="placeholder"
|
|
20
19
|
:isError="isError"
|
|
@@ -27,27 +26,20 @@
|
|
|
27
26
|
:isDisabled="disabled"
|
|
28
27
|
:fontSize="fontSize"
|
|
29
28
|
/>
|
|
30
|
-
<error-message v-if="isError">{{ errorMessage }}</error-message>
|
|
31
|
-
</input-error-wrapper>
|
|
32
29
|
</input-wrapper>
|
|
30
|
+
<error-message v-if="isError">{{ errorMessage }}</error-message>
|
|
33
31
|
</container>
|
|
34
32
|
</template>
|
|
35
33
|
|
|
36
34
|
<script>
|
|
37
35
|
import styled from "vue-styled-components"
|
|
38
36
|
import InfoText from "../../infoText"
|
|
39
|
-
import ErrorMessage from '../../errorMessage'
|
|
40
37
|
|
|
41
38
|
const Container = styled.div`
|
|
42
39
|
width: 100%;
|
|
43
40
|
position: relative;
|
|
44
41
|
`
|
|
45
|
-
|
|
46
|
-
display: inline-grid;
|
|
47
|
-
grid-template-row: auto auto;
|
|
48
|
-
grid-gap: 0px;
|
|
49
|
-
align-items: center;
|
|
50
|
-
`
|
|
42
|
+
|
|
51
43
|
const labelAttrs = { fontSize: String }
|
|
52
44
|
const InputLabel = styled("div", labelAttrs)`
|
|
53
45
|
font-weight: bold;
|
|
@@ -112,6 +104,13 @@ const InputWrapper = styled("div", inputAttrs)`
|
|
|
112
104
|
props.alignItems === "vertical" || !props.hasLabel ? "1fr" : "auto 1fr"};
|
|
113
105
|
`
|
|
114
106
|
|
|
107
|
+
const ErrorMessage = styled.div`
|
|
108
|
+
font-size: 14px;
|
|
109
|
+
color: ${(props) => props.theme.colors.red};
|
|
110
|
+
position: absolute;
|
|
111
|
+
top: calc(100% + 1px);
|
|
112
|
+
`
|
|
113
|
+
|
|
115
114
|
export default {
|
|
116
115
|
// import InputText from "@eturnity/eturnity_reusable_components/src/components/inputs/inputText"
|
|
117
116
|
// To use:
|
|
@@ -137,7 +136,6 @@ export default {
|
|
|
137
136
|
ErrorMessage,
|
|
138
137
|
InfoText,
|
|
139
138
|
InputLabel,
|
|
140
|
-
InputErrorWrapper,
|
|
141
139
|
LabelWrapper,
|
|
142
140
|
},
|
|
143
141
|
props: {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
/>
|
|
13
13
|
<span class="checkmark"></span>
|
|
14
14
|
<label-text :isDisabled="item.disabled">{{ item.label }}</label-text>
|
|
15
|
-
<info-text v-if="item.infoText" :text="item.infoText" size="
|
|
15
|
+
<info-text v-if="item.infoText" :text="item.infoText" size="16" />
|
|
16
16
|
</label-container>
|
|
17
17
|
<image-container v-if="item.img">
|
|
18
18
|
<radio-image :src="item.img" />
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
v-if="infoTextMessage"
|
|
11
11
|
:text="infoTextMessage"
|
|
12
12
|
borderColor="#ccc"
|
|
13
|
-
size="
|
|
13
|
+
size="16"
|
|
14
14
|
:alignText="infoTextAlign"
|
|
15
15
|
/>
|
|
16
16
|
</label-wrapper>
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
:disabled="isDisabled"
|
|
24
24
|
:fontSize="fontSize"
|
|
25
25
|
@input="onChangeHandler"
|
|
26
|
-
:resize="resize"
|
|
27
26
|
/>
|
|
28
27
|
</input-wrapper>
|
|
29
28
|
<error-message v-if="isError && errorText">{{ errorText }}</error-message>
|
|
@@ -175,11 +174,7 @@ export default {
|
|
|
175
174
|
},
|
|
176
175
|
inputWidth: {
|
|
177
176
|
required: false,
|
|
178
|
-
default: null
|
|
179
|
-
},
|
|
180
|
-
resize:{
|
|
181
|
-
required:false,
|
|
182
|
-
default: "none"
|
|
177
|
+
default: null
|
|
183
178
|
}
|
|
184
179
|
},
|
|
185
180
|
methods: {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
v-if="infoTextMessage"
|
|
11
11
|
:text="infoTextMessage"
|
|
12
12
|
borderColor="#ccc"
|
|
13
|
-
size="
|
|
13
|
+
size="14"
|
|
14
14
|
:alignText="infoTextAlign"
|
|
15
15
|
/>
|
|
16
16
|
</label-container>
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
v-if="infoTextMessage"
|
|
47
47
|
:text="infoTextMessage"
|
|
48
48
|
borderColor="#ccc"
|
|
49
|
-
size="
|
|
49
|
+
size="14"
|
|
50
50
|
:alignText="infoTextAlign"
|
|
51
51
|
/>
|
|
52
52
|
</label-container>
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<page-container :withDate="!!date">
|
|
3
|
+
<marker-container
|
|
4
|
+
:backgroundColor="markerData.color"
|
|
5
|
+
:hasIcon="!!iconName"
|
|
6
|
+
:isEditionAllowed="editionAllowed"
|
|
7
|
+
:isActive="activated"
|
|
8
|
+
@click.native="editionAllowed
|
|
9
|
+
? activated = !activated
|
|
10
|
+
: ''
|
|
11
|
+
"
|
|
12
|
+
>
|
|
13
|
+
<icon
|
|
14
|
+
v-if="!!iconName"
|
|
15
|
+
:name="iconName"
|
|
16
|
+
color="white"
|
|
17
|
+
size="10px"
|
|
18
|
+
cursor="default"
|
|
19
|
+
/>
|
|
20
|
+
<span>{{ markerData.translations[activeLanguage].name }}</span>
|
|
21
|
+
<dot-wrapper
|
|
22
|
+
v-if="editionAllowed"
|
|
23
|
+
class="dotContainer"
|
|
24
|
+
>
|
|
25
|
+
<dot-icon />
|
|
26
|
+
<dot-icon />
|
|
27
|
+
<dot-icon />
|
|
28
|
+
</dot-wrapper>
|
|
29
|
+
<edit-container
|
|
30
|
+
v-if="activated"
|
|
31
|
+
v-click-outside="clickOutsideActionHandler"
|
|
32
|
+
>
|
|
33
|
+
<edit-item @click.native="deleteModalOpened = !deleteModalOpened">
|
|
34
|
+
<delete-icon />
|
|
35
|
+
<div>{{ $gettext('Delete') }}</div>
|
|
36
|
+
</edit-item>
|
|
37
|
+
<edit-item @click.native="onEditClick">
|
|
38
|
+
<icon-container>
|
|
39
|
+
<icon
|
|
40
|
+
name="edit_button"
|
|
41
|
+
size="14px"
|
|
42
|
+
/>
|
|
43
|
+
</icon-container>
|
|
44
|
+
<div>{{ $gettext('Edit') }}</div>
|
|
45
|
+
</edit-item>
|
|
46
|
+
</edit-container>
|
|
47
|
+
</marker-container>
|
|
48
|
+
<date v-if="!!date">
|
|
49
|
+
{{ date }}
|
|
50
|
+
</date>
|
|
51
|
+
<modal
|
|
52
|
+
:isOpen="deleteModalOpened"
|
|
53
|
+
@on-close="closeDeleteModal"
|
|
54
|
+
:preventOutsideClose="true"
|
|
55
|
+
>
|
|
56
|
+
<modal-container>
|
|
57
|
+
<page-title :text="$gettext('delete_confirm_text')" />
|
|
58
|
+
<page-subtitle :text="$gettext('delete_confirm_subtext')" />
|
|
59
|
+
<cta-container>
|
|
60
|
+
<main-button
|
|
61
|
+
@click.native="onDelete"
|
|
62
|
+
:text="$gettext('Delete')"
|
|
63
|
+
/>
|
|
64
|
+
<main-button
|
|
65
|
+
type="cancel"
|
|
66
|
+
@click.native="closeDeleteModal"
|
|
67
|
+
:text="$gettext('Cancel')"
|
|
68
|
+
/>
|
|
69
|
+
</cta-container>
|
|
70
|
+
</modal-container>
|
|
71
|
+
</modal>
|
|
72
|
+
</page-container>
|
|
73
|
+
</template>
|
|
74
|
+
|
|
75
|
+
<script>
|
|
76
|
+
// import ThreeDots from "@eturnity/eturnity_reusable_components/src/components/projectMarker"
|
|
77
|
+
// To use:
|
|
78
|
+
// <project-marker
|
|
79
|
+
// :activeLanguage="'en-us'"
|
|
80
|
+
// :markerData="{"choice":"sold","translations":{"en-us":{"name":"Sold"}}","color":"#000"}"
|
|
81
|
+
// :isLimitedPartner="false"
|
|
82
|
+
// :isGroupSupport="false"
|
|
83
|
+
// :isEditable='false'
|
|
84
|
+
// :date="'23.07.2022'"
|
|
85
|
+
// @editHandler="onMarkerEdit($event)"
|
|
86
|
+
// @deleteHandler="onMarkerDelete($event)"
|
|
87
|
+
// />
|
|
88
|
+
|
|
89
|
+
import styled from "vue-styled-components"
|
|
90
|
+
import Icon from "@eturnity/eturnity_reusable_components/src/components/icon"
|
|
91
|
+
import Modal from '@eturnity/eturnity_reusable_components/src/components/modals/modal'
|
|
92
|
+
import PageTitle from '@eturnity/eturnity_reusable_components/src/components/pageTitle'
|
|
93
|
+
import DeleteIcon from '@eturnity/eturnity_reusable_components/src/components/deleteIcon'
|
|
94
|
+
import PageSubtitle from '@eturnity/eturnity_reusable_components/src/components/pageSubtitle'
|
|
95
|
+
import MainButton from '@eturnity/eturnity_reusable_components/src/components/buttons/mainButton'
|
|
96
|
+
|
|
97
|
+
const PageContainerAttrs = {
|
|
98
|
+
withDate: Boolean
|
|
99
|
+
}
|
|
100
|
+
const PageContainer = styled('div', PageContainerAttrs)`
|
|
101
|
+
display: flex;
|
|
102
|
+
align-items: center;
|
|
103
|
+
gap: 10px;
|
|
104
|
+
font-size: 12px;
|
|
105
|
+
line-height: 14px;
|
|
106
|
+
`
|
|
107
|
+
|
|
108
|
+
const ModalContainer = styled.div`
|
|
109
|
+
padding: 40px;
|
|
110
|
+
min-width: 500px;
|
|
111
|
+
`
|
|
112
|
+
|
|
113
|
+
const CtaContainer = styled.div`
|
|
114
|
+
display: flex;
|
|
115
|
+
gap: 20px;
|
|
116
|
+
margin-top: 30px;
|
|
117
|
+
`
|
|
118
|
+
|
|
119
|
+
const MarkerAttrs = {
|
|
120
|
+
backgroundColor: String,
|
|
121
|
+
hasIcon: Boolean,
|
|
122
|
+
isEditionAllowed: Boolean,
|
|
123
|
+
isActive: Boolean
|
|
124
|
+
}
|
|
125
|
+
const MarkerContainer = styled('div', MarkerAttrs)`
|
|
126
|
+
display: grid;
|
|
127
|
+
grid-template-columns: ${(props) =>
|
|
128
|
+
props.hasIcon || props.isEditionAllowed ? 'auto 1fr' : '1fr'};
|
|
129
|
+
grid-gap: 5px;
|
|
130
|
+
position: relative;
|
|
131
|
+
align-items: center;
|
|
132
|
+
padding: 2px 7px;
|
|
133
|
+
color: ${(props) => props.theme.colors.white};
|
|
134
|
+
background-color: ${(props) =>
|
|
135
|
+
props.backgroundColor ? props.backgroundColor : props.theme.colors.grey3};
|
|
136
|
+
border-radius: 4px;
|
|
137
|
+
white-space: nowrap;
|
|
138
|
+
cursor: ${(props) =>
|
|
139
|
+
props.isEditionAllowed? 'pointer' : 'default'};
|
|
140
|
+
|
|
141
|
+
.dotContainer {
|
|
142
|
+
display: ${(props) => (props.isActive ? 'flex' : 'none')};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
&:hover {
|
|
146
|
+
.dotContainer {
|
|
147
|
+
display: flex;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
`
|
|
151
|
+
|
|
152
|
+
const DotWrapper = styled.div`
|
|
153
|
+
display: flex;
|
|
154
|
+
gap: 2px;
|
|
155
|
+
cursor: pointer;
|
|
156
|
+
`
|
|
157
|
+
|
|
158
|
+
const DotIcon = styled.div`
|
|
159
|
+
width: 4px;
|
|
160
|
+
height: 4px;
|
|
161
|
+
border-radius: 100%;
|
|
162
|
+
background-color: ${(props) => props.theme.colors.white};
|
|
163
|
+
`
|
|
164
|
+
|
|
165
|
+
const EditContainer = styled.div`
|
|
166
|
+
position: absolute;
|
|
167
|
+
z-index: 99;
|
|
168
|
+
top: 22px;
|
|
169
|
+
display: grid;
|
|
170
|
+
background-color: ${(props) => props.theme.colors.white};
|
|
171
|
+
border: 1px solid ${(props) => props.theme.colors.grey4};
|
|
172
|
+
border-radius: 4px;
|
|
173
|
+
cursor: pointer;
|
|
174
|
+
overflow: hidden;
|
|
175
|
+
`
|
|
176
|
+
|
|
177
|
+
const EditItem = styled.div`
|
|
178
|
+
display: flex;
|
|
179
|
+
align-items: center;
|
|
180
|
+
gap: 12px;
|
|
181
|
+
color: ${(props) => props.theme.colors.black};
|
|
182
|
+
font-size: 13px;
|
|
183
|
+
padding: 4px 18px;
|
|
184
|
+
|
|
185
|
+
&:hover {
|
|
186
|
+
background-color: ${(props) => props.theme.colors.grey5};
|
|
187
|
+
}
|
|
188
|
+
`
|
|
189
|
+
|
|
190
|
+
const IconContainer = styled.div`
|
|
191
|
+
padding: 8px;
|
|
192
|
+
line-height: 0;
|
|
193
|
+
`
|
|
194
|
+
|
|
195
|
+
const Date = styled.div``
|
|
196
|
+
|
|
197
|
+
export default {
|
|
198
|
+
name: "project-marker",
|
|
199
|
+
components: {
|
|
200
|
+
PageContainer,
|
|
201
|
+
MarkerContainer,
|
|
202
|
+
DotWrapper,
|
|
203
|
+
DotIcon,
|
|
204
|
+
EditContainer,
|
|
205
|
+
EditItem,
|
|
206
|
+
DeleteIcon,
|
|
207
|
+
IconContainer,
|
|
208
|
+
Icon,
|
|
209
|
+
Modal,
|
|
210
|
+
ModalContainer,
|
|
211
|
+
CtaContainer,
|
|
212
|
+
PageTitle,
|
|
213
|
+
PageSubtitle,
|
|
214
|
+
MainButton,
|
|
215
|
+
Date
|
|
216
|
+
},
|
|
217
|
+
props: {
|
|
218
|
+
markerData: {
|
|
219
|
+
required: true
|
|
220
|
+
},
|
|
221
|
+
activeLanguage: {
|
|
222
|
+
required: true
|
|
223
|
+
},
|
|
224
|
+
date: {
|
|
225
|
+
required: false,
|
|
226
|
+
default: null
|
|
227
|
+
},
|
|
228
|
+
isEditable: {
|
|
229
|
+
required: false,
|
|
230
|
+
default: false
|
|
231
|
+
},
|
|
232
|
+
isGroupSupport: {
|
|
233
|
+
required: false,
|
|
234
|
+
default: false
|
|
235
|
+
},
|
|
236
|
+
isLimitedPartner: {
|
|
237
|
+
required: false,
|
|
238
|
+
default: false
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
data() {
|
|
242
|
+
return {
|
|
243
|
+
activated: false,
|
|
244
|
+
deleteModalOpened: false
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
computed: {
|
|
248
|
+
editionAllowed() {
|
|
249
|
+
return (this.markerData.can_be_deleted && (!this.isLimitedPartner || this.isGroupSupport)) && this.isEditable
|
|
250
|
+
},
|
|
251
|
+
iconName() {
|
|
252
|
+
if (this.markerData.choice === 'sold') {
|
|
253
|
+
return 'all_good'
|
|
254
|
+
} else if (this.markerData.choice === 'lost') {
|
|
255
|
+
return 'cross'
|
|
256
|
+
} else if (this.markerData.choice === 'transferred') {
|
|
257
|
+
return 'transfer'
|
|
258
|
+
} else {
|
|
259
|
+
return ''
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
methods: {
|
|
264
|
+
clickOutsideActionHandler() {
|
|
265
|
+
this.activated = false
|
|
266
|
+
},
|
|
267
|
+
closeDeleteModal() {
|
|
268
|
+
this.deleteModalOpened = false
|
|
269
|
+
},
|
|
270
|
+
onEditClick() {
|
|
271
|
+
this.$emit("editHandler")
|
|
272
|
+
},
|
|
273
|
+
onDelete() {
|
|
274
|
+
this.closeDeleteModal()
|
|
275
|
+
this.$emit("deleteHandler")
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
</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,
|
|
@@ -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,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>
|