@eturnity/eturnity_reusable_components 7.30.3-EPDM-10647.0 → 7.30.3-EPDM-10576.2
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/.eslintrc.js +184 -0
- package/.prettierrc +8 -6
- package/package.json +9 -21
- package/src/App.vue +79 -78
- package/src/assets/theme.js +3 -3
- package/src/components/addNewButton/AddNewButton.stories.js +2 -2
- package/src/components/addNewButton/index.vue +48 -51
- package/src/components/banner/actionBanner/index.vue +54 -55
- 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 +41 -53
- package/src/components/buttons/buttonIcon/index.vue +125 -122
- 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 +108 -108
- package/src/components/card/index.vue +70 -70
- package/src/components/collapsableInfoText/index.vue +96 -94
- 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 +9 -10
- package/src/components/dropdown/index.vue +106 -106
- package/src/components/errorMessage/index.vue +52 -52
- package/src/components/filter/filterSettings.vue +486 -452
- 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 +122 -122
- package/src/components/iconWrapper/index.vue +156 -156
- package/src/components/infoCard/index.vue +30 -32
- package/src/components/infoText/index.vue +142 -137
- package/src/components/inputs/checkbox/Checkbox.stories.js +8 -8
- package/src/components/inputs/checkbox/index.vue +190 -180
- package/src/components/inputs/inputNumber/InputNumber.stories.js +41 -41
- package/src/components/inputs/inputNumber/index.vue +696 -701
- package/src/components/inputs/inputNumberQuestion/index.vue +185 -182
- package/src/components/inputs/inputText/InputText.stories.js +22 -22
- package/src/components/inputs/inputText/index.vue +337 -336
- package/src/components/inputs/radioButton/RadioButton.stories.js +16 -16
- package/src/components/inputs/radioButton/index.vue +222 -219
- package/src/components/inputs/searchInput/SearchInput.stories.js +8 -8
- package/src/components/inputs/searchInput/index.vue +127 -126
- package/src/components/inputs/select/index.vue +792 -792
- package/src/components/inputs/select/option/index.vue +124 -124
- package/src/components/inputs/select/select.stories.js +31 -32
- package/src/components/inputs/slider/index.vue +99 -99
- package/src/components/inputs/switchField/index.vue +220 -222
- package/src/components/inputs/textAreaInput/TextAreaInput.stories.js +57 -57
- package/src/components/inputs/textAreaInput/index.vue +171 -173
- package/src/components/inputs/toggle/Toggle.stories.js +14 -14
- package/src/components/inputs/toggle/index.vue +214 -217
- package/src/components/label/index.vue +82 -82
- package/src/components/markerItem/index.vue +68 -66
- package/src/components/modals/actionModal/index.vue +54 -54
- package/src/components/modals/infoModal/index.vue +39 -36
- 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 +96 -94
- package/src/components/pageSubtitle/index.vue +55 -49
- package/src/components/pageTitle/index.vue +56 -56
- package/src/components/pagination/index.vue +92 -89
- package/src/components/progressBar/index.vue +107 -107
- package/src/components/projectMarker/index.vue +246 -244
- package/src/components/rangeSlider/Slider.vue +491 -465
- 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 +417 -400
- package/src/components/tables/viewTable/index.vue +171 -171
- package/src/components/threeDots/index.vue +340 -334
- package/src/components/videoThumbnail/index.vue +86 -86
- package/src/components/videoThumbnail/videoThumbnail.stories.js +14 -16
- package/src/helpers/numberConverter.js +2 -2
- package/src/helpers/translateLang.js +9 -9
- package/src/mixins/inputValidations.js +5 -5
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -17
- package/src/utils/index.js +0 -12
@@ -1,86 +1,88 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
<
|
4
|
-
:
|
5
|
-
:hasIcon="!!iconName"
|
2
|
+
<PageContainer>
|
3
|
+
<MarkerContainer
|
4
|
+
:background-color="backgroundColor"
|
6
5
|
:cursor="cursor"
|
6
|
+
:has-icon="!!iconName"
|
7
7
|
>
|
8
|
-
<
|
8
|
+
<Icon
|
9
9
|
v-if="!!iconName"
|
10
|
-
:name="iconName"
|
11
10
|
color="white"
|
12
|
-
size="10px"
|
13
11
|
:cursor="cursor"
|
12
|
+
:name="iconName"
|
13
|
+
size="10px"
|
14
14
|
/>
|
15
15
|
<span>{{ label }}</span>
|
16
|
-
</
|
17
|
-
</
|
16
|
+
</MarkerContainer>
|
17
|
+
</PageContainer>
|
18
18
|
</template>
|
19
19
|
|
20
20
|
<script>
|
21
|
-
// import MarkerItem from "@eturnity/eturnity_reusable_components/src/components/markerItem"
|
22
|
-
// To use:
|
23
|
-
// <marker-item
|
24
|
-
// label="Label"
|
25
|
-
// backgroundColor="#ab5348"
|
26
|
-
// iconName="icon_name"
|
27
|
-
// cursor="pointer"
|
28
|
-
// />
|
21
|
+
// import MarkerItem from "@eturnity/eturnity_reusable_components/src/components/markerItem"
|
22
|
+
// To use:
|
23
|
+
// <marker-item
|
24
|
+
// label="Label"
|
25
|
+
// backgroundColor="#ab5348"
|
26
|
+
// iconName="icon_name"
|
27
|
+
// cursor="pointer"
|
28
|
+
// />
|
29
29
|
|
30
|
-
import styled from 'vue3-styled-components'
|
31
|
-
import Icon from '../icon'
|
30
|
+
import styled from 'vue3-styled-components'
|
31
|
+
import Icon from '../icon'
|
32
32
|
|
33
|
-
const PageContainer = styled.div`
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
`
|
33
|
+
const PageContainer = styled.div`
|
34
|
+
display: flex;
|
35
|
+
align-items: center;
|
36
|
+
font-size: 12px;
|
37
|
+
line-height: 14px;
|
38
|
+
`
|
39
39
|
|
40
|
-
const MarkerAttrs = {
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
}
|
45
|
-
const MarkerContainer = styled('div', MarkerAttrs)`
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
props.backgroundColor ? props.backgroundColor : props.theme.colors.grey3};
|
55
|
-
border: 1px solid
|
56
|
-
${(props) =>
|
40
|
+
const MarkerAttrs = {
|
41
|
+
backgroundColor: String,
|
42
|
+
hasIcon: Boolean,
|
43
|
+
cursor: String,
|
44
|
+
}
|
45
|
+
const MarkerContainer = styled('div', MarkerAttrs)`
|
46
|
+
display: grid;
|
47
|
+
grid-template-columns: ${(props) => (props.hasIcon ? 'auto 1fr' : '1fr')};
|
48
|
+
grid-gap: 5px;
|
49
|
+
position: relative;
|
50
|
+
align-items: center;
|
51
|
+
padding: 2px 7px;
|
52
|
+
color: ${(props) => props.theme.colors.white};
|
53
|
+
background-color: ${(props) =>
|
57
54
|
props.backgroundColor ? props.backgroundColor : props.theme.colors.grey3};
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
55
|
+
border: 1px solid
|
56
|
+
${(props) =>
|
57
|
+
props.backgroundColor
|
58
|
+
? props.backgroundColor
|
59
|
+
: props.theme.colors.grey3};
|
60
|
+
border-radius: 4px;
|
61
|
+
white-space: nowrap;
|
62
|
+
cursor: ${(props) => (props.isEditionAllowed ? 'pointer' : props.cursor)};
|
63
|
+
`
|
62
64
|
|
63
|
-
export default {
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
},
|
70
|
-
props: {
|
71
|
-
backgroundColor: {
|
72
|
-
required: false
|
73
|
-
},
|
74
|
-
iconName: {
|
75
|
-
required: false
|
65
|
+
export default {
|
66
|
+
name: 'ProjectMarker',
|
67
|
+
components: {
|
68
|
+
PageContainer,
|
69
|
+
MarkerContainer,
|
70
|
+
Icon,
|
76
71
|
},
|
77
|
-
|
78
|
-
|
72
|
+
props: {
|
73
|
+
backgroundColor: {
|
74
|
+
required: false,
|
75
|
+
},
|
76
|
+
iconName: {
|
77
|
+
required: false,
|
78
|
+
},
|
79
|
+
label: {
|
80
|
+
required: true,
|
81
|
+
},
|
82
|
+
cursor: {
|
83
|
+
required: false,
|
84
|
+
default: 'default',
|
85
|
+
},
|
79
86
|
},
|
80
|
-
cursor: {
|
81
|
-
required: false,
|
82
|
-
default: 'default'
|
83
|
-
}
|
84
87
|
}
|
85
|
-
}
|
86
88
|
</script>
|
@@ -1,64 +1,64 @@
|
|
1
1
|
<template>
|
2
2
|
<Modal :is-open="isOpen" @on-close="closeModal">
|
3
|
-
<
|
4
|
-
<
|
3
|
+
<ModalContainer>
|
4
|
+
<ModalTitle v-if="$slots.title">
|
5
5
|
<slot name="title"></slot>
|
6
|
-
</
|
7
|
-
<
|
6
|
+
</ModalTitle>
|
7
|
+
<TextContainer v-if="$slots.body">
|
8
8
|
<slot name="body"></slot>
|
9
|
-
</
|
10
|
-
<
|
9
|
+
</TextContainer>
|
10
|
+
<ButtonContainer v-if="$slots.buttons">
|
11
11
|
<slot name="buttons"></slot>
|
12
|
-
</
|
13
|
-
</
|
12
|
+
</ButtonContainer>
|
13
|
+
</ModalContainer>
|
14
14
|
</Modal>
|
15
15
|
</template>
|
16
16
|
<script>
|
17
|
-
import styled from 'vue3-styled-components'
|
18
|
-
import Modal from '../modal'
|
19
|
-
const
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
`
|
24
|
-
const
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
`
|
33
|
-
const
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
`
|
38
|
-
const
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
`
|
48
|
-
export default {
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
17
|
+
import styled from 'vue3-styled-components'
|
18
|
+
import Modal from '../modal'
|
19
|
+
const ModalContainer = styled.div`
|
20
|
+
width: 450px;
|
21
|
+
min-height: 205px;
|
22
|
+
padding: 40px 40px 30px 40px;
|
23
|
+
`
|
24
|
+
const ModalTitle = styled.div`
|
25
|
+
color: ${(props) => props.theme.colors.black};
|
26
|
+
font-family: ${(props) => props.theme.fonts.mainFont};
|
27
|
+
font-size: 18px;
|
28
|
+
font-style: normal;
|
29
|
+
font-weight: 700;
|
30
|
+
line-height: 120%;
|
31
|
+
text-transform: uppercase;
|
32
|
+
`
|
33
|
+
const ButtonContainer = styled.div`
|
34
|
+
display: inline-flex;
|
35
|
+
align-items: flex-start;
|
36
|
+
gap: 20px;
|
37
|
+
`
|
38
|
+
const TextContainer = styled.div`
|
39
|
+
color: ${(props) => props.theme.colors.black};
|
40
|
+
font-family: ${(props) => props.theme.fonts.mainFont};
|
41
|
+
font-size: 13px;
|
42
|
+
font-style: normal;
|
43
|
+
font-weight: 400;
|
44
|
+
line-height: normal;
|
45
|
+
padding: 30px 0px;
|
46
|
+
white-space: pre-wrap;
|
47
|
+
`
|
48
|
+
export default {
|
49
|
+
name: 'ActionModal',
|
50
|
+
components: {
|
51
|
+
Modal,
|
52
|
+
ModalContainer,
|
53
|
+
ModalTitle,
|
54
|
+
ButtonContainer,
|
55
|
+
TextContainer,
|
56
|
+
},
|
57
|
+
props: ['isOpen'],
|
58
|
+
methods: {
|
59
|
+
closeModal() {
|
60
|
+
this.$emit('on-close')
|
61
|
+
},
|
62
|
+
},
|
62
63
|
}
|
63
|
-
}
|
64
64
|
</script>
|
@@ -1,49 +1,52 @@
|
|
1
1
|
<template>
|
2
2
|
<ActionModal :is-open="isOpen" @on-close="closeModal">
|
3
|
-
<
|
3
|
+
<ModalContainer>
|
4
4
|
<template #title>
|
5
|
-
<slot name="title"
|
5
|
+
<slot name="title"></slot>
|
6
6
|
</template>
|
7
7
|
<template #body>
|
8
|
-
<slot name="body"
|
8
|
+
<slot name="body"></slot>
|
9
9
|
</template>
|
10
10
|
<template #buttons>
|
11
|
-
<
|
12
|
-
<
|
13
|
-
|
11
|
+
<ButtonContainer>
|
12
|
+
<RCMainButton
|
13
|
+
min-width="150px"
|
14
|
+
:text="$gettext('Got it')"
|
15
|
+
type="primary"
|
16
|
+
@click="closeModal"
|
17
|
+
/>
|
18
|
+
</ButtonContainer>
|
14
19
|
</template>
|
15
|
-
|
16
|
-
</modalContainer>
|
20
|
+
</ModalContainer>
|
17
21
|
</ActionModal>
|
18
22
|
</template>
|
19
23
|
<script>
|
20
|
-
|
21
|
-
import
|
22
|
-
import
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
`
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
}
|
24
|
+
import styled from 'vue3-styled-components'
|
25
|
+
import ActionModal from '../actionModal'
|
26
|
+
import RCMainButton from '../../buttons/mainButton'
|
27
|
+
const ModalContainer = styled.div`
|
28
|
+
width: 450px;
|
29
|
+
min-height: 205px;
|
30
|
+
padding: 40px 40px 30px 40px;
|
31
|
+
`
|
32
|
+
const ButtonContainer = styled.div`
|
33
|
+
display: inline-flex;
|
34
|
+
align-items: flex-start;
|
35
|
+
gap: 20px;
|
36
|
+
`
|
37
|
+
export default {
|
38
|
+
name: 'InfoModal',
|
39
|
+
components: {
|
40
|
+
ModalContainer,
|
41
|
+
ButtonContainer,
|
42
|
+
ActionModal,
|
43
|
+
RCMainButton,
|
44
|
+
},
|
45
|
+
props: ['isOpen'],
|
46
|
+
methods: {
|
47
|
+
closeModal() {
|
48
|
+
this.$emit('on-close')
|
49
|
+
},
|
50
|
+
},
|
47
51
|
}
|
48
|
-
}
|
49
52
|
</script>
|
@@ -1,42 +1,42 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
:position="position"
|
4
|
-
:isOpen="isOpen"
|
5
|
-
:class="{ visible: isOpen, hidden: !isOpen }"
|
2
|
+
<PageWrapper
|
6
3
|
:backdrop="backdrop"
|
4
|
+
:class="{ visible: isOpen, hidden: !isOpen }"
|
5
|
+
:is-open="isOpen"
|
6
|
+
:position="position"
|
7
7
|
>
|
8
|
-
<
|
9
|
-
<
|
10
|
-
<
|
11
|
-
<slot
|
12
|
-
</
|
13
|
-
<
|
14
|
-
</
|
15
|
-
</
|
8
|
+
<ModalContainer @click="onClickModalContainer">
|
9
|
+
<Spinner v-if="isLoading" :limited-to-modal="true" size="50px" />
|
10
|
+
<ContentContainer :visible="!isLoading">
|
11
|
+
<slot></slot>
|
12
|
+
</ContentContainer>
|
13
|
+
<CloseButton v-if="!hideClose" class="close" @click="onCloseModal()" />
|
14
|
+
</ModalContainer>
|
15
|
+
</PageWrapper>
|
16
16
|
</template>
|
17
17
|
|
18
18
|
<script>
|
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>
|
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
|
-
import styled from 'vue3-styled-components'
|
30
|
-
import CloseButton from '../../buttons/closeButton'
|
31
|
-
import Spinner from '../../spinner'
|
29
|
+
import styled from 'vue3-styled-components'
|
30
|
+
import CloseButton from '../../buttons/closeButton'
|
31
|
+
import Spinner from '../../spinner'
|
32
32
|
|
33
|
-
const contentAttrs = { visible: Boolean }
|
34
|
-
const ContentContainer = styled('div', contentAttrs)`
|
35
|
-
|
36
|
-
`
|
33
|
+
const contentAttrs = { visible: Boolean }
|
34
|
+
const ContentContainer = styled('div', contentAttrs)`
|
35
|
+
visibility: ${(props) => (props.visible ? 'inherit' : 'hidden')};
|
36
|
+
`
|
37
37
|
|
38
|
-
const pageAttrs = { isOpen: Boolean, backdrop: String, position: String }
|
39
|
-
const PageWrapper = styled('div', pageAttrs)`
|
38
|
+
const pageAttrs = { isOpen: Boolean, backdrop: String, position: String }
|
39
|
+
const PageWrapper = styled('div', pageAttrs)`
|
40
40
|
position: ${(props) => props.position}
|
41
41
|
display: grid;
|
42
42
|
top: 0;
|
@@ -67,122 +67,122 @@ const PageWrapper = styled('div', pageAttrs)`
|
|
67
67
|
}
|
68
68
|
`
|
69
69
|
|
70
|
-
const ModalContainer = styled.div`
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
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;
|
83
83
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
84
|
+
::-webkit-scrollbar {
|
85
|
+
width: 0.3em;
|
86
|
+
height: 100%;
|
87
|
+
background-color: ${(props) => props.theme.colors.grey5};
|
88
|
+
}
|
89
89
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
90
|
+
/* Make scrollbar visible when needed */
|
91
|
+
::-webkit-scrollbar-thumb {
|
92
|
+
background-color: ${(props) => props.theme.colors.grey3};
|
93
|
+
}
|
94
94
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
95
|
+
/* Make scrollbar track visible when needed */
|
96
|
+
::-webkit-scrollbar-track {
|
97
|
+
background-color: ${(props) => props.theme.colors.grey5};
|
98
|
+
}
|
99
99
|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
100
|
+
.close {
|
101
|
+
position: absolute;
|
102
|
+
right: 20px;
|
103
|
+
top: 20px;
|
104
104
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
105
|
+
@media (max-width: 425px) {
|
106
|
+
right: 14px;
|
107
|
+
top: 12px;
|
108
|
+
background: white;
|
109
|
+
position: fixed;
|
110
|
+
z-index: 99;
|
111
|
+
}
|
111
112
|
}
|
112
|
-
}
|
113
113
|
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
`
|
114
|
+
@media (max-width: 425px) {
|
115
|
+
width: 100%;
|
116
|
+
height: 100%;
|
117
|
+
box-shadow: none;
|
118
|
+
}
|
119
|
+
`
|
120
120
|
|
121
|
-
export default {
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
},
|
130
|
-
props: {
|
131
|
-
isOpen: {
|
132
|
-
required: true,
|
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'
|
121
|
+
export default {
|
122
|
+
name: 'Modal',
|
123
|
+
components: {
|
124
|
+
PageWrapper,
|
125
|
+
ModalContainer,
|
126
|
+
CloseButton,
|
127
|
+
Spinner,
|
128
|
+
ContentContainer,
|
146
129
|
},
|
147
|
-
|
148
|
-
|
149
|
-
|
130
|
+
props: {
|
131
|
+
isOpen: {
|
132
|
+
required: true,
|
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
|
+
},
|
150
155
|
},
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
156
|
+
watch: {
|
157
|
+
isOpen: {
|
158
|
+
immediate: true,
|
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
|
+
},
|
162
168
|
},
|
163
|
-
|
164
|
-
|
165
|
-
this.onCloseModal()
|
166
|
-
}
|
169
|
+
beforeDestroy() {
|
170
|
+
window.removeEventListener('keydown', this.handleKeyDown)
|
167
171
|
},
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
}
|
172
|
-
|
173
|
-
|
174
|
-
|
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)
|
172
|
+
methods: {
|
173
|
+
onCloseModal() {
|
174
|
+
this.$emit('on-close')
|
175
|
+
},
|
176
|
+
handleKeyDown({ key }) {
|
177
|
+
if (key === 'Escape') {
|
178
|
+
this.onCloseModal()
|
183
179
|
}
|
184
|
-
}
|
185
|
-
|
180
|
+
},
|
181
|
+
onClickModalContainer(event) {
|
182
|
+
if (this.stopPropagation) {
|
183
|
+
event.stopPropagation()
|
184
|
+
}
|
185
|
+
},
|
186
|
+
},
|
186
187
|
}
|
187
|
-
}
|
188
188
|
</script>
|