@eturnity/eturnity_reusable_components 7.12.7-EPDM-7951.1 → 7.12.7-EPDM-10597.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/.storybook/preview.js +1 -1
- package/package.json +23 -19
- package/src/App.vue +2 -2
- package/src/assets/svgIcons/anchor.svg +18 -0
- package/src/components/addNewButton/index.vue +3 -5
- package/src/components/buttons/buttonIcon/index.vue +1 -1
- package/src/components/buttons/closeButton/index.vue +1 -1
- package/src/components/buttons/mainButton/index.vue +1 -6
- package/src/components/deleteIcon/DeleteIcon.stories.js +7 -7
- package/src/components/deleteIcon/index.vue +21 -25
- package/src/components/draggableInputHandle/index.vue +25 -24
- package/src/components/dropdown/index.vue +110 -129
- package/src/components/errorMessage/index.vue +5 -10
- package/src/components/filter/filterSettings.vue +97 -57
- package/src/components/filter/index.vue +3 -3
- package/src/components/filter/parentDropdown.vue +2 -2
- package/src/components/icon/iconCollection.vue +2 -2
- package/src/components/icon/index.vue +70 -67
- package/src/components/iconWrapper/index.vue +4 -1
- package/src/components/infoCard/index.vue +3 -2
- package/src/components/infoText/index.vue +1 -1
- package/src/components/inputs/checkbox/index.vue +6 -21
- package/src/components/inputs/inputNumber/index.vue +11 -8
- package/src/components/inputs/inputNumberQuestion/index.vue +1 -1
- package/src/components/inputs/inputText/index.vue +3 -3
- package/src/components/inputs/radioButton/index.vue +1 -1
- package/src/components/inputs/searchInput/index.vue +8 -7
- package/src/components/inputs/select/index.vue +55 -199
- package/src/components/inputs/select/option/index.vue +5 -5
- package/src/components/inputs/slider/index.vue +16 -16
- package/src/components/inputs/switchField/index.vue +2 -2
- package/src/components/inputs/textAreaInput/index.vue +1 -1
- package/src/components/inputs/toggle/index.vue +2 -2
- package/src/components/label/index.vue +31 -27
- package/src/components/modals/modal/index.vue +6 -2
- package/src/components/navigationTabs/index.vue +20 -27
- package/src/components/pageSubtitle/index.vue +1 -1
- package/src/components/pageTitle/index.vue +4 -4
- package/src/components/pagination/index.vue +1 -1
- package/src/components/progressBar/index.vue +1 -1
- package/src/components/projectMarker/index.vue +7 -10
- package/src/components/sideMenu/index.vue +1 -1
- package/src/components/spinner/index.vue +11 -6
- package/src/components/tableDropdown/index.vue +26 -21
- package/src/components/tables/mainTable/exampleNested.vue +1 -1
- package/src/components/tables/mainTable/index.vue +9 -10
- package/src/components/tables/viewTable/index.vue +2 -2
- package/src/components/threeDots/index.vue +1 -1
- package/src/components/videoThumbnail/index.vue +100 -95
- package/src/main.js +11 -4
- package/src/components/icon/iconCache.js +0 -23
package/.storybook/preview.js
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@eturnity/eturnity_reusable_components",
|
3
|
-
"version": "7.12.7-EPDM-
|
3
|
+
"version": "7.12.7-EPDM-10597.0",
|
4
4
|
"private": false,
|
5
5
|
"scripts": {
|
6
6
|
"dev": "vue-cli-service serve",
|
@@ -10,26 +10,30 @@
|
|
10
10
|
"build-storybook": "build-storybook"
|
11
11
|
},
|
12
12
|
"dependencies": {
|
13
|
-
"@
|
14
|
-
"@vue/compat": "3.3.4",
|
15
|
-
"@vueform/slider": "2.1.10",
|
16
|
-
"@vuepic/vue-datepicker": "6.1.0",
|
17
|
-
"click-outside-vue3": "4.0.1",
|
13
|
+
"@vueform/slider": "1.0.5",
|
18
14
|
"html-loader": "0.5.5",
|
19
|
-
"postcss": "8.4.25",
|
20
|
-
"
|
21
|
-
"
|
22
|
-
"
|
15
|
+
"postcss": "^8.4.25",
|
16
|
+
"v-click-outside": "2.1.4",
|
17
|
+
"vue": "2.6.11",
|
18
|
+
"vue-styled-components": "1.6.0",
|
19
|
+
"vue2-datepicker": "3.11.1",
|
20
|
+
"vuedraggable": "2.24.3",
|
21
|
+
"core-js": "3.31.1"
|
23
22
|
},
|
24
23
|
"devDependencies": {
|
25
|
-
"@
|
26
|
-
"@
|
27
|
-
"@
|
28
|
-
"@
|
29
|
-
"@vue
|
30
|
-
"@vue/
|
31
|
-
"eslint": "
|
32
|
-
"
|
24
|
+
"@storybook/addon-actions": "6.2.8",
|
25
|
+
"@storybook/addon-docs": "6.4.19",
|
26
|
+
"@storybook/addon-essentials": "6.2.8",
|
27
|
+
"@storybook/addon-links": "6.2.8",
|
28
|
+
"@storybook/vue": "6.4.19",
|
29
|
+
"@vue/cli-plugin-babel": "~4.5.0",
|
30
|
+
"@vue/cli-plugin-eslint": "~4.5.0",
|
31
|
+
"@vue/cli-service": "~4.5.0",
|
32
|
+
"@vue/composition-api": "1.0.0-rc.10",
|
33
|
+
"babel-eslint": "10.1.0",
|
34
|
+
"eslint": "6.7.2",
|
35
|
+
"eslint-plugin-vue": "6.2.2",
|
36
|
+
"vue-template-compiler": "2.6.11"
|
33
37
|
},
|
34
38
|
"eslintConfig": {
|
35
39
|
"root": true,
|
@@ -41,7 +45,7 @@
|
|
41
45
|
"eslint:recommended"
|
42
46
|
],
|
43
47
|
"parserOptions": {
|
44
|
-
"parser": "
|
48
|
+
"parser": "babel-eslint"
|
45
49
|
},
|
46
50
|
"rules": {}
|
47
51
|
},
|
package/src/App.vue
CHANGED
@@ -55,9 +55,9 @@
|
|
55
55
|
</template>
|
56
56
|
|
57
57
|
<script>
|
58
|
-
import { ThemeProvider } from '
|
58
|
+
import { ThemeProvider } from 'vue-styled-components'
|
59
59
|
import theme from './assets/theme'
|
60
|
-
import styled from '
|
60
|
+
import styled from 'vue-styled-components'
|
61
61
|
import InputNumber from '@/components/inputs/inputNumber'
|
62
62
|
|
63
63
|
const PageContainer = styled.div`
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
3
|
+
<svg height="800px" width="800px" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
4
|
+
viewBox="0 0 204.851 204.851" xml:space="preserve">
|
5
|
+
<g>
|
6
|
+
<g>
|
7
|
+
<g>
|
8
|
+
<path style="fill:#263238;" d="M139.518,128.595l16.834,16.336c0,0-20.644,29.877-42.725,30.473
|
9
|
+
c0.479,0,0.117-84.092,0.039-104.472c14.694-4.797,25.402-18.182,25.402-34.117c0-20.009-16.697-36.218-37.273-36.218
|
10
|
+
c-20.615,0-37.312,16.209-37.312,36.208c0,15.671,10.376,28.929,24.748,33.961l0.098,104.277
|
11
|
+
c-26.643-1.837-42.061-27.474-42.061-27.474l17.997-17.41L0,120.505l9.887,63.301l17.362-16.795
|
12
|
+
c15.036,12.105,32.017,37.244,72.876,37.244c51.332-1.309,63.184-28.939,76.344-39.804l18.993,18.514l9.389-63.907
|
13
|
+
L139.518,128.595z M82.558,36.208c0-10.298,8.608-18.661,19.218-18.661s19.257,8.363,19.257,18.661
|
14
|
+
c0,10.327-8.647,18.681-19.257,18.681S82.558,46.535,82.558,36.208z"/>
|
15
|
+
</g>
|
16
|
+
</g>
|
17
|
+
</g>
|
18
|
+
</svg>
|
@@ -1,15 +1,14 @@
|
|
1
1
|
<template>
|
2
2
|
<page-container :shouldPosition="shouldPosition">
|
3
3
|
<button-container :data-id="dataId">
|
4
|
-
<
|
4
|
+
<plus-button :src="require('../../assets/icons/plus_button.svg')" />
|
5
5
|
</button-container>
|
6
6
|
</page-container>
|
7
7
|
</template>
|
8
8
|
|
9
9
|
<script>
|
10
10
|
// import AddNewButton from "@eturnity/eturnity_reusable_components/src/components/addNewButton"
|
11
|
-
import styled from '
|
12
|
-
import PlusButtonSvg from '../../assets/icons/plus_button.svg'
|
11
|
+
import styled from 'vue-styled-components'
|
13
12
|
|
14
13
|
const pageAttrs = { shouldPosition: Boolean }
|
15
14
|
const PageContainer = styled('div', pageAttrs)`
|
@@ -47,8 +46,7 @@ export default {
|
|
47
46
|
components: {
|
48
47
|
PageContainer,
|
49
48
|
ButtonContainer,
|
50
|
-
PlusButton
|
51
|
-
PlusButtonSvg
|
49
|
+
PlusButton
|
52
50
|
},
|
53
51
|
props: {
|
54
52
|
shouldPosition: {
|
@@ -1,7 +1,6 @@
|
|
1
1
|
<template>
|
2
2
|
<page-container>
|
3
3
|
<button-container
|
4
|
-
:id="id"
|
5
4
|
:type="type"
|
6
5
|
:minWidth="minWidth"
|
7
6
|
:isDisabled="isDisabled"
|
@@ -26,7 +25,7 @@
|
|
26
25
|
// :data-id="test_data_id"
|
27
26
|
// />
|
28
27
|
|
29
|
-
import styled from '
|
28
|
+
import styled from 'vue-styled-components'
|
30
29
|
|
31
30
|
const PageContainer = styled.div``
|
32
31
|
|
@@ -99,10 +98,6 @@ export default {
|
|
99
98
|
required: false,
|
100
99
|
default: null
|
101
100
|
},
|
102
|
-
id: {
|
103
|
-
required: false,
|
104
|
-
default: null
|
105
|
-
},
|
106
101
|
dataId: {
|
107
102
|
type: String,
|
108
103
|
default: ''
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import DeleteIcon from
|
1
|
+
import DeleteIcon from "./index.vue"
|
2
2
|
|
3
3
|
export default {
|
4
|
-
title:
|
5
|
-
component: DeleteIcon
|
4
|
+
title: "DeleteIcon",
|
5
|
+
component: DeleteIcon,
|
6
6
|
// argTypes: {},
|
7
7
|
}
|
8
8
|
|
@@ -11,19 +11,19 @@ const Template = (args, { argTypes }) => ({
|
|
11
11
|
components: { DeleteIcon },
|
12
12
|
// The story's `args` need to be mapped into the template through the `setup()` method
|
13
13
|
props: Object.keys(argTypes),
|
14
|
-
template: '<delete-icon v-bind="$props" />'
|
14
|
+
template: '<delete-icon v-bind="$props" />',
|
15
15
|
|
16
16
|
// import DeleteIcon from "@eturnity/eturnity_reusable_components/src/components/deleteIcon"
|
17
17
|
// To use:
|
18
|
-
// <delete-icon color="gray" @click="onDeleteItem(item)" :isDisabled="true" />
|
18
|
+
// <delete-icon color="gray" @click.native="onDeleteItem(item)" :isDisabled="true" />
|
19
19
|
})
|
20
20
|
|
21
21
|
export const Default = Template.bind({})
|
22
22
|
Default.args = {
|
23
|
-
isDisabled: false
|
23
|
+
isDisabled: false,
|
24
24
|
}
|
25
25
|
|
26
26
|
export const Disabled = Template.bind({})
|
27
27
|
Disabled.args = {
|
28
|
-
isDisabled: true
|
28
|
+
isDisabled: true,
|
29
29
|
}
|
@@ -4,62 +4,58 @@
|
|
4
4
|
@mouseleave="isHovered = false"
|
5
5
|
:isDisabled="isDisabled"
|
6
6
|
>
|
7
|
-
<
|
8
|
-
|
7
|
+
<icon-image
|
8
|
+
v-if="isHovered && !isDisabled"
|
9
|
+
:hoverBg="hoverBg"
|
10
|
+
:src="require('../../assets/icons/delete_icon.svg')"
|
11
|
+
/>
|
12
|
+
<icon-image
|
13
|
+
v-else
|
14
|
+
:src="require('../../assets/icons/delete_icon_gray.svg')"
|
15
|
+
/>
|
9
16
|
</wrapper>
|
10
17
|
</template>
|
11
18
|
|
12
19
|
<script>
|
13
20
|
// To use:
|
14
|
-
// <delete-icon @click="onDeleteItem(item)" :isDisabled="true" />
|
15
|
-
import styled from
|
16
|
-
import SvgDelete from '../../assets/icons/delete_icon.svg'
|
17
|
-
import SvgDeleteGray from '../../assets/icons/delete_icon_gray.svg'
|
21
|
+
// <delete-icon @click.native="onDeleteItem(item)" :isDisabled="true" />
|
22
|
+
import styled from "vue-styled-components"
|
18
23
|
|
19
24
|
const wrapperAttrs = { isDisabled: Boolean }
|
20
|
-
const Wrapper = styled(
|
25
|
+
const Wrapper = styled("div", wrapperAttrs)`
|
21
26
|
width: 30px;
|
22
27
|
height: 30px;
|
23
|
-
cursor: ${(props) => (props.isDisabled ?
|
28
|
+
cursor: ${(props) => (props.isDisabled ? "not-allowed" : "pointer")};
|
24
29
|
`
|
25
30
|
|
26
31
|
const IconImageAttrs = { hoverBg: String }
|
27
|
-
const
|
32
|
+
const IconImage = styled('img', IconImageAttrs)`
|
28
33
|
&:hover {
|
29
|
-
background-color: ${(props) =>
|
30
|
-
props.hoverBg ? props.hoverBg : props.theme.colors.grey5};
|
31
|
-
border-radius: 4px;
|
32
|
-
}
|
33
|
-
`
|
34
|
-
|
35
|
-
const DeleteIconGray = styled(SvgDeleteGray, IconImageAttrs)`
|
36
|
-
&:hover {
|
37
|
-
background-color: ${(props) => props.theme.colors.grey5};
|
34
|
+
background-color: ${(props) => props.hoverBg ? props.hoverBg : props.theme.colors.grey5};
|
38
35
|
border-radius: 4px;
|
39
36
|
}
|
40
37
|
`
|
41
38
|
|
42
39
|
export default {
|
43
|
-
name:
|
40
|
+
name: "delete-icon",
|
44
41
|
components: {
|
45
42
|
Wrapper,
|
46
|
-
|
47
|
-
DeleteIconGray
|
43
|
+
IconImage,
|
48
44
|
},
|
49
45
|
props: {
|
50
46
|
isDisabled: {
|
51
47
|
required: false,
|
52
|
-
default: false
|
48
|
+
default: false,
|
53
49
|
},
|
54
50
|
hoverBg: {
|
55
51
|
required: false,
|
56
|
-
default: ''
|
52
|
+
default: '',
|
57
53
|
}
|
58
54
|
},
|
59
55
|
data() {
|
60
56
|
return {
|
61
|
-
isHovered: false
|
57
|
+
isHovered: false,
|
62
58
|
}
|
63
|
-
}
|
59
|
+
},
|
64
60
|
}
|
65
61
|
</script>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<template>
|
2
|
-
<Handle :height="height" class="handle">
|
2
|
+
<Handle :height = "height" class="handle">
|
3
3
|
<Dot></Dot>
|
4
4
|
<Dot></Dot>
|
5
5
|
<Dot></Dot>
|
@@ -7,34 +7,35 @@
|
|
7
7
|
</template>
|
8
8
|
|
9
9
|
<script>
|
10
|
-
import styled from 'vue3-styled-components'
|
11
10
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
11
|
+
import styled from 'vue-styled-components'
|
12
|
+
|
13
|
+
const Handle = styled('div',{ height : String })`
|
14
|
+
position:absolute;
|
15
|
+
left:0;
|
16
|
+
margin-right:10px;
|
17
|
+
display: flex;
|
18
|
+
align-items: stretch;
|
19
|
+
flex-direction: column;
|
20
|
+
justify-content: center;
|
21
|
+
width: 14px;
|
22
|
+
height:${props=> props.height};
|
23
|
+
padding: 0 5px;
|
24
|
+
background-color: #f3f3f7;
|
25
|
+
cursor: pointer;
|
26
|
+
align-items: center;
|
27
|
+
`
|
27
28
|
const Dot = styled.div`
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
`
|
29
|
+
display: inline-block;
|
30
|
+
width: 4px;
|
31
|
+
height: 4px;
|
32
|
+
margin:2px;
|
33
|
+
background-color: #0068de;
|
34
|
+
`
|
34
35
|
|
35
36
|
export default {
|
36
37
|
name: 'draggableInputHandle',
|
37
|
-
props:
|
38
|
+
props:['height'],
|
38
39
|
components: {
|
39
40
|
Handle,
|
40
41
|
Dot
|
@@ -1,138 +1,119 @@
|
|
1
1
|
<template>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
</DropdownWindow>
|
21
|
-
</WrapperDropdown>
|
22
|
-
</wrapper>
|
23
|
-
</template>
|
2
|
+
<wrapper ref="dropdown" :openingMode="openingMode">
|
3
|
+
<WrapperButton @click="isOpenByClick=!isOpenByClick">
|
4
|
+
<slot name="trigger"/>
|
5
|
+
</WrapperButton>
|
6
|
+
<WrapperDropdown class="dropdown-content" :class="{openDropdown:isOpenByClick && openingMode=='click'}" :justify="justify" :position="position" :width="width" :backgroundColor="backgroundColor">
|
7
|
+
<DropdownWindow :gap="gap" :backgroundColor="backgroundColor" :width="width">
|
8
|
+
<slot name="dropdown"/>
|
9
|
+
</DropdownWindow>
|
10
|
+
</WrapperDropdown>
|
11
|
+
</wrapper>
|
12
|
+
</template>
|
13
|
+
|
14
|
+
<script>
|
15
|
+
// import Icon from "@eturnity/eturnity_reusable_components/src/components/icon"
|
16
|
+
// How to use:
|
17
|
+
//<DropdownComponent
|
18
|
+
// width="300px"
|
19
|
+
// backgroundColor="red">
|
24
20
|
|
25
|
-
<
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
21
|
+
// <DropdownComponent/>
|
22
|
+
|
23
|
+
import styled from 'vue-styled-components'
|
24
|
+
|
25
|
+
const wrapperAttrs = { width: String, backgroundColor:String,openingMode:String,gap:String,justify:String }
|
26
|
+
const Wrapper = styled('div', wrapperAttrs)`
|
27
|
+
display: inline-block;
|
28
|
+
position: relative;
|
31
29
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
${(props) =>
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
position: relative;
|
69
|
-
min-width: 160px;
|
70
|
-
box-shadow: -1px 0px 5px rgba(0, 0, 0, 0.302);
|
71
|
-
z-index: 1;
|
72
|
-
`
|
73
|
-
|
74
|
-
const WrapperButton = styled('div', wrapperAttrs)`
|
75
|
-
display: inline-block;
|
76
|
-
`
|
77
|
-
|
78
|
-
export default {
|
79
|
-
name: 'DropdownComponent',
|
80
|
-
components: {
|
81
|
-
WrapperDropdown,
|
82
|
-
WrapperButton,
|
83
|
-
Wrapper,
|
84
|
-
DropdownWindow
|
85
|
-
},
|
86
|
-
props: {
|
87
|
-
width: {
|
88
|
-
required: false,
|
89
|
-
default: '300px'
|
30
|
+
&:hover .dropdown-content {
|
31
|
+
${props=>props.openingMode=='hover'?"display:block":""}
|
32
|
+
}
|
33
|
+
& .openDropdown{
|
34
|
+
${props=>props.openingMode=='click'?"display:block !important":""}
|
35
|
+
}
|
36
|
+
`
|
37
|
+
const WrapperDropdown = styled('div', wrapperAttrs)`
|
38
|
+
margin-top: 0;
|
39
|
+
display: none;
|
40
|
+
position: absolute;
|
41
|
+
z-index: 1;
|
42
|
+
${(props) => props.justify=="right"?"right:0;":""}
|
43
|
+
`
|
44
|
+
const DropdownWindow = styled('div', wrapperAttrs)`
|
45
|
+
width: ${(props) => props.width};
|
46
|
+
background-color: ${(props) => props.theme.colors[props.backgroundColor] || props.backgroundColor};
|
47
|
+
margin-top: ${(props) => props.gap};
|
48
|
+
border-radius: 4px;
|
49
|
+
position: relative;
|
50
|
+
min-width: 160px;
|
51
|
+
box-shadow: -1px 0px 5px rgba(0, 0, 0, 0.302);
|
52
|
+
z-index: 1;
|
53
|
+
`
|
54
|
+
|
55
|
+
const WrapperButton = styled('div', wrapperAttrs)`
|
56
|
+
display: inline-block;
|
57
|
+
`
|
58
|
+
|
59
|
+
export default {
|
60
|
+
name: 'DropdownComponent',
|
61
|
+
components: {
|
62
|
+
WrapperDropdown,
|
63
|
+
WrapperButton,
|
64
|
+
Wrapper,
|
65
|
+
DropdownWindow
|
90
66
|
},
|
91
|
-
|
92
|
-
|
93
|
-
|
67
|
+
props: {
|
68
|
+
width: {
|
69
|
+
required: false,
|
70
|
+
default: '300px'
|
71
|
+
},
|
72
|
+
gap: {
|
73
|
+
required: false,
|
74
|
+
default: '10px'
|
75
|
+
},
|
76
|
+
position: {
|
77
|
+
required: false,
|
78
|
+
default: 'bottom'
|
79
|
+
},
|
80
|
+
justify: {
|
81
|
+
required: false,
|
82
|
+
default: 'left'
|
83
|
+
},
|
84
|
+
openingMode: {
|
85
|
+
required: false,
|
86
|
+
default: 'hover'
|
87
|
+
},
|
88
|
+
backgroundColor: {
|
89
|
+
required: false,
|
90
|
+
default: 'white'
|
91
|
+
}
|
94
92
|
},
|
95
|
-
|
96
|
-
|
97
|
-
|
93
|
+
data() {
|
94
|
+
return {
|
95
|
+
isOpenByClick:false
|
96
|
+
}
|
98
97
|
},
|
99
|
-
|
100
|
-
|
101
|
-
|
98
|
+
methods:{
|
99
|
+
clickOutside(event) {
|
100
|
+
if (this.openingMode!="click") return
|
101
|
+
if (
|
102
|
+
this.$refs.dropdown.$el == event.target ||
|
103
|
+
this.$refs.dropdown.$el.contains(event.target)
|
104
|
+
) {
|
105
|
+
return
|
106
|
+
} else {
|
107
|
+
this.isOpenByClick=false
|
108
|
+
}
|
109
|
+
},
|
102
110
|
},
|
103
|
-
|
104
|
-
|
105
|
-
|
111
|
+
mounted() {
|
112
|
+
document.addEventListener('click', this.clickOutside)
|
113
|
+
},
|
114
|
+
beforeDestroy() {
|
115
|
+
document.removeEventListener('click', this.clickOutside)
|
106
116
|
},
|
107
|
-
backgroundColor: {
|
108
|
-
required: false,
|
109
|
-
default: 'white'
|
110
|
-
}
|
111
|
-
},
|
112
|
-
data() {
|
113
|
-
return {
|
114
|
-
isOpenByClick: false
|
115
|
-
}
|
116
|
-
},
|
117
|
-
methods: {
|
118
|
-
clickOutside(event) {
|
119
|
-
if (this.openingMode != 'click') return
|
120
|
-
if (
|
121
|
-
this.$refs.dropdown &&
|
122
|
-
(this.$refs.dropdown.$el == event.target ||
|
123
|
-
this.$refs.dropdown.$el.contains(event.target))
|
124
|
-
) {
|
125
|
-
return
|
126
|
-
} else {
|
127
|
-
this.isOpenByClick = false
|
128
|
-
}
|
129
|
-
}
|
130
|
-
},
|
131
|
-
mounted() {
|
132
|
-
document.addEventListener('click', this.clickOutside)
|
133
|
-
},
|
134
|
-
beforeDestroy() {
|
135
|
-
document.removeEventListener('click', this.clickOutside)
|
136
117
|
}
|
137
|
-
|
138
|
-
|
118
|
+
</script>
|
119
|
+
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<template>
|
2
2
|
<component-wrapper>
|
3
|
-
<text-overlay
|
3
|
+
<text-overlay>
|
4
4
|
<slot></slot>
|
5
5
|
</text-overlay>
|
6
6
|
</component-wrapper>
|
@@ -11,11 +11,11 @@
|
|
11
11
|
//To use:
|
12
12
|
// <error-message />
|
13
13
|
|
14
|
-
import styled from '
|
14
|
+
import styled from 'vue-styled-components'
|
15
15
|
|
16
|
-
const TextOverlay = styled
|
16
|
+
const TextOverlay = styled.div`
|
17
17
|
position: absolute;
|
18
|
-
top: calc(100% +
|
18
|
+
top: calc(100% + 13px);
|
19
19
|
background: ${(props) => props.theme.colors.red};
|
20
20
|
padding: 10px;
|
21
21
|
width: max-content;
|
@@ -50,12 +50,7 @@ export default {
|
|
50
50
|
TextOverlay,
|
51
51
|
ComponentWrapper
|
52
52
|
},
|
53
|
-
props: {
|
54
|
-
marginTop: {
|
55
|
-
required: true,
|
56
|
-
default: '13px'
|
57
|
-
}
|
58
|
-
},
|
53
|
+
props: {},
|
59
54
|
methods: {},
|
60
55
|
data() {
|
61
56
|
return {}
|