srcdev-nuxt-components 6.1.3 → 6.1.4
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/app/components/carousel-basic/CarouselBasic.vue +86 -62
- package/app/components/marquee-scroller/MarqueeScroller.vue +122 -0
- package/app/components/masonry-grid-ordered/MasonryGridOrdered.vue +44 -41
- package/nuxt.config.ts +1 -1
- package/package.json +3 -3
- package/app/assets/styles/extends-layer/srcdev-components/components/_display-prompt-core.css +0 -72
- package/app/assets/styles/extends-layer/srcdev-components/components/_expanding-panel.css +0 -37
- package/app/assets/styles/extends-layer/srcdev-components/components/index.css +0 -2
- package/app/assets/styles/extends-layer/srcdev-components/index.css +0 -2
- package/app/assets/styles/extends-layer/srcdev-components/setup/index.css +0 -1
- package/app/assets/styles/extends-layer/srcdev-components/setup/themes/_error.css +0 -15
- package/app/assets/styles/extends-layer/srcdev-components/setup/themes/_info.css +0 -15
- package/app/assets/styles/extends-layer/srcdev-components/setup/themes/_secondary.css +0 -15
- package/app/assets/styles/extends-layer/srcdev-components/setup/themes/_success.css +0 -15
- package/app/assets/styles/extends-layer/srcdev-components/setup/themes/_warning.css +0 -15
- package/app/assets/styles/extends-layer/srcdev-components/setup/themes/index.css +0 -5
- package/app/assets/styles/main.css +0 -2
- package/app/assets/styles/setup/_head.css +0 -36
- package/app/assets/styles/setup/a11y/_utils.css +0 -20
- package/app/assets/styles/setup/a11y/_variables.css +0 -8
- package/app/assets/styles/setup/a11y/index.css +0 -2
- package/app/assets/styles/setup/index.css +0 -5
- package/app/assets/styles/setup/typography/index.css +0 -2
- package/app/assets/styles/setup/typography/utility-classes/_generic-font-classes.css +0 -217
- package/app/assets/styles/setup/typography/utility-classes/_generic-font-variation-settings.css +0 -29
- package/app/assets/styles/setup/typography/utility-classes/_generic-font-weights.css +0 -39
- package/app/assets/styles/setup/typography/utility-classes/index.css +0 -3
- package/app/assets/styles/setup/typography/vars/_colors.css +0 -14
- package/app/assets/styles/setup/typography/vars/_reponsive-font-sizes.css +0 -12
- package/app/assets/styles/setup/typography/vars/index.css +0 -2
- package/app/assets/styles/setup/utility-classes/_fluid-spacing.css +0 -13
- package/app/assets/styles/setup/utility-classes/_margin.css +0 -334
- package/app/assets/styles/setup/utility-classes/_padding.css +0 -308
- package/app/assets/styles/setup/utility-classes/animations/_auto-rotate.css +0 -13
- package/app/assets/styles/setup/utility-classes/animations/_entry-exit-blur.css +0 -16
- package/app/assets/styles/setup/utility-classes/animations/_entry-slide-in.css +0 -15
- package/app/assets/styles/setup/utility-classes/animations/_entry-zoom-reveal.css +0 -15
- package/app/assets/styles/setup/utility-classes/animations/index.css +0 -4
- package/app/assets/styles/setup/utility-classes/index.css +0 -4
- package/app/assets/styles/setup/variables/colors/_blue.css +0 -15
- package/app/assets/styles/setup/variables/colors/_gray.css +0 -16
- package/app/assets/styles/setup/variables/colors/_green.css +0 -15
- package/app/assets/styles/setup/variables/colors/_orange.css +0 -15
- package/app/assets/styles/setup/variables/colors/_red.css +0 -15
- package/app/assets/styles/setup/variables/colors/_yellow.css +0 -15
- package/app/assets/styles/setup/variables/colors/index.css +0 -6
- package/app/assets/styles/setup/variables/index.css +0 -1
|
@@ -1,11 +1,30 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<section
|
|
2
|
+
<section
|
|
3
|
+
class="carousel-basic"
|
|
4
|
+
:class="[elementClasses]"
|
|
5
|
+
ref="carouselWrapperRef"
|
|
6
|
+
role="region"
|
|
7
|
+
aria-label="Image carousel"
|
|
8
|
+
>
|
|
3
9
|
<!-- Screen reader announcement for current item -->
|
|
4
10
|
<div aria-live="polite" aria-atomic="true" class="sr-only">Item {{ currentIndex + 1 }} of {{ itemCount }}</div>
|
|
5
11
|
|
|
6
12
|
<LayoutRow tag="div" variant="full-width" :style-class-passthrough="['mbe-20']">
|
|
7
|
-
<div
|
|
8
|
-
|
|
13
|
+
<div
|
|
14
|
+
tabindex="0"
|
|
15
|
+
class="item-container"
|
|
16
|
+
:class="{ 'allow-overflow': allowCarouselOverflow }"
|
|
17
|
+
ref="carouselContainerRef"
|
|
18
|
+
role="group"
|
|
19
|
+
aria-label="Carousel items"
|
|
20
|
+
>
|
|
21
|
+
<div
|
|
22
|
+
v-for="(item, index) in carouselDataIds"
|
|
23
|
+
:key="index"
|
|
24
|
+
class="item"
|
|
25
|
+
ref="carouselItems"
|
|
26
|
+
:aria-current="currentIndex === index ? 'true' : 'false'"
|
|
27
|
+
>
|
|
9
28
|
<slot :name="item"></slot>
|
|
10
29
|
</div>
|
|
11
30
|
</div>
|
|
@@ -24,7 +43,12 @@
|
|
|
24
43
|
<div class="markers-container">
|
|
25
44
|
<ul class="markers-list">
|
|
26
45
|
<li v-for="index in itemCount" :key="index" class="markers-item">
|
|
27
|
-
<button
|
|
46
|
+
<button
|
|
47
|
+
@click.prevent="jumpToFrame(index - 1)"
|
|
48
|
+
class="btn-marker"
|
|
49
|
+
:class="[{ active: currentIndex === index - 1 }]"
|
|
50
|
+
:aria-label="`Jump to item ${Math.floor(index + 1)}`"
|
|
51
|
+
></button>
|
|
28
52
|
</li>
|
|
29
53
|
</ul>
|
|
30
54
|
</div>
|
|
@@ -42,7 +66,7 @@
|
|
|
42
66
|
</template>
|
|
43
67
|
|
|
44
68
|
<script setup lang="ts">
|
|
45
|
-
import { useEventListener, useResizeObserver, useSwipe } from
|
|
69
|
+
import { useEventListener, useResizeObserver, useSwipe } from "@vueuse/core"
|
|
46
70
|
|
|
47
71
|
const props = defineProps({
|
|
48
72
|
carouselDataIds: {
|
|
@@ -65,108 +89,108 @@ const props = defineProps({
|
|
|
65
89
|
type: Boolean,
|
|
66
90
|
default: false,
|
|
67
91
|
},
|
|
68
|
-
})
|
|
92
|
+
})
|
|
69
93
|
|
|
70
|
-
const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
94
|
+
const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
71
95
|
|
|
72
|
-
const carouselWrapperRef = ref<HTMLDivElement | null>(null)
|
|
73
|
-
const carouselContainerRef = ref<HTMLDivElement | null>(null)
|
|
74
|
-
const carouselItemsRef = useTemplateRef<HTMLDivElement[]>(
|
|
75
|
-
const controlsContainerRef = ref<HTMLDivElement | null>(null)
|
|
76
|
-
const carouselInitComplete = ref(false)
|
|
96
|
+
const carouselWrapperRef = ref<HTMLDivElement | null>(null)
|
|
97
|
+
const carouselContainerRef = ref<HTMLDivElement | null>(null)
|
|
98
|
+
const carouselItemsRef = useTemplateRef<HTMLDivElement[]>("carouselItems")
|
|
99
|
+
const controlsContainerRef = ref<HTMLDivElement | null>(null)
|
|
100
|
+
const carouselInitComplete = ref(false)
|
|
77
101
|
|
|
78
|
-
const currentIndex = ref(0)
|
|
79
|
-
const itemCount = ref(props.carouselDataIds.length)
|
|
80
|
-
const offset = ref(0)
|
|
81
|
-
const transitionSpeedStr = props.transitionSpeed +
|
|
102
|
+
const currentIndex = ref(0)
|
|
103
|
+
const itemCount = ref(props.carouselDataIds.length)
|
|
104
|
+
const offset = ref(0)
|
|
105
|
+
const transitionSpeedStr = props.transitionSpeed + "ms"
|
|
82
106
|
const itemTransform = computed(() => {
|
|
83
|
-
return `translateX(calc(${offset.value} * (${itemWidth.value} + var(--_carousel-item-track-gap))))
|
|
84
|
-
})
|
|
107
|
+
return `translateX(calc(${offset.value} * (${itemWidth.value} + var(--_carousel-item-track-gap))))`
|
|
108
|
+
})
|
|
85
109
|
|
|
86
|
-
const itemWidth = ref(
|
|
110
|
+
const itemWidth = ref("0px")
|
|
87
111
|
|
|
88
112
|
const actionPrevious = () => {
|
|
89
113
|
if (props.returnToStart && currentIndex.value === 0) {
|
|
90
|
-
offset.value = -itemCount.value
|
|
91
|
-
doAction()
|
|
114
|
+
offset.value = -itemCount.value
|
|
115
|
+
doAction()
|
|
92
116
|
}
|
|
93
117
|
|
|
94
118
|
if (offset.value >= 0) {
|
|
95
|
-
return
|
|
119
|
+
return
|
|
96
120
|
}
|
|
97
121
|
|
|
98
|
-
offset.value = Math.min(offset.value + 1)
|
|
99
|
-
doAction()
|
|
100
|
-
}
|
|
122
|
+
offset.value = Math.min(offset.value + 1)
|
|
123
|
+
doAction()
|
|
124
|
+
}
|
|
101
125
|
|
|
102
126
|
const actionNext = () => {
|
|
103
127
|
if (props.returnToStart && offset.value <= -1 * (itemCount.value - 1)) {
|
|
104
|
-
offset.value = 0
|
|
105
|
-
doAction()
|
|
106
|
-
return
|
|
128
|
+
offset.value = 0
|
|
129
|
+
doAction()
|
|
130
|
+
return
|
|
107
131
|
}
|
|
108
132
|
|
|
109
133
|
if (offset.value <= -1 * (itemCount.value - 1)) {
|
|
110
|
-
return
|
|
134
|
+
return
|
|
111
135
|
}
|
|
112
136
|
|
|
113
|
-
offset.value = Math.min(offset.value - 1)
|
|
114
|
-
doAction()
|
|
115
|
-
}
|
|
137
|
+
offset.value = Math.min(offset.value - 1)
|
|
138
|
+
doAction()
|
|
139
|
+
}
|
|
116
140
|
|
|
117
141
|
const doAction = () => {
|
|
118
|
-
currentIndex.value = Math.abs(offset.value)
|
|
119
|
-
}
|
|
142
|
+
currentIndex.value = Math.abs(offset.value)
|
|
143
|
+
}
|
|
120
144
|
|
|
121
145
|
const jumpToFrame = (index: number) => {
|
|
122
146
|
if (index >= 0 && index < itemCount.value) {
|
|
123
|
-
offset.value = -index
|
|
124
|
-
doAction()
|
|
147
|
+
offset.value = -index
|
|
148
|
+
doAction()
|
|
125
149
|
}
|
|
126
|
-
}
|
|
150
|
+
}
|
|
127
151
|
|
|
128
152
|
const initialSetup = () => {
|
|
129
153
|
if (carouselItemsRef?.value && carouselItemsRef.value.length > 0 && carouselItemsRef.value[0]) {
|
|
130
|
-
itemWidth.value = carouselItemsRef.value[0].offsetWidth +
|
|
154
|
+
itemWidth.value = carouselItemsRef.value[0].offsetWidth + "px"
|
|
131
155
|
}
|
|
132
156
|
|
|
133
|
-
carouselInitComplete.value = true
|
|
134
|
-
}
|
|
157
|
+
carouselInitComplete.value = true
|
|
158
|
+
}
|
|
135
159
|
|
|
136
160
|
const { direction } = useSwipe(carouselContainerRef, {
|
|
137
161
|
passive: false,
|
|
138
162
|
onSwipeEnd() {
|
|
139
|
-
if (direction.value ===
|
|
140
|
-
actionNext()
|
|
141
|
-
} else if (direction.value ===
|
|
142
|
-
actionPrevious()
|
|
163
|
+
if (direction.value === "left") {
|
|
164
|
+
actionNext()
|
|
165
|
+
} else if (direction.value === "right") {
|
|
166
|
+
actionPrevious()
|
|
143
167
|
}
|
|
144
168
|
},
|
|
145
|
-
})
|
|
169
|
+
})
|
|
146
170
|
|
|
147
|
-
useEventListener(carouselContainerRef,
|
|
148
|
-
if (event.key ===
|
|
149
|
-
actionPrevious()
|
|
150
|
-
} else if (event.key ===
|
|
151
|
-
actionNext()
|
|
171
|
+
useEventListener(carouselContainerRef, "keydown", (event: KeyboardEvent) => {
|
|
172
|
+
if (event.key === "ArrowLeft") {
|
|
173
|
+
actionPrevious()
|
|
174
|
+
} else if (event.key === "ArrowRight") {
|
|
175
|
+
actionNext()
|
|
152
176
|
}
|
|
153
|
-
})
|
|
177
|
+
})
|
|
154
178
|
|
|
155
|
-
useEventListener(controlsContainerRef,
|
|
156
|
-
if (event.key ===
|
|
157
|
-
actionPrevious()
|
|
158
|
-
} else if (event.key ===
|
|
159
|
-
actionNext()
|
|
179
|
+
useEventListener(controlsContainerRef, "keydown", (event: KeyboardEvent) => {
|
|
180
|
+
if (event.key === "ArrowLeft") {
|
|
181
|
+
actionPrevious()
|
|
182
|
+
} else if (event.key === "ArrowRight") {
|
|
183
|
+
actionNext()
|
|
160
184
|
}
|
|
161
|
-
})
|
|
185
|
+
})
|
|
162
186
|
|
|
163
187
|
useResizeObserver(carouselWrapperRef, async () => {
|
|
164
|
-
initialSetup()
|
|
165
|
-
})
|
|
188
|
+
initialSetup()
|
|
189
|
+
})
|
|
166
190
|
|
|
167
191
|
onMounted(() => {
|
|
168
|
-
initialSetup()
|
|
169
|
-
})
|
|
192
|
+
initialSetup()
|
|
193
|
+
})
|
|
170
194
|
</script>
|
|
171
195
|
|
|
172
196
|
<style lang="css">
|
|
@@ -203,7 +227,7 @@ onMounted(() => {
|
|
|
203
227
|
position: relative;
|
|
204
228
|
|
|
205
229
|
&::before {
|
|
206
|
-
content:
|
|
230
|
+
content: "";
|
|
207
231
|
position: absolute;
|
|
208
232
|
height: 2px;
|
|
209
233
|
background-color: #fff;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="displayComponent" class="marquee-scroller" :reverse>
|
|
3
|
+
<ul class="list">
|
|
4
|
+
<li v-for="item in marqueeData" :key="item.id" class="item" :style="{ '--position': item.id }">
|
|
5
|
+
<slot :name="item.id"></slot>
|
|
6
|
+
</li>
|
|
7
|
+
</ul>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script setup lang="ts">
|
|
12
|
+
const props = defineProps({
|
|
13
|
+
animationRuntime: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: "40s",
|
|
16
|
+
},
|
|
17
|
+
reverse: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: false,
|
|
20
|
+
},
|
|
21
|
+
marqueeData: {
|
|
22
|
+
type: Array as PropType<Array<{ id: number; content: string }>>,
|
|
23
|
+
default: () => [],
|
|
24
|
+
},
|
|
25
|
+
itemConfig: {
|
|
26
|
+
type: Object,
|
|
27
|
+
default: () => ({
|
|
28
|
+
width: "50px",
|
|
29
|
+
height: "50px",
|
|
30
|
+
quantity: 30,
|
|
31
|
+
}),
|
|
32
|
+
required: true,
|
|
33
|
+
},
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
const displayComponent = ref(false)
|
|
37
|
+
|
|
38
|
+
const height = computed(() => props.itemConfig.height)
|
|
39
|
+
const quantity = computed(() => props.itemConfig.quantity)
|
|
40
|
+
const width = computed(() => props.itemConfig.width)
|
|
41
|
+
|
|
42
|
+
const animationRuntimeNumber = computed(() => {
|
|
43
|
+
const [seconds] = props.animationRuntime.split("s")
|
|
44
|
+
return parseFloat(seconds ?? "0")
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
const animationDelay = computed(() => {
|
|
48
|
+
return Math.floor(animationRuntimeNumber.value * 1.25) + "s"
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
onMounted(() => {
|
|
52
|
+
console.log(`Mounted: quantity(${quantity.value}) | animationDelay(${animationDelay.value})`)
|
|
53
|
+
displayComponent.value = true
|
|
54
|
+
})
|
|
55
|
+
</script>
|
|
56
|
+
|
|
57
|
+
<style lang="css">
|
|
58
|
+
.marquee-scroller {
|
|
59
|
+
width: 100%;
|
|
60
|
+
height: v-bind(height);
|
|
61
|
+
overflow: hidden;
|
|
62
|
+
mask-image: linear-gradient(to right, transparent, #000 10% 90%, transparent);
|
|
63
|
+
|
|
64
|
+
&:hover .item {
|
|
65
|
+
animation-play-state: paused !important;
|
|
66
|
+
filter: grayscale(1);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&[reverse="true"] .item {
|
|
70
|
+
animation: reversePlay v-bind(animationRuntime) linear infinite;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.list {
|
|
74
|
+
display: flex;
|
|
75
|
+
width: 100%;
|
|
76
|
+
height: v-bind(height);
|
|
77
|
+
min-width: calc(v-bind(width) * v-bind(quantity));
|
|
78
|
+
position: relative;
|
|
79
|
+
|
|
80
|
+
.item {
|
|
81
|
+
width: v-bind(width);
|
|
82
|
+
height: v-bind(height);
|
|
83
|
+
display: grid;
|
|
84
|
+
place-items: center;
|
|
85
|
+
position: absolute;
|
|
86
|
+
aspect-ratio: 1 / 1;
|
|
87
|
+
left: 100%;
|
|
88
|
+
animation: autoRun v-bind(animationRuntime) linear infinite;
|
|
89
|
+
transition: filter 0.5s;
|
|
90
|
+
/* animation-delay: calc((50s / v-bind(quantity)) * (var(--position) - 1) - 50s) !important; */
|
|
91
|
+
animation-delay: calc(
|
|
92
|
+
(v-bind(animationDelay) / v-bind(quantity)) * (var(--position) - 1) - v-bind(animationDelay)
|
|
93
|
+
) !important;
|
|
94
|
+
|
|
95
|
+
border: 1px solid light-dark(var(--gray-12), var(--gray-0));
|
|
96
|
+
border-radius: 4px;
|
|
97
|
+
|
|
98
|
+
&:hover {
|
|
99
|
+
filter: grayscale(0);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
@keyframes autoRun {
|
|
106
|
+
from {
|
|
107
|
+
left: 100%;
|
|
108
|
+
}
|
|
109
|
+
to {
|
|
110
|
+
left: calc(v-bind(width) * -1);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@keyframes reversePlay {
|
|
115
|
+
from {
|
|
116
|
+
left: calc(v-bind(width) * -1);
|
|
117
|
+
}
|
|
118
|
+
to {
|
|
119
|
+
left: 100%;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
</style>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
11
|
<script setup lang="ts">
|
|
12
|
-
import { useBreakpoints, useElementSize, useResizeObserver } from
|
|
12
|
+
import { useBreakpoints, useElementSize, useResizeObserver } from "@vueuse/core"
|
|
13
13
|
|
|
14
14
|
const props = defineProps({
|
|
15
15
|
gridData: {
|
|
@@ -38,77 +38,79 @@ const props = defineProps({
|
|
|
38
38
|
},
|
|
39
39
|
justify: {
|
|
40
40
|
type: String as PropType<String>,
|
|
41
|
-
default:
|
|
42
|
-
validator: (val: string) => [
|
|
41
|
+
default: "left",
|
|
42
|
+
validator: (val: string) => ["left", "center", "right"].includes(val),
|
|
43
43
|
},
|
|
44
|
-
})
|
|
44
|
+
})
|
|
45
45
|
|
|
46
|
-
const { elementClasses, resetElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
46
|
+
const { elementClasses, resetElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough)
|
|
47
47
|
|
|
48
|
-
const gridData = toRef(() => props.gridData)
|
|
48
|
+
const gridData = toRef(() => props.gridData)
|
|
49
49
|
|
|
50
|
-
const minTileWidth = toRef(() => props.minTileWidth)
|
|
51
|
-
const gridWrapper = ref<null | HTMLDivElement>(null)
|
|
52
|
-
const gridItemsRefs = ref<HTMLDivElement[]>([])
|
|
53
|
-
const { width } = useElementSize(gridWrapper)
|
|
50
|
+
const minTileWidth = toRef(() => props.minTileWidth)
|
|
51
|
+
const gridWrapper = ref<null | HTMLDivElement>(null)
|
|
52
|
+
const gridItemsRefs = ref<HTMLDivElement[]>([])
|
|
53
|
+
const { width } = useElementSize(gridWrapper)
|
|
54
54
|
const columnCount = computed(() => {
|
|
55
|
-
return Math.floor(width.value / minTileWidth.value)
|
|
56
|
-
})
|
|
55
|
+
return Math.floor(width.value / minTileWidth.value)
|
|
56
|
+
})
|
|
57
57
|
|
|
58
|
-
const gapNum = toRef(props.gap)
|
|
59
|
-
const gapStr = toRef(props.gap +
|
|
58
|
+
const gapNum = toRef(props.gap)
|
|
59
|
+
const gapStr = toRef(props.gap + "px")
|
|
60
60
|
|
|
61
|
-
const fixedWidth = toRef(() => props.fixedWidth)
|
|
62
|
-
const minTileWidthStr = toRef(props.minTileWidth +
|
|
61
|
+
const fixedWidth = toRef(() => props.fixedWidth)
|
|
62
|
+
const minTileWidthStr = toRef(props.minTileWidth + "px")
|
|
63
63
|
const maxTileWidth = computed(() => {
|
|
64
|
-
return fixedWidth.value ? minTileWidth.value +
|
|
65
|
-
})
|
|
64
|
+
return fixedWidth.value ? minTileWidth.value + "px" : "1fr"
|
|
65
|
+
})
|
|
66
66
|
|
|
67
67
|
const justify = computed(() => {
|
|
68
|
-
return fixedWidth.value ? props.justify :
|
|
69
|
-
})
|
|
68
|
+
return fixedWidth.value ? props.justify : "stretch"
|
|
69
|
+
})
|
|
70
70
|
|
|
71
71
|
const updateGrid = () => {
|
|
72
72
|
if (gridWrapper.value !== null) {
|
|
73
|
-
const wrapperWidth = gridWrapper.value?.offsetWidth ?? 0
|
|
74
|
-
const itemWidth = fixedWidth.value
|
|
73
|
+
const wrapperWidth = gridWrapper.value?.offsetWidth ?? 0
|
|
74
|
+
const itemWidth = fixedWidth.value
|
|
75
|
+
? minTileWidth.value
|
|
76
|
+
: Math.floor((wrapperWidth - (columnCount.value - 1) * gapNum.value) / columnCount.value)
|
|
75
77
|
|
|
76
|
-
const colHeights = Array(columnCount.value).fill(0)
|
|
78
|
+
const colHeights = Array(columnCount.value).fill(0)
|
|
77
79
|
|
|
78
80
|
gridItemsRefs.value.forEach((item) => {
|
|
79
|
-
const minHeight = Math.min(...colHeights)
|
|
80
|
-
const minIndex = colHeights.indexOf(minHeight)
|
|
81
|
+
const minHeight = Math.min(...colHeights)
|
|
82
|
+
const minIndex = colHeights.indexOf(minHeight)
|
|
81
83
|
|
|
82
|
-
item?.style.setProperty(
|
|
83
|
-
item?.style.setProperty(
|
|
84
|
-
item?.style.setProperty(
|
|
85
|
-
item?.style.setProperty(
|
|
84
|
+
item?.style.setProperty("--_position", "absolute")
|
|
85
|
+
item?.style.setProperty("--_position-top", minHeight + "px")
|
|
86
|
+
item?.style.setProperty("--_position-left", minIndex * (100 / columnCount.value) + "%")
|
|
87
|
+
item?.style.setProperty("--_element-width", itemWidth + "px")
|
|
86
88
|
|
|
87
|
-
colHeights[minIndex] += Math.floor(item.offsetHeight + gapNum.value)
|
|
88
|
-
})
|
|
89
|
+
colHeights[minIndex] += Math.floor(item.offsetHeight + gapNum.value)
|
|
90
|
+
})
|
|
89
91
|
|
|
90
|
-
const maxHeight = Math.max(...colHeights)
|
|
91
|
-
gridWrapper.value?.style.setProperty(
|
|
92
|
+
const maxHeight = Math.max(...colHeights)
|
|
93
|
+
gridWrapper.value?.style.setProperty("--_wrapper-height", maxHeight + "px")
|
|
92
94
|
}
|
|
93
|
-
}
|
|
95
|
+
}
|
|
94
96
|
|
|
95
97
|
useResizeObserver(gridWrapper, () => {
|
|
96
|
-
updateGrid()
|
|
97
|
-
})
|
|
98
|
+
updateGrid()
|
|
99
|
+
})
|
|
98
100
|
|
|
99
101
|
watch(
|
|
100
102
|
() => fixedWidth.value,
|
|
101
103
|
() => {
|
|
102
|
-
updateGrid()
|
|
104
|
+
updateGrid()
|
|
103
105
|
}
|
|
104
|
-
)
|
|
106
|
+
)
|
|
105
107
|
|
|
106
108
|
watch(
|
|
107
109
|
() => props.styleClassPassthrough,
|
|
108
110
|
() => {
|
|
109
|
-
resetElementClasses(props.styleClassPassthrough)
|
|
111
|
+
resetElementClasses(props.styleClassPassthrough)
|
|
110
112
|
}
|
|
111
|
-
)
|
|
113
|
+
)
|
|
112
114
|
</script>
|
|
113
115
|
|
|
114
116
|
<style scoped lang="css">
|
|
@@ -142,7 +144,8 @@ watch(
|
|
|
142
144
|
}
|
|
143
145
|
|
|
144
146
|
.masonry-grid-ordered-item {
|
|
145
|
-
transition: position var(--_transition-duration) ease, top var(--_transition-duration) ease,
|
|
147
|
+
transition: position var(--_transition-duration) ease, top var(--_transition-duration) ease,
|
|
148
|
+
left var(--_transition-duration) ease;
|
|
146
149
|
|
|
147
150
|
position: var(--_position);
|
|
148
151
|
top: var(--_position-top);
|
package/nuxt.config.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// https://nuxt.com/docs/api/configuration/nuxt-config
|
|
2
2
|
export default defineNuxtConfig({
|
|
3
3
|
devtools: { enabled: true },
|
|
4
|
-
css: ["modern-normalize", "./app/assets/styles/main.css"],
|
|
4
|
+
// css: ["modern-normalize", "./app/assets/styles/main.css"],
|
|
5
5
|
modules: ["@nuxt/eslint", "@nuxt/icon", "@nuxt/image"],
|
|
6
6
|
app: {
|
|
7
7
|
head: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "srcdev-nuxt-components",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.1.
|
|
4
|
+
"version": "6.1.4",
|
|
5
5
|
"main": "nuxt.config.ts",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"clean": "rm -rf .nuxt && rm -rf .output && rm -rf .playground/.nuxt && rm -rf .playground/.output",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@iconify-json/akar-icons": "1.2.7",
|
|
26
26
|
"@iconify-json/bitcoin-icons": "1.2.4",
|
|
27
|
+
"@iconify-json/material-symbols": "^1.2.33",
|
|
27
28
|
"@nuxt/eslint": "1.8.0",
|
|
28
29
|
"@nuxt/icon": "2.0.0",
|
|
29
30
|
"@nuxt/image": "1.11.0",
|
|
@@ -35,8 +36,7 @@
|
|
|
35
36
|
"typescript": "5.9.2"
|
|
36
37
|
},
|
|
37
38
|
"dependencies": {
|
|
38
|
-
"focus-trap-vue": "4.0.3"
|
|
39
|
-
"modern-normalize": "3.0.1"
|
|
39
|
+
"focus-trap-vue": "4.0.3"
|
|
40
40
|
},
|
|
41
41
|
"release-it": {
|
|
42
42
|
"$schema": "https://unpkg.com/release-it/schema/release-it.json",
|
package/app/assets/styles/extends-layer/srcdev-components/components/_display-prompt-core.css
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
.srcdev-components-extended {
|
|
2
|
-
.display-prompt-core {
|
|
3
|
-
.display-prompt-wrapper {
|
|
4
|
-
background-color: var(--component-theme-10);
|
|
5
|
-
border: 1px solid var(--component-theme-8);
|
|
6
|
-
border-inline-start: 8px solid var(--component-theme-8);
|
|
7
|
-
border-radius: 4px;
|
|
8
|
-
border-start-start-radius: 8px;
|
|
9
|
-
border-end-start-radius: 8px;
|
|
10
|
-
|
|
11
|
-
.display-prompt-inner {
|
|
12
|
-
align-items: center;
|
|
13
|
-
gap: 12px;
|
|
14
|
-
padding-block: 1rem;
|
|
15
|
-
padding-inline: 1.5rem;
|
|
16
|
-
|
|
17
|
-
.display-prompt-icon {
|
|
18
|
-
.icon {
|
|
19
|
-
color: var(--component-theme-0);
|
|
20
|
-
font-size: 3rem;
|
|
21
|
-
font-style: normal;
|
|
22
|
-
font-weight: normal;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.display-prompt-content {
|
|
27
|
-
gap: 1rem;
|
|
28
|
-
margin: 0;
|
|
29
|
-
padding: 0.2rem;
|
|
30
|
-
|
|
31
|
-
.title {
|
|
32
|
-
font-size: var(--step-5);
|
|
33
|
-
font-weight: bold;
|
|
34
|
-
line-height: 1.3;
|
|
35
|
-
color: var(--component-theme-0);
|
|
36
|
-
margin: 0;
|
|
37
|
-
padding: 0;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.text {
|
|
41
|
-
font-size: var(--step-5);
|
|
42
|
-
font-weight: normal;
|
|
43
|
-
line-height: 1.3;
|
|
44
|
-
color: var(--component-theme-0);
|
|
45
|
-
margin: 0;
|
|
46
|
-
padding: 0;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
.display-prompt-action {
|
|
50
|
-
background-color: transparent;
|
|
51
|
-
align-items: center;
|
|
52
|
-
margin: 1rem;
|
|
53
|
-
padding: 0.5rem;
|
|
54
|
-
border: 0.1rem solid var(--component-theme-8);
|
|
55
|
-
border-radius: 50%;
|
|
56
|
-
outline: 1px solid var(--component-theme-3);
|
|
57
|
-
|
|
58
|
-
&:hover {
|
|
59
|
-
cursor: pointer;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.icon {
|
|
63
|
-
color: var(--component-theme-0);
|
|
64
|
-
font-size: var(--step-5);
|
|
65
|
-
border: 1px solid green;
|
|
66
|
-
padding: 1rem;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
.srcdev-components-extended {
|
|
2
|
-
.expanding-panel {
|
|
3
|
-
.expanding-panel-details {
|
|
4
|
-
.expanding-panel-summary {
|
|
5
|
-
&::-webkit-details-marker,
|
|
6
|
-
&::marker {
|
|
7
|
-
display: none;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.label-wrapper {
|
|
11
|
-
}
|
|
12
|
-
.icon-wrapper {
|
|
13
|
-
.icon {
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
&[open] {
|
|
19
|
-
.expanding-panel-summary {
|
|
20
|
-
.icon-wrapper {
|
|
21
|
-
.icon {
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
+ .expanding-panel-content {
|
|
26
|
-
.inner {
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.expanding-panel-content {
|
|
33
|
-
.inner {
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import './themes';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
[data-component-theme='error'] {
|
|
2
|
-
--component-theme-0: var(--red-0);
|
|
3
|
-
--component-theme-1: var(--red-1);
|
|
4
|
-
--component-theme-2: var(--red-2);
|
|
5
|
-
--component-theme-3: var(--red-3);
|
|
6
|
-
--component-theme-4: var(--red-4);
|
|
7
|
-
--component-theme-5: var(--red-5);
|
|
8
|
-
--component-theme-6: var(--red-6);
|
|
9
|
-
--component-theme-7: var(--red-7);
|
|
10
|
-
--component-theme-8: var(--red-8);
|
|
11
|
-
--component-theme-9: var(--red-9);
|
|
12
|
-
--component-theme-10: var(--red-10);
|
|
13
|
-
--component-theme-11: var(--red-11);
|
|
14
|
-
--component-theme-12: var(--red-12);
|
|
15
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
[data-component-theme='info'] {
|
|
2
|
-
--component-theme-0: var(--blue-0);
|
|
3
|
-
--component-theme-1: var(--blue-1);
|
|
4
|
-
--component-theme-2: var(--blue-2);
|
|
5
|
-
--component-theme-3: var(--blue-3);
|
|
6
|
-
--component-theme-4: var(--blue-4);
|
|
7
|
-
--component-theme-5: var(--blue-5);
|
|
8
|
-
--component-theme-6: var(--blue-6);
|
|
9
|
-
--component-theme-7: var(--blue-7);
|
|
10
|
-
--component-theme-8: var(--blue-8);
|
|
11
|
-
--component-theme-9: var(--blue-9);
|
|
12
|
-
--component-theme-10: var(--blue-10);
|
|
13
|
-
--component-theme-11: var(--blue-11);
|
|
14
|
-
--component-theme-12: var(--blue-12);
|
|
15
|
-
}
|