@eturnity/eturnity_reusable_components 7.24.3-EPDM-11320.2 → 7.24.3-qa-elisee-7.32.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 -8
- package/package.json +21 -9
- package/public/favicon.ico +0 -0
- package/public/index.html +17 -0
- package/src/App.vue +78 -79
- package/src/assets/svgIcons/adjust_roof.svg +6 -0
- package/src/assets/svgIcons/copy.svg +10 -0
- package/src/assets/theme.js +3 -3
- package/src/components/addNewButton/AddNewButton.stories.js +2 -2
- package/src/components/addNewButton/index.vue +51 -48
- package/src/components/banner/actionBanner/index.vue +55 -54
- package/src/components/banner/banner/banner.stories.js +5 -5
- package/src/components/banner/banner/index.vue +159 -159
- package/src/components/banner/infoBanner/index.vue +53 -41
- package/src/components/buttons/buttonIcon/index.vue +122 -125
- package/src/components/buttons/closeButton/CloseButton.stories.js +3 -3
- package/src/components/buttons/closeButton/index.vue +49 -49
- package/src/components/buttons/mainButton/index.vue +119 -119
- package/src/components/card/index.vue +70 -70
- package/src/components/collapsableInfoText/index.vue +94 -96
- package/src/components/deleteIcon/DeleteIcon.stories.js +4 -4
- package/src/components/deleteIcon/index.vue +54 -54
- package/src/components/draggableInputHandle/index.vue +37 -37
- package/src/components/dropdown/Dropdown.stories.js +10 -9
- package/src/components/dropdown/index.vue +106 -106
- package/src/components/errorMessage/index.vue +52 -52
- package/src/components/filter/filterSettings.vue +433 -439
- package/src/components/filter/index.vue +135 -135
- package/src/components/filter/parentDropdown.vue +73 -73
- package/src/components/icon/Icons.stories.js +7 -7
- package/src/components/icon/iconCollection.vue +53 -53
- package/src/components/icon/index.vue +121 -121
- package/src/components/iconWrapper/index.vue +156 -156
- package/src/components/infoCard/index.vue +26 -26
- package/src/components/infoText/index.vue +132 -133
- package/src/components/inputs/checkbox/Checkbox.stories.js +8 -8
- package/src/components/inputs/checkbox/index.vue +180 -190
- package/src/components/inputs/inputNumber/InputNumber.stories.js +41 -41
- package/src/components/inputs/inputNumber/index.vue +644 -647
- package/src/components/inputs/inputNumberQuestion/index.vue +182 -185
- package/src/components/inputs/inputText/InputText.stories.js +22 -22
- package/src/components/inputs/inputText/index.vue +336 -337
- package/src/components/inputs/radioButton/RadioButton.stories.js +16 -16
- package/src/components/inputs/radioButton/index.vue +219 -221
- package/src/components/inputs/searchInput/SearchInput.stories.js +8 -8
- package/src/components/inputs/searchInput/index.vue +126 -126
- package/src/components/inputs/select/index.vue +776 -778
- package/src/components/inputs/select/option/index.vue +124 -124
- package/src/components/inputs/select/select.stories.js +32 -31
- package/src/components/inputs/slider/index.vue +99 -99
- package/src/components/inputs/switchField/index.vue +222 -220
- package/src/components/inputs/textAreaInput/TextAreaInput.stories.js +57 -57
- package/src/components/inputs/textAreaInput/index.vue +173 -171
- package/src/components/inputs/toggle/Toggle.stories.js +14 -14
- package/src/components/inputs/toggle/index.vue +217 -214
- package/src/components/label/index.vue +82 -82
- package/src/components/markerItem/index.vue +66 -68
- package/src/components/modals/actionModal/index.vue +54 -54
- package/src/components/modals/infoModal/index.vue +36 -39
- package/src/components/modals/modal/index.vue +134 -134
- package/src/components/modals/modal/modal.stories.js +5 -5
- package/src/components/navigationTabs/index.vue +94 -96
- package/src/components/pageSubtitle/index.vue +49 -55
- package/src/components/pageTitle/index.vue +56 -56
- package/src/components/pagination/index.vue +89 -92
- package/src/components/progressBar/index.vue +107 -107
- package/src/components/projectMarker/index.vue +244 -246
- package/src/components/rangeSlider/Slider.vue +465 -491
- package/src/components/rangeSlider/index.vue +410 -410
- package/src/components/rangeSlider/utils/dom.js +5 -5
- package/src/components/selectedOptions/index.vue +119 -119
- package/src/components/sideMenu/index.vue +199 -199
- package/src/components/spinner/index.vue +57 -57
- package/src/components/tableDropdown/index.vue +520 -520
- package/src/components/tables/mainTable/index.vue +362 -366
- package/src/components/tables/viewTable/index.vue +171 -171
- package/src/components/threeDots/index.vue +334 -340
- package/src/components/videoThumbnail/index.vue +86 -86
- package/src/components/videoThumbnail/videoThumbnail.stories.js +16 -14
- package/src/helpers/numberConverter.js +2 -2
- package/src/helpers/translateLang.js +9 -9
- package/src/mixins/inputValidations.js +5 -5
- package/.eslintrc.js +0 -184
@@ -1,188 +1,188 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
:backdrop="backdrop"
|
4
|
-
:class="{ visible: isOpen, hidden: !isOpen }"
|
5
|
-
:is-open="isOpen"
|
2
|
+
<page-wrapper
|
6
3
|
:position="position"
|
4
|
+
:isOpen="isOpen"
|
5
|
+
:class="{ visible: isOpen, hidden: !isOpen }"
|
6
|
+
:backdrop="backdrop"
|
7
7
|
>
|
8
|
-
<
|
9
|
-
<
|
10
|
-
<
|
11
|
-
<slot
|
12
|
-
</
|
13
|
-
<
|
14
|
-
</
|
15
|
-
</
|
8
|
+
<modal-container @click="onClickModalContainer">
|
9
|
+
<spinner v-if="isLoading" size="50px" :limitedToModal="true" />
|
10
|
+
<content-container :visible="!isLoading">
|
11
|
+
<slot />
|
12
|
+
</content-container>
|
13
|
+
<close-button v-if="!hideClose" @click="onCloseModal()" class="close" />
|
14
|
+
</modal-container>
|
15
|
+
</page-wrapper>
|
16
16
|
</template>
|
17
17
|
|
18
18
|
<script>
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
19
|
+
// Rules: (as defined in https://e-turnity.atlassian.net/browse/EPDM-9694)
|
20
|
+
// 1. On clicking the “escape” key, close the modal onCloseModal()
|
21
|
+
// 2. Always prevent outside close
|
22
|
+
// import Modal from "@eturnity/eturnity_reusable_components/src/components/modals/modal"
|
23
|
+
// This is a more flexible modal box, where the parent can decide how the body of the modal looks
|
24
|
+
// To use:
|
25
|
+
// <modal :isOpen="isOpen" @on-close="$emit('on-close-summary')" :isLoading="true" :hideClose="true" :stopPropagation="false">
|
26
|
+
// <div>Data....</div>
|
27
|
+
// </modal>
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
29
|
+
import styled from 'vue3-styled-components'
|
30
|
+
import CloseButton from '../../buttons/closeButton'
|
31
|
+
import Spinner from '../../spinner'
|
32
32
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
33
|
+
const contentAttrs = { visible: Boolean }
|
34
|
+
const ContentContainer = styled('div', contentAttrs)`
|
35
|
+
visibility: ${(props) => (props.visible ? 'inherit' : 'hidden')};
|
36
|
+
`
|
37
37
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
38
|
+
const pageAttrs = { isOpen: Boolean, backdrop: String, position: String }
|
39
|
+
const PageWrapper = styled('div', pageAttrs)`
|
40
|
+
position: ${(props) => props.position}
|
41
|
+
display: grid;
|
42
|
+
top: 0;
|
43
|
+
left: 0;
|
44
|
+
width: 100%;
|
45
|
+
height: 100%;
|
46
|
+
background-color: ${(props) =>
|
47
|
+
props.backdrop == 'dark'
|
48
|
+
? 'rgba(0, 0, 0, 0.4)'
|
49
|
+
: 'rgba(255, 255, 255, 0.9)'};
|
50
|
+
z-index: 99999;
|
51
|
+
overflow: auto;
|
52
52
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
&.hidden {
|
60
|
-
visibility: hidden;
|
61
|
-
opacity: 0;
|
62
|
-
transition: visibility 0s linear 300ms, opacity 300ms;
|
63
|
-
}
|
53
|
+
&.visible {
|
54
|
+
visibility: visible;
|
55
|
+
opacity: 1;
|
56
|
+
transition: visibility 0s linear 0s, opacity 300ms;
|
57
|
+
}
|
64
58
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
59
|
+
&.hidden {
|
60
|
+
visibility: hidden;
|
61
|
+
opacity: 0;
|
62
|
+
transition: visibility 0s linear 300ms, opacity 300ms;
|
63
|
+
}
|
69
64
|
|
70
|
-
|
71
|
-
align-self: center;
|
72
|
-
justify-self: center;
|
73
|
-
position: relative;
|
74
|
-
box-shadow: 0px 4px 4px 3px rgba(0, 0, 0, 0.1);
|
75
|
-
border-radius: 4px;
|
65
|
+
@media (max-width: 425px) {
|
76
66
|
background: white;
|
77
|
-
|
78
|
-
|
79
|
-
max-width: 95%;
|
80
|
-
max-height: 95%;
|
81
|
-
min-width: 100px;
|
82
|
-
min-height: 100px;
|
67
|
+
}
|
68
|
+
`
|
83
69
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
70
|
+
const ModalContainer = styled.div`
|
71
|
+
align-self: center;
|
72
|
+
justify-self: center;
|
73
|
+
position: relative;
|
74
|
+
box-shadow: 0px 4px 4px 3px rgba(0, 0, 0, 0.1);
|
75
|
+
border-radius: 4px;
|
76
|
+
background: white;
|
77
|
+
margin: 0 auto;
|
78
|
+
overflow: auto;
|
79
|
+
max-width: 95%;
|
80
|
+
max-height: 95%;
|
81
|
+
min-width: 100px;
|
82
|
+
min-height: 100px;
|
89
83
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
}
|
84
|
+
::-webkit-scrollbar {
|
85
|
+
width: 0.3em;
|
86
|
+
height: 100%;
|
87
|
+
background-color: ${(props) => props.theme.colors.grey5};
|
88
|
+
}
|
94
89
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
90
|
+
/* Make scrollbar visible when needed */
|
91
|
+
::-webkit-scrollbar-thumb {
|
92
|
+
background-color: ${(props) => props.theme.colors.grey3};
|
93
|
+
}
|
99
94
|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
95
|
+
/* Make scrollbar track visible when needed */
|
96
|
+
::-webkit-scrollbar-track {
|
97
|
+
background-color: ${(props) => props.theme.colors.grey5};
|
98
|
+
}
|
104
99
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
position: fixed;
|
110
|
-
z-index: 99;
|
111
|
-
}
|
112
|
-
}
|
100
|
+
.close {
|
101
|
+
position: absolute;
|
102
|
+
right: 20px;
|
103
|
+
top: 20px;
|
113
104
|
|
114
105
|
@media (max-width: 425px) {
|
115
|
-
|
116
|
-
|
117
|
-
|
106
|
+
right: 14px;
|
107
|
+
top: 12px;
|
108
|
+
background: white;
|
109
|
+
position: fixed;
|
110
|
+
z-index: 99;
|
118
111
|
}
|
119
|
-
|
112
|
+
}
|
120
113
|
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
114
|
+
@media (max-width: 425px) {
|
115
|
+
width: 100%;
|
116
|
+
height: 100%;
|
117
|
+
box-shadow: none;
|
118
|
+
}
|
119
|
+
`
|
120
|
+
|
121
|
+
export default {
|
122
|
+
name: 'modal',
|
123
|
+
components: {
|
124
|
+
PageWrapper,
|
125
|
+
ModalContainer,
|
126
|
+
CloseButton,
|
127
|
+
Spinner,
|
128
|
+
ContentContainer
|
129
|
+
},
|
130
|
+
props: {
|
131
|
+
isOpen: {
|
132
|
+
required: true,
|
133
|
+
default: false
|
129
134
|
},
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
default: false,
|
134
|
-
},
|
135
|
-
isLoading: {
|
136
|
-
required: false,
|
137
|
-
default: false,
|
138
|
-
},
|
139
|
-
hideClose: {
|
140
|
-
required: false,
|
141
|
-
default: false,
|
142
|
-
},
|
143
|
-
backdrop: {
|
144
|
-
required: false,
|
145
|
-
default: 'white',
|
146
|
-
},
|
147
|
-
position: {
|
148
|
-
required: false,
|
149
|
-
default: 'fixed',
|
150
|
-
},
|
151
|
-
stopPropagation: {
|
152
|
-
type: Boolean,
|
153
|
-
default: true,
|
154
|
-
},
|
135
|
+
isLoading: {
|
136
|
+
required: false,
|
137
|
+
default: false
|
155
138
|
},
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
handler(isOpen) {
|
160
|
-
document.body.style.overflow = isOpen ? 'hidden' : ''
|
161
|
-
if (isOpen) {
|
162
|
-
window.addEventListener('keydown', this.handleKeyDown)
|
163
|
-
} else {
|
164
|
-
window.removeEventListener('keydown', this.handleKeyDown)
|
165
|
-
}
|
166
|
-
},
|
167
|
-
},
|
139
|
+
hideClose: {
|
140
|
+
required: false,
|
141
|
+
default: false
|
168
142
|
},
|
169
|
-
|
170
|
-
|
143
|
+
backdrop: {
|
144
|
+
required: false,
|
145
|
+
default: 'white'
|
171
146
|
},
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
147
|
+
position: {
|
148
|
+
required: false,
|
149
|
+
default: 'fixed'
|
150
|
+
},
|
151
|
+
stopPropagation: {
|
152
|
+
type: Boolean,
|
153
|
+
default: true
|
154
|
+
}
|
155
|
+
},
|
156
|
+
beforeDestroy() {
|
157
|
+
window.removeEventListener('keydown', this.handleKeyDown)
|
158
|
+
},
|
159
|
+
methods: {
|
160
|
+
onCloseModal() {
|
161
|
+
this.$emit('on-close')
|
162
|
+
},
|
163
|
+
handleKeyDown({ key }) {
|
164
|
+
if (key === 'Escape') {
|
165
|
+
this.onCloseModal()
|
166
|
+
}
|
186
167
|
},
|
168
|
+
onClickModalContainer(event) {
|
169
|
+
if (this.stopPropagation) {
|
170
|
+
event.stopPropagation()
|
171
|
+
}
|
172
|
+
}
|
173
|
+
},
|
174
|
+
watch: {
|
175
|
+
isOpen: {
|
176
|
+
immediate: true,
|
177
|
+
handler(isOpen) {
|
178
|
+
document.body.style.overflow = isOpen ? 'hidden' : ''
|
179
|
+
if (isOpen) {
|
180
|
+
window.addEventListener('keydown', this.handleKeyDown)
|
181
|
+
} else {
|
182
|
+
window.removeEventListener('keydown', this.handleKeyDown)
|
183
|
+
}
|
184
|
+
}
|
185
|
+
}
|
187
186
|
}
|
187
|
+
}
|
188
188
|
</script>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<template>
|
2
2
|
<ActionModal :is-open="isOpen" @on-close="closeModal">
|
3
|
-
<
|
3
|
+
<modalContainer>
|
4
4
|
<template name="title">
|
5
5
|
<slot name="title"></slot>
|
6
6
|
</template>
|
@@ -8,50 +8,62 @@
|
|
8
8
|
<slot name="body"></slot>
|
9
9
|
</template>
|
10
10
|
<template name="buttons">
|
11
|
-
<
|
12
|
-
<Button
|
13
|
-
|
14
|
-
:text="$gettext('Got it')"
|
15
|
-
type="primary"
|
16
|
-
@click="closeModal"
|
17
|
-
/>
|
18
|
-
</ButtonContainer>
|
11
|
+
<buttonContainer>
|
12
|
+
<Button type="primary" :text="$gettext('Got it')" minWidth="150px" @click="closeModal" />
|
13
|
+
</buttonContainer>
|
19
14
|
</template>
|
20
|
-
|
15
|
+
|
16
|
+
</modalContainer>
|
21
17
|
</ActionModal>
|
22
18
|
</template>
|
23
19
|
<script>
|
24
|
-
import styled from 'vue3-styled-components'
|
25
|
-
import ActionModal from '../actionModal'
|
26
20
|
|
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
|
-
|
21
|
+
import styled from 'vue3-styled-components'
|
22
|
+
import ActionModal from '../actionModal'
|
23
|
+
|
24
|
+
const modalContainer = styled.div`
|
25
|
+
width: 450px;
|
26
|
+
min-height: 205px;
|
27
|
+
padding: 40px 40px 30px 40px;
|
28
|
+
`
|
29
|
+
const modalTitle = styled.div`
|
30
|
+
color: ${(props) => props.theme.colors.black};
|
31
|
+
font-family: ${(props) => props.theme.fonts.mainFont};
|
32
|
+
font-size: 18px;
|
33
|
+
font-style: normal;
|
34
|
+
font-weight: 700;
|
35
|
+
line-height: 120%;
|
36
|
+
text-transform: uppercase;
|
37
|
+
`
|
38
|
+
const buttonContainer = styled.div`
|
39
|
+
display: inline-flex;
|
40
|
+
align-items: flex-start;
|
41
|
+
gap: 20px;
|
42
|
+
`
|
43
|
+
const textContainer = styled.div`
|
44
|
+
color: ${(props) => props.theme.colors.black};
|
45
|
+
font-family: ${(props) => props.theme.fonts.mainFont};
|
46
|
+
font-size: 13px;
|
47
|
+
font-style: normal;
|
48
|
+
font-weight: 400;
|
49
|
+
line-height: normal;
|
50
|
+
padding: 30px 0px;
|
51
|
+
white-space: pre-wrap;
|
52
|
+
`
|
53
|
+
export default {
|
54
|
+
name: 'InfoModal',
|
55
|
+
props: ['isOpen'],
|
56
|
+
components: {
|
57
|
+
Modal,
|
58
|
+
modalContainer,
|
59
|
+
modalTitle,
|
60
|
+
buttonContainer,
|
61
|
+
textContainer
|
62
|
+
},
|
63
|
+
methods: {
|
64
|
+
closeModal() {
|
65
|
+
this.$emit('on-close')
|
66
|
+
}
|
56
67
|
}
|
68
|
+
}
|
57
69
|
</script>
|