@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.
Files changed (83) hide show
  1. package/.prettierrc +6 -8
  2. package/package.json +21 -9
  3. package/public/favicon.ico +0 -0
  4. package/public/index.html +17 -0
  5. package/src/App.vue +78 -79
  6. package/src/assets/svgIcons/adjust_roof.svg +6 -0
  7. package/src/assets/svgIcons/copy.svg +10 -0
  8. package/src/assets/theme.js +3 -3
  9. package/src/components/addNewButton/AddNewButton.stories.js +2 -2
  10. package/src/components/addNewButton/index.vue +51 -48
  11. package/src/components/banner/actionBanner/index.vue +55 -54
  12. package/src/components/banner/banner/banner.stories.js +5 -5
  13. package/src/components/banner/banner/index.vue +159 -159
  14. package/src/components/banner/infoBanner/index.vue +53 -41
  15. package/src/components/buttons/buttonIcon/index.vue +122 -125
  16. package/src/components/buttons/closeButton/CloseButton.stories.js +3 -3
  17. package/src/components/buttons/closeButton/index.vue +49 -49
  18. package/src/components/buttons/mainButton/index.vue +119 -119
  19. package/src/components/card/index.vue +70 -70
  20. package/src/components/collapsableInfoText/index.vue +94 -96
  21. package/src/components/deleteIcon/DeleteIcon.stories.js +4 -4
  22. package/src/components/deleteIcon/index.vue +54 -54
  23. package/src/components/draggableInputHandle/index.vue +37 -37
  24. package/src/components/dropdown/Dropdown.stories.js +10 -9
  25. package/src/components/dropdown/index.vue +106 -106
  26. package/src/components/errorMessage/index.vue +52 -52
  27. package/src/components/filter/filterSettings.vue +433 -439
  28. package/src/components/filter/index.vue +135 -135
  29. package/src/components/filter/parentDropdown.vue +73 -73
  30. package/src/components/icon/Icons.stories.js +7 -7
  31. package/src/components/icon/iconCollection.vue +53 -53
  32. package/src/components/icon/index.vue +121 -121
  33. package/src/components/iconWrapper/index.vue +156 -156
  34. package/src/components/infoCard/index.vue +26 -26
  35. package/src/components/infoText/index.vue +132 -133
  36. package/src/components/inputs/checkbox/Checkbox.stories.js +8 -8
  37. package/src/components/inputs/checkbox/index.vue +180 -190
  38. package/src/components/inputs/inputNumber/InputNumber.stories.js +41 -41
  39. package/src/components/inputs/inputNumber/index.vue +644 -647
  40. package/src/components/inputs/inputNumberQuestion/index.vue +182 -185
  41. package/src/components/inputs/inputText/InputText.stories.js +22 -22
  42. package/src/components/inputs/inputText/index.vue +336 -337
  43. package/src/components/inputs/radioButton/RadioButton.stories.js +16 -16
  44. package/src/components/inputs/radioButton/index.vue +219 -221
  45. package/src/components/inputs/searchInput/SearchInput.stories.js +8 -8
  46. package/src/components/inputs/searchInput/index.vue +126 -126
  47. package/src/components/inputs/select/index.vue +776 -778
  48. package/src/components/inputs/select/option/index.vue +124 -124
  49. package/src/components/inputs/select/select.stories.js +32 -31
  50. package/src/components/inputs/slider/index.vue +99 -99
  51. package/src/components/inputs/switchField/index.vue +222 -220
  52. package/src/components/inputs/textAreaInput/TextAreaInput.stories.js +57 -57
  53. package/src/components/inputs/textAreaInput/index.vue +173 -171
  54. package/src/components/inputs/toggle/Toggle.stories.js +14 -14
  55. package/src/components/inputs/toggle/index.vue +217 -214
  56. package/src/components/label/index.vue +82 -82
  57. package/src/components/markerItem/index.vue +66 -68
  58. package/src/components/modals/actionModal/index.vue +54 -54
  59. package/src/components/modals/infoModal/index.vue +36 -39
  60. package/src/components/modals/modal/index.vue +134 -134
  61. package/src/components/modals/modal/modal.stories.js +5 -5
  62. package/src/components/navigationTabs/index.vue +94 -96
  63. package/src/components/pageSubtitle/index.vue +49 -55
  64. package/src/components/pageTitle/index.vue +56 -56
  65. package/src/components/pagination/index.vue +89 -92
  66. package/src/components/progressBar/index.vue +107 -107
  67. package/src/components/projectMarker/index.vue +244 -246
  68. package/src/components/rangeSlider/Slider.vue +465 -491
  69. package/src/components/rangeSlider/index.vue +410 -410
  70. package/src/components/rangeSlider/utils/dom.js +5 -5
  71. package/src/components/selectedOptions/index.vue +119 -119
  72. package/src/components/sideMenu/index.vue +199 -199
  73. package/src/components/spinner/index.vue +57 -57
  74. package/src/components/tableDropdown/index.vue +520 -520
  75. package/src/components/tables/mainTable/index.vue +362 -366
  76. package/src/components/tables/viewTable/index.vue +171 -171
  77. package/src/components/threeDots/index.vue +334 -340
  78. package/src/components/videoThumbnail/index.vue +86 -86
  79. package/src/components/videoThumbnail/videoThumbnail.stories.js +16 -14
  80. package/src/helpers/numberConverter.js +2 -2
  81. package/src/helpers/translateLang.js +9 -9
  82. package/src/mixins/inputValidations.js +5 -5
  83. package/.eslintrc.js +0 -184
@@ -1,88 +1,86 @@
1
1
  <template>
2
- <PageContainer>
3
- <MarkerContainer
4
- :background-color="backgroundColor"
2
+ <page-container>
3
+ <marker-container
4
+ :backgroundColor="backgroundColor"
5
+ :hasIcon="!!iconName"
5
6
  :cursor="cursor"
6
- :has-icon="!!iconName"
7
7
  >
8
- <Icon
8
+ <icon
9
9
  v-if="!!iconName"
10
- color="white"
11
- :cursor="cursor"
12
10
  :name="iconName"
11
+ color="white"
13
12
  size="10px"
13
+ :cursor="cursor"
14
14
  />
15
15
  <span>{{ label }}</span>
16
- </MarkerContainer>
17
- </PageContainer>
16
+ </marker-container>
17
+ </page-container>
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) =>
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) =>
54
57
  props.backgroundColor ? props.backgroundColor : props.theme.colors.grey3};
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
- `
58
+ border-radius: 4px;
59
+ white-space: nowrap;
60
+ cursor: ${(props) => (props.isEditionAllowed ? 'pointer' : props.cursor)};
61
+ `
64
62
 
65
- export default {
66
- name: 'ProjectMarker',
67
- components: {
68
- PageContainer,
69
- MarkerContainer,
70
- Icon,
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
71
76
  },
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
- },
77
+ label: {
78
+ required: true
86
79
  },
80
+ cursor: {
81
+ required: false,
82
+ default: 'default'
83
+ }
87
84
  }
85
+ }
88
86
  </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
- 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
- },
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
+ }
63
62
  }
63
+ }
64
64
  </script>
@@ -1,52 +1,49 @@
1
1
  <template>
2
2
  <ActionModal :is-open="isOpen" @on-close="closeModal">
3
- <ModalContainer>
3
+ <modalContainer>
4
4
  <template #title>
5
- <slot name="title"></slot>
5
+ <slot name="title" />
6
6
  </template>
7
7
  <template #body>
8
- <slot name="body"></slot>
8
+ <slot name="body" />
9
9
  </template>
10
10
  <template #buttons>
11
- <ButtonContainer>
12
- <RCMainButton
13
- min-width="150px"
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
- </ModalContainer>
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
- 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
- },
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
+ }
51
47
  }
48
+ }
52
49
  </script>
@@ -1,42 +1,42 @@
1
1
  <template>
2
- <PageWrapper
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
- <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>
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
- // 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 @@
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;
83
-
84
- ::-webkit-scrollbar {
85
- width: 0.3em;
86
- height: 100%;
87
- background-color: ${(props) => props.theme.colors.grey5};
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
- /* Make scrollbar visible when needed */
91
- ::-webkit-scrollbar-thumb {
92
- background-color: ${(props) => props.theme.colors.grey3};
93
- }
84
+ ::-webkit-scrollbar {
85
+ width: 0.3em;
86
+ height: 100%;
87
+ background-color: ${(props) => props.theme.colors.grey5};
88
+ }
94
89
 
95
- /* Make scrollbar track visible when needed */
96
- ::-webkit-scrollbar-track {
97
- background-color: ${(props) => props.theme.colors.grey5};
98
- }
90
+ /* Make scrollbar visible when needed */
91
+ ::-webkit-scrollbar-thumb {
92
+ background-color: ${(props) => props.theme.colors.grey3};
93
+ }
99
94
 
100
- .close {
101
- position: absolute;
102
- right: 20px;
103
- top: 20px;
95
+ /* Make scrollbar track visible when needed */
96
+ ::-webkit-scrollbar-track {
97
+ background-color: ${(props) => props.theme.colors.grey5};
98
+ }
104
99
 
105
- @media (max-width: 425px) {
106
- right: 14px;
107
- top: 12px;
108
- background: white;
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
- width: 100%;
116
- height: 100%;
117
- box-shadow: none;
106
+ right: 14px;
107
+ top: 12px;
108
+ background: white;
109
+ position: fixed;
110
+ z-index: 99;
118
111
  }
119
- `
112
+ }
113
+
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,
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
- 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
- },
135
+ isLoading: {
136
+ required: false,
137
+ default: false
155
138
  },
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
- },
139
+ hideClose: {
140
+ required: false,
141
+ default: false
168
142
  },
169
- beforeDestroy() {
170
- window.removeEventListener('keydown', this.handleKeyDown)
143
+ backdrop: {
144
+ required: false,
145
+ default: 'white'
171
146
  },
172
- methods: {
173
- onCloseModal() {
174
- this.$emit('on-close')
175
- },
176
- handleKeyDown({ key }) {
177
- if (key === 'Escape') {
178
- this.onCloseModal()
179
- }
180
- },
181
- onClickModalContainer(event) {
182
- if (this.stopPropagation) {
183
- event.stopPropagation()
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>