layers-design-system 1.1.0 → 1.2.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/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/layers-core-design-system.iml +12 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/package.json +1 -1
- package/src/components/LButton/docs.vue +0 -1
- package/src/components/LCarousel/docs.vue +32 -0
- package/src/components/LCarousel/index.vue +88 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="WEB_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager">
|
|
4
|
+
<content url="file://$MODULE_DIR$">
|
|
5
|
+
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
|
6
|
+
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
|
7
|
+
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
|
8
|
+
</content>
|
|
9
|
+
<orderEntry type="inheritedJdk" />
|
|
10
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
11
|
+
</component>
|
|
12
|
+
</module>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectModuleManager">
|
|
4
|
+
<modules>
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/layers-core-design-system.iml" filepath="$PROJECT_DIR$/.idea/layers-core-design-system.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
package/.idea/vcs.xml
ADDED
package/package.json
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div style="display: flex; flex: 1 1 auto; max-width: 80%">
|
|
3
|
+
<l-carousel :images="demoImages"/>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
export default {
|
|
9
|
+
name: 'Carousel',
|
|
10
|
+
data: function() {
|
|
11
|
+
return {
|
|
12
|
+
demoImages: [
|
|
13
|
+
{
|
|
14
|
+
name: "Imagem 1",
|
|
15
|
+
id: "1",
|
|
16
|
+
src: "https://image.shutterstock.com/image-photo/panoramic-background-wide-old-red-600w-1642362355.jpg",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "Imagem 2",
|
|
20
|
+
id: "2",
|
|
21
|
+
src: "https://image.shutterstock.com/image-photo/panoramic-background-wide-old-red-600w-1642362355.jpg",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "Imagem 3",
|
|
25
|
+
id: "3",
|
|
26
|
+
src: "https://image.shutterstock.com/image-photo/panoramic-background-wide-old-red-600w-1642362355.jpg",
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
</script>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="carousel">
|
|
3
|
+
<l-button class="slider-control" circle icon="uil-angle-left" style="left: 1em;" @click="previous" v-if="selected > 0"></l-button>
|
|
4
|
+
<div class="slider-container">
|
|
5
|
+
<div v-for="(image, index) of images" :key="image.index"
|
|
6
|
+
class="slide" :ref="`img:${index}`">
|
|
7
|
+
<div class="img-container">
|
|
8
|
+
<img :src="image.src" :height="height" :width="width" style="border-radius: 10px;"/>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
<l-button class="slider-control" circle icon="uil-angle-right" style="right: 1em;" @click="next" v-if="selected < images.length - 1"></l-button>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
tagName: 'l-carousel',
|
|
20
|
+
name: 'Lcarousel',
|
|
21
|
+
props:['images', 'height', 'width'],
|
|
22
|
+
data: function() {
|
|
23
|
+
return {
|
|
24
|
+
selected: 0
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
methods: {
|
|
28
|
+
previous() {
|
|
29
|
+
this.selected--
|
|
30
|
+
const el = this.$refs[`img:${this.selected}`]
|
|
31
|
+
el[0].scrollIntoView({ behavior: 'smooth' })
|
|
32
|
+
},
|
|
33
|
+
next() {
|
|
34
|
+
this.selected++
|
|
35
|
+
const el = this.$refs[`img:${this.selected}`]
|
|
36
|
+
el[0].scrollIntoView({ behavior: 'smooth' })
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<style scoped>
|
|
43
|
+
.carousel {
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: row;
|
|
46
|
+
height: 100%;
|
|
47
|
+
max-width: 100%;
|
|
48
|
+
position: relative;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.slider-container {
|
|
52
|
+
height: 100%;
|
|
53
|
+
padding-bottom: 1em;
|
|
54
|
+
padding-top: 1em;
|
|
55
|
+
position: relative;
|
|
56
|
+
overflow-x: scroll;
|
|
57
|
+
scroll-snap-type: x mandatory;
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: row;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.slide {
|
|
63
|
+
display: flex;
|
|
64
|
+
height: 100%;
|
|
65
|
+
min-width: 80%;
|
|
66
|
+
scroll-snap-align: center;
|
|
67
|
+
scroll-snap-stop: always;
|
|
68
|
+
}
|
|
69
|
+
.slide + .slide {
|
|
70
|
+
margin-left: 1rem;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.slider-control {
|
|
74
|
+
position: absolute;
|
|
75
|
+
top: 50%;
|
|
76
|
+
z-index: 999;
|
|
77
|
+
height: 24px;
|
|
78
|
+
width: 24px
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.img-container {
|
|
82
|
+
display: flex;
|
|
83
|
+
flex: 1 1 auto;
|
|
84
|
+
justify-content: center;
|
|
85
|
+
align-items: center;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
</style>
|