@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.
Files changed (82) hide show
  1. package/.eslintrc.js +184 -0
  2. package/.prettierrc +8 -6
  3. package/package.json +9 -21
  4. package/src/App.vue +79 -78
  5. package/src/assets/theme.js +3 -3
  6. package/src/components/addNewButton/AddNewButton.stories.js +2 -2
  7. package/src/components/addNewButton/index.vue +48 -51
  8. package/src/components/banner/actionBanner/index.vue +54 -55
  9. package/src/components/banner/banner/banner.stories.js +5 -5
  10. package/src/components/banner/banner/index.vue +159 -159
  11. package/src/components/banner/infoBanner/index.vue +41 -53
  12. package/src/components/buttons/buttonIcon/index.vue +125 -122
  13. package/src/components/buttons/closeButton/CloseButton.stories.js +3 -3
  14. package/src/components/buttons/closeButton/index.vue +49 -49
  15. package/src/components/buttons/mainButton/index.vue +108 -108
  16. package/src/components/card/index.vue +70 -70
  17. package/src/components/collapsableInfoText/index.vue +96 -94
  18. package/src/components/deleteIcon/DeleteIcon.stories.js +4 -4
  19. package/src/components/deleteIcon/index.vue +54 -54
  20. package/src/components/draggableInputHandle/index.vue +37 -37
  21. package/src/components/dropdown/Dropdown.stories.js +9 -10
  22. package/src/components/dropdown/index.vue +106 -106
  23. package/src/components/errorMessage/index.vue +52 -52
  24. package/src/components/filter/filterSettings.vue +486 -452
  25. package/src/components/filter/index.vue +135 -135
  26. package/src/components/filter/parentDropdown.vue +73 -73
  27. package/src/components/icon/Icons.stories.js +7 -7
  28. package/src/components/icon/iconCollection.vue +53 -53
  29. package/src/components/icon/index.vue +122 -122
  30. package/src/components/iconWrapper/index.vue +156 -156
  31. package/src/components/infoCard/index.vue +30 -32
  32. package/src/components/infoText/index.vue +142 -137
  33. package/src/components/inputs/checkbox/Checkbox.stories.js +8 -8
  34. package/src/components/inputs/checkbox/index.vue +190 -180
  35. package/src/components/inputs/inputNumber/InputNumber.stories.js +41 -41
  36. package/src/components/inputs/inputNumber/index.vue +696 -701
  37. package/src/components/inputs/inputNumberQuestion/index.vue +185 -182
  38. package/src/components/inputs/inputText/InputText.stories.js +22 -22
  39. package/src/components/inputs/inputText/index.vue +337 -336
  40. package/src/components/inputs/radioButton/RadioButton.stories.js +16 -16
  41. package/src/components/inputs/radioButton/index.vue +222 -219
  42. package/src/components/inputs/searchInput/SearchInput.stories.js +8 -8
  43. package/src/components/inputs/searchInput/index.vue +127 -126
  44. package/src/components/inputs/select/index.vue +792 -792
  45. package/src/components/inputs/select/option/index.vue +124 -124
  46. package/src/components/inputs/select/select.stories.js +31 -32
  47. package/src/components/inputs/slider/index.vue +99 -99
  48. package/src/components/inputs/switchField/index.vue +220 -222
  49. package/src/components/inputs/textAreaInput/TextAreaInput.stories.js +57 -57
  50. package/src/components/inputs/textAreaInput/index.vue +171 -173
  51. package/src/components/inputs/toggle/Toggle.stories.js +14 -14
  52. package/src/components/inputs/toggle/index.vue +214 -217
  53. package/src/components/label/index.vue +82 -82
  54. package/src/components/markerItem/index.vue +68 -66
  55. package/src/components/modals/actionModal/index.vue +54 -54
  56. package/src/components/modals/infoModal/index.vue +39 -36
  57. package/src/components/modals/modal/index.vue +134 -134
  58. package/src/components/modals/modal/modal.stories.js +5 -5
  59. package/src/components/navigationTabs/index.vue +96 -94
  60. package/src/components/pageSubtitle/index.vue +55 -49
  61. package/src/components/pageTitle/index.vue +56 -56
  62. package/src/components/pagination/index.vue +92 -89
  63. package/src/components/progressBar/index.vue +107 -107
  64. package/src/components/projectMarker/index.vue +246 -244
  65. package/src/components/rangeSlider/Slider.vue +491 -465
  66. package/src/components/rangeSlider/index.vue +410 -410
  67. package/src/components/rangeSlider/utils/dom.js +5 -5
  68. package/src/components/selectedOptions/index.vue +119 -119
  69. package/src/components/sideMenu/index.vue +199 -199
  70. package/src/components/spinner/index.vue +57 -57
  71. package/src/components/tableDropdown/index.vue +520 -520
  72. package/src/components/tables/mainTable/index.vue +417 -400
  73. package/src/components/tables/viewTable/index.vue +171 -171
  74. package/src/components/threeDots/index.vue +340 -334
  75. package/src/components/videoThumbnail/index.vue +86 -86
  76. package/src/components/videoThumbnail/videoThumbnail.stories.js +14 -16
  77. package/src/helpers/numberConverter.js +2 -2
  78. package/src/helpers/translateLang.js +9 -9
  79. package/src/mixins/inputValidations.js +5 -5
  80. package/public/favicon.ico +0 -0
  81. package/public/index.html +0 -17
  82. package/src/utils/index.js +0 -12
@@ -1,86 +1,88 @@
1
1
  <template>
2
- <page-container>
3
- <marker-container
4
- :backgroundColor="backgroundColor"
5
- :hasIcon="!!iconName"
2
+ <PageContainer>
3
+ <MarkerContainer
4
+ :background-color="backgroundColor"
6
5
  :cursor="cursor"
6
+ :has-icon="!!iconName"
7
7
  >
8
- <icon
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
- </marker-container>
17
- </page-container>
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
- display: flex;
35
- align-items: center;
36
- font-size: 12px;
37
- line-height: 14px;
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
- 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) =>
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
- border-radius: 4px;
59
- white-space: nowrap;
60
- cursor: ${(props) => (props.isEditionAllowed ? 'pointer' : props.cursor)};
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
- name: 'project-marker',
65
- components: {
66
- PageContainer,
67
- MarkerContainer,
68
- Icon
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
- label: {
78
- required: true
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
- <modalContainer>
4
- <modalTitle v-if="$slots.title">
3
+ <ModalContainer>
4
+ <ModalTitle v-if="$slots.title">
5
5
  <slot name="title"></slot>
6
- </modalTitle>
7
- <textContainer v-if="$slots.body">
6
+ </ModalTitle>
7
+ <TextContainer v-if="$slots.body">
8
8
  <slot name="body"></slot>
9
- </textContainer>
10
- <buttonContainer v-if="$slots.buttons">
9
+ </TextContainer>
10
+ <ButtonContainer v-if="$slots.buttons">
11
11
  <slot name="buttons"></slot>
12
- </buttonContainer>
13
- </modalContainer>
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 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
- props: ['isOpen'],
51
- components: {
52
- Modal,
53
- modalContainer,
54
- modalTitle,
55
- buttonContainer,
56
- textContainer
57
- },
58
- methods: {
59
- closeModal() {
60
- this.$emit('on-close')
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
- <modalContainer>
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
- <buttonContainer>
12
- <Button type="primary" :text="$gettext('Got it')" minWidth="150px" @click="closeModal" />
13
- </buttonContainer>
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 styled from 'vue3-styled-components'
22
- import ActionModal from '../actionModal'
23
- import Button from '../../buttons/mainButton'
24
- const modalContainer = styled.div`
25
- width: 450px;
26
- min-height: 205px;
27
- padding: 40px 40px 30px 40px;
28
- `
29
- const buttonContainer = styled.div`
30
- display: inline-flex;
31
- align-items: flex-start;
32
- gap: 20px;
33
- `
34
- export default {
35
- name: 'InfoModal',
36
- props: ['isOpen'],
37
- components: {
38
- modalContainer,
39
- buttonContainer,
40
- ActionModal,
41
- Button
42
- },
43
- methods: {
44
- closeModal() {
45
- this.$emit('on-close')
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
- <page-wrapper
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
- <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>
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
- visibility: ${(props) => (props.visible ? 'inherit' : 'hidden')};
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
- 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;
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
- ::-webkit-scrollbar {
85
- width: 0.3em;
86
- height: 100%;
87
- background-color: ${(props) => props.theme.colors.grey5};
88
- }
84
+ ::-webkit-scrollbar {
85
+ width: 0.3em;
86
+ height: 100%;
87
+ background-color: ${(props) => props.theme.colors.grey5};
88
+ }
89
89
 
90
- /* Make scrollbar visible when needed */
91
- ::-webkit-scrollbar-thumb {
92
- background-color: ${(props) => props.theme.colors.grey3};
93
- }
90
+ /* Make scrollbar visible when needed */
91
+ ::-webkit-scrollbar-thumb {
92
+ background-color: ${(props) => props.theme.colors.grey3};
93
+ }
94
94
 
95
- /* Make scrollbar track visible when needed */
96
- ::-webkit-scrollbar-track {
97
- background-color: ${(props) => props.theme.colors.grey5};
98
- }
95
+ /* Make scrollbar track visible when needed */
96
+ ::-webkit-scrollbar-track {
97
+ background-color: ${(props) => props.theme.colors.grey5};
98
+ }
99
99
 
100
- .close {
101
- position: absolute;
102
- right: 20px;
103
- top: 20px;
100
+ .close {
101
+ position: absolute;
102
+ right: 20px;
103
+ top: 20px;
104
104
 
105
- @media (max-width: 425px) {
106
- right: 14px;
107
- top: 12px;
108
- background: white;
109
- position: fixed;
110
- z-index: 99;
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
- @media (max-width: 425px) {
115
- width: 100%;
116
- height: 100%;
117
- box-shadow: none;
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
- 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
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
- position: {
148
- required: false,
149
- default: 'fixed'
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
- 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')
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
- handleKeyDown({ key }) {
164
- if (key === 'Escape') {
165
- this.onCloseModal()
166
- }
169
+ beforeDestroy() {
170
+ window.removeEventListener('keydown', this.handleKeyDown)
167
171
  },
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)
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>