@eturnity/eturnity_reusable_components 6.33.1-EPDM-7956 → 6.33.1-EPDM-7762.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 +18 -15
- package/src/App.vue +2 -2
- package/src/assets/theme.js +3 -3
- package/src/components/addNewButton/index.vue +1 -1
- 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 -1
- package/src/components/deleteIcon/index.vue +1 -1
- package/src/components/dropdown/index.vue +110 -129
- package/src/components/errorMessage/index.vue +1 -1
- package/src/components/icon/iconCollection.vue +2 -2
- package/src/components/icon/index.vue +42 -36
- package/src/components/iconWrapper/index.vue +1 -1
- package/src/components/infoText/index.vue +6 -2
- package/src/components/inputs/checkbox/index.vue +1 -1
- package/src/components/inputs/inputNumber/index.vue +2 -1
- 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 +1 -1
- package/src/components/inputs/select/index.vue +28 -22
- package/src/components/inputs/select/option/index.vue +1 -1
- package/src/components/inputs/slider/index.vue +1 -1
- package/src/components/inputs/switchField/index.vue +1 -1
- package/src/components/inputs/textAreaInput/index.vue +1 -1
- package/src/components/inputs/toggle/index.vue +1 -1
- package/src/components/modals/modal/index.vue +1 -1
- package/src/components/pageSubtitle/index.vue +1 -1
- package/src/components/pageTitle/index.vue +1 -1
- package/src/components/pagination/index.vue +12 -12
- package/src/components/progressBar/index.vue +1 -1
- package/src/components/projectMarker/index.vue +1 -1
- package/src/components/spinner/index.vue +1 -1
- package/src/components/tableDropdown/index.vue +4 -4
- package/src/components/tables/mainTable/exampleNested.vue +1 -1
- package/src/components/tables/mainTable/index.vue +1 -1
- package/src/components/tables/viewTable/index.vue +3 -3
- package/src/components/threeDots/index.vue +1 -1
- package/src/components/videoThumbnail/index.vue +100 -95
- package/src/main.js +9 -4
package/.storybook/preview.js
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@eturnity/eturnity_reusable_components",
|
3
|
-
"version": "6.33.1-EPDM-
|
3
|
+
"version": "6.33.1-EPDM-7762.0",
|
4
4
|
"private": false,
|
5
5
|
"scripts": {
|
6
6
|
"dev": "vue-cli-service serve",
|
@@ -10,24 +10,27 @@
|
|
10
10
|
"build-storybook": "build-storybook"
|
11
11
|
},
|
12
12
|
"dependencies": {
|
13
|
-
"@storybook/vue3": "^7.0.18",
|
14
|
-
"@vue/compat": "^3.3.4",
|
15
13
|
"@vueform/slider": "1.0.5",
|
16
|
-
"
|
14
|
+
"core-js": "^3.31.1",
|
17
15
|
"html-loader": "0.5.5",
|
18
16
|
"v-click-outside": "2.1.4",
|
19
|
-
"vue": "
|
20
|
-
"
|
17
|
+
"vue": "2.6.11",
|
18
|
+
"vue-styled-components": "1.6.0"
|
21
19
|
},
|
22
20
|
"devDependencies": {
|
23
|
-
"@
|
24
|
-
"@
|
25
|
-
"@
|
26
|
-
"@
|
27
|
-
"@vue
|
28
|
-
"@vue/
|
29
|
-
"eslint": "
|
30
|
-
"
|
21
|
+
"@storybook/addon-actions": "6.2.8",
|
22
|
+
"@storybook/addon-docs": "6.4.19",
|
23
|
+
"@storybook/addon-essentials": "6.2.8",
|
24
|
+
"@storybook/addon-links": "6.2.8",
|
25
|
+
"@storybook/vue": "6.4.19",
|
26
|
+
"@vue/cli-plugin-babel": "~4.5.0",
|
27
|
+
"@vue/cli-plugin-eslint": "~4.5.0",
|
28
|
+
"@vue/cli-service": "~4.5.0",
|
29
|
+
"@vue/composition-api": "1.0.0-rc.10",
|
30
|
+
"babel-eslint": "10.1.0",
|
31
|
+
"eslint": "6.7.2",
|
32
|
+
"eslint-plugin-vue": "6.2.2",
|
33
|
+
"vue-template-compiler": "2.6.11"
|
31
34
|
},
|
32
35
|
"eslintConfig": {
|
33
36
|
"root": true,
|
@@ -39,7 +42,7 @@
|
|
39
42
|
"eslint:recommended"
|
40
43
|
],
|
41
44
|
"parserOptions": {
|
42
|
-
"parser": "
|
45
|
+
"parser": "babel-eslint"
|
43
46
|
},
|
44
47
|
"rules": {}
|
45
48
|
},
|
package/src/App.vue
CHANGED
@@ -94,9 +94,9 @@
|
|
94
94
|
</template>
|
95
95
|
|
96
96
|
<script>
|
97
|
-
import { ThemeProvider } from '
|
97
|
+
import { ThemeProvider } from 'vue-styled-components'
|
98
98
|
import theme from './assets/theme'
|
99
|
-
import styled from '
|
99
|
+
import styled from 'vue-styled-components'
|
100
100
|
import InputNumber from '@/components/inputs/inputNumber'
|
101
101
|
import Select from '@/components/inputs/select'
|
102
102
|
import SwitchField from '@/components/inputs/switchField'
|
package/src/assets/theme.js
CHANGED
@@ -3,7 +3,7 @@ const theme = {
|
|
3
3
|
primary: '#48a2d0',
|
4
4
|
secondary: '#fdb813',
|
5
5
|
tertiary: '#d5d5d5',
|
6
|
-
black: '#
|
6
|
+
black: '#263238',
|
7
7
|
yellow: '#fdb813',
|
8
8
|
darkGray: '#818181',
|
9
9
|
gray1: '#666',
|
@@ -20,8 +20,8 @@ const theme = {
|
|
20
20
|
grey5: '#fafafa',
|
21
21
|
grey6: '#555d61',
|
22
22
|
green: '#99db0c',
|
23
|
-
transparentWhite1:'#ffffff32',
|
24
|
-
transparentBlack1:'#263238e6',
|
23
|
+
transparentWhite1: '#ffffff32',
|
24
|
+
transparentBlack1: '#263238e6',
|
25
25
|
disabled: '#dfe1e1',
|
26
26
|
eturnityGrey: '#263238'
|
27
27
|
},
|
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
<script>
|
10
10
|
// import AddNewButton from "@eturnity/eturnity_reusable_components/src/components/addNewButton"
|
11
|
-
import styled from "
|
11
|
+
import styled from "vue-styled-components"
|
12
12
|
|
13
13
|
const pageAttrs = { shouldPosition: Boolean }
|
14
14
|
const PageContainer = styled("div", pageAttrs)`
|
@@ -19,7 +19,7 @@
|
|
19
19
|
<script>
|
20
20
|
// To use:
|
21
21
|
// <delete-icon @click.native="onDeleteItem(item)" :isDisabled="true" />
|
22
|
-
import styled from "
|
22
|
+
import styled from "vue-styled-components"
|
23
23
|
|
24
24
|
const wrapperAttrs = { isDisabled: Boolean }
|
25
25
|
const Wrapper = styled("div", wrapperAttrs)`
|
@@ -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
|
+
|
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
<script>
|
18
18
|
import icon from './index.vue'
|
19
|
-
import styled from '
|
19
|
+
import styled from 'vue-styled-components'
|
20
20
|
|
21
21
|
const Wrapper = styled.div`
|
22
22
|
display: block;
|
@@ -36,7 +36,7 @@ const IconWrapper = styled.div`
|
|
36
36
|
margin: 10px;
|
37
37
|
`
|
38
38
|
export default {
|
39
|
-
name: '
|
39
|
+
name: 'collection',
|
40
40
|
components: { icon, IconWrapper, Wrapper },
|
41
41
|
props: {
|
42
42
|
size: { required: false },
|
@@ -1,12 +1,18 @@
|
|
1
1
|
<template>
|
2
2
|
<Wrapper :isDisabled="disabled" :size="size" :cursor="cursor">
|
3
|
-
<
|
4
|
-
|
5
|
-
|
3
|
+
<icon-image
|
4
|
+
:disabled="disabled"
|
5
|
+
:size="size"
|
6
|
+
:color="color"
|
7
|
+
:hoveredColor="hoveredColor"
|
8
|
+
v-html="
|
9
|
+
require(`!html-loader!./../../assets/svgIcons/${name.toLowerCase()}.svg`)
|
10
|
+
"
|
11
|
+
></icon-image>
|
6
12
|
</Wrapper>
|
7
13
|
</template>
|
8
14
|
|
9
|
-
<script
|
15
|
+
<script>
|
10
16
|
// import Icon from "@eturnity/eturnity_reusable_components/src/components/icon"
|
11
17
|
// How to use:
|
12
18
|
//<icon
|
@@ -17,8 +23,8 @@
|
|
17
23
|
// cursor="default"
|
18
24
|
// />
|
19
25
|
|
20
|
-
import
|
21
|
-
|
26
|
+
import styled from 'vue-styled-components'
|
27
|
+
|
22
28
|
const wrapperAttrs = { isDisabled: Boolean, size: String, cursor: String }
|
23
29
|
const Wrapper = styled('div', wrapperAttrs)`
|
24
30
|
display: flex;
|
@@ -46,37 +52,37 @@ const IconImage = styled('div', IconImageProps)`
|
|
46
52
|
}
|
47
53
|
`
|
48
54
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
name: {
|
55
|
-
required: true
|
56
|
-
},
|
57
|
-
color: {
|
58
|
-
required: false
|
59
|
-
},
|
60
|
-
hoveredColor: {
|
61
|
-
required: false
|
55
|
+
export default {
|
56
|
+
name: 'icon',
|
57
|
+
components: {
|
58
|
+
IconImage,
|
59
|
+
Wrapper
|
62
60
|
},
|
63
|
-
|
64
|
-
|
65
|
-
|
61
|
+
props: {
|
62
|
+
disabled: {
|
63
|
+
required: false,
|
64
|
+
default: false
|
65
|
+
},
|
66
|
+
name: {
|
67
|
+
required: true
|
68
|
+
},
|
69
|
+
color: {
|
70
|
+
required: false
|
71
|
+
},
|
72
|
+
hoveredColor: {
|
73
|
+
required: false
|
74
|
+
},
|
75
|
+
size: {
|
76
|
+
required: false,
|
77
|
+
default: '30px'
|
78
|
+
},
|
79
|
+
cursor: {
|
80
|
+
required: false,
|
81
|
+
default: null
|
82
|
+
}
|
66
83
|
},
|
67
|
-
|
68
|
-
|
69
|
-
default: null
|
84
|
+
data() {
|
85
|
+
return {}
|
70
86
|
}
|
71
|
-
}
|
72
|
-
|
73
|
-
const svgIconsContext = import.meta.glob('../../assets/svgIcons/*.svg', {
|
74
|
-
as: 'raw'
|
75
|
-
})
|
76
|
-
|
77
|
-
const svgIconModule = computed(() => {
|
78
|
-
const moduleKey = `../../assets/svgIcons/${props.name}.svg`
|
79
|
-
|
80
|
-
return svgIconsContext[moduleKey]
|
81
|
-
})
|
87
|
+
}
|
82
88
|
</script>
|
@@ -34,7 +34,7 @@
|
|
34
34
|
// size="60px" by default, this is 30px
|
35
35
|
// />
|
36
36
|
|
37
|
-
import styled from '
|
37
|
+
import styled from 'vue-styled-components'
|
38
38
|
import icon from '../icon'
|
39
39
|
const wrapperAttrs = { isHovered:Boolean,borderRadius:String,disabled: Boolean, size: String,backgroundColor:String,hoveredBackgroundColor:String }
|
40
40
|
const Wrapper = styled('div', wrapperAttrs)`
|
@@ -32,7 +32,7 @@
|
|
32
32
|
// alignArrow="right" // which side the arrow should be on
|
33
33
|
// />
|
34
34
|
import theme from '../../assets/theme.js'
|
35
|
-
import styled from '
|
35
|
+
import styled from 'vue-styled-components'
|
36
36
|
import icon from '../icon'
|
37
37
|
|
38
38
|
const textAttrs = {
|
@@ -156,7 +156,11 @@ export default {
|
|
156
156
|
},
|
157
157
|
computed: {
|
158
158
|
iconColor() {
|
159
|
-
return
|
159
|
+
return this.isActive
|
160
|
+
? this.borderColor
|
161
|
+
? this.borderColor
|
162
|
+
: theme.colors.secondary
|
163
|
+
: theme.colors.mediumGray
|
160
164
|
},
|
161
165
|
halfComputedTextInfoWidth() {
|
162
166
|
return parseInt(this.width) / 2
|
@@ -48,6 +48,7 @@
|
|
48
48
|
:fontSize="fontSize"
|
49
49
|
:fontColor="fontColor"
|
50
50
|
:backgroundColor="backgroundColor"
|
51
|
+
v-on="$listeners"
|
51
52
|
:hasSlot="hasSlot"
|
52
53
|
:hasLabelSlot="hasLabelSlot"
|
53
54
|
:slotSize="slotSize"
|
@@ -97,7 +98,7 @@
|
|
97
98
|
// :minNumber="0"
|
98
99
|
// fontColor="blue"
|
99
100
|
// />
|
100
|
-
import styled from '
|
101
|
+
import styled from 'vue-styled-components'
|
101
102
|
import {
|
102
103
|
stringToNumber,
|
103
104
|
numberToString
|
@@ -59,7 +59,7 @@
|
|
59
59
|
</template>
|
60
60
|
|
61
61
|
<script>
|
62
|
-
import styled from '
|
62
|
+
import styled from 'vue-styled-components'
|
63
63
|
import InfoText from '../../infoText'
|
64
64
|
import Icon from '../../icon'
|
65
65
|
import ErrorMessage from '../../errorMessage'
|
@@ -313,8 +313,8 @@ export default {
|
|
313
313
|
}
|
314
314
|
},
|
315
315
|
methods: {
|
316
|
-
onChangeHandler(event) {
|
317
|
-
this.$emit('input-change', event
|
316
|
+
onChangeHandler($event) {
|
317
|
+
this.$emit('input-change', $event)
|
318
318
|
},
|
319
319
|
onInputBlur($event) {
|
320
320
|
this.$emit('input-blur', $event.target.value)
|
@@ -14,11 +14,9 @@
|
|
14
14
|
labelFontColor || colorMode == 'dark' ? 'white' : 'eturnityGrey'
|
15
15
|
"
|
16
16
|
:fontSize="fontSize"
|
17
|
-
>{{ label }}
|
18
|
-
|
19
|
-
|
20
|
-
>
|
21
|
-
</input-label>
|
17
|
+
>{{ label }} <optionalLabel v-if="labelOptional"> ({{ $gettext('Optional') }})</optionalLabel>
|
18
|
+
</input-label
|
19
|
+
>
|
22
20
|
<info-text
|
23
21
|
v-if="infoTextMessage"
|
24
22
|
:text="infoTextMessage"
|
@@ -131,7 +129,7 @@
|
|
131
129
|
// </template>
|
132
130
|
// </Select>
|
133
131
|
|
134
|
-
import styled from '
|
132
|
+
import styled from 'vue-styled-components'
|
135
133
|
import InfoText from '../../infoText'
|
136
134
|
import icon from '../../icon'
|
137
135
|
import inputText from '../inputText'
|
@@ -164,6 +162,7 @@ const InputLabel = styled('div', labelAttrs)`
|
|
164
162
|
`
|
165
163
|
const optionalLabel = styled.span`
|
166
164
|
font-weight: 300;
|
165
|
+
|
167
166
|
`
|
168
167
|
const inputProps = { selectWidth: String, optionWidth: String }
|
169
168
|
const Container = styled('div', inputProps)`
|
@@ -199,7 +198,8 @@ const selectButton = styled('div', selectButtonAttrs)`
|
|
199
198
|
position: relative;
|
200
199
|
box-sizing: border-box;
|
201
200
|
border-radius: 4px;
|
202
|
-
padding: ${(props) =>
|
201
|
+
padding: ${(props) =>
|
202
|
+
props.isSearchBarVisible ? '0' : '0px 0px 0 15px'};
|
203
203
|
text-align: left;
|
204
204
|
border-radius: 4px;
|
205
205
|
min-height: 36px;
|
@@ -427,7 +427,9 @@ export default {
|
|
427
427
|
const optionElement = this.$el.querySelector(`[data-value="${e}"]`)
|
428
428
|
if (this.$refs.dropdown) {
|
429
429
|
this.hoveredIndex =
|
430
|
-
|
430
|
+
this.$refs.dropdown.$children
|
431
|
+
.map((component) => component.$el)
|
432
|
+
.indexOf(optionElement) + 1
|
431
433
|
}
|
432
434
|
},
|
433
435
|
mouseEnterHandler() {
|
@@ -444,13 +446,15 @@ export default {
|
|
444
446
|
searchChange(value) {
|
445
447
|
this.textSearch = value
|
446
448
|
this.$emit('search-change', value)
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
449
|
+
this.$refs.dropdown.$children
|
450
|
+
.map((component) => component.$el)
|
451
|
+
.forEach((el) => {
|
452
|
+
if (!el.textContent.toLowerCase().includes(value.toLowerCase())) {
|
453
|
+
el.style.display = 'none'
|
454
|
+
} else {
|
455
|
+
el.style.display = 'inherit'
|
456
|
+
}
|
457
|
+
})
|
454
458
|
},
|
455
459
|
onSelectSlotClick() {
|
456
460
|
this.toggleDropdown()
|
@@ -472,9 +476,10 @@ export default {
|
|
472
476
|
} else if (e.key == 'ArrowUp') {
|
473
477
|
this.onArrowPress(-1)
|
474
478
|
} else if (e.key == 'Enter') {
|
475
|
-
const optionHoveredComponent =
|
476
|
-
|
477
|
-
|
479
|
+
const optionHoveredComponent =
|
480
|
+
this.$refs.dropdown.$children[
|
481
|
+
(this.hoveredIndex - 1 + this.optionLength) % this.optionLength
|
482
|
+
]
|
478
483
|
this.optionSelected(optionHoveredComponent.$el.dataset.value)
|
479
484
|
}
|
480
485
|
},
|
@@ -483,9 +488,10 @@ export default {
|
|
483
488
|
((this.hoveredIndex + dir + this.optionLength - 1) %
|
484
489
|
this.optionLength) +
|
485
490
|
1
|
486
|
-
const optionHoveredComponent =
|
487
|
-
|
488
|
-
|
491
|
+
const optionHoveredComponent =
|
492
|
+
this.$refs.dropdown.$children[
|
493
|
+
(this.hoveredIndex - 1 + this.optionLength) % this.optionLength
|
494
|
+
]
|
489
495
|
const topPos = optionHoveredComponent.$el.offsetTop
|
490
496
|
this.$refs.dropdown.$el.scrollTop = topPos
|
491
497
|
}
|
@@ -493,7 +499,7 @@ export default {
|
|
493
499
|
computed: {
|
494
500
|
optionLength() {
|
495
501
|
if (this.isDropdownOpen) {
|
496
|
-
return this.$refs.dropdown.$
|
502
|
+
return this.$refs.dropdown.$children.length
|
497
503
|
} else {
|
498
504
|
return 0
|
499
505
|
}
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<script>
|
8
8
|
// import selectButton from './selectButton'
|
9
9
|
// import selectDropdown from './selectDropDown'
|
10
|
-
import styled from '
|
10
|
+
import styled from 'vue-styled-components'
|
11
11
|
const optionProps={hoveredBgColor:String}
|
12
12
|
const optionContainer = styled('div',optionProps)`
|
13
13
|
display:flex;
|
@@ -22,7 +22,7 @@
|
|
22
22
|
// :maxValue="500" //default is 100 if not specified
|
23
23
|
// />
|
24
24
|
import Slider from "@vueform/slider/dist/slider.vue2.js"
|
25
|
-
import styled from "
|
25
|
+
import styled from "vue-styled-components"
|
26
26
|
|
27
27
|
const Container = styled.div`
|
28
28
|
margin: 16px 0 16px 21px;
|
@@ -21,7 +21,7 @@
|
|
21
21
|
// color="red"
|
22
22
|
// infoText="My info text"
|
23
23
|
// />
|
24
|
-
import styled from "
|
24
|
+
import styled from "vue-styled-components"
|
25
25
|
import InfoText from "../infoText"
|
26
26
|
|
27
27
|
const textAttrs = { color: String, hasInfoText: Boolean, marginBottom: String }
|
@@ -9,7 +9,7 @@
|
|
9
9
|
// text="My Page Title"
|
10
10
|
// color="red"
|
11
11
|
// />
|
12
|
-
import styled from "
|
12
|
+
import styled from "vue-styled-components"
|
13
13
|
|
14
14
|
const textAttrs = { color: String, fontSize: String, uppercase: Boolean }
|
15
15
|
const TitleText = styled("div", textAttrs)`
|
@@ -11,17 +11,17 @@
|
|
11
11
|
</arrowIconContainer>
|
12
12
|
<arrowText>{{ $gettext('back') }}</arrowText>
|
13
13
|
</paginationLink>
|
14
|
-
|
14
|
+
|
15
15
|
<!-- First page -->
|
16
16
|
<paginationLink
|
17
17
|
v-if="currentPage > 2 && paginationParams.pages > 3"
|
18
18
|
@click="fetchPage(1)"
|
19
19
|
>1</paginationLink
|
20
20
|
>
|
21
|
-
|
21
|
+
|
22
22
|
<!-- Back tree dots -->
|
23
23
|
<span v-if="currentPage > 3 && paginationParams.pages > 4">...</span>
|
24
|
-
|
24
|
+
|
25
25
|
<!-- Current block -->
|
26
26
|
<paginationLink
|
27
27
|
v-for="number in paginationNumbers()"
|
@@ -30,7 +30,7 @@
|
|
30
30
|
@click="fetchPage(number)"
|
31
31
|
>{{ number }}</paginationLink
|
32
32
|
>
|
33
|
-
|
33
|
+
|
34
34
|
<!-- Forward tree dots -->
|
35
35
|
<span
|
36
36
|
v-if="
|
@@ -38,7 +38,7 @@
|
|
38
38
|
"
|
39
39
|
>...</span
|
40
40
|
>
|
41
|
-
|
41
|
+
|
42
42
|
<!-- End page -->
|
43
43
|
<paginationLink
|
44
44
|
v-if="
|
@@ -47,7 +47,7 @@
|
|
47
47
|
@click="fetchPage(paginationParams.pages)"
|
48
48
|
>{{ paginationParams.pages }}</paginationLink
|
49
49
|
>
|
50
|
-
|
50
|
+
|
51
51
|
<!-- Forward button -->
|
52
52
|
<paginationLink
|
53
53
|
v-if="paginationParams.next"
|
@@ -60,12 +60,11 @@
|
|
60
60
|
</paginationLink>
|
61
61
|
</paginationWrapper>
|
62
62
|
</template>
|
63
|
-
|
64
|
-
<script>
|
65
|
-
import styled from "
|
66
|
-
import icon from "../icon"
|
67
|
-
|
68
|
-
const paginationWrapper=styled.nav`
|
63
|
+
|
64
|
+
<script>
|
65
|
+
import styled from "vue-styled-components"
|
66
|
+
import icon from "../icon"
|
67
|
+
const paginationWrapper=styled.nav`
|
69
68
|
color: #1a237e;
|
70
69
|
font-size: 13px;
|
71
70
|
display: -webkit-box;
|
@@ -135,3 +134,4 @@ const paginationWrapper=styled.nav`
|
|
135
134
|
}
|
136
135
|
}
|
137
136
|
</script>
|
137
|
+
|
@@ -18,7 +18,7 @@
|
|
18
18
|
<script>
|
19
19
|
// import Spinner from "@eturnity/eturnity_reusable_components/src/components/spinner"
|
20
20
|
// <spinner size="30px" />
|
21
|
-
import styled from '
|
21
|
+
import styled from 'vue-styled-components'
|
22
22
|
|
23
23
|
const SpinnerContainer = styled.div`
|
24
24
|
position: fixed;
|
@@ -186,10 +186,10 @@
|
|
186
186
|
// :optionsDisplay="['display_name', 'company_item_number']" // Array. what should be displayed
|
187
187
|
// :disabled="true"
|
188
188
|
// />
|
189
|
-
import styled from '
|
190
|
-
import Spinner from '
|
191
|
-
import SearchInput from '
|
192
|
-
import InputText from '
|
189
|
+
import styled from 'vue-styled-components'
|
190
|
+
import Spinner from '@eturnity/eturnity_reusable_components/src/components/spinner'
|
191
|
+
import SearchInput from '@eturnity/eturnity_reusable_components/src/components/inputs/searchInput'
|
192
|
+
import InputText from '@eturnity/eturnity_reusable_components/src/components/inputs/inputText'
|
193
193
|
|
194
194
|
const rowAttrs = { disabled: Boolean, isOpen: Boolean }
|
195
195
|
const DropdownRow = styled('div', rowAttrs)`
|
@@ -161,7 +161,7 @@
|
|
161
161
|
|
162
162
|
<script>
|
163
163
|
import draggable from "vuedraggable"
|
164
|
-
import styled from "
|
164
|
+
import styled from "vue-styled-components"
|
165
165
|
import MainTable from "@/components/reusable-components/tables/MainTable"
|
166
166
|
import InputText from "@eturnity/eturnity_reusable_components/src/components/inputs/inputText"
|
167
167
|
import DeleteIcon from "@/components/reusable-components/DeleteIcon"
|
@@ -23,7 +23,7 @@
|
|
23
23
|
<script>
|
24
24
|
// ToDo: add this to storybook
|
25
25
|
// import MainTable from "@eturnity/eturnity_reusable_components/src/components/tables/mainTable"
|
26
|
-
import styled from '
|
26
|
+
import styled from 'vue-styled-components'
|
27
27
|
import Spinner from '../../spinner'
|
28
28
|
|
29
29
|
const PageContainer = styled.div``
|
@@ -45,9 +45,9 @@
|
|
45
45
|
// This is a read only table. Pass it data, and it displays it
|
46
46
|
// ToDo: add this to storybook
|
47
47
|
// import ViewTable from "@eturnity/eturnity_reusable_components/src/components/tables/viewTable"
|
48
|
-
import styled from
|
49
|
-
import DeleteIcon from
|
50
|
-
import Spinner from
|
48
|
+
import styled from 'vue-styled-components'
|
49
|
+
import DeleteIcon from '../../deleteIcon'
|
50
|
+
import Spinner from '../../spinner'
|
51
51
|
|
52
52
|
const TableScroll = styled.div`
|
53
53
|
position: relative;
|
@@ -1,103 +1,108 @@
|
|
1
1
|
<template>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
//
|
16
|
-
//
|
17
|
-
|
18
|
-
//
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
width:
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
width
|
32
|
-
height
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
2
|
+
<wrapper :width="width" :height="height" :fit="fit">
|
3
|
+
<img :src="src">
|
4
|
+
<iconWrapper>
|
5
|
+
<icon
|
6
|
+
name="play"
|
7
|
+
:size="playIconSize"
|
8
|
+
:color="playIconColor"
|
9
|
+
/>
|
10
|
+
</iconWrapper>
|
11
|
+
</wrapper>
|
12
|
+
</template>
|
13
|
+
|
14
|
+
<script>
|
15
|
+
// import VideoThumbnail from "@eturnity/eturnity_reusable_components/src/components/videoThumbnail"
|
16
|
+
// How to use:
|
17
|
+
//<videoThumbnail src="https://musicart.xboxlive.com/6/cfaf1e9d-0000-0000-0000-000000000009/504/image.jpg?w=1920&h=1080"
|
18
|
+
// playIconColor="red"
|
19
|
+
// playIconSize="20px"
|
20
|
+
// width="400px"
|
21
|
+
// height="600px"
|
22
|
+
// />
|
23
|
+
|
24
|
+
import styled from 'vue-styled-components'
|
25
|
+
import Icon from '../icon'
|
26
|
+
|
27
|
+
const wrapperAttrs = { width: String, height:String,fit:String }
|
28
|
+
const Wrapper = styled('div', wrapperAttrs)`
|
29
|
+
display: inline-block;
|
30
|
+
position: relative;
|
31
|
+
width:${props=>props.width};
|
32
|
+
height:${props=>props.height};
|
33
|
+
& img{
|
34
|
+
object-fit:${props=>props.fit};
|
35
|
+
width:${props=>props.width};
|
36
|
+
height:${props=>props.height};
|
37
|
+
}
|
38
|
+
`
|
39
|
+
const iconWrapper = styled('div')`
|
40
|
+
position: absolute;
|
41
|
+
top:0;
|
42
|
+
bottom:0;
|
43
|
+
left:0;
|
44
|
+
right:0;
|
45
|
+
display:flex;
|
46
|
+
justify-content:center;
|
47
|
+
align-items: center;
|
48
|
+
`
|
45
49
|
|
46
|
-
export default {
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
},
|
53
|
-
props: {
|
54
|
-
src: {
|
55
|
-
required: true
|
50
|
+
export default {
|
51
|
+
name: 'VideoThumbnail',
|
52
|
+
components: {
|
53
|
+
Wrapper,
|
54
|
+
Icon,
|
55
|
+
iconWrapper
|
56
56
|
},
|
57
|
-
|
58
|
-
|
59
|
-
|
57
|
+
props: {
|
58
|
+
src:{
|
59
|
+
required: true,
|
60
|
+
},
|
61
|
+
fit:{
|
62
|
+
required: false,
|
63
|
+
default: 'cover'
|
64
|
+
},
|
65
|
+
width: {
|
66
|
+
required: false,
|
67
|
+
default: '300px'
|
68
|
+
},
|
69
|
+
height: {
|
70
|
+
required: false,
|
71
|
+
default: '200px'
|
72
|
+
},
|
73
|
+
playIconSize:{
|
74
|
+
required: false,
|
75
|
+
default: '50px'
|
76
|
+
},
|
77
|
+
playIconColor:{
|
78
|
+
required: false,
|
79
|
+
default: 'blue'
|
80
|
+
}
|
60
81
|
},
|
61
|
-
|
62
|
-
|
63
|
-
|
82
|
+
data() {
|
83
|
+
return {
|
84
|
+
isOpenByClick:false
|
85
|
+
}
|
64
86
|
},
|
65
|
-
|
66
|
-
|
67
|
-
|
87
|
+
methods:{
|
88
|
+
clickOutside(event) {
|
89
|
+
if (this.openingMode!="click") return
|
90
|
+
if (
|
91
|
+
this.$refs.dropdown.$el == event.target ||
|
92
|
+
this.$refs.dropdown.$el.contains(event.target)
|
93
|
+
) {
|
94
|
+
return
|
95
|
+
} else {
|
96
|
+
this.isOpenByClick=false
|
97
|
+
}
|
98
|
+
},
|
68
99
|
},
|
69
|
-
|
70
|
-
|
71
|
-
|
100
|
+
mounted() {
|
101
|
+
document.addEventListener('click', this.clickOutside)
|
102
|
+
},
|
103
|
+
beforeDestroy() {
|
104
|
+
document.removeEventListener('click', this.clickOutside)
|
72
105
|
},
|
73
|
-
playIconColor: {
|
74
|
-
required: false,
|
75
|
-
default: 'blue'
|
76
|
-
}
|
77
|
-
},
|
78
|
-
data() {
|
79
|
-
return {
|
80
|
-
isOpenByClick: false
|
81
|
-
}
|
82
|
-
},
|
83
|
-
methods: {
|
84
|
-
clickOutside(event) {
|
85
|
-
if (this.openingMode != 'click') return
|
86
|
-
if (
|
87
|
-
this.$refs.dropdown.$el == event.target ||
|
88
|
-
this.$refs.dropdown.$el.contains(event.target)
|
89
|
-
) {
|
90
|
-
return
|
91
|
-
} else {
|
92
|
-
this.isOpenByClick = false
|
93
|
-
}
|
94
|
-
}
|
95
|
-
},
|
96
|
-
mounted() {
|
97
|
-
document.addEventListener('click', this.clickOutside)
|
98
|
-
},
|
99
|
-
beforeDestroy() {
|
100
|
-
document.removeEventListener('click', this.clickOutside)
|
101
106
|
}
|
102
|
-
|
103
|
-
|
107
|
+
</script>
|
108
|
+
|
package/src/main.js
CHANGED
@@ -1,8 +1,13 @@
|
|
1
|
+
import Vue from "vue"
|
1
2
|
import App from "./App.vue"
|
3
|
+
import VueCompositionAPI from "@vue/composition-api"
|
4
|
+
import vClickOutside from 'v-click-outside'
|
2
5
|
|
3
|
-
|
6
|
+
Vue.config.productionTip = false
|
4
7
|
|
5
|
-
|
6
|
-
|
7
|
-
app.mount('#app')
|
8
|
+
Vue.use(VueCompositionAPI)
|
9
|
+
Vue.use(vClickOutside)
|
8
10
|
|
11
|
+
new Vue({
|
12
|
+
render: (h) => h(App),
|
13
|
+
}).$mount("#app")
|