@eturnity/eturnity_reusable_components 6.38.0-EPDM-8508.0 → 6.38.0-team-day.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_reusable_components",
3
- "version": "6.38.0-EPDM-8508.0",
3
+ "version": "6.38.0-team-day.1",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
@@ -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
- <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
-
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 dropdownComponent from '@/components/dropdown'
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
- dropdownComponent,
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',
@@ -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: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>
@@ -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>
@@ -7,7 +7,12 @@
7
7
  :backdrop="backdrop"
8
8
  >
9
9
  <modal-container @click.stop>
10
- <spinner v-if="isLoading" size="50px" :limitedToModal="true" />
10
+ <loadingContainer v-if="isLoading" class="loading container">
11
+ <spinnerContainer>
12
+ <spinner size="50px" :limitedToModal="true" />
13
+ </spinnerContainer>
14
+ <carousel animation="fade" :slides="annoncements" v-if="annoncements && annoncements.length"></carousel>
15
+ </loadingContainer>
11
16
  <content-container :visible="!isLoading">
12
17
  <slot />
13
18
  </content-container>
@@ -31,11 +36,25 @@
31
36
  import styled from 'vue-styled-components'
32
37
  import CloseButton from '../../buttons/closeButton'
33
38
  import Spinner from '../../spinner'
34
-
39
+ import carousel from '../../carousel'
35
40
  const contentAttrs = { visible: Boolean }
36
41
  const ContentContainer = styled('div', contentAttrs)`
37
42
  visibility: ${(props) => (props.visible ? 'inherit' : 'hidden')};
38
43
  `
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
+ `
39
58
 
40
59
  const pageAttrs = { isOpen: Boolean, backdrop: String,position:String }
41
60
  const PageWrapper = styled('div', pageAttrs)`
@@ -111,7 +130,10 @@ export default {
111
130
  ModalContainer,
112
131
  CloseButton,
113
132
  Spinner,
114
- ContentContainer
133
+ ContentContainer,
134
+ carousel,
135
+ loadingContainer,
136
+ spinnerContainer
115
137
  },
116
138
  props: {
117
139
  isOpen: {
@@ -137,7 +159,11 @@ export default {
137
159
  position: {
138
160
  required: false,
139
161
  default: 'fixed'
140
- }
162
+ },
163
+ annoncements:{
164
+ required: false,
165
+ default: []
166
+ },
141
167
  },
142
168
  methods: {
143
169
  onCloseModal() {
@@ -9,7 +9,7 @@ export const stringToNumber = ({
9
9
  }
10
10
  let newVal = value.toString()
11
11
  const selectedLang = localStorage.getItem('lang')
12
- // The first replace will replace not allowed characters with a blank
12
+ // The first replace will replace not allowed characters with a blank
13
13
  if (
14
14
  selectedLang === 'de-DE' ||
15
15
  selectedLang === 'de-de' ||
@@ -21,7 +21,6 @@ export const stringToNumber = ({
21
21
  selectedLang === 'es-es' ||
22
22
  selectedLang === 'de' ||
23
23
  selectedLang === 'it' ||
24
- selectedLang === 'it-it' ||
25
24
  selectedLang === 'nl-nl' ||
26
25
  selectedLang === 'nl-be'
27
26
  ) {