@eturnity/eturnity_reusable_components 1.2.0-beta.3 → 1.2.1-5.QA03-20092022.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -2
- package/src/App.vue +88 -89
- package/src/assets/icons/warning_icon.svg +3 -0
- package/src/assets/svgIcons/2d_active.svg +7 -0
- package/src/assets/svgIcons/2d_inactive.svg +8 -0
- package/src/assets/svgIcons/3d_active.svg +7 -0
- package/src/assets/svgIcons/3d_inactive.svg +8 -0
- package/src/assets/svgIcons/accept.svg +5 -0
- package/src/assets/svgIcons/activate_panels_active.svg +22 -0
- package/src/assets/svgIcons/activate_panels_inactive.svg +20 -0
- package/src/assets/svgIcons/add_icon-1.svg +3 -0
- package/src/assets/svgIcons/add_icon.svg +4 -0
- package/src/assets/svgIcons/address_book.svg +3 -0
- package/src/assets/svgIcons/after_sale_as_a_service.svg +6 -0
- package/src/assets/svgIcons/all_good.svg +3 -0
- package/src/assets/svgIcons/angle_active.svg +5 -0
- package/src/assets/svgIcons/angle_inactive.svg +4 -0
- package/src/assets/svgIcons/area_active.svg +11 -0
- package/src/assets/svgIcons/area_inactive.svg +26 -0
- package/src/assets/svgIcons/arrow_down.svg +3 -0
- package/src/assets/svgIcons/arrow_left.svg +4 -0
- package/src/assets/svgIcons/arrow_right.svg +4 -0
- package/src/assets/svgIcons/arrow_up.svg +3 -0
- package/src/assets/svgIcons/attachment.svg +3 -0
- package/src/assets/svgIcons/battery.svg +3 -0
- package/src/assets/svgIcons/bell.svg +3 -0
- package/src/assets/svgIcons/bold.svg +3 -0
- package/src/assets/svgIcons/bom.svg +3 -0
- package/src/assets/svgIcons/bom_generation.svg +10 -0
- package/src/assets/svgIcons/bubble.svg +3 -0
- package/src/assets/svgIcons/bullet_list.svg +8 -0
- package/src/assets/svgIcons/calendar.svg +7 -0
- package/src/assets/svgIcons/calendar_icon.svg +7 -0
- package/src/assets/svgIcons/call.svg +3 -0
- package/src/assets/svgIcons/camera.svg +3 -0
- package/src/assets/svgIcons/car.svg +3 -0
- package/src/assets/svgIcons/cart.svg +3 -0
- package/src/assets/svgIcons/checkbox.svg +3 -0
- package/src/assets/svgIcons/clear_formatting.svg +7 -0
- package/src/assets/svgIcons/clickable_info.svg +4 -0
- package/src/assets/svgIcons/clip.svg +3 -0
- package/src/assets/svgIcons/clock.svg +4 -0
- package/src/assets/svgIcons/close_for_modals,_tool_tips.svg +4 -0
- package/src/assets/svgIcons/collapse.svg +4 -0
- package/src/assets/svgIcons/component_library.svg +7 -0
- package/src/assets/svgIcons/context_menu-1.svg +6 -0
- package/src/assets/svgIcons/context_menu-2.svg +5 -0
- package/src/assets/svgIcons/context_menu.svg +5 -0
- package/src/assets/svgIcons/context_menu_tabs.svg +5 -0
- package/src/assets/svgIcons/current_variant.svg +4 -0
- package/src/assets/svgIcons/deadline.svg +4 -0
- package/src/assets/svgIcons/delete.svg +4 -0
- package/src/assets/svgIcons/delete_area_active.svg +16 -0
- package/src/assets/svgIcons/delete_area_inactive.svg +15 -0
- package/src/assets/svgIcons/direction_active-1.svg +12 -0
- package/src/assets/svgIcons/direction_active.svg +5 -0
- package/src/assets/svgIcons/direction_inactive.svg +4 -0
- package/src/assets/svgIcons/distances_active.svg +9 -0
- package/src/assets/svgIcons/distances_inactive.svg +8 -0
- package/src/assets/svgIcons/document.svg +3 -0
- package/src/assets/svgIcons/downarrow.svg +3 -0
- package/src/assets/svgIcons/download.svg +4 -0
- package/src/assets/svgIcons/duplicate-1.svg +8 -0
- package/src/assets/svgIcons/duplicate-2.svg +5 -0
- package/src/assets/svgIcons/duplicate-3.svg +3 -0
- package/src/assets/svgIcons/duplicate.svg +4 -0
- package/src/assets/svgIcons/e-mobility_configurator.svg +6 -0
- package/src/assets/svgIcons/edit_button.svg +3 -0
- package/src/assets/svgIcons/email.svg +3 -0
- package/src/assets/svgIcons/ems-1.svg +3 -0
- package/src/assets/svgIcons/ems.svg +3 -0
- package/src/assets/svgIcons/end_of_the_list.svg +5 -0
- package/src/assets/svgIcons/erase.svg +4 -0
- package/src/assets/svgIcons/fav_icon.svg +4 -0
- package/src/assets/svgIcons/financing_for_pv-1.svg +5 -0
- package/src/assets/svgIcons/financing_for_pv-2.svg +3 -0
- package/src/assets/svgIcons/financing_for_pv.svg +6 -0
- package/src/assets/svgIcons/finish-1.svg +4 -0
- package/src/assets/svgIcons/finish.svg +3 -0
- package/src/assets/svgIcons/folder.svg +3 -0
- package/src/assets/svgIcons/heat_calc.svg +7 -0
- package/src/assets/svgIcons/house.svg +3 -0
- package/src/assets/svgIcons/initial_situation.svg +3 -0
- package/src/assets/svgIcons/intro-tour-1.svg +3 -0
- package/src/assets/svgIcons/intro-tour.svg +3 -0
- package/src/assets/svgIcons/inverter-1.svg +5 -0
- package/src/assets/svgIcons/inverter.svg +3 -0
- package/src/assets/svgIcons/italic.svg +3 -0
- package/src/assets/svgIcons/key.svg +3 -0
- package/src/assets/svgIcons/lead_marketplace.svg +6 -0
- package/src/assets/svgIcons/lead_provider.svg +4 -0
- package/src/assets/svgIcons/length_in_2d_active.svg +12 -0
- package/src/assets/svgIcons/length_in_2d_inctive.svg +13 -0
- package/src/assets/svgIcons/light_bulb.svg +3 -0
- package/src/assets/svgIcons/line_graph.svg +3 -0
- package/src/assets/svgIcons/local_subsidies.svg +18 -0
- package/src/assets/svgIcons/location.svg +3 -0
- package/src/assets/svgIcons/lock.svg +3 -0
- package/src/assets/svgIcons/loop.svg +3 -0
- package/src/assets/svgIcons/lunch.svg +4 -0
- package/src/assets/svgIcons/map_icon.svg +3 -0
- package/src/assets/svgIcons/meeting.svg +6 -0
- package/src/assets/svgIcons/move_copy.svg +4 -0
- package/src/assets/svgIcons/new_area_inactive.svg +11 -0
- package/src/assets/svgIcons/next.svg +4 -0
- package/src/assets/svgIcons/not_equal_to.svg +3 -0
- package/src/assets/svgIcons/numbered_list.svg +6 -0
- package/src/assets/svgIcons/obstacle_tool.svg +13 -0
- package/src/assets/svgIcons/pan_tool.svg +12 -0
- package/src/assets/svgIcons/panels_tool.svg +8 -0
- package/src/assets/svgIcons/pen_tool.svg +4 -0
- package/src/assets/svgIcons/picker_tool.svg +4 -0
- package/src/assets/svgIcons/picture.svg +3 -0
- package/src/assets/svgIcons/pin.svg +5 -0
- package/src/assets/svgIcons/presentation.svg +3 -0
- package/src/assets/svgIcons/previous.svg +4 -0
- package/src/assets/svgIcons/profile-1.svg +4 -0
- package/src/assets/svgIcons/profile.svg +4 -0
- package/src/assets/svgIcons/profitability.svg +3 -0
- package/src/assets/svgIcons/project_analysis.svg +4 -0
- package/src/assets/svgIcons/project_settings.svg +4 -0
- package/src/assets/svgIcons/pv.svg +3 -0
- package/src/assets/svgIcons/quotations.svg +6 -0
- package/src/assets/svgIcons/rotate_view.svg +5 -0
- package/src/assets/svgIcons/run_simulation.svg +3 -0
- package/src/assets/svgIcons/scaling_tool.svg +8 -0
- package/src/assets/svgIcons/search.svg +3 -0
- package/src/assets/svgIcons/security.svg +3 -0
- package/src/assets/svgIcons/settings.svg +3 -0
- package/src/assets/svgIcons/show_in_a_new_tab.svg +12 -0
- package/src/assets/svgIcons/smartphone.svg +4 -0
- package/src/assets/svgIcons/solar_calc.svg +13 -0
- package/src/assets/svgIcons/sorting.svg +4 -0
- package/src/assets/svgIcons/start_of_the_list.svg +5 -0
- package/src/assets/svgIcons/strikethrough.svg +4 -0
- package/src/assets/svgIcons/subsidies-1.svg +5 -0
- package/src/assets/svgIcons/subsidies-2.svg +3 -0
- package/src/assets/svgIcons/subsidies.svg +3 -0
- package/src/assets/svgIcons/subtract_icon.svg +3 -0
- package/src/assets/svgIcons/suitcase.svg +3 -0
- package/src/assets/svgIcons/template_icon_not_clickable.svg +6 -0
- package/src/assets/svgIcons/truck.svg +3 -0
- package/src/assets/svgIcons/underlined.svg +3 -0
- package/src/assets/svgIcons/uparrow.svg +3 -0
- package/src/assets/svgIcons/upload_avatar-1.svg +12 -0
- package/src/assets/svgIcons/upload_avatar.svg +5 -0
- package/src/assets/svgIcons/upload_image.svg +8 -0
- package/src/assets/svgIcons/virtual_storage.svg +4 -0
- package/src/assets/svgIcons/warning.svg +4 -0
- package/src/assets/svgIcons/way.svg +5 -0
- package/src/assets/svgIcons/wifi.svg +3 -0
- package/src/assets/svgIcons/winter.svg +3 -0
- package/src/components/icon/Icons.stories.js +41 -0
- package/src/components/icon/iconCollection.vue +68 -0
- package/src/components/icon/index.vue +76 -0
- package/src/components/inputs/inputNumber/index.vue +44 -41
- package/src/components/inputs/radioButton/index.vue +15 -13
- package/src/components/inputs/textAreaInput/index.vue +39 -37
- package/src/components/modals/modal/index.vue +22 -6
- package/src/components/modals/modal/modal.stories.js +2 -1
- package/src/components/spinner/index.vue +20 -13
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<wrapper :isDisabled="isDisabled" :size="size">
|
|
3
|
+
<icon-image
|
|
4
|
+
:size="size"
|
|
5
|
+
:color="color"
|
|
6
|
+
:hoveredColor="hoveredColor"
|
|
7
|
+
v-html="
|
|
8
|
+
require(`!html-loader!./../../assets/svgIcons/${name.toLowerCase()}.svg`)
|
|
9
|
+
"
|
|
10
|
+
></icon-image>
|
|
11
|
+
</wrapper>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
// import Icon from "@eturnity/eturnity_reusable_components/src/components/icon"
|
|
16
|
+
// How to use:
|
|
17
|
+
//<icon
|
|
18
|
+
// name="House" //required. a svg file named [name].svg should be present in /assets/svgIcons
|
|
19
|
+
// color="red"
|
|
20
|
+
// hoveredColor="blue"
|
|
21
|
+
// size="60px" by default, this is 30px
|
|
22
|
+
// />
|
|
23
|
+
|
|
24
|
+
import styled from 'vue-styled-components'
|
|
25
|
+
|
|
26
|
+
const wrapperAttrs = { isDisabled: Boolean, size: String }
|
|
27
|
+
const Wrapper = styled('div', wrapperAttrs)`
|
|
28
|
+
display: inline-block;
|
|
29
|
+
width: ${(props) => props.size};
|
|
30
|
+
height: ${(props) => props.size};
|
|
31
|
+
cursor: ${(props) => (props.isDisabled ? 'not-allowed' : 'pointer')};
|
|
32
|
+
`
|
|
33
|
+
const IconImageProps = { color: String, hoveredColor: String, size: String }
|
|
34
|
+
const IconImage = styled('div', IconImageProps)`
|
|
35
|
+
svg {
|
|
36
|
+
width: ${(props) => props.size};
|
|
37
|
+
height: ${(props) => props.size};
|
|
38
|
+
}
|
|
39
|
+
svg > path {
|
|
40
|
+
${(props) => props.color && `fill: ${props.color};`}
|
|
41
|
+
}
|
|
42
|
+
&:hover > svg > path {
|
|
43
|
+
${(props) => props.hoveredColor && `fill: ${props.hoveredColor};`}
|
|
44
|
+
}
|
|
45
|
+
`
|
|
46
|
+
|
|
47
|
+
export default {
|
|
48
|
+
name: 'icon',
|
|
49
|
+
components: {
|
|
50
|
+
Wrapper,
|
|
51
|
+
IconImage
|
|
52
|
+
},
|
|
53
|
+
props: {
|
|
54
|
+
isDisabled: {
|
|
55
|
+
required: false,
|
|
56
|
+
default: false
|
|
57
|
+
},
|
|
58
|
+
name: {
|
|
59
|
+
required: true
|
|
60
|
+
},
|
|
61
|
+
color: {
|
|
62
|
+
required: false
|
|
63
|
+
},
|
|
64
|
+
hoveredColor: {
|
|
65
|
+
required: false
|
|
66
|
+
},
|
|
67
|
+
size: {
|
|
68
|
+
required: false,
|
|
69
|
+
default: '30px'
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
data() {
|
|
73
|
+
return {}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
</script>
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
</label-wrapper>
|
|
15
15
|
<input-wrapper>
|
|
16
16
|
<input-container
|
|
17
|
+
v-bind="$attrs"
|
|
17
18
|
ref="inputField1"
|
|
18
19
|
:hasUnit="unitName && !!unitName.length"
|
|
19
20
|
:placeholder="displayedPlaceholder"
|
|
@@ -30,6 +31,7 @@
|
|
|
30
31
|
:textAlign="textAlign"
|
|
31
32
|
:fontSize="fontSize"
|
|
32
33
|
:fontColor="fontColor"
|
|
34
|
+
v-on="$listeners"
|
|
33
35
|
/>
|
|
34
36
|
<unit-container
|
|
35
37
|
v-if="unitName && showLinearUnitName"
|
|
@@ -71,7 +73,7 @@
|
|
|
71
73
|
import styled from 'vue-styled-components'
|
|
72
74
|
import {
|
|
73
75
|
stringToNumber,
|
|
74
|
-
numberToString
|
|
76
|
+
numberToString
|
|
75
77
|
} from '../../../helpers/numberConverter'
|
|
76
78
|
import InfoText from '../../infoText'
|
|
77
79
|
|
|
@@ -89,15 +91,15 @@ const inputProps = {
|
|
|
89
91
|
noBorder: Boolean,
|
|
90
92
|
textAlign: String,
|
|
91
93
|
fontSize: String,
|
|
92
|
-
fontColor: String
|
|
94
|
+
fontColor: String
|
|
93
95
|
}
|
|
94
96
|
const InputContainer = styled('input', inputProps)`
|
|
95
97
|
border: ${(props) =>
|
|
96
98
|
props.isError
|
|
97
99
|
? '1px solid ' + props.theme.colors.red
|
|
98
100
|
: props.noBorder
|
|
99
|
-
?
|
|
100
|
-
:
|
|
101
|
+
? 'none'
|
|
102
|
+
: '1px solid ' + props.theme.colors.mediumGray};
|
|
101
103
|
padding: ${(props) =>
|
|
102
104
|
props.hasUnit ? '11px 40px 11px 10px' : '11px 5px 11px 10px'};
|
|
103
105
|
border-radius: 4px;
|
|
@@ -178,101 +180,102 @@ export default {
|
|
|
178
180
|
ErrorMessage,
|
|
179
181
|
LabelWrapper,
|
|
180
182
|
LabelText,
|
|
181
|
-
InfoText
|
|
183
|
+
InfoText
|
|
182
184
|
},
|
|
185
|
+
inheritAttrs: false,
|
|
183
186
|
data() {
|
|
184
187
|
return {
|
|
185
188
|
textInput: '',
|
|
186
|
-
isFocused: false
|
|
189
|
+
isFocused: false
|
|
187
190
|
}
|
|
188
191
|
},
|
|
189
192
|
computed: {
|
|
190
193
|
displayedPlaceholder() {
|
|
191
194
|
if (this.placeholder) return this.placeholder
|
|
192
195
|
return `${this.minNumber || 0} ${this.unitName ? this.unitName : ''}`
|
|
193
|
-
}
|
|
196
|
+
}
|
|
194
197
|
},
|
|
195
198
|
props: {
|
|
196
199
|
placeholder: {
|
|
197
200
|
required: false,
|
|
198
|
-
default: ''
|
|
201
|
+
default: ''
|
|
199
202
|
},
|
|
200
203
|
isError: {
|
|
201
204
|
required: false,
|
|
202
|
-
default: false
|
|
205
|
+
default: false
|
|
203
206
|
},
|
|
204
207
|
inputWidth: {
|
|
205
208
|
required: false,
|
|
206
|
-
default: null
|
|
209
|
+
default: null
|
|
207
210
|
},
|
|
208
211
|
minWidth: {
|
|
209
212
|
required: false,
|
|
210
|
-
default: null
|
|
213
|
+
default: null
|
|
211
214
|
},
|
|
212
215
|
value: {
|
|
213
216
|
required: true,
|
|
214
|
-
default: null
|
|
217
|
+
default: null
|
|
215
218
|
},
|
|
216
219
|
clearInput: {
|
|
217
220
|
required: false,
|
|
218
|
-
default: false
|
|
221
|
+
default: false
|
|
219
222
|
},
|
|
220
223
|
errorMessage: {
|
|
221
224
|
required: false,
|
|
222
|
-
default: 'Please insert a correct number'
|
|
225
|
+
default: 'Please insert a correct number'
|
|
223
226
|
},
|
|
224
227
|
numberPrecision: {
|
|
225
228
|
required: false,
|
|
226
|
-
default: 0
|
|
229
|
+
default: 0
|
|
227
230
|
},
|
|
228
231
|
unitName: {
|
|
229
232
|
required: false,
|
|
230
|
-
default: ''
|
|
233
|
+
default: ''
|
|
231
234
|
},
|
|
232
235
|
showLinearUnitName: {
|
|
233
236
|
required: false,
|
|
234
|
-
default: false
|
|
237
|
+
default: false
|
|
235
238
|
},
|
|
236
239
|
disabled: {
|
|
237
240
|
required: false,
|
|
238
|
-
default: false
|
|
241
|
+
default: false
|
|
239
242
|
},
|
|
240
243
|
noBorder: {
|
|
241
244
|
required: false,
|
|
242
|
-
default: false
|
|
245
|
+
default: false
|
|
243
246
|
},
|
|
244
247
|
textAlign: {
|
|
245
248
|
required: false,
|
|
246
|
-
default: 'left'
|
|
249
|
+
default: 'left'
|
|
247
250
|
},
|
|
248
251
|
fontSize: {
|
|
249
252
|
required: false,
|
|
250
|
-
default: '13px'
|
|
253
|
+
default: '13px'
|
|
251
254
|
},
|
|
252
255
|
labelText: {
|
|
253
256
|
required: false,
|
|
254
|
-
default: null
|
|
257
|
+
default: null
|
|
255
258
|
},
|
|
256
259
|
labelInfoText: {
|
|
257
260
|
required: false,
|
|
258
|
-
default: null
|
|
261
|
+
default: null
|
|
259
262
|
},
|
|
260
263
|
labelInfoAlign: {
|
|
261
264
|
required: false,
|
|
262
|
-
default: 'right'
|
|
265
|
+
default: 'right'
|
|
263
266
|
},
|
|
264
267
|
minNumber: {
|
|
265
268
|
required: false,
|
|
266
|
-
default: null
|
|
269
|
+
default: null
|
|
267
270
|
},
|
|
268
271
|
fontColor: {
|
|
269
272
|
required: false,
|
|
270
|
-
default: null
|
|
273
|
+
default: null
|
|
271
274
|
},
|
|
272
275
|
numberToStringEnabled: {
|
|
273
276
|
required: false,
|
|
274
|
-
default: true
|
|
275
|
-
}
|
|
277
|
+
default: true
|
|
278
|
+
}
|
|
276
279
|
},
|
|
277
280
|
methods: {
|
|
278
281
|
onChangeHandler(event) {
|
|
@@ -300,15 +303,15 @@ export default {
|
|
|
300
303
|
} else {
|
|
301
304
|
let num = stringToNumber({
|
|
302
305
|
value: item,
|
|
303
|
-
numberPrecision: false
|
|
306
|
+
numberPrecision: false
|
|
304
307
|
})
|
|
305
308
|
return num
|
|
306
309
|
}
|
|
307
310
|
})
|
|
308
|
-
let evaluated = eval(formatted.join(
|
|
311
|
+
let evaluated = eval(formatted.join('')) || ''
|
|
309
312
|
evaluated = stringToNumber({
|
|
310
313
|
value: evaluated,
|
|
311
|
-
numberPrecision: this.numberPrecision
|
|
314
|
+
numberPrecision: this.numberPrecision
|
|
312
315
|
})
|
|
313
316
|
return evaluated
|
|
314
317
|
},
|
|
@@ -321,7 +324,7 @@ export default {
|
|
|
321
324
|
this.textInput = numberToString({
|
|
322
325
|
value:
|
|
323
326
|
evaluatedInput && value.length ? evaluatedInput : this.minNumber,
|
|
324
|
-
numberPrecision: this.numberPrecision
|
|
327
|
+
numberPrecision: this.numberPrecision
|
|
325
328
|
})
|
|
326
329
|
}
|
|
327
330
|
let adjustedMinValue =
|
|
@@ -352,33 +355,33 @@ export default {
|
|
|
352
355
|
let input = this.numberToStringEnabled
|
|
353
356
|
? numberToString({
|
|
354
357
|
value: adjustedMinValue,
|
|
355
|
-
numberPrecision: this.numberPrecision
|
|
358
|
+
numberPrecision: this.numberPrecision
|
|
356
359
|
})
|
|
357
360
|
: adjustedMinValue
|
|
358
|
-
let unit = this.showLinearUnitName ?
|
|
359
|
-
return input +
|
|
361
|
+
let unit = this.showLinearUnitName ? '' : this.unitName
|
|
362
|
+
return input + ' ' + unit
|
|
360
363
|
} else if (!adjustedMinValue && adjustedMinValue !== 0) {
|
|
361
364
|
return ''
|
|
362
365
|
} else {
|
|
363
366
|
return this.numberToStringEnabled
|
|
364
367
|
? numberToString({
|
|
365
368
|
value: adjustedMinValue,
|
|
366
|
-
numberPrecision: this.numberPrecision
|
|
369
|
+
numberPrecision: this.numberPrecision
|
|
367
370
|
})
|
|
368
371
|
: adjustedMinValue
|
|
369
372
|
}
|
|
370
|
-
}
|
|
373
|
+
}
|
|
371
374
|
},
|
|
372
375
|
created() {
|
|
373
376
|
if (this.value) {
|
|
374
377
|
this.textInput = numberToString({
|
|
375
378
|
value: this.value,
|
|
376
|
-
numberPrecision: this.numberPrecision
|
|
379
|
+
numberPrecision: this.numberPrecision
|
|
377
380
|
})
|
|
378
381
|
} else if (this.minNumber !== null) {
|
|
379
382
|
this.textInput = numberToString({
|
|
380
383
|
value: this.minNumber,
|
|
381
|
-
numberPrecision: this.numberPrecision
|
|
384
|
+
numberPrecision: this.numberPrecision
|
|
382
385
|
})
|
|
383
386
|
}
|
|
384
387
|
},
|
|
@@ -388,7 +391,7 @@ export default {
|
|
|
388
391
|
// If the value is typed, then we should clear the textInput on Continue
|
|
389
392
|
this.textInput = ''
|
|
390
393
|
}
|
|
391
|
-
}
|
|
392
|
-
}
|
|
394
|
+
}
|
|
395
|
+
}
|
|
393
396
|
}
|
|
394
397
|
</script>
|
|
@@ -65,7 +65,7 @@ const ComponentWrapper = styled("div", wrapperProps)`
|
|
|
65
65
|
display: flex;
|
|
66
66
|
flex-direction: ${(props) =>
|
|
67
67
|
props.layout === "vertical" ? "column" : "row"};
|
|
68
|
-
grid-gap:
|
|
68
|
+
grid-gap: 10px 5px;
|
|
69
69
|
flex-wrap: wrap;
|
|
70
70
|
`
|
|
71
71
|
|
|
@@ -95,58 +95,60 @@ const containerProps = { size: String, isDisabled: Boolean }
|
|
|
95
95
|
const LabelContainer = styled("label", containerProps)`
|
|
96
96
|
display: grid;
|
|
97
97
|
grid-template-columns: auto 1fr auto;
|
|
98
|
-
grid-gap:
|
|
98
|
+
grid-gap: 15px;
|
|
99
99
|
align-items: center;
|
|
100
100
|
color: ${(props) =>
|
|
101
101
|
props.isDisabled ? props.theme.colors.disabled : props.theme.colors.black};
|
|
102
102
|
position: relative;
|
|
103
103
|
cursor: ${(props) => (props.isDisabled ? "not-allowed" : "pointer")};
|
|
104
|
-
font-size:
|
|
104
|
+
font-size: ${(props) =>
|
|
105
|
+
props.size === "large"
|
|
106
|
+
? "16px"
|
|
107
|
+
: props.size === "medium"
|
|
108
|
+
? "13px"
|
|
109
|
+
: "10px"};
|
|
105
110
|
user-select: none;
|
|
106
111
|
flex: auto;
|
|
107
112
|
align-self: baseline;
|
|
108
113
|
|
|
109
114
|
.checkmark {
|
|
110
|
-
position: relative;
|
|
111
115
|
height: ${(props) =>
|
|
112
116
|
props.size === "large"
|
|
113
117
|
? "23px"
|
|
114
118
|
: props.size === "medium"
|
|
115
|
-
? "
|
|
119
|
+
? "16px"
|
|
116
120
|
: "12px"};
|
|
117
121
|
width: ${(props) =>
|
|
118
122
|
props.size === "large"
|
|
119
123
|
? "23px"
|
|
120
124
|
: props.size === "medium"
|
|
121
|
-
? "
|
|
125
|
+
? "16px"
|
|
122
126
|
: "12px"};
|
|
123
127
|
background-color: #fff;
|
|
124
128
|
border-radius: 100%;
|
|
125
129
|
border: 1px solid ${(props) => props.theme.colors.mediumGray};
|
|
130
|
+
display: flex;
|
|
131
|
+
align-items: center;
|
|
132
|
+
justify-content: center;
|
|
126
133
|
|
|
127
134
|
&:after {
|
|
128
135
|
content: "";
|
|
129
|
-
position: absolute;
|
|
130
136
|
display: none;
|
|
131
137
|
}
|
|
132
138
|
}
|
|
133
139
|
|
|
134
140
|
.checkmark:after {
|
|
135
|
-
top: ${(props) =>
|
|
136
|
-
props.size === "large" ? "6px" : props.size === "medium" ? "5px" : "3px"};
|
|
137
|
-
left: ${(props) =>
|
|
138
|
-
props.size === "large" ? "7px" : props.size === "medium" ? "5px" : "3px"};
|
|
139
141
|
width: ${(props) =>
|
|
140
142
|
props.size === "large"
|
|
141
143
|
? "10px"
|
|
142
144
|
: props.size === "medium"
|
|
143
|
-
? "
|
|
145
|
+
? "8px"
|
|
144
146
|
: "6px"};
|
|
145
147
|
height: ${(props) =>
|
|
146
148
|
props.size === "large"
|
|
147
149
|
? "10px"
|
|
148
150
|
: props.size === "medium"
|
|
149
|
-
? "
|
|
151
|
+
? "8px"
|
|
150
152
|
: "6px"};
|
|
151
153
|
border-radius: 100%;
|
|
152
154
|
background: ${(props) => props.theme.colors.primary};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
:hasLabel="label && label.length > 0"
|
|
6
6
|
>
|
|
7
7
|
<label-wrapper v-if="label">
|
|
8
|
-
<input-label>{{ label }}</input-label>
|
|
8
|
+
<input-label :fontSize="fontSize">{{ label }}</input-label>
|
|
9
9
|
<info-text
|
|
10
10
|
v-if="infoTextMessage"
|
|
11
11
|
:text="infoTextMessage"
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
// alignItems="horizontal" // horizontal, vertical
|
|
46
46
|
// :isDisabled="true"
|
|
47
47
|
// />
|
|
48
|
-
import styled from
|
|
49
|
-
import InfoText from
|
|
48
|
+
import styled from 'vue-styled-components'
|
|
49
|
+
import InfoText from '../../infoText'
|
|
50
50
|
|
|
51
51
|
const containerProps = { inputWidth: String }
|
|
52
|
-
const Container = styled(
|
|
53
|
-
width: ${(props) => (props.inputWidth ? props.inputWidth :
|
|
52
|
+
const Container = styled('div', containerProps)`
|
|
53
|
+
width: ${(props) => (props.inputWidth ? props.inputWidth : '100%')};
|
|
54
54
|
position: relative;
|
|
55
55
|
margin-bottom: 20px;
|
|
56
56
|
`
|
|
@@ -66,22 +66,22 @@ const inputProps = {
|
|
|
66
66
|
isError: Boolean,
|
|
67
67
|
disabled: Boolean,
|
|
68
68
|
fontSize: String,
|
|
69
|
-
inputWidth: String
|
|
69
|
+
inputWidth: String
|
|
70
70
|
}
|
|
71
|
-
const InputContainer = styled(
|
|
71
|
+
const InputContainer = styled('textarea', inputProps)`
|
|
72
72
|
border: ${(props) =>
|
|
73
73
|
props.isError
|
|
74
|
-
?
|
|
75
|
-
:
|
|
74
|
+
? '1px solid ' + props.theme.colors.red
|
|
75
|
+
: '1px solid ' + props.theme.colors.mediumGray};
|
|
76
76
|
padding: ${(props) =>
|
|
77
|
-
props.hasUnit ?
|
|
77
|
+
props.hasUnit ? '11px 40px 11px 10px' : '11px 5px 11px 10px'};
|
|
78
78
|
border-radius: 4px;
|
|
79
|
-
font-size: ${(props) => (props.fontSize ? props.fontSize :
|
|
79
|
+
font-size: ${(props) => (props.fontSize ? props.fontSize : '16px')};
|
|
80
80
|
color: ${(props) => props.theme.colors.black};
|
|
81
|
-
width: ${(props) => (props.inputWidth ? props.inputWidth :
|
|
81
|
+
width: ${(props) => (props.inputWidth ? props.inputWidth : '100%')};
|
|
82
82
|
max-width: 100%;
|
|
83
83
|
box-sizing: border-box; // to allow width of 100% with padding
|
|
84
|
-
cursor: ${(props) => (props.disabled ?
|
|
84
|
+
cursor: ${(props) => (props.disabled ? 'not-allowed' : 'inherit')};
|
|
85
85
|
|
|
86
86
|
&::placeholder {
|
|
87
87
|
color: ${(props) =>
|
|
@@ -94,17 +94,17 @@ const InputContainer = styled("textarea", inputProps)`
|
|
|
94
94
|
`
|
|
95
95
|
|
|
96
96
|
const inputAttrs = { alignItems: String, hasLabel: Boolean }
|
|
97
|
-
const InputWrapper = styled(
|
|
97
|
+
const InputWrapper = styled('div', inputAttrs)`
|
|
98
98
|
position: relative;
|
|
99
99
|
display: grid;
|
|
100
100
|
align-items: center;
|
|
101
101
|
gap: 8px;
|
|
102
102
|
grid-template-columns: ${(props) =>
|
|
103
103
|
!props.hasLabel
|
|
104
|
-
?
|
|
105
|
-
: props.alignItems ===
|
|
106
|
-
?
|
|
107
|
-
:
|
|
104
|
+
? '1fr'
|
|
105
|
+
: props.alignItems === 'vertical'
|
|
106
|
+
? '1fr'
|
|
107
|
+
: 'auto 1fr'};
|
|
108
108
|
`
|
|
109
109
|
|
|
110
110
|
const ErrorMessage = styled.div`
|
|
@@ -114,12 +114,14 @@ const ErrorMessage = styled.div`
|
|
|
114
114
|
top: calc(100% + 1px);
|
|
115
115
|
`
|
|
116
116
|
|
|
117
|
-
const
|
|
117
|
+
const labelAttrs = { fontSize: String }
|
|
118
|
+
const InputLabel = styled('div', labelAttrs)`
|
|
118
119
|
font-weight: bold;
|
|
120
|
+
font-size: ${(props) => (props.fontSize ? props.fontSize : '16px')};
|
|
119
121
|
`
|
|
120
122
|
|
|
121
123
|
export default {
|
|
122
|
-
name:
|
|
124
|
+
name: 'text-area-input',
|
|
123
125
|
components: {
|
|
124
126
|
Container,
|
|
125
127
|
InputContainer,
|
|
@@ -127,61 +129,61 @@ export default {
|
|
|
127
129
|
ErrorMessage,
|
|
128
130
|
InfoText,
|
|
129
131
|
LabelWrapper,
|
|
130
|
-
InputLabel
|
|
132
|
+
InputLabel
|
|
131
133
|
},
|
|
132
134
|
props: {
|
|
133
135
|
placeholder: {
|
|
134
136
|
required: false,
|
|
135
|
-
default:
|
|
137
|
+
default: ''
|
|
136
138
|
},
|
|
137
139
|
isError: {
|
|
138
140
|
required: false,
|
|
139
|
-
default: false
|
|
141
|
+
default: false
|
|
140
142
|
},
|
|
141
143
|
rowHeight: {
|
|
142
144
|
required: false,
|
|
143
|
-
default:
|
|
145
|
+
default: '2'
|
|
144
146
|
},
|
|
145
147
|
value: {
|
|
146
148
|
required: true,
|
|
147
|
-
default: null
|
|
149
|
+
default: null
|
|
148
150
|
},
|
|
149
151
|
errorText: {
|
|
150
|
-
required: false
|
|
152
|
+
required: false
|
|
151
153
|
},
|
|
152
154
|
isDisabled: {
|
|
153
155
|
required: false,
|
|
154
|
-
default: false
|
|
156
|
+
default: false
|
|
155
157
|
},
|
|
156
158
|
alignItems: {
|
|
157
159
|
required: false,
|
|
158
|
-
default:
|
|
160
|
+
default: 'horizontal'
|
|
159
161
|
},
|
|
160
162
|
infoTextMessage: {
|
|
161
|
-
required: false
|
|
163
|
+
required: false
|
|
162
164
|
},
|
|
163
165
|
infoTextAlign: {
|
|
164
|
-
required: false
|
|
166
|
+
required: false
|
|
165
167
|
},
|
|
166
168
|
label: {
|
|
167
|
-
required: false
|
|
169
|
+
required: false
|
|
168
170
|
},
|
|
169
171
|
fontSize: {
|
|
170
172
|
required: false,
|
|
171
|
-
default:
|
|
173
|
+
default: '16px'
|
|
172
174
|
},
|
|
173
175
|
inputWidth: {
|
|
174
176
|
required: false,
|
|
175
|
-
default: null
|
|
176
|
-
}
|
|
177
|
+
default: null
|
|
178
|
+
}
|
|
177
179
|
},
|
|
178
180
|
methods: {
|
|
179
181
|
onChangeHandler($event) {
|
|
180
182
|
if (this.isDisabled) {
|
|
181
183
|
return
|
|
182
184
|
}
|
|
183
|
-
this.$emit(
|
|
184
|
-
}
|
|
185
|
-
}
|
|
185
|
+
this.$emit('input-change', $event)
|
|
186
|
+
}
|
|
187
|
+
}
|
|
186
188
|
}
|
|
187
189
|
</script>
|
|
@@ -3,15 +3,18 @@
|
|
|
3
3
|
:isOpen="isOpen"
|
|
4
4
|
:class="{ visible: isOpen, hidden: !isOpen }"
|
|
5
5
|
@click.native="onOutsideClose()"
|
|
6
|
+
:backdrop="backdrop"
|
|
6
7
|
>
|
|
7
8
|
<modal-container @click.stop>
|
|
8
|
-
<spinner v-if="isLoading" size="50px" :
|
|
9
|
+
<spinner v-if="isLoading" size="50px" :limitedToModal="true" />
|
|
10
|
+
<content-container :visible="!isLoading">
|
|
11
|
+
<slot />
|
|
12
|
+
</content-container>
|
|
9
13
|
<close-button
|
|
10
14
|
v-if="!hideClose"
|
|
11
15
|
@click.native="onCloseModal()"
|
|
12
16
|
class="close"
|
|
13
17
|
/>
|
|
14
|
-
<slot />
|
|
15
18
|
</modal-container>
|
|
16
19
|
</page-wrapper>
|
|
17
20
|
</template>
|
|
@@ -28,7 +31,12 @@ import styled from 'vue-styled-components'
|
|
|
28
31
|
import CloseButton from '../../buttons/closeButton'
|
|
29
32
|
import Spinner from '../../spinner'
|
|
30
33
|
|
|
31
|
-
const
|
|
34
|
+
const contentAttrs = { visible: Boolean }
|
|
35
|
+
const ContentContainer = styled('div', contentAttrs)`
|
|
36
|
+
visibility: ${(props) => (props.visible ? 'inherit' : 'hidden')};
|
|
37
|
+
`
|
|
38
|
+
|
|
39
|
+
const pageAttrs = { isOpen: Boolean, backdrop: String }
|
|
32
40
|
const PageWrapper = styled('div', pageAttrs)`
|
|
33
41
|
position: fixed;
|
|
34
42
|
display: grid;
|
|
@@ -36,7 +44,10 @@ const PageWrapper = styled('div', pageAttrs)`
|
|
|
36
44
|
left: 0;
|
|
37
45
|
width: 100%;
|
|
38
46
|
height: 100%;
|
|
39
|
-
background-color:
|
|
47
|
+
background-color: ${(props) =>
|
|
48
|
+
props.backdrop == 'dark'
|
|
49
|
+
? 'rgba(0, 0, 0, 0.4)'
|
|
50
|
+
: 'rgba(255, 255, 255, 0.9)'};
|
|
40
51
|
z-index: 99999;
|
|
41
52
|
overflow: auto;
|
|
42
53
|
|
|
@@ -98,7 +109,8 @@ export default {
|
|
|
98
109
|
PageWrapper,
|
|
99
110
|
ModalContainer,
|
|
100
111
|
CloseButton,
|
|
101
|
-
Spinner
|
|
112
|
+
Spinner,
|
|
113
|
+
ContentContainer
|
|
102
114
|
},
|
|
103
115
|
props: {
|
|
104
116
|
isOpen: {
|
|
@@ -116,6 +128,10 @@ export default {
|
|
|
116
128
|
hideClose: {
|
|
117
129
|
required: false,
|
|
118
130
|
default: false
|
|
131
|
+
},
|
|
132
|
+
backdrop: {
|
|
133
|
+
required: false,
|
|
134
|
+
default: 'white'
|
|
119
135
|
}
|
|
120
136
|
},
|
|
121
137
|
methods: {
|
|
@@ -135,4 +151,4 @@ export default {
|
|
|
135
151
|
}
|
|
136
152
|
}
|
|
137
153
|
}
|
|
138
|
-
</script>
|
|
154
|
+
</script>
|