@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
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.
|
|
3
|
+
"version": "1.2.22-3d-master.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vue-cli-service serve",
|
|
@@ -14,8 +14,7 @@
|
|
|
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"
|
|
18
|
-
"v-click-outside": "^2.1.4"
|
|
17
|
+
"html-loader": "^0.5.5"
|
|
19
18
|
},
|
|
20
19
|
"devDependencies": {
|
|
21
20
|
"@storybook/addon-actions": "^6.2.8",
|
package/src/App.vue
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
<ThemeProvider :theme="getTheme()" :style="{ height: '100%' }">
|
|
3
3
|
<page-container>
|
|
4
4
|
<br />
|
|
5
|
-
|
|
5
|
+
<<<<<<< HEAD
|
|
6
|
+
=======
|
|
7
|
+
<iconWrapper name="bell"/>
|
|
8
|
+
<modal backdrop="dark" :isLoading="false" :isOpen="true">
|
|
6
9
|
<main-table titleText="My Table">
|
|
7
10
|
<thead>
|
|
8
11
|
<tr>
|
|
@@ -31,23 +34,6 @@
|
|
|
31
34
|
</tbody>
|
|
32
35
|
</main-table>
|
|
33
36
|
</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
37
|
<br />
|
|
52
38
|
<toggle
|
|
53
39
|
@on-toggle-change="onInputChange($event)"
|
|
@@ -59,73 +45,113 @@
|
|
|
59
45
|
:disabled="false"
|
|
60
46
|
/>
|
|
61
47
|
<br />
|
|
48
|
+
>>>>>>> EPDM-5448
|
|
62
49
|
<input-number
|
|
63
|
-
placeholder="Enter distance"
|
|
64
|
-
:numberPrecision="2"
|
|
65
50
|
:value="inputValue"
|
|
66
|
-
@input-change="
|
|
67
|
-
|
|
51
|
+
@input-change="inputValue = $event"
|
|
52
|
+
inputWidth="250px"
|
|
53
|
+
slotSize="50%"
|
|
54
|
+
><InputAnnexContainer>
|
|
55
|
+
<span>123m2</span>
|
|
56
|
+
<info-text size="10px" alignArrow="right" text="infoText ceci est le text"></info-text>
|
|
57
|
+
</InputAnnexContainer>
|
|
58
|
+
</input-number>
|
|
59
|
+
<input-number
|
|
60
|
+
:value="inputValue"
|
|
61
|
+
@input-change="inputValue = $event"
|
|
62
|
+
inputWidth="250px"
|
|
63
|
+
slotSize="50%"
|
|
64
|
+
:isError="true"
|
|
65
|
+
><InputAnnexContainer>
|
|
66
|
+
<span>123m2</span>
|
|
67
|
+
<info-text :style="{'justify-self': 'end'}" size="12px" alignArrow="center" text="infoText ceci est le text">This is the tooltip text</info-text>
|
|
68
|
+
</InputAnnexContainer>
|
|
69
|
+
</input-number>
|
|
68
70
|
<br />
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
|
|
72
|
+
<p>InputText</p>
|
|
73
|
+
<input-text
|
|
74
|
+
placeholder="Company name"
|
|
75
|
+
:value="inputValue"
|
|
76
|
+
:isError="true"
|
|
77
|
+
errorMessage="This is my error message"
|
|
78
|
+
infoTextAlign="right"
|
|
79
|
+
infoTextMessage="My info message"
|
|
80
|
+
label="Question 5"
|
|
81
|
+
alignItems="vertical"
|
|
82
|
+
inputWidth="250px"
|
|
83
|
+
minWidth="100px"
|
|
84
|
+
/>
|
|
85
|
+
<br/>
|
|
86
|
+
<input-number
|
|
87
|
+
:value="num"
|
|
88
|
+
@input-change="num = $event"
|
|
89
|
+
unitName="t"
|
|
90
|
+
id="biebie"
|
|
91
|
+
test="koko"
|
|
92
|
+
@keydown="keydownHandler"
|
|
76
93
|
/>
|
|
77
|
-
<external-button text="Click me!" minWidth="500px" />
|
|
78
94
|
</page-container>
|
|
79
95
|
</ThemeProvider>
|
|
80
96
|
</template>
|
|
81
97
|
|
|
82
98
|
<script>
|
|
99
|
+
<<<<<<< HEAD
|
|
100
|
+
import { ThemeProvider } from "vue-styled-components"
|
|
101
|
+
import theme from "./assets/theme"
|
|
102
|
+
import styled from "vue-styled-components"
|
|
103
|
+
import MainTable from "@/components/tables/mainTable"
|
|
104
|
+
import ThreeDots from "@/components/threeDots"
|
|
105
|
+
import Toggle from "@/components/inputs/toggle"
|
|
106
|
+
import InputNumber from "@/components/inputs/inputNumber"
|
|
107
|
+
import Checkbox from "@/components/inputs/checkbox"
|
|
108
|
+
import PageSubtitle from "@/components/pageSubtitle"
|
|
109
|
+
import Spinner from "@/components/spinner"
|
|
110
|
+
import ExternalButton from "@/components/buttons/externalButton"
|
|
111
|
+
import InputText from "@/components/inputs/inputText"
|
|
112
|
+
=======
|
|
83
113
|
import { ThemeProvider } from 'vue-styled-components'
|
|
84
114
|
import theme from './assets/theme'
|
|
85
115
|
import styled from 'vue-styled-components'
|
|
86
116
|
import MainTable from '@/components/tables/mainTable'
|
|
87
117
|
import ThreeDots from '@/components/threeDots'
|
|
118
|
+
import iconWrapper from '@/components/iconWrapper'
|
|
88
119
|
import Toggle from '@/components/inputs/toggle'
|
|
89
120
|
import InputNumber from '@/components/inputs/inputNumber'
|
|
90
121
|
import Checkbox from '@/components/inputs/checkbox'
|
|
91
122
|
import PageSubtitle from '@/components/pageSubtitle'
|
|
92
123
|
import Spinner from '@/components/spinner'
|
|
93
124
|
import ExternalButton from '@/components/buttons/externalButton'
|
|
94
|
-
import ProjectMarker from '@/components/projectMarker'
|
|
95
|
-
import iconCollection from '@/components/icon/iconCollection'
|
|
96
125
|
import Modal from '@/components/modals/modal'
|
|
126
|
+
>>>>>>> EPDM-5448
|
|
97
127
|
// import TableDropdown from "@/components/tableDropdown"
|
|
128
|
+
const InputAnnexContainer = styled.div`
|
|
129
|
+
display: grid;
|
|
130
|
+
grid-template-columns: auto auto;
|
|
131
|
+
grid-gap: 10px;
|
|
132
|
+
`
|
|
98
133
|
|
|
99
134
|
const PageContainer = styled.div`
|
|
100
135
|
padding: 40px;
|
|
101
136
|
`
|
|
102
137
|
|
|
103
|
-
const RowContainer = styled.div`
|
|
104
|
-
display: inline-flex;
|
|
105
|
-
gap: 10px;
|
|
106
|
-
flex-wrap: wrap;
|
|
107
|
-
`
|
|
108
|
-
|
|
109
138
|
export default {
|
|
110
139
|
name: 'App',
|
|
111
140
|
components: {
|
|
112
141
|
ThemeProvider,
|
|
113
142
|
PageContainer,
|
|
114
|
-
MainTable,
|
|
115
|
-
ThreeDots,
|
|
116
|
-
Toggle,
|
|
117
143
|
InputNumber,
|
|
118
144
|
PageSubtitle,
|
|
119
145
|
Spinner,
|
|
120
146
|
Checkbox,
|
|
147
|
+
InputText,
|
|
121
148
|
ExternalButton,
|
|
149
|
+
iconWrapper,
|
|
122
150
|
Modal,
|
|
123
|
-
ProjectMarker,
|
|
124
|
-
iconCollection,
|
|
125
|
-
RowContainer
|
|
126
151
|
},
|
|
127
152
|
data() {
|
|
128
153
|
return {
|
|
154
|
+
num: 42,
|
|
129
155
|
inputValue: null,
|
|
130
156
|
checkedOption: 'button_1',
|
|
131
157
|
question: {
|
|
@@ -181,15 +207,11 @@ export default {
|
|
|
181
207
|
id: 4,
|
|
182
208
|
},
|
|
183
209
|
],
|
|
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}]
|
|
185
210
|
}
|
|
186
211
|
},
|
|
187
212
|
methods: {
|
|
188
|
-
|
|
189
|
-
console.log(
|
|
190
|
-
},
|
|
191
|
-
gettext(string) {
|
|
192
|
-
return string.toUpperCase()
|
|
213
|
+
keydownHandler(e) {
|
|
214
|
+
console.log('test', e)
|
|
193
215
|
},
|
|
194
216
|
getTheme() {
|
|
195
217
|
return theme
|
|
@@ -240,8 +262,8 @@ export default {
|
|
|
240
262
|
item = '-'
|
|
241
263
|
}
|
|
242
264
|
return item
|
|
243
|
-
}
|
|
244
|
-
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
245
267
|
}
|
|
246
268
|
</script>
|
|
247
269
|
|
|
@@ -251,4 +273,4 @@ body {
|
|
|
251
273
|
height: 100%;
|
|
252
274
|
margin: 0;
|
|
253
275
|
}
|
|
254
|
-
</style>
|
|
276
|
+
</style>
|
|
Binary file
|
|
File without changes
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
<svg fill="none" height="14" viewbox="13 13 14 14" width="14" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path d="M21.3333 15V24H22.1281L21.9394 24.0809L17.6667 25.912L14 24.3406V14.5165L17.2727 15.9191L17.4614 16H16.6667V25H18.6667V16H17.8719L18.0606 15.9191L22.3333 14.088L26 15.6594V25.4835L22.7273 24.0809L22.5386 24H23.3333V15H21.3333Z" stroke="#B2B9C5" stroke-width="
|
|
2
|
+
<path d="M21.3333 15V24H22.1281L21.9394 24.0809L17.6667 25.912L14 24.3406V14.5165L17.2727 15.9191L17.4614 16H16.6667V25H18.6667V16H17.8719L18.0606 15.9191L22.3333 14.088L26 15.6594V25.4835L22.7273 24.0809L22.5386 24H23.3333V15H21.3333Z" stroke="#B2B9C5" stroke-width="1"></path>
|
|
3
3
|
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
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
|
+
<path d="M0 0 h 14 v 14 h -14 v-12.5 h 1.5 v11 h11 v-11 h-12.5 Z" fill="red"></path>
|
|
5
|
+
<path d="M3 3 h 8 v 8 h -8 v-7.5 h1.5 v6 h5 v-5 h-6.5Z" fill="red"></path>
|
|
6
|
+
</svg>
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
<svg fill="none" height="
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<rect
|
|
8
|
-
<rect fill="#FF5656" height="1.55556" transform="rotate(-45 11.1777 26.0269)" width="21" x="11.1777" y="26.0269"></rect>
|
|
9
|
-
<rect fill="#FF5656" height="1.55556" transform="rotate(-45 13.3774 28.2266)" width="21" x="13.3774" y="28.2266"></rect>
|
|
10
|
-
<rect fill="#FF5656" height="1.55556" transform="rotate(-45 15.5771 30.4265)" width="21" x="15.5771" y="30.4265"></rect>
|
|
11
|
-
<rect fill="#FF5656" height="1.55556" transform="rotate(-45 17.7773 32.6262)" width="21" x="17.7773" y="32.6262"></rect>
|
|
1
|
+
<svg fill="none" height="16" viewbox="0 0 16 16" width="16" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<defs>
|
|
3
|
+
<pattern id="pattern_Z6wSY" patternUnits="userSpaceOnUse" width="4" height="4" patternTransform="rotate(-45)">
|
|
4
|
+
<path d="M0 0 L 16 0 L 16 2 L 0 2 Z" fill="red" stroke-width="0"></path>
|
|
5
|
+
</pattern>
|
|
6
|
+
</defs>
|
|
7
|
+
<rect width="16" height="16" fill="url(#pattern_Z6wSY)" :opacity="1" />
|
|
12
8
|
</g>
|
|
13
9
|
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
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>
|
|
@@ -0,0 +1,6 @@
|
|
|
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>
|
package/src/assets/theme.js
CHANGED
|
@@ -0,0 +1,62 @@
|
|
|
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>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<wrapper :isDisabled="isDisabled" :size="size" :cursor="cursor">
|
|
3
2
|
<icon-image
|
|
3
|
+
:disabled="disabled"
|
|
4
4
|
:size="size"
|
|
5
5
|
:color="color"
|
|
6
6
|
:hoveredColor="hoveredColor"
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
require(`!html-loader!./../../assets/svgIcons/${name.toLowerCase()}.svg`)
|
|
9
9
|
"
|
|
10
10
|
></icon-image>
|
|
11
|
-
</wrapper>
|
|
12
11
|
</template>
|
|
13
12
|
|
|
14
13
|
<script>
|
|
@@ -23,25 +22,23 @@
|
|
|
23
22
|
|
|
24
23
|
import styled from 'vue-styled-components'
|
|
25
24
|
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
display: inline-
|
|
25
|
+
const IconImageProps = { color: String, hoveredColor: String, size: String ,disabled:Boolean}
|
|
26
|
+
const IconImage = styled('div', IconImageProps)`
|
|
27
|
+
display: inline-flex;
|
|
29
28
|
width: ${(props) => props.size};
|
|
30
29
|
height: ${(props) => props.size};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const IconImageProps = { color: String, hoveredColor: String, size: String }
|
|
35
|
-
const IconImage = styled('div', IconImageProps)`
|
|
30
|
+
justify-content:center;
|
|
31
|
+
align-items:center;
|
|
32
|
+
cursor: ${(props) => (props.disabled ? 'not-allowed' : 'pointer')};
|
|
36
33
|
svg {
|
|
37
|
-
width:
|
|
38
|
-
height:
|
|
34
|
+
width: 100%;
|
|
35
|
+
height: 100%;
|
|
39
36
|
}
|
|
40
|
-
svg
|
|
37
|
+
svg path {
|
|
41
38
|
${(props) =>
|
|
42
39
|
props.color && `fill: ${props.theme.colors[props.color] || props.color};`}
|
|
43
40
|
}
|
|
44
|
-
&:hover > svg
|
|
41
|
+
&:hover > svg path {
|
|
45
42
|
${(props) => props.hoveredColor && `fill: ${props.hoveredColor};`}
|
|
46
43
|
}
|
|
47
44
|
`
|
|
@@ -49,11 +46,10 @@ const IconImage = styled('div', IconImageProps)`
|
|
|
49
46
|
export default {
|
|
50
47
|
name: 'icon',
|
|
51
48
|
components: {
|
|
52
|
-
Wrapper,
|
|
53
49
|
IconImage
|
|
54
50
|
},
|
|
55
51
|
props: {
|
|
56
|
-
|
|
52
|
+
disabled: {
|
|
57
53
|
required: false,
|
|
58
54
|
default: false
|
|
59
55
|
},
|
|
@@ -69,14 +65,10 @@ export default {
|
|
|
69
65
|
size: {
|
|
70
66
|
required: false,
|
|
71
67
|
default: '30px'
|
|
72
|
-
},
|
|
73
|
-
cursor: {
|
|
74
|
-
required: false,
|
|
75
|
-
default: 'pointer'
|
|
76
68
|
}
|
|
77
69
|
},
|
|
78
70
|
data() {
|
|
79
71
|
return {}
|
|
80
72
|
}
|
|
81
73
|
}
|
|
82
|
-
</script>
|
|
74
|
+
</script>
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Wrapper
|
|
3
|
+
:disabled="disabled"
|
|
4
|
+
:size="size"
|
|
5
|
+
:backgroundColor="backgroundColor"
|
|
6
|
+
:borderRadius="borderRadius"
|
|
7
|
+
:hoveredBackgroundColor="hoveredBackgroundColor"
|
|
8
|
+
:isHovered="isHovered"
|
|
9
|
+
>
|
|
10
|
+
<icon :disabled="disabled"
|
|
11
|
+
:size="iconSize"
|
|
12
|
+
:name="name"
|
|
13
|
+
:color="iconColor"
|
|
14
|
+
:hoveredColor="hoveredIconColor" />
|
|
15
|
+
<caret v-if="hasCaret">
|
|
16
|
+
<iconWrapper :disabled="disabled"
|
|
17
|
+
size="10px"
|
|
18
|
+
name="arrow_down"
|
|
19
|
+
:iconColor="iconColor"
|
|
20
|
+
:hoveredBackgroundColor="hoveredIconColor"
|
|
21
|
+
borderRadius="1px"
|
|
22
|
+
/>
|
|
23
|
+
</caret>
|
|
24
|
+
</Wrapper>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script>
|
|
28
|
+
// import Icon from "@eturnity/eturnity_reusable_components/src/components/icon"
|
|
29
|
+
// How to use:
|
|
30
|
+
//<icon
|
|
31
|
+
// name="House" //required. a svg file named [name].svg should be present in /assets/svgIcons
|
|
32
|
+
// color="red"
|
|
33
|
+
// hoveredColor="blue"
|
|
34
|
+
// size="60px" by default, this is 30px
|
|
35
|
+
// />
|
|
36
|
+
|
|
37
|
+
import styled from 'vue-styled-components'
|
|
38
|
+
import icon from '../icon'
|
|
39
|
+
const wrapperAttrs = { isHovered:Boolean,borderRadius:String,disabled: Boolean, size: String,backgroundColor:String,hoveredBackgroundColor:String }
|
|
40
|
+
const Wrapper = styled('div', wrapperAttrs)`
|
|
41
|
+
position:relative;
|
|
42
|
+
display: inline-flex;
|
|
43
|
+
width: ${(props) => props.size};
|
|
44
|
+
height: ${(props) => props.size};
|
|
45
|
+
justify-content:center;
|
|
46
|
+
align-items:center;
|
|
47
|
+
cursor: ${(props) => (props.disabled ? 'not-allowed' : 'pointer')};
|
|
48
|
+
background-color: ${(props)=>props.theme.colors[props.backgroundColor] || props.backgroundColor};
|
|
49
|
+
border-radius: ${(props) => props.borderRadius};
|
|
50
|
+
${(props)=>(props.isHovered ? 'background-color:'+props.theme.colors[props.hoveredBackgroundColor] || props.hoveredBackgroundColor : "")};
|
|
51
|
+
&:hover{
|
|
52
|
+
background-color:${(props)=>props.theme.colors[props.hoveredBackgroundColor] || props.hoveredBackgroundColor};
|
|
53
|
+
}
|
|
54
|
+
`
|
|
55
|
+
const caret=styled.div`
|
|
56
|
+
position:absolute;
|
|
57
|
+
bottom:3px;
|
|
58
|
+
right:2px;
|
|
59
|
+
height:10px;
|
|
60
|
+
`
|
|
61
|
+
|
|
62
|
+
export default {
|
|
63
|
+
name: 'iconWrapper',
|
|
64
|
+
components: {
|
|
65
|
+
Wrapper,
|
|
66
|
+
icon,
|
|
67
|
+
caret
|
|
68
|
+
},
|
|
69
|
+
props: {
|
|
70
|
+
disabled: {
|
|
71
|
+
required: false,
|
|
72
|
+
default: false
|
|
73
|
+
},
|
|
74
|
+
name: {
|
|
75
|
+
required: true
|
|
76
|
+
},
|
|
77
|
+
iconColor: {
|
|
78
|
+
required: false,
|
|
79
|
+
default: 'white'
|
|
80
|
+
},
|
|
81
|
+
hoveredIconColor: {
|
|
82
|
+
required: false
|
|
83
|
+
},
|
|
84
|
+
backgroundColor: {
|
|
85
|
+
required: false,
|
|
86
|
+
},
|
|
87
|
+
hoveredBackgroundColor: {
|
|
88
|
+
required: false,
|
|
89
|
+
default:"transparentWhite1"
|
|
90
|
+
},
|
|
91
|
+
size: {
|
|
92
|
+
required: false,
|
|
93
|
+
default: '32px'
|
|
94
|
+
},
|
|
95
|
+
iconSize:{
|
|
96
|
+
required: false,
|
|
97
|
+
default:'18px'
|
|
98
|
+
},
|
|
99
|
+
hasCaret:{
|
|
100
|
+
required: false,
|
|
101
|
+
default: false
|
|
102
|
+
},
|
|
103
|
+
borderRadius:{
|
|
104
|
+
required:false,
|
|
105
|
+
default:'6px'
|
|
106
|
+
},
|
|
107
|
+
isHovered:{
|
|
108
|
+
required:false,
|
|
109
|
+
default:false
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
data() {
|
|
113
|
+
return {}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
</script>
|