@eturnity/eturnity_reusable_components 7.24.3-EPDM-11320.0 → 7.24.3-EPDM-11143.1
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 +7 -0
- package/package.json +20 -6
- package/public/favicon.ico +0 -0
- package/public/index.html +17 -0
- package/src/App.vue +70 -75
- package/src/assets/svgIcons/copy.svg +10 -0
- package/src/components/addNewButton/index.vue +27 -24
- package/src/components/banner/actionBanner/index.vue +30 -32
- package/src/components/banner/banner/index.vue +80 -88
- package/src/components/banner/infoBanner/index.vue +44 -36
- package/src/components/buttons/buttonIcon/index.vue +78 -83
- package/src/components/buttons/closeButton/index.vue +26 -26
- package/src/components/buttons/mainButton/index.vue +76 -80
- package/src/components/card/index.vue +52 -56
- package/src/components/collapsableInfoText/index.vue +76 -81
- package/src/components/deleteIcon/index.vue +28 -31
- package/src/components/draggableInputHandle/index.vue +17 -20
- package/src/components/dropdown/Dropdown.stories.js +8 -8
- package/src/components/dropdown/index.vue +72 -75
- package/src/components/errorMessage/index.vue +23 -23
- package/src/components/filter/filterSettings.vue +329 -349
- package/src/components/filter/index.vue +130 -130
- package/src/components/filter/parentDropdown.vue +40 -43
- package/src/components/icon/Icons.stories.js +4 -4
- package/src/components/icon/iconCache.js +1 -1
- package/src/components/icon/iconCollection.vue +37 -40
- package/src/components/icon/index.vue +65 -72
- package/src/components/iconWrapper/index.vue +118 -122
- package/src/components/infoCard/index.vue +17 -20
- package/src/components/infoText/index.vue +82 -88
- package/src/components/inputs/checkbox/index.vue +94 -91
- package/src/components/inputs/inputNumber/index.vue +488 -508
- package/src/components/inputs/inputNumberQuestion/index.vue +124 -127
- package/src/components/inputs/inputText/index.vue +252 -265
- package/src/components/inputs/radioButton/index.vue +120 -135
- package/src/components/inputs/searchInput/index.vue +81 -84
- package/src/components/inputs/select/index.vue +631 -644
- package/src/components/inputs/select/option/index.vue +91 -91
- package/src/components/inputs/select/select.stories.js +7 -7
- package/src/components/inputs/slider/index.vue +46 -46
- package/src/components/inputs/switchField/index.vue +152 -159
- package/src/components/inputs/textAreaInput/index.vue +113 -120
- package/src/components/inputs/toggle/index.vue +127 -137
- package/src/components/label/index.vue +61 -64
- package/src/components/markerItem/index.vue +40 -40
- package/src/components/modals/actionModal/index.vue +29 -32
- package/src/components/modals/infoModal/index.vue +27 -34
- package/src/components/modals/modal/index.vue +80 -88
- package/src/components/navigationTabs/index.vue +47 -50
- package/src/components/pageSubtitle/index.vue +29 -33
- package/src/components/pageTitle/index.vue +39 -47
- package/src/components/pagination/index.vue +62 -64
- package/src/components/progressBar/index.vue +67 -70
- package/src/components/projectMarker/index.vue +163 -172
- package/src/components/rangeSlider/Slider.vue +449 -449
- package/src/components/rangeSlider/index.vue +270 -282
- package/src/components/rangeSlider/utils/dom.js +3 -3
- package/src/components/selectedOptions/index.vue +51 -51
- package/src/components/sideMenu/index.vue +109 -117
- package/src/components/spinner/index.vue +34 -37
- package/src/components/tableDropdown/index.vue +326 -343
- package/src/components/tables/mainTable/index.vue +106 -109
- package/src/components/tables/viewTable/index.vue +92 -105
- package/src/components/threeDots/index.vue +171 -174
- package/src/components/videoThumbnail/index.vue +59 -67
- package/src/components/videoThumbnail/videoThumbnail.stories.js +6 -6
- package/.eslintrc.js +0 -125
package/.prettierrc
ADDED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@eturnity/eturnity_reusable_components",
|
3
|
-
"version": "7.24.3-EPDM-
|
3
|
+
"version": "7.24.3-EPDM-11143.1",
|
4
4
|
"private": false,
|
5
5
|
"scripts": {
|
6
6
|
"dev": "vue-cli-service serve",
|
@@ -22,14 +22,28 @@
|
|
22
22
|
"vuedraggable": "4.1.0"
|
23
23
|
},
|
24
24
|
"devDependencies": {
|
25
|
-
"babel
|
25
|
+
"@babel/core": "7.12.16",
|
26
|
+
"@babel/eslint-parser": "7.12.16",
|
27
|
+
"@vue/cli-plugin-babel": "5.0.8",
|
26
28
|
"@vue/cli-plugin-eslint": "5.0.8",
|
27
29
|
"@vue/cli-service": "5.0.8",
|
28
30
|
"@vue/compiler-sfc": "3.3.4",
|
29
|
-
"eslint": "
|
30
|
-
"eslint-
|
31
|
-
|
32
|
-
|
31
|
+
"eslint": "7.32.0",
|
32
|
+
"eslint-plugin-vue": "8.0.3"
|
33
|
+
},
|
34
|
+
"eslintConfig": {
|
35
|
+
"root": true,
|
36
|
+
"env": {
|
37
|
+
"node": true
|
38
|
+
},
|
39
|
+
"extends": [
|
40
|
+
"plugin:vue/essential",
|
41
|
+
"eslint:recommended"
|
42
|
+
],
|
43
|
+
"parserOptions": {
|
44
|
+
"parser": "@babel/eslint-parser"
|
45
|
+
},
|
46
|
+
"rules": {}
|
33
47
|
},
|
34
48
|
"browserslist": [
|
35
49
|
"> 1%",
|
Binary file
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="">
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
6
|
+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
7
|
+
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
8
|
+
<title><%= htmlWebpackPlugin.options.title %></title>
|
9
|
+
</head>
|
10
|
+
<body>
|
11
|
+
<noscript>
|
12
|
+
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
|
13
|
+
</noscript>
|
14
|
+
<div id="app"></div>
|
15
|
+
<!-- built files will be auto injected -->
|
16
|
+
</body>
|
17
|
+
</html>
|
package/src/App.vue
CHANGED
@@ -1,108 +1,103 @@
|
|
1
1
|
<template>
|
2
|
-
<ThemeProvider
|
3
|
-
|
4
|
-
:theme="getTheme()"
|
5
|
-
>
|
6
|
-
<PageContainer>
|
2
|
+
<ThemeProvider :theme="getTheme()" :style="{ height: '100%' }">
|
3
|
+
<page-container>
|
7
4
|
<br />
|
8
|
-
<
|
9
|
-
background-color="transparent"
|
10
|
-
border-color="eturnityGrey"
|
11
|
-
input-height="34px"
|
12
|
-
input-width="420px"
|
13
|
-
:interaction-step="1"
|
14
|
-
:is-interactive="true"
|
15
|
-
:min-number="0"
|
16
|
-
:number-precision="0"
|
17
|
-
text-align="left"
|
18
|
-
unit-name="mm"
|
5
|
+
<input-number
|
19
6
|
:value="value"
|
20
|
-
|
7
|
+
:minNumber="0"
|
8
|
+
unitName="mm"
|
9
|
+
:numberPrecision="0"
|
10
|
+
backgroundColor="transparent"
|
11
|
+
borderColor="eturnityGrey"
|
12
|
+
inputHeight="34px"
|
13
|
+
inputWidth="420px"
|
14
|
+
textAlign="left"
|
15
|
+
:isInteractive="true"
|
16
|
+
:interactionStep="1"
|
17
|
+
@on-input="inputHandler"
|
21
18
|
@input-change="changeHandler"
|
22
19
|
@input-focus="focusHandler"
|
23
|
-
@
|
20
|
+
@input-blur="blurHandler"
|
24
21
|
>
|
25
|
-
<template
|
22
|
+
<template v-slot:label>
|
26
23
|
<div>Interactive Label 1</div>
|
27
24
|
</template>
|
28
|
-
</
|
25
|
+
</input-number>
|
29
26
|
|
30
|
-
<hr
|
27
|
+
<hr>
|
31
28
|
|
32
|
-
<
|
33
|
-
background-color="transparent"
|
34
|
-
border-color="eturnityGrey"
|
35
|
-
input-height="34px"
|
36
|
-
input-width="420px"
|
37
|
-
:interaction-step="1"
|
38
|
-
:is-interactive="true"
|
39
|
-
:min-number="0"
|
40
|
-
:number-precision="0"
|
41
|
-
text-align="left"
|
42
|
-
unit-name="mm"
|
29
|
+
<input-number
|
43
30
|
:value="value"
|
44
|
-
|
31
|
+
:minNumber="0"
|
32
|
+
unitName="mm"
|
33
|
+
:numberPrecision="0"
|
34
|
+
backgroundColor="transparent"
|
35
|
+
borderColor="eturnityGrey"
|
36
|
+
inputHeight="34px"
|
37
|
+
inputWidth="420px"
|
38
|
+
textAlign="left"
|
39
|
+
:isInteractive="true"
|
40
|
+
:interactionStep="1"
|
41
|
+
@on-input="inputHandler"
|
45
42
|
@input-change="changeHandler"
|
46
43
|
@input-focus="focusHandler"
|
47
|
-
@
|
44
|
+
@input-blur="blurHandler"
|
48
45
|
>
|
49
|
-
<template
|
46
|
+
<template v-slot:label>
|
50
47
|
<div>Interactive Label 2</div>
|
51
48
|
</template>
|
52
|
-
</
|
49
|
+
</input-number>
|
53
50
|
|
54
|
-
<hr
|
55
|
-
<button @click="value=42">
|
56
|
-
|
57
|
-
</button>
|
58
|
-
</PageContainer>
|
51
|
+
<hr>
|
52
|
+
<button @click="value=42">Click to set at 42</button>
|
53
|
+
</page-container>
|
59
54
|
</ThemeProvider>
|
60
55
|
</template>
|
61
56
|
|
62
57
|
<script>
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
58
|
+
import { ThemeProvider } from 'vue3-styled-components'
|
59
|
+
import theme from './assets/theme'
|
60
|
+
import styled from 'vue3-styled-components'
|
61
|
+
import InputNumber from '@/components/inputs/inputNumber'
|
67
62
|
|
68
|
-
|
63
|
+
const PageContainer = styled.div`
|
69
64
|
padding: 40px;
|
70
65
|
`
|
71
66
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
67
|
+
export default {
|
68
|
+
name: 'App',
|
69
|
+
components: {
|
70
|
+
ThemeProvider,
|
71
|
+
PageContainer,
|
72
|
+
InputNumber,
|
73
|
+
},
|
74
|
+
data() {
|
75
|
+
return {
|
76
|
+
value: 42,
|
77
|
+
}
|
78
|
+
},
|
79
|
+
computed: {
|
80
|
+
},
|
81
|
+
methods: {
|
82
|
+
blurHandler(e) {
|
83
|
+
console.log('blur', e)
|
78
84
|
},
|
79
|
-
|
80
|
-
|
81
|
-
value: 42,
|
82
|
-
}
|
85
|
+
changeHandler(e) {
|
86
|
+
console.log('change', e)
|
83
87
|
},
|
84
|
-
|
88
|
+
focusHandler(e) {
|
89
|
+
console.log('focus', e)
|
85
90
|
},
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
},
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
focusHandler(e) {
|
94
|
-
console.log('focus', e)
|
95
|
-
},
|
96
|
-
inputHandler(e) {
|
97
|
-
console.log('input', e)
|
98
|
-
//this.value = e
|
99
|
-
setTimeout(() => {this.value = e}, 1000)
|
100
|
-
},
|
101
|
-
getTheme() {
|
102
|
-
return theme
|
103
|
-
}
|
91
|
+
inputHandler(e) {
|
92
|
+
console.log('input', e)
|
93
|
+
//this.value = e
|
94
|
+
setTimeout(()=>{this.value = e},1000)
|
95
|
+
},
|
96
|
+
getTheme() {
|
97
|
+
return theme
|
104
98
|
}
|
105
99
|
}
|
100
|
+
}
|
106
101
|
</script>
|
107
102
|
|
108
103
|
<style>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
3
|
+
<svg width="800px" height="800px" viewBox="0 0 512 512" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
4
|
+
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
5
|
+
<g id="copy" fill="none" transform="translate(85.333333, 42.666667)">
|
6
|
+
<path d="M341.333333,85.3333333 L341.333333,405.333333 L85.3333333,405.333333 L85.3333333,85.3333333 L341.333333,85.3333333 Z M298.666667,128 L128,128 L128,362.666667 L298.666667,362.666667 L298.666667,128 Z M234.666667,7.10542736e-15 L234.666667,42.6666667 L42.6666667,42.6666667 L42.6666667,298.666667 L1.42108547e-14,298.666667 L1.42108547e-14,7.10542736e-15 L234.666667,7.10542736e-15 Z">
|
7
|
+
</path>
|
8
|
+
</g>
|
9
|
+
</g>
|
10
|
+
</svg>
|
@@ -1,24 +1,24 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
<
|
2
|
+
<page-container :shouldPosition="shouldPosition">
|
3
|
+
<button-container :data-id="dataId">
|
4
4
|
<PlusButtonSvg />
|
5
|
-
</
|
6
|
-
</
|
5
|
+
</button-container>
|
6
|
+
</page-container>
|
7
7
|
</template>
|
8
8
|
|
9
9
|
<script>
|
10
10
|
// import AddNewButton from "@eturnity/eturnity_reusable_components/src/components/addNewButton"
|
11
|
-
|
12
|
-
|
11
|
+
import styled from 'vue3-styled-components'
|
12
|
+
import PlusButtonSvg from '../../assets/icons/plus_button.svg'
|
13
13
|
|
14
|
-
|
15
|
-
|
14
|
+
const pageAttrs = { shouldPosition: Boolean }
|
15
|
+
const PageContainer = styled('div', pageAttrs)`
|
16
16
|
position: ${(props) => (props.shouldPosition ? 'fixed' : 'unset')};
|
17
17
|
bottom: 30px;
|
18
18
|
right: 30px;
|
19
19
|
`
|
20
20
|
|
21
|
-
|
21
|
+
const ButtonContainer = styled.div`
|
22
22
|
height: 60px;
|
23
23
|
width: 60px;
|
24
24
|
background-color: ${(props) => props.theme.colors.green};
|
@@ -40,22 +40,25 @@
|
|
40
40
|
}
|
41
41
|
`
|
42
42
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
43
|
+
const PlusButton = styled.img``
|
44
|
+
|
45
|
+
export default {
|
46
|
+
name: 'add-new-button',
|
47
|
+
components: {
|
48
|
+
PageContainer,
|
49
|
+
ButtonContainer,
|
50
|
+
PlusButton,
|
51
|
+
PlusButtonSvg
|
52
|
+
},
|
53
|
+
props: {
|
54
|
+
shouldPosition: {
|
55
|
+
required: false,
|
56
|
+
default: true
|
49
57
|
},
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
default: true
|
54
|
-
},
|
55
|
-
dataId: {
|
56
|
-
type: String,
|
57
|
-
default: ''
|
58
|
-
}
|
58
|
+
dataId: {
|
59
|
+
type: String,
|
60
|
+
default: ''
|
59
61
|
}
|
60
62
|
}
|
63
|
+
}
|
61
64
|
</script>
|
@@ -1,30 +1,28 @@
|
|
1
1
|
<template>
|
2
|
-
<Modal
|
3
|
-
|
4
|
-
|
5
|
-
>
|
6
|
-
<ModalContainer>
|
7
|
-
<ModalTitle v-if="$slots.title">
|
2
|
+
<Modal :is-open="isOpen" @on-close="closeModal">
|
3
|
+
<modalContainer>
|
4
|
+
<modalTitle v-if="$slots.title">
|
8
5
|
<slot name="title"></slot>
|
9
|
-
</
|
10
|
-
<
|
6
|
+
</modalTitle>
|
7
|
+
<textContainer v-if="$slots.body">
|
11
8
|
<slot name="body"></slot>
|
12
|
-
</
|
13
|
-
<
|
9
|
+
</textContainer>
|
10
|
+
<buttonContainer v-if="$slots.buttons">
|
14
11
|
<slot name="buttons"></slot>
|
15
|
-
</
|
16
|
-
</
|
12
|
+
</buttonContainer>
|
13
|
+
</modalContainer>
|
17
14
|
</Modal>
|
18
15
|
</template>
|
19
16
|
<script>
|
20
|
-
|
21
|
-
|
22
|
-
|
17
|
+
import styled from 'vue3-styled-components'
|
18
|
+
import { mapActions, mapState } from 'vuex'
|
19
|
+
import Modal from '../modal'
|
20
|
+
const modalContainer = styled.div`
|
23
21
|
width: 450px;
|
24
22
|
min-height: 205px;
|
25
23
|
padding: 40px 40px 30px 40px;
|
26
24
|
`
|
27
|
-
|
25
|
+
const modalTitle = styled.div`
|
28
26
|
color: ${(props) => props.theme.colors.black};
|
29
27
|
font-family: ${(props) => props.theme.fonts.mainFont};
|
30
28
|
font-size: 18px;
|
@@ -33,12 +31,12 @@
|
|
33
31
|
line-height: 120%;
|
34
32
|
text-transform: uppercase;
|
35
33
|
`
|
36
|
-
|
34
|
+
const buttonContainer = styled.div`
|
37
35
|
display: inline-flex;
|
38
36
|
align-items: flex-start;
|
39
37
|
gap: 20px;
|
40
38
|
`
|
41
|
-
|
39
|
+
const textContainer = styled.div`
|
42
40
|
color: ${(props) => props.theme.colors.black};
|
43
41
|
font-family: ${(props) => props.theme.fonts.mainFont};
|
44
42
|
font-size: 13px;
|
@@ -48,20 +46,20 @@
|
|
48
46
|
padding: 30px 0px;
|
49
47
|
white-space: pre-wrap;
|
50
48
|
`
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
}
|
49
|
+
export default {
|
50
|
+
name: 'actionModal',
|
51
|
+
props: ['isOpen'],
|
52
|
+
components: {
|
53
|
+
Modal,
|
54
|
+
modalContainer,
|
55
|
+
modalTitle,
|
56
|
+
buttonContainer,
|
57
|
+
textContainer
|
58
|
+
},
|
59
|
+
methods: {
|
60
|
+
closeModal() {
|
61
|
+
this.$emit('on-close')
|
65
62
|
}
|
66
63
|
}
|
64
|
+
}
|
67
65
|
</script>
|
@@ -1,26 +1,18 @@
|
|
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
|
-
|
12
|
-
|
13
|
-
/>
|
14
|
-
|
15
|
-
|
16
|
-
</ContentContainer>
|
17
|
-
<CloseButton
|
18
|
-
v-if="!hideClose"
|
19
|
-
class="close"
|
20
|
-
@click="onCloseModal()"
|
21
|
-
/>
|
22
|
-
</ModalContainer>
|
23
|
-
</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>
|
24
16
|
</template>
|
25
17
|
|
26
18
|
<script>
|
@@ -34,17 +26,17 @@
|
|
34
26
|
// <div>Data....</div>
|
35
27
|
// </modal>
|
36
28
|
|
37
|
-
|
38
|
-
|
39
|
-
|
29
|
+
import styled from 'vue3-styled-components'
|
30
|
+
import CloseButton from '../../buttons/closeButton'
|
31
|
+
import Spinner from '../../spinner'
|
40
32
|
|
41
|
-
|
42
|
-
|
33
|
+
const contentAttrs = { visible: Boolean }
|
34
|
+
const ContentContainer = styled('div', contentAttrs)`
|
43
35
|
visibility: ${(props) => (props.visible ? 'inherit' : 'hidden')};
|
44
36
|
`
|
45
37
|
|
46
|
-
|
47
|
-
|
38
|
+
const pageAttrs = { isOpen: Boolean, backdrop: String, position: String }
|
39
|
+
const PageWrapper = styled('div', pageAttrs)`
|
48
40
|
position: ${(props) => props.position}
|
49
41
|
display: grid;
|
50
42
|
top: 0;
|
@@ -54,7 +46,7 @@
|
|
54
46
|
background-color: ${(props) =>
|
55
47
|
props.backdrop == 'dark'
|
56
48
|
? 'rgba(0, 0, 0, 0.4)'
|
57
|
-
|
49
|
+
: 'rgba(255, 255, 255, 0.9)'};
|
58
50
|
z-index: 99999;
|
59
51
|
overflow: auto;
|
60
52
|
|
@@ -75,7 +67,7 @@
|
|
75
67
|
}
|
76
68
|
`
|
77
69
|
|
78
|
-
|
70
|
+
const ModalContainer = styled.div`
|
79
71
|
align-self: center;
|
80
72
|
justify-self: center;
|
81
73
|
position: relative;
|
@@ -126,71 +118,71 @@
|
|
126
118
|
}
|
127
119
|
`
|
128
120
|
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
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
|
137
134
|
},
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
default: false
|
142
|
-
},
|
143
|
-
isLoading: {
|
144
|
-
required: false,
|
145
|
-
default: false
|
146
|
-
},
|
147
|
-
hideClose: {
|
148
|
-
required: false,
|
149
|
-
default: false
|
150
|
-
},
|
151
|
-
backdrop: {
|
152
|
-
required: false,
|
153
|
-
default: 'white'
|
154
|
-
},
|
155
|
-
position: {
|
156
|
-
required: false,
|
157
|
-
default: 'fixed'
|
158
|
-
},
|
159
|
-
stopPropagation: {
|
160
|
-
type: Boolean,
|
161
|
-
default: true
|
162
|
-
}
|
135
|
+
isLoading: {
|
136
|
+
required: false,
|
137
|
+
default: false
|
163
138
|
},
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
handler(isOpen) {
|
168
|
-
document.body.style.overflow = isOpen ? 'hidden' : ''
|
169
|
-
if (isOpen) {
|
170
|
-
window.addEventListener('keydown', this.handleKeyDown)
|
171
|
-
} else {
|
172
|
-
window.removeEventListener('keydown', this.handleKeyDown)
|
173
|
-
}
|
174
|
-
}
|
175
|
-
}
|
139
|
+
hideClose: {
|
140
|
+
required: false,
|
141
|
+
default: false
|
176
142
|
},
|
177
|
-
|
178
|
-
|
143
|
+
backdrop: {
|
144
|
+
required: false,
|
145
|
+
default: 'white'
|
179
146
|
},
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
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
|
+
}
|
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)
|
192
183
|
}
|
193
184
|
}
|
194
185
|
}
|
195
186
|
}
|
187
|
+
}
|
196
188
|
</script>
|