@eturnity/eturnity_reusable_components 6.38.0-team-day.1 → 6.39.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 +1 -1
- package/src/App.vue +115 -7
- package/src/components/buttons/mainButton/index.vue +7 -1
- package/src/components/inputs/inputNumber/index.vue +32 -2
- package/src/components/modals/modal/index.vue +4 -30
- package/src/helpers/numberConverter.js +1 -0
- package/postcss.config.js +0 -1
- package/src/components/carousel/index.vue +0 -173
- package/src/components/carousel/slide.vue +0 -39
package/package.json
CHANGED
package/src/App.vue
CHANGED
@@ -1,17 +1,122 @@
|
|
1
1
|
<template>
|
2
2
|
<ThemeProvider :theme="getTheme()" :style="{ height: '100%' }">
|
3
|
-
|
3
|
+
<page-container>
|
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
|
+
|
4
98
|
<iconCollection color="red" />
|
99
|
+
</page-container>
|
5
100
|
</ThemeProvider>
|
6
101
|
</template>
|
7
102
|
|
8
103
|
<script>
|
9
104
|
import { ThemeProvider } from 'vue-styled-components'
|
10
105
|
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'
|
11
111
|
import iconCollection from '@/components/icon/iconCollection'
|
12
|
-
import
|
112
|
+
import dropdownComponent from '@/components/dropdown'
|
113
|
+
import videoThumbnail from '@/components/videoThumbnail'
|
114
|
+
import icon from '@/components/icon'
|
13
115
|
// import TableDropdown from "@/components/tableDropdown"
|
14
116
|
|
117
|
+
const PageContainer = styled.div`
|
118
|
+
padding: 40px;
|
119
|
+
`
|
15
120
|
|
16
121
|
// const RowContainer = styled.div`
|
17
122
|
// display: inline-flex;
|
@@ -23,15 +128,18 @@ export default {
|
|
23
128
|
name: 'App',
|
24
129
|
components: {
|
25
130
|
ThemeProvider,
|
131
|
+
PageContainer,
|
132
|
+
InputNumber,
|
133
|
+
Option,
|
134
|
+
Select,
|
135
|
+
SwitchField,
|
26
136
|
iconCollection,
|
27
|
-
|
137
|
+
dropdownComponent,
|
138
|
+
videoThumbnail,
|
139
|
+
icon
|
28
140
|
},
|
29
141
|
data() {
|
30
142
|
return {
|
31
|
-
slides:[
|
32
|
-
{text:"<div>Hello World</div>",duration:4},
|
33
|
-
{text:"<div>Hello World <hr/>2</div>",duration:5},
|
34
|
-
],
|
35
143
|
value: 42,
|
36
144
|
value2: 42,
|
37
145
|
companyName: 'toto',
|
@@ -5,6 +5,7 @@
|
|
5
5
|
:minWidth="minWidth"
|
6
6
|
:isDisabled="isDisabled"
|
7
7
|
:customColor="customColor"
|
8
|
+
:noWrap="noWrap"
|
8
9
|
>
|
9
10
|
{{ text }}
|
10
11
|
</button-container>
|
@@ -26,7 +27,7 @@ import styled from "vue-styled-components"
|
|
26
27
|
|
27
28
|
const PageContainer = styled.div``
|
28
29
|
|
29
|
-
const ButtonAttrs = { type: String, isDisabled: Boolean, minWidth: String, customColor: String }
|
30
|
+
const ButtonAttrs = { type: String, isDisabled: Boolean, minWidth: String, customColor: String, noWrap: Boolean }
|
30
31
|
const ButtonContainer = styled("div", ButtonAttrs)`
|
31
32
|
padding: 7px 15px;
|
32
33
|
font-size: 13px;
|
@@ -48,6 +49,7 @@ const ButtonContainer = styled("div", ButtonAttrs)`
|
|
48
49
|
cursor: ${(props) => (props.isDisabled ? "not-allowed" : "pointer")};
|
49
50
|
user-select: none;
|
50
51
|
${(props) => (props.minWidth ? `min-width: ${props.minWidth};` : '')};
|
52
|
+
${(props) => (props.noWrap ? `white-space: nowrap;` : '')};
|
51
53
|
|
52
54
|
&:hover {
|
53
55
|
opacity: ${(props) => (props.isDisabled ? "1" : "0.8")};
|
@@ -80,6 +82,10 @@ export default {
|
|
80
82
|
required: false,
|
81
83
|
default: null,
|
82
84
|
},
|
85
|
+
noWrap: {
|
86
|
+
required: false,
|
87
|
+
default: false
|
88
|
+
},
|
83
89
|
minWidth: {
|
84
90
|
required: false,
|
85
91
|
default: null
|
@@ -311,7 +311,8 @@ export default {
|
|
311
311
|
return {
|
312
312
|
textInput: '',
|
313
313
|
isFocused: false,
|
314
|
-
warningIcon: warningIcon
|
314
|
+
warningIcon: warningIcon,
|
315
|
+
isBlurred: false
|
315
316
|
}
|
316
317
|
},
|
317
318
|
props: {
|
@@ -488,7 +489,9 @@ export default {
|
|
488
489
|
return num
|
489
490
|
}
|
490
491
|
})
|
491
|
-
let evaluated
|
492
|
+
let evaluated
|
493
|
+
formatted = this.removeStringItemsAfterLastNumber(formatted)
|
494
|
+
evaluated = eval(formatted.join(' '))
|
492
495
|
if (typeof evaluated === 'string') {
|
493
496
|
evaluated = stringToNumber({
|
494
497
|
value: evaluated,
|
@@ -499,7 +502,32 @@ export default {
|
|
499
502
|
}
|
500
503
|
return evaluated
|
501
504
|
},
|
505
|
+
removeStringItemsAfterLastNumber(array) {
|
506
|
+
// fixed in EPDM-6487, in order to prevent 'Unexpected end of input'
|
507
|
+
let lastNumberIndex = -1
|
508
|
+
// Find the index of the last number in the array
|
509
|
+
for (let i = array.length - 1; i >= 0; i--) {
|
510
|
+
if (typeof array[i] === 'number') {
|
511
|
+
lastNumberIndex = i
|
512
|
+
break
|
513
|
+
}
|
514
|
+
}
|
515
|
+
// if there are no numbers, return an empty array
|
516
|
+
if (lastNumberIndex === -1) {
|
517
|
+
return []
|
518
|
+
}
|
519
|
+
// Remove non-numeric items after the last number
|
520
|
+
if (lastNumberIndex !== -1) {
|
521
|
+
const newArray = array.slice(0, lastNumberIndex + 1)
|
522
|
+
return newArray
|
523
|
+
}
|
524
|
+
return array
|
525
|
+
},
|
502
526
|
onInput(value) {
|
527
|
+
if (this.isBlurred) {
|
528
|
+
this.isBlurred = false
|
529
|
+
return
|
530
|
+
}
|
503
531
|
if (value === '') {
|
504
532
|
this.$emit('on-input', '')
|
505
533
|
}
|
@@ -514,6 +542,8 @@ export default {
|
|
514
542
|
},
|
515
543
|
onInputBlur(e) {
|
516
544
|
this.isFocused = false
|
545
|
+
// setting isBlurred so we don't trigger onInput as well
|
546
|
+
this.isBlurred = true
|
517
547
|
let value = e.target.value
|
518
548
|
let evaluatedInput = this.onEvaluateCode(value)
|
519
549
|
this.onChangeHandler(evaluatedInput ? evaluatedInput : value)
|
@@ -7,12 +7,7 @@
|
|
7
7
|
:backdrop="backdrop"
|
8
8
|
>
|
9
9
|
<modal-container @click.stop>
|
10
|
-
<
|
11
|
-
<spinnerContainer>
|
12
|
-
<spinner size="50px" :limitedToModal="true" />
|
13
|
-
</spinnerContainer>
|
14
|
-
<carousel animation="fade" :slides="annoncements" v-if="annoncements && annoncements.length"></carousel>
|
15
|
-
</loadingContainer>
|
10
|
+
<spinner v-if="isLoading" size="50px" :limitedToModal="true" />
|
16
11
|
<content-container :visible="!isLoading">
|
17
12
|
<slot />
|
18
13
|
</content-container>
|
@@ -36,25 +31,11 @@
|
|
36
31
|
import styled from 'vue-styled-components'
|
37
32
|
import CloseButton from '../../buttons/closeButton'
|
38
33
|
import Spinner from '../../spinner'
|
39
|
-
|
34
|
+
|
40
35
|
const contentAttrs = { visible: Boolean }
|
41
36
|
const ContentContainer = styled('div', contentAttrs)`
|
42
37
|
visibility: ${(props) => (props.visible ? 'inherit' : 'hidden')};
|
43
38
|
`
|
44
|
-
const loadingContainer = styled('div')`
|
45
|
-
display: flex;
|
46
|
-
position: absolute;
|
47
|
-
top: 0;
|
48
|
-
bottom: 0;
|
49
|
-
left: 0;
|
50
|
-
right: 0;
|
51
|
-
justify-content: center;
|
52
|
-
align-items: center;
|
53
|
-
`
|
54
|
-
const spinnerContainer = styled('div')`
|
55
|
-
position: absolute;
|
56
|
-
top: 100px;
|
57
|
-
`
|
58
39
|
|
59
40
|
const pageAttrs = { isOpen: Boolean, backdrop: String,position:String }
|
60
41
|
const PageWrapper = styled('div', pageAttrs)`
|
@@ -130,10 +111,7 @@ export default {
|
|
130
111
|
ModalContainer,
|
131
112
|
CloseButton,
|
132
113
|
Spinner,
|
133
|
-
ContentContainer
|
134
|
-
carousel,
|
135
|
-
loadingContainer,
|
136
|
-
spinnerContainer
|
114
|
+
ContentContainer
|
137
115
|
},
|
138
116
|
props: {
|
139
117
|
isOpen: {
|
@@ -159,11 +137,7 @@ export default {
|
|
159
137
|
position: {
|
160
138
|
required: false,
|
161
139
|
default: 'fixed'
|
162
|
-
}
|
163
|
-
annoncements:{
|
164
|
-
required: false,
|
165
|
-
default: []
|
166
|
-
},
|
140
|
+
}
|
167
141
|
},
|
168
142
|
methods: {
|
169
143
|
onCloseModal() {
|
package/postcss.config.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
module.exports = {}
|
@@ -1,173 +0,0 @@
|
|
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:0px 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:70px;
|
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>
|
@@ -1,39 +0,0 @@
|
|
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>
|