@eturnity/eturnity_reusable_components 6.38.0-EDPM-8545.1 → 6.38.0-team-day.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/package.json
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
module.exports = {}
|
package/src/App.vue
CHANGED
@@ -1,122 +1,17 @@
|
|
1
1
|
<template>
|
2
2
|
<ThemeProvider :theme="getTheme()" :style="{ height: '100%' }">
|
3
|
-
|
4
|
-
<br />
|
5
|
-
|
6
|
-
{{ alignItems }}
|
7
|
-
<input-number
|
8
|
-
:value="value"
|
9
|
-
:minNumber="0"
|
10
|
-
unitName="mm"
|
11
|
-
:numberPrecision="0"
|
12
|
-
backgroundColor="transparent"
|
13
|
-
borderColor="eturnityGrey"
|
14
|
-
inputHeight="34px"
|
15
|
-
inputWidth="420px"
|
16
|
-
textAlign="left"
|
17
|
-
:isInteractive="true"
|
18
|
-
:interactionStep="1"
|
19
|
-
@on-input="value = $event"
|
20
|
-
@input-change="changeHandler"
|
21
|
-
@input-focus="focusHandler"
|
22
|
-
@input-blur="blurHandler"
|
23
|
-
>
|
24
|
-
<template v-slot:label>
|
25
|
-
<div>Interactive Label</div>
|
26
|
-
</template>
|
27
|
-
</input-number>
|
28
|
-
|
29
|
-
<dropdown-component openingMode="hover" gap="30px">
|
30
|
-
<template #trigger><i>Click Me</i></template>
|
31
|
-
<template #dropdown>
|
32
|
-
<div>
|
33
|
-
<a href="">test1</a>
|
34
|
-
<button href="">test2</button><br>
|
35
|
-
<p>Text</p>
|
36
|
-
</div>
|
37
|
-
</template>
|
38
|
-
</dropdown-component>
|
39
|
-
|
40
|
-
<videoThumbnail src="https://musicart.xboxlive.com/6/cfaf1e9d-0000-0000-0000-000000000009/504/image.jpg?w=1920&h=1080"
|
41
|
-
playIconColor="red"
|
42
|
-
playIconSize="20px"
|
43
|
-
width="400px"
|
44
|
-
height="600px"
|
45
|
-
/>
|
46
|
-
|
47
|
-
<SwitchField
|
48
|
-
@on-switch-change="onInputChange($event)"
|
49
|
-
:options="[
|
50
|
-
{ value: 0, content: 'zero' },
|
51
|
-
{ value: 1, content: 'one' },
|
52
|
-
{ value: 2, content: 'two' }
|
53
|
-
]"
|
54
|
-
:value="value"
|
55
|
-
label="label"
|
56
|
-
toggleColor="red"
|
57
|
-
size="large"
|
58
|
-
backgroundColor="blue"
|
59
|
-
labelAlign="left"
|
60
|
-
fontColor="black"
|
61
|
-
:disabled="false"
|
62
|
-
/>
|
63
|
-
<icon
|
64
|
-
name="opacity"
|
65
|
-
color="red"
|
66
|
-
hoveredColor="blue"
|
67
|
-
size="60px"
|
68
|
-
cursor="default"
|
69
|
-
isStriked = "true"
|
70
|
-
/>
|
71
|
-
<Select
|
72
|
-
:value="value"
|
73
|
-
selectWidth="100%"
|
74
|
-
optionWidth="50%"
|
75
|
-
label="that is a label"
|
76
|
-
alignItems="vertical"
|
77
|
-
colorMode="dark"
|
78
|
-
isSearchable="true"
|
79
|
-
@input-change="value = $event"
|
80
|
-
@search-change="searchValue = $event"
|
81
|
-
>
|
82
|
-
<template #selector="{ selectedValue }">
|
83
|
-
value selected: {{ selectedValue }}
|
84
|
-
</template>
|
85
|
-
<template #dropdown>
|
86
|
-
<Option
|
87
|
-
v-for="opt in filteredOptionList"
|
88
|
-
:key="opt.id"
|
89
|
-
:value="opt.val"
|
90
|
-
>{{ opt.lookFor }}</Option
|
91
|
-
>
|
92
|
-
</template>
|
93
|
-
</Select>
|
94
|
-
|
95
|
-
|
96
|
-
{{ filteredOptionList }}
|
97
|
-
|
3
|
+
<carousel :slides="slides"></carousel>
|
98
4
|
<iconCollection color="red" />
|
99
|
-
</page-container>
|
100
5
|
</ThemeProvider>
|
101
6
|
</template>
|
102
7
|
|
103
8
|
<script>
|
104
9
|
import { ThemeProvider } from 'vue-styled-components'
|
105
10
|
import theme from './assets/theme'
|
106
|
-
import styled from 'vue-styled-components'
|
107
|
-
import InputNumber from '@/components/inputs/inputNumber'
|
108
|
-
import Select from '@/components/inputs/select'
|
109
|
-
import SwitchField from '@/components/inputs/switchField'
|
110
|
-
import Option from '@/components/inputs/select/option'
|
111
11
|
import iconCollection from '@/components/icon/iconCollection'
|
112
|
-
import
|
113
|
-
import videoThumbnail from '@/components/videoThumbnail'
|
114
|
-
import icon from '@/components/icon'
|
12
|
+
import carousel from '@/components/carousel'
|
115
13
|
// import TableDropdown from "@/components/tableDropdown"
|
116
14
|
|
117
|
-
const PageContainer = styled.div`
|
118
|
-
padding: 40px;
|
119
|
-
`
|
120
15
|
|
121
16
|
// const RowContainer = styled.div`
|
122
17
|
// display: inline-flex;
|
@@ -128,18 +23,15 @@ export default {
|
|
128
23
|
name: 'App',
|
129
24
|
components: {
|
130
25
|
ThemeProvider,
|
131
|
-
PageContainer,
|
132
|
-
InputNumber,
|
133
|
-
Option,
|
134
|
-
Select,
|
135
|
-
SwitchField,
|
136
26
|
iconCollection,
|
137
|
-
|
138
|
-
videoThumbnail,
|
139
|
-
icon
|
27
|
+
carousel
|
140
28
|
},
|
141
29
|
data() {
|
142
30
|
return {
|
31
|
+
slides:[
|
32
|
+
{text:"<div>Hello World</div>",duration:4},
|
33
|
+
{text:"<div>Hello World <hr/>2</div>",duration:5},
|
34
|
+
],
|
143
35
|
value: 42,
|
144
36
|
value2: 42,
|
145
37
|
companyName: 'toto',
|
@@ -5,7 +5,6 @@
|
|
5
5
|
:minWidth="minWidth"
|
6
6
|
:isDisabled="isDisabled"
|
7
7
|
:customColor="customColor"
|
8
|
-
:noWrap="noWrap"
|
9
8
|
>
|
10
9
|
{{ text }}
|
11
10
|
</button-container>
|
@@ -27,7 +26,7 @@ import styled from "vue-styled-components"
|
|
27
26
|
|
28
27
|
const PageContainer = styled.div``
|
29
28
|
|
30
|
-
const ButtonAttrs = { type: String, isDisabled: Boolean, minWidth: String, customColor: String
|
29
|
+
const ButtonAttrs = { type: String, isDisabled: Boolean, minWidth: String, customColor: String }
|
31
30
|
const ButtonContainer = styled("div", ButtonAttrs)`
|
32
31
|
padding: 7px 15px;
|
33
32
|
font-size: 13px;
|
@@ -49,7 +48,6 @@ const ButtonContainer = styled("div", ButtonAttrs)`
|
|
49
48
|
cursor: ${(props) => (props.isDisabled ? "not-allowed" : "pointer")};
|
50
49
|
user-select: none;
|
51
50
|
${(props) => (props.minWidth ? `min-width: ${props.minWidth};` : '')};
|
52
|
-
${(props) => (props.noWrap ? `white-space: nowrap;` : '')};
|
53
51
|
|
54
52
|
&:hover {
|
55
53
|
opacity: ${(props) => (props.isDisabled ? "1" : "0.8")};
|
@@ -82,10 +80,6 @@ export default {
|
|
82
80
|
required: false,
|
83
81
|
default: null,
|
84
82
|
},
|
85
|
-
noWrap: {
|
86
|
-
required: false,
|
87
|
-
default: false
|
88
|
-
},
|
89
83
|
minWidth: {
|
90
84
|
required: false,
|
91
85
|
default: null
|
@@ -0,0 +1,173 @@
|
|
1
|
+
<template>
|
2
|
+
<sliderContainer :backgroundColor="backgroundColor">
|
3
|
+
<transition-group tag="div" :name="transitionName">
|
4
|
+
<!-- <div v-for='( slide, index ) in slides' :key="index+1" @click="cancelTimeout()"> -->
|
5
|
+
<div :key="current" @click="cancelTimeout()" class="slide">
|
6
|
+
<slide :show='true || current==index' :content="currentSlide.text"></slide>
|
7
|
+
</div>
|
8
|
+
</transition-group>
|
9
|
+
<slideSelector>
|
10
|
+
<roundSlideSelector v-for="(slide,index) in slides" :key="index" :class="{'active':current==index}" @click="gotoSlide(index)"></roundSlideSelector>
|
11
|
+
</slideSelector>
|
12
|
+
</sliderContainer>
|
13
|
+
</template>
|
14
|
+
|
15
|
+
<script>
|
16
|
+
import slide from './slide.vue'
|
17
|
+
import styled from 'vue-styled-components'
|
18
|
+
|
19
|
+
const roundSlideSelector=styled.div`
|
20
|
+
padding:3px;
|
21
|
+
border:2px solid lightgrey;
|
22
|
+
margin:20px 10px;
|
23
|
+
border-radius:50%;
|
24
|
+
&.active{
|
25
|
+
background-color:lightgrey;
|
26
|
+
}
|
27
|
+
&:hover{
|
28
|
+
cursor:pointer;
|
29
|
+
background-color:lightgrey;
|
30
|
+
}
|
31
|
+
`
|
32
|
+
const slideSelector=styled.div`
|
33
|
+
position:absolute;
|
34
|
+
display:flex
|
35
|
+
bottom:10px;
|
36
|
+
justify-content: center;
|
37
|
+
align-items: center;
|
38
|
+
width:100%;
|
39
|
+
|
40
|
+
`
|
41
|
+
const sliderContainer=styled('div',{backgroundColor:String})`
|
42
|
+
overflow: hidden;
|
43
|
+
position:relative;
|
44
|
+
width:100%;
|
45
|
+
min-height:300px;
|
46
|
+
background-color:${(props=>props.backgroundColor)}
|
47
|
+
`
|
48
|
+
|
49
|
+
export default {
|
50
|
+
name:'carousel',
|
51
|
+
components:{
|
52
|
+
slide,
|
53
|
+
slideSelector,
|
54
|
+
roundSlideSelector,
|
55
|
+
sliderContainer
|
56
|
+
},
|
57
|
+
props: {
|
58
|
+
slides: {
|
59
|
+
required: true,
|
60
|
+
default: []
|
61
|
+
},
|
62
|
+
backgroundColor: {
|
63
|
+
required: false,
|
64
|
+
default: 'white'
|
65
|
+
}
|
66
|
+
},
|
67
|
+
data() {
|
68
|
+
return{
|
69
|
+
current: 0,
|
70
|
+
direction: 1,
|
71
|
+
transitionName: "fade",
|
72
|
+
timeoutId: null
|
73
|
+
}
|
74
|
+
},
|
75
|
+
computed:{
|
76
|
+
currentSlide(){
|
77
|
+
if(this.slides && this.slides.length){
|
78
|
+
return this.slides[this.current]
|
79
|
+
}
|
80
|
+
return null
|
81
|
+
}
|
82
|
+
},
|
83
|
+
methods: {
|
84
|
+
gotoSlide(slideNumber) {
|
85
|
+
this.direction = Math.sign(this.current-slideNumber);
|
86
|
+
// this.direction === 1
|
87
|
+
// ? (this.transitionName = "slide-next")
|
88
|
+
// : (this.transitionName = "slide-prev");
|
89
|
+
this.current = slideNumber
|
90
|
+
this.transitionName = "slide-next"
|
91
|
+
},
|
92
|
+
cancelTimeout(){
|
93
|
+
console.log('cancel timeOut')
|
94
|
+
if(this.timeoutId){
|
95
|
+
clearTimeout(this.timeoutId)
|
96
|
+
}
|
97
|
+
},
|
98
|
+
startCarousel(){
|
99
|
+
if(this.slides && this.slides.length){
|
100
|
+
this.timeoutId=setTimeout(()=>{this.gotoSlide((this.current+1)%this.slides.length)},this.slides[this.current].duration*1000)
|
101
|
+
}
|
102
|
+
}
|
103
|
+
},
|
104
|
+
mounted() {
|
105
|
+
this.show = true;
|
106
|
+
this.startCarousel()
|
107
|
+
window.focus()
|
108
|
+
window.addEventListener("blur", () => {
|
109
|
+
setTimeout(() => {
|
110
|
+
if (document.activeElement.tagName === "IFRAME") {
|
111
|
+
this.cancelTimeout()
|
112
|
+
}
|
113
|
+
});
|
114
|
+
}, { once: true });
|
115
|
+
|
116
|
+
},
|
117
|
+
beforeDestroy(){
|
118
|
+
this.cancelTimeout()
|
119
|
+
},
|
120
|
+
watch:{
|
121
|
+
current(){
|
122
|
+
this.cancelTimeout()
|
123
|
+
this.startCarousel()
|
124
|
+
},
|
125
|
+
slides(){
|
126
|
+
this.startCarousel()
|
127
|
+
}
|
128
|
+
}
|
129
|
+
}
|
130
|
+
</script>
|
131
|
+
<style>
|
132
|
+
/* FADE IN */
|
133
|
+
.slide {
|
134
|
+
position: absolute;
|
135
|
+
top: 0;
|
136
|
+
left: 0;
|
137
|
+
bottom:0;
|
138
|
+
right:0;
|
139
|
+
display: flex;
|
140
|
+
align-items: center;
|
141
|
+
justify-content: center;
|
142
|
+
}
|
143
|
+
.fade-enter-active {
|
144
|
+
transition: opacity 1s;
|
145
|
+
}
|
146
|
+
.fade-enter {
|
147
|
+
opacity: 0;
|
148
|
+
}
|
149
|
+
|
150
|
+
/* GO TO NEXT SLIDE */
|
151
|
+
.slide-next-enter-active,
|
152
|
+
.slide-next-leave-active {
|
153
|
+
transition: transform 2s ease-in-out;
|
154
|
+
}
|
155
|
+
.slide-next-enter {
|
156
|
+
transform: translate(100%);
|
157
|
+
}
|
158
|
+
.slide-next-leave-to {
|
159
|
+
transform: translate(-100%);
|
160
|
+
}
|
161
|
+
|
162
|
+
/* GO TO PREVIOUS SLIDE */
|
163
|
+
.slide-prev-enter-active,
|
164
|
+
.slide-prev-leave-active {
|
165
|
+
transition: transform 2s ease-in-out;
|
166
|
+
}
|
167
|
+
.slide-prev-enter {
|
168
|
+
transform: translate(-100%);
|
169
|
+
}
|
170
|
+
.slide-prev-leave-to {
|
171
|
+
transform: translate(100%);
|
172
|
+
}
|
173
|
+
</style>
|
@@ -0,0 +1,39 @@
|
|
1
|
+
<template>
|
2
|
+
<slideContent v-if="show" v-html="content">
|
3
|
+
</slideContent>
|
4
|
+
</template>
|
5
|
+
|
6
|
+
<script>
|
7
|
+
import styled from 'vue-styled-components'
|
8
|
+
|
9
|
+
const slideContent=styled.div`
|
10
|
+
position:absolute;
|
11
|
+
text-align:center;
|
12
|
+
top:0;
|
13
|
+
bottom:0;
|
14
|
+
left:0;
|
15
|
+
right:0;
|
16
|
+
display: flex;
|
17
|
+
justify-content: center;
|
18
|
+
align-items: center;
|
19
|
+
padding:20px;
|
20
|
+
`
|
21
|
+
export default {
|
22
|
+
name: "slide",
|
23
|
+
data() {
|
24
|
+
return{}
|
25
|
+
},
|
26
|
+
props:{
|
27
|
+
show:{
|
28
|
+
required:true,
|
29
|
+
default:true,
|
30
|
+
},
|
31
|
+
content:{
|
32
|
+
required:true,
|
33
|
+
},
|
34
|
+
},
|
35
|
+
components:{
|
36
|
+
slideContent
|
37
|
+
}
|
38
|
+
}
|
39
|
+
</script>
|