@eturnity/eturnity_reusable_components 1.2.25-EPDM-5202.2 → 1.2.26-3d-master.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/.prettierrc +6 -6
- package/.storybook/main.js +8 -8
- package/.storybook/preview.js +46 -46
- package/README.md +29 -29
- package/babel.config.js +5 -5
- package/package.json +63 -63
- package/public/index.html +17 -17
- package/src/App.vue +376 -321
- package/src/assets/icons/arrow_down.svg +3 -3
- package/src/assets/icons/arrow_up_red.svg +3 -3
- package/src/assets/icons/black_spinner.svg +35 -35
- package/src/assets/icons/delete_icon.svg +11 -11
- package/src/assets/icons/delete_icon_gray.svg +11 -11
- package/src/assets/icons/drag_icon.svg +8 -8
- package/src/assets/icons/error_icon copy.png +0 -0
- package/src/assets/icons/external_icon.svg +6 -6
- package/src/assets/icons/language_icon.svg +6 -6
- package/src/assets/icons/pdf_icon.svg +6 -6
- package/src/assets/icons/plus_button.svg +4 -4
- package/src/assets/icons/search_icon_black.svg +3 -3
- package/src/assets/icons/subposition_icon.svg +3 -3
- package/src/assets/icons/subposition_marker.svg +3 -3
- package/src/assets/icons/warning_icon.svg +3 -3
- package/src/assets/svgIcons/2d_active.svg +7 -7
- package/src/assets/svgIcons/2d_inactive.svg +8 -8
- package/src/assets/svgIcons/3d_active.svg +7 -7
- package/src/assets/svgIcons/3d_inactive.svg +8 -8
- package/src/assets/svgIcons/accept.svg +5 -5
- package/src/assets/svgIcons/activate_panels_active.svg +22 -22
- package/src/assets/svgIcons/activate_panels_inactive.svg +20 -20
- package/src/assets/svgIcons/add_icon-1.svg +3 -3
- package/src/assets/svgIcons/add_icon.svg +4 -4
- package/src/assets/svgIcons/address_book.svg +3 -3
- package/src/assets/svgIcons/after_sale_as_a_service.svg +6 -6
- package/src/assets/svgIcons/all_good.svg +3 -3
- package/src/assets/svgIcons/angle_active.svg +5 -5
- package/src/assets/svgIcons/angle_inactive.svg +4 -4
- package/src/assets/svgIcons/area_active.svg +11 -11
- package/src/assets/svgIcons/area_inactive.svg +26 -26
- package/src/assets/svgIcons/arrow_down.svg +3 -3
- package/src/assets/svgIcons/arrow_left.svg +4 -4
- package/src/assets/svgIcons/arrow_right.svg +4 -4
- package/src/assets/svgIcons/arrow_up.svg +3 -3
- package/src/assets/svgIcons/attachment.svg +3 -3
- package/src/assets/svgIcons/base_layer.svg +3 -0
- package/src/assets/svgIcons/battery.svg +3 -3
- package/src/assets/svgIcons/bell.svg +3 -3
- package/src/assets/svgIcons/bold.svg +3 -3
- package/src/assets/svgIcons/bom.svg +3 -3
- package/src/assets/svgIcons/bom_generation.svg +10 -10
- package/src/assets/svgIcons/bookmaker.svg +3 -3
- package/src/assets/svgIcons/bubble.svg +3 -3
- package/src/assets/svgIcons/bullet_list.svg +8 -8
- package/src/assets/svgIcons/calendar.svg +7 -7
- package/src/assets/svgIcons/calendar_icon.svg +7 -7
- package/src/assets/svgIcons/call.svg +3 -3
- package/src/assets/svgIcons/camera.svg +3 -3
- package/src/assets/svgIcons/car.svg +3 -3
- package/src/assets/svgIcons/cart.svg +3 -3
- package/src/assets/svgIcons/checkbox.svg +3 -3
- package/src/assets/svgIcons/clear_formatting.svg +7 -7
- package/src/assets/svgIcons/clickable_info.svg +4 -4
- package/src/assets/svgIcons/clip.svg +3 -3
- package/src/assets/svgIcons/clock.svg +4 -4
- package/src/assets/svgIcons/close_for_modals,_tool_tips.svg +4 -4
- package/src/assets/svgIcons/collapse.svg +4 -4
- package/src/assets/svgIcons/component_library.svg +7 -7
- package/src/assets/svgIcons/context_menu-1.svg +6 -6
- package/src/assets/svgIcons/context_menu-2.svg +5 -5
- package/src/assets/svgIcons/context_menu.svg +5 -5
- package/src/assets/svgIcons/context_menu_tabs.svg +5 -5
- package/src/assets/svgIcons/cross.svg +4 -4
- package/src/assets/svgIcons/current_variant.svg +4 -4
- package/src/assets/svgIcons/deadline.svg +4 -4
- package/src/assets/svgIcons/delete.svg +4 -4
- package/src/assets/svgIcons/delete_area_active.svg +16 -16
- package/src/assets/svgIcons/delete_area_inactive.svg +15 -15
- package/src/assets/svgIcons/direction_active-1.svg +12 -12
- package/src/assets/svgIcons/direction_active.svg +5 -5
- package/src/assets/svgIcons/direction_inactive.svg +4 -4
- package/src/assets/svgIcons/distances_active.svg +9 -9
- package/src/assets/svgIcons/distances_inactive.svg +8 -8
- package/src/assets/svgIcons/document.svg +3 -3
- package/src/assets/svgIcons/downarrow.svg +3 -3
- package/src/assets/svgIcons/download.svg +4 -4
- package/src/assets/svgIcons/draggable_corner.svg +5 -0
- package/src/assets/svgIcons/duplicate-1.svg +8 -8
- package/src/assets/svgIcons/duplicate-2.svg +5 -5
- package/src/assets/svgIcons/duplicate.svg +4 -4
- package/src/assets/svgIcons/e-mobility_configurator.svg +6 -6
- package/src/assets/svgIcons/edit_button.svg +3 -3
- package/src/assets/svgIcons/email.svg +3 -3
- package/src/assets/svgIcons/ems-1.svg +3 -3
- package/src/assets/svgIcons/ems.svg +3 -3
- package/src/assets/svgIcons/end_of_the_list.svg +5 -5
- package/src/assets/svgIcons/erase.svg +4 -4
- package/src/assets/svgIcons/fav_icon.svg +4 -4
- package/src/assets/svgIcons/financing_for_pv-1.svg +5 -5
- package/src/assets/svgIcons/financing_for_pv-2.svg +3 -3
- package/src/assets/svgIcons/financing_for_pv.svg +6 -6
- package/src/assets/svgIcons/finish-1.svg +4 -4
- package/src/assets/svgIcons/finish.svg +3 -3
- package/src/assets/svgIcons/folder.svg +3 -3
- package/src/assets/svgIcons/heat_calc.svg +7 -7
- package/src/assets/svgIcons/house.svg +3 -3
- package/src/assets/svgIcons/info.svg +3 -3
- package/src/assets/svgIcons/initial_situation.svg +3 -3
- package/src/assets/svgIcons/intro-tour-1.svg +3 -3
- package/src/assets/svgIcons/intro-tour.svg +3 -3
- package/src/assets/svgIcons/inverter-1.svg +5 -5
- package/src/assets/svgIcons/inverter.svg +3 -3
- package/src/assets/svgIcons/italic.svg +3 -3
- package/src/assets/svgIcons/key.svg +3 -3
- package/src/assets/svgIcons/lead_marketplace.svg +6 -6
- package/src/assets/svgIcons/lead_provider.svg +4 -4
- package/src/assets/svgIcons/length_in_2d_active.svg +12 -12
- package/src/assets/svgIcons/length_in_2d_inctive.svg +13 -13
- package/src/assets/svgIcons/light_bulb.svg +3 -3
- package/src/assets/svgIcons/line_graph.svg +3 -3
- package/src/assets/svgIcons/local_subsidies.svg +18 -18
- package/src/assets/svgIcons/location.svg +3 -3
- package/src/assets/svgIcons/lock.svg +3 -3
- package/src/assets/svgIcons/loop.svg +3 -3
- package/src/assets/svgIcons/lunch.svg +4 -4
- package/src/assets/svgIcons/magic_tool.svg +6 -0
- package/src/assets/svgIcons/map_icon.svg +5 -3
- package/src/assets/svgIcons/margin_tool.svg +6 -0
- package/src/assets/svgIcons/meeting.svg +6 -6
- package/src/assets/svgIcons/move_copy.svg +4 -4
- package/src/assets/svgIcons/new_area_inactive.svg +11 -11
- package/src/assets/svgIcons/next.svg +4 -4
- package/src/assets/svgIcons/not_equal_to.svg +3 -3
- package/src/assets/svgIcons/numbered_list.svg +6 -6
- package/src/assets/svgIcons/obstacle_tool.svg +9 -13
- package/src/assets/svgIcons/outline_tool.svg +11 -0
- package/src/assets/svgIcons/pan_tool.svg +12 -12
- package/src/assets/svgIcons/panels_tool.svg +8 -8
- package/src/assets/svgIcons/pen_tool.svg +4 -4
- package/src/assets/svgIcons/picker_tool.svg +4 -4
- package/src/assets/svgIcons/picture.svg +3 -3
- package/src/assets/svgIcons/pin.svg +5 -5
- package/src/assets/svgIcons/presentation.svg +3 -3
- package/src/assets/svgIcons/previous.svg +4 -4
- package/src/assets/svgIcons/profile-1.svg +4 -4
- package/src/assets/svgIcons/profile.svg +4 -4
- package/src/assets/svgIcons/profitability.svg +3 -3
- package/src/assets/svgIcons/project_analysis.svg +4 -4
- package/src/assets/svgIcons/project_settings.svg +4 -4
- package/src/assets/svgIcons/pv.svg +3 -3
- package/src/assets/svgIcons/quotations.svg +6 -6
- package/src/assets/svgIcons/redo.svg +6 -0
- package/src/assets/svgIcons/resizer.svg +5 -0
- package/src/assets/svgIcons/roof_layer.svg +3 -0
- package/src/assets/svgIcons/rotate_view.svg +5 -5
- package/src/assets/svgIcons/run_simulation.svg +3 -3
- package/src/assets/svgIcons/scaling_tool.svg +8 -8
- package/src/assets/svgIcons/search.svg +3 -3
- package/src/assets/svgIcons/security.svg +3 -3
- package/src/assets/svgIcons/settings.svg +3 -3
- package/src/assets/svgIcons/show_in_a_new_tab.svg +12 -12
- package/src/assets/svgIcons/smartphone.svg +4 -4
- package/src/assets/svgIcons/solar_calc.svg +13 -13
- package/src/assets/svgIcons/sorting.svg +4 -4
- package/src/assets/svgIcons/start_of_the_list.svg +5 -5
- package/src/assets/svgIcons/strikethrough.svg +4 -4
- package/src/assets/svgIcons/subsidies-1.svg +5 -5
- package/src/assets/svgIcons/subsidies-2.svg +3 -3
- package/src/assets/svgIcons/subsidies.svg +3 -3
- package/src/assets/svgIcons/subtract_icon.svg +3 -3
- package/src/assets/svgIcons/suitcase.svg +3 -3
- package/src/assets/svgIcons/template_icon_not_clickable.svg +6 -6
- package/src/assets/svgIcons/transfer.svg +4 -4
- package/src/assets/svgIcons/truck.svg +3 -3
- package/src/assets/svgIcons/underlined.svg +3 -3
- package/src/assets/svgIcons/undo.svg +6 -0
- package/src/assets/svgIcons/uparrow.svg +3 -3
- package/src/assets/svgIcons/upload_avatar-1.svg +12 -12
- package/src/assets/svgIcons/upload_avatar.svg +5 -5
- package/src/assets/svgIcons/upload_image.svg +8 -8
- package/src/assets/svgIcons/vertical_tool.svg +3 -0
- package/src/assets/svgIcons/virtual_storage.svg +4 -4
- package/src/assets/svgIcons/warning.svg +4 -4
- package/src/assets/svgIcons/way.svg +5 -5
- package/src/assets/svgIcons/wifi.svg +3 -3
- package/src/assets/svgIcons/winter.svg +3 -3
- package/src/assets/theme.js +36 -34
- package/src/components/addNewButton/AddNewButton.stories.js +24 -24
- package/src/components/addNewButton/index.vue +58 -58
- package/src/components/buttons/closeButton/CloseButton.stories.js +29 -29
- package/src/components/buttons/closeButton/index.vue +61 -61
- package/src/components/buttons/externalButton/index.vue +101 -101
- package/src/components/buttons/mainButton/index.vue +82 -82
- package/src/components/deleteIcon/DeleteIcon.stories.js +29 -29
- package/src/components/deleteIcon/index.vue +55 -55
- package/src/components/errorMessage/index.vue +62 -0
- package/src/components/icon/Icons.stories.js +41 -41
- package/src/components/icon/iconCollection.vue +68 -68
- package/src/components/icon/index.vue +84 -83
- package/src/components/iconWrapper/index.vue +116 -0
- package/src/components/infoText/index.vue +166 -151
- package/src/components/inputs/checkbox/Checkbox.stories.js +57 -57
- package/src/components/inputs/checkbox/index.vue +182 -182
- package/src/components/inputs/inputNumber/InputNumber.stories.js +150 -150
- package/src/components/inputs/inputNumber/index.vue +557 -390
- package/src/components/inputs/inputNumberQuestion/index.vue +215 -215
- package/src/components/inputs/inputText/InputText.stories.js +75 -75
- package/src/components/inputs/inputText/index.vue +258 -253
- package/src/components/inputs/radioButton/RadioButton.stories.js +58 -58
- package/src/components/inputs/radioButton/index.vue +246 -246
- package/src/components/inputs/searchInput/SearchInput.stories.js +40 -40
- package/src/components/inputs/searchInput/index.vue +97 -97
- package/src/components/inputs/slider/index.vue +126 -126
- package/src/components/inputs/textAreaInput/TextAreaInput.stories.js +135 -135
- package/src/components/inputs/textAreaInput/index.vue +194 -189
- package/src/components/inputs/toggle/Toggle.stories.js +77 -77
- package/src/components/inputs/toggle/index.vue +288 -288
- package/src/components/modals/modal/index.vue +153 -153
- package/src/components/modals/modal/modal.stories.js +31 -31
- package/src/components/pageSubtitle/index.vue +68 -68
- package/src/components/pageTitle/index.vue +45 -45
- package/src/components/progressBar/index.vue +125 -125
- package/src/components/projectMarker/index.vue +285 -285
- package/src/components/spinner/index.vue +71 -71
- package/src/components/tableDropdown/index.vue +644 -644
- package/src/components/tables/mainTable/exampleNested.vue +328 -328
- package/src/components/tables/mainTable/index.vue +379 -379
- package/src/components/tables/viewTable/index.vue +195 -195
- package/src/components/threeDots/index.vue +333 -333
- package/src/helpers/numberConverter.js +103 -98
- package/src/helpers/translateLang.js +80 -80
- package/src/main.js +13 -13
|
@@ -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>
|
|
@@ -1,151 +1,166 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component-wrapper>
|
|
3
|
-
<icon-wrapper>
|
|
4
|
-
<icon-img
|
|
5
|
-
:isActive="showInfo"
|
|
6
|
-
:size="size"
|
|
7
|
-
:borderColor="borderColor"
|
|
8
|
-
@click.prevent="toggleShowInfo()"
|
|
9
|
-
@mouseenter="toggleShowInfo()"
|
|
10
|
-
@mouseleave="toggleShowInfo()"
|
|
11
|
-
>
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
this.
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<component-wrapper>
|
|
3
|
+
<icon-wrapper :size="size">
|
|
4
|
+
<icon-img
|
|
5
|
+
:isActive="showInfo"
|
|
6
|
+
:size="size"
|
|
7
|
+
:borderColor="borderColor"
|
|
8
|
+
@click.prevent="toggleShowInfo()"
|
|
9
|
+
@mouseenter="openTrigger == 'onHover' ? toggleShowInfo() : ''"
|
|
10
|
+
@mouseleave="openTrigger == 'onHover' ? toggleShowInfo() : ''"
|
|
11
|
+
>
|
|
12
|
+
<icon :size="size" name="info" :color="iconColor" />
|
|
13
|
+
</icon-img>
|
|
14
|
+
<text-overlay
|
|
15
|
+
v-if="showInfo"
|
|
16
|
+
:borderColor="borderColor"
|
|
17
|
+
:alignText="alignText"
|
|
18
|
+
:width="width"
|
|
19
|
+
:halfComputedTextInfoWidth="halfComputedTextInfoWidth"
|
|
20
|
+
:alignArrow="alignArrow"
|
|
21
|
+
:iconSize="size"
|
|
22
|
+
><slot />
|
|
23
|
+
{{ text }}
|
|
24
|
+
</text-overlay>
|
|
25
|
+
</icon-wrapper>
|
|
26
|
+
</component-wrapper>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script>
|
|
30
|
+
// import InfoText from "@eturnity/eturnity_reusable_components/src/components/infoText"
|
|
31
|
+
//To use:
|
|
32
|
+
// <info-text
|
|
33
|
+
// text="Veritatis et quasi architecto beatae vitae"
|
|
34
|
+
// borderColor="#ccc"
|
|
35
|
+
// size="20"
|
|
36
|
+
// alignText="right" // default is left
|
|
37
|
+
// />
|
|
38
|
+
import theme from '../../assets/theme.js'
|
|
39
|
+
import styled from 'vue-styled-components'
|
|
40
|
+
import icon from '../icon'
|
|
41
|
+
|
|
42
|
+
const textAttrs = { iconSize:String, borderColor: String, alignArrow:String, alignText: String, width:String,halfComputedTextInfoWidth:Number }
|
|
43
|
+
const TextOverlay = styled('div', textAttrs)`
|
|
44
|
+
position: absolute;
|
|
45
|
+
top: ${(props) => 'calc('+props.iconSize+' + 15px)'};
|
|
46
|
+
${(props) => (props.alignArrow === 'left'
|
|
47
|
+
? 'left: calc('+props.iconSize+' /2 - 18px)'
|
|
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};
|
|
52
|
+
background: ${(props) => props.theme.colors.black};
|
|
53
|
+
padding: 10px;
|
|
54
|
+
width: ${(props) => props.width };
|
|
55
|
+
max-width: 400px;
|
|
56
|
+
font-size: 13px;
|
|
57
|
+
font-weight: 400;
|
|
58
|
+
border-radius: 4px;
|
|
59
|
+
z-index: 99;
|
|
60
|
+
color: ${(props) => props.theme.colors.white};
|
|
61
|
+
|
|
62
|
+
:before {
|
|
63
|
+
content: '';
|
|
64
|
+
background-color: ${(props) => props.theme.colors.black};
|
|
65
|
+
position: absolute;
|
|
66
|
+
top: 2px;
|
|
67
|
+
${(props) => (props.alignArrow === 'left' ? 'left:40px;' :
|
|
68
|
+
props.alignArrow=='center' ? 'left: calc(50% + 19px);' :
|
|
69
|
+
'right:-13px;')};
|
|
70
|
+
height: 8px;
|
|
71
|
+
width: 8px;
|
|
72
|
+
transform-origin: center center;
|
|
73
|
+
transform: translate(-2em, -0.5em) rotate(45deg);
|
|
74
|
+
}
|
|
75
|
+
`
|
|
76
|
+
|
|
77
|
+
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
|
+
cursor: pointer;
|
|
86
|
+
height: ${(props) => props.size};
|
|
87
|
+
`
|
|
88
|
+
|
|
89
|
+
const ComponentWrapper = styled.div`
|
|
90
|
+
display: inline-block;
|
|
91
|
+
`
|
|
92
|
+
|
|
93
|
+
export default {
|
|
94
|
+
name: 'info-text',
|
|
95
|
+
components: {
|
|
96
|
+
IconWrapper,
|
|
97
|
+
TextOverlay,
|
|
98
|
+
ComponentWrapper,
|
|
99
|
+
IconImg,
|
|
100
|
+
icon
|
|
101
|
+
},
|
|
102
|
+
props: {
|
|
103
|
+
text: {
|
|
104
|
+
required: false,
|
|
105
|
+
},
|
|
106
|
+
borderColor: {
|
|
107
|
+
required: false,
|
|
108
|
+
default: null
|
|
109
|
+
},
|
|
110
|
+
size: {
|
|
111
|
+
required: false,
|
|
112
|
+
default: '14px'
|
|
113
|
+
},
|
|
114
|
+
alignText: {
|
|
115
|
+
required: false,
|
|
116
|
+
default: 'left' // "left" or "right"
|
|
117
|
+
},
|
|
118
|
+
alignArrow:{
|
|
119
|
+
required:false,
|
|
120
|
+
default:'center'
|
|
121
|
+
},
|
|
122
|
+
openTrigger:{
|
|
123
|
+
required:false,
|
|
124
|
+
default: 'onClick'
|
|
125
|
+
},
|
|
126
|
+
width:{
|
|
127
|
+
required:false,
|
|
128
|
+
default:'165px'
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
methods: {
|
|
132
|
+
toggleShowInfo() {
|
|
133
|
+
this.showInfo = !this.showInfo
|
|
134
|
+
|
|
135
|
+
if (this.showInfo) {
|
|
136
|
+
document.addEventListener('click', this.clickOutside)
|
|
137
|
+
} else {
|
|
138
|
+
document.removeEventListener('click', this.clickOutside)
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
clickOutside(event) {
|
|
142
|
+
if (this.$el.contains(event.target)) {
|
|
143
|
+
return
|
|
144
|
+
}
|
|
145
|
+
this.toggleShowInfo()
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
data() {
|
|
149
|
+
return {
|
|
150
|
+
showInfo: false,
|
|
151
|
+
}
|
|
152
|
+
},
|
|
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
|
+
}
|
|
166
|
+
</script>
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
import Checkbox from "./index.vue"
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: "Checkbox",
|
|
5
|
-
component: Checkbox,
|
|
6
|
-
// argTypes: {},
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const Template = (args, { argTypes }) => ({
|
|
10
|
-
// Components used in your story `template` are defined in the `components` object
|
|
11
|
-
components: { Checkbox },
|
|
12
|
-
// The story's `args` need to be mapped into the template through the `setup()` method
|
|
13
|
-
props: Object.keys(argTypes),
|
|
14
|
-
template: '<checkbox v-bind="$props" />',
|
|
15
|
-
|
|
16
|
-
// import Checkbox from "@eturnity/eturnity_reusable_components/src/components/inputs/checkbox"
|
|
17
|
-
//To use:
|
|
18
|
-
// <checkbox
|
|
19
|
-
// label="Do you accept the Terms?"
|
|
20
|
-
// :isChecked="isChecked" //required
|
|
21
|
-
// @on-event-handler="onInputChange($event)" //required
|
|
22
|
-
// checkColor="blue"
|
|
23
|
-
// size="small"
|
|
24
|
-
// backgroundColor="red"
|
|
25
|
-
// :isDisabled="true"
|
|
26
|
-
// />
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
export const Default = Template.bind({})
|
|
30
|
-
Default.args = {
|
|
31
|
-
isChecked: true,
|
|
32
|
-
size: "medium", // "small" or "medium"
|
|
33
|
-
isDisabled: false,
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export const Small = Template.bind({})
|
|
37
|
-
Small.args = {
|
|
38
|
-
isChecked: true,
|
|
39
|
-
size: "small", // "small" or "medium"
|
|
40
|
-
isDisabled: false,
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export const CustomColor = Template.bind({})
|
|
44
|
-
CustomColor.args = {
|
|
45
|
-
isChecked: true,
|
|
46
|
-
size: "medium", // "small" or "medium"
|
|
47
|
-
checkColor: "blue",
|
|
48
|
-
backgroundColor: "red",
|
|
49
|
-
isDisabled: false,
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export const Disabled = Template.bind({})
|
|
53
|
-
Disabled.args = {
|
|
54
|
-
isChecked: false,
|
|
55
|
-
size: "medium", // "small" or "medium"
|
|
56
|
-
isDisabled: true,
|
|
57
|
-
}
|
|
1
|
+
import Checkbox from "./index.vue"
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: "Checkbox",
|
|
5
|
+
component: Checkbox,
|
|
6
|
+
// argTypes: {},
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const Template = (args, { argTypes }) => ({
|
|
10
|
+
// Components used in your story `template` are defined in the `components` object
|
|
11
|
+
components: { Checkbox },
|
|
12
|
+
// The story's `args` need to be mapped into the template through the `setup()` method
|
|
13
|
+
props: Object.keys(argTypes),
|
|
14
|
+
template: '<checkbox v-bind="$props" />',
|
|
15
|
+
|
|
16
|
+
// import Checkbox from "@eturnity/eturnity_reusable_components/src/components/inputs/checkbox"
|
|
17
|
+
//To use:
|
|
18
|
+
// <checkbox
|
|
19
|
+
// label="Do you accept the Terms?"
|
|
20
|
+
// :isChecked="isChecked" //required
|
|
21
|
+
// @on-event-handler="onInputChange($event)" //required
|
|
22
|
+
// checkColor="blue"
|
|
23
|
+
// size="small"
|
|
24
|
+
// backgroundColor="red"
|
|
25
|
+
// :isDisabled="true"
|
|
26
|
+
// />
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
export const Default = Template.bind({})
|
|
30
|
+
Default.args = {
|
|
31
|
+
isChecked: true,
|
|
32
|
+
size: "medium", // "small" or "medium"
|
|
33
|
+
isDisabled: false,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const Small = Template.bind({})
|
|
37
|
+
Small.args = {
|
|
38
|
+
isChecked: true,
|
|
39
|
+
size: "small", // "small" or "medium"
|
|
40
|
+
isDisabled: false,
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const CustomColor = Template.bind({})
|
|
44
|
+
CustomColor.args = {
|
|
45
|
+
isChecked: true,
|
|
46
|
+
size: "medium", // "small" or "medium"
|
|
47
|
+
checkColor: "blue",
|
|
48
|
+
backgroundColor: "red",
|
|
49
|
+
isDisabled: false,
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const Disabled = Template.bind({})
|
|
53
|
+
Disabled.args = {
|
|
54
|
+
isChecked: false,
|
|
55
|
+
size: "medium", // "small" or "medium"
|
|
56
|
+
isDisabled: true,
|
|
57
|
+
}
|