srcdev-nuxt-components 3.0.0 → 4.0.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/assets/styles/a11y/_utils.css +20 -0
- package/assets/styles/a11y/_variables.css +8 -0
- package/assets/styles/a11y/index.css +2 -0
- package/assets/styles/forms/index.css +2 -0
- package/assets/styles/forms/themes/_error.css +77 -0
- package/assets/styles/forms/themes/_ghost.css +77 -0
- package/assets/styles/forms/themes/_input-action.css +20 -0
- package/assets/styles/forms/themes/_primary.css +82 -0
- package/assets/styles/forms/themes/_secondary.css +77 -0
- package/assets/styles/forms/themes/_success.css +77 -0
- package/assets/styles/forms/themes/_tertiary.css +77 -0
- package/assets/styles/forms/themes/_warning.css +77 -0
- package/assets/styles/forms/themes/index.css +8 -0
- package/assets/styles/forms/variables/_sizes.css +82 -0
- package/assets/styles/forms/variables/_theme.css +11 -0
- package/assets/styles/forms/variables/index.css +2 -0
- package/assets/styles/main.css +5 -0
- package/assets/styles/typography/index.css +2 -0
- package/assets/styles/typography/utils/_font-classes.css +160 -0
- package/assets/styles/typography/utils/_weights.css +69 -0
- package/assets/styles/typography/utils/index.css +2 -0
- package/assets/styles/typography/variables/_colors.css +14 -0
- package/assets/styles/typography/variables/_reponsive-font-size.css +10 -0
- package/assets/styles/typography/variables/index.css +2 -0
- package/assets/styles/utils/_animations.css +42 -0
- package/assets/styles/utils/_canvasWidths.css +18 -0
- package/assets/styles/utils/_display.css +7 -0
- package/assets/styles/utils/_margin-helpers.css +334 -0
- package/assets/styles/utils/_padding-helpers.css +308 -0
- package/assets/styles/utils/_page.css +24 -0
- package/assets/styles/utils/_placement.css +73 -0
- package/assets/styles/utils/index.css +7 -0
- package/assets/styles/variables/colors/_blue.css +15 -0
- package/assets/styles/variables/colors/_gray.css +16 -0
- package/assets/styles/variables/colors/_green.css +15 -0
- package/assets/styles/variables/colors/_orange.css +15 -0
- package/assets/styles/variables/colors/_red.css +15 -0
- package/assets/styles/variables/colors/_yellow.css +15 -0
- package/assets/styles/variables/colors/colors.css +6 -0
- package/assets/styles/variables/components/_accordian.css +7 -0
- package/assets/styles/variables/components/_container-glow-core.css +16 -0
- package/assets/styles/variables/components/_display-dialog-core.css +35 -0
- package/assets/styles/variables/components/_tabs.css +18 -0
- package/assets/styles/variables/components/display-prompt-core/_scaffolding.css +57 -0
- package/assets/styles/variables/components/display-prompt-core/index.css +2 -0
- package/assets/styles/variables/components/display-prompt-core/themes/_error.css +39 -0
- package/assets/styles/variables/components/display-prompt-core/themes/_info.css +39 -0
- package/assets/styles/variables/components/display-prompt-core/themes/_success.css +39 -0
- package/assets/styles/variables/components/display-prompt-core/themes/_warning.css +39 -0
- package/assets/styles/variables/components/display-prompt-core/themes/index.css +4 -0
- package/assets/styles/variables/components/index.css +5 -0
- package/assets/styles/variables/index.css +2 -0
- package/components/animated-svg-text/AnimatedSvgText.vue +87 -0
- package/components/canvas-switcher/CanvasSwitcher.vue +77 -0
- package/components/clip-element/ClipElement.vue +73 -0
- package/components/clipped-panels/ClippedPanel.vue +73 -0
- package/components/deep-expanding-menu/DeepExpandingMenu.vue +214 -0
- package/components/deep-expanding-menu/DeepExpandingMenuOld.vue +218 -0
- package/components/display-banner/DisplayBanner.vue +63 -0
- package/components/display-details/DisplayDetailsCore.vue +312 -0
- package/components/functional/accordian/AccordianCore.vue +138 -0
- package/components/functional/display-dialog/DisplayDialogCore.vue +244 -0
- package/components/functional/display-dialog/variants/DisplayDialogConfirm.vue +45 -0
- package/components/functional/display-dialog/variants/DisplayDialogScrollableContent.vue +49 -0
- package/components/functional/pop-over/PopOver.vue +88 -0
- package/components/image-galleries/SliderGallery.vue +784 -0
- package/components/masonry-grid-ordered/MasonryGridOrdered.vue +158 -0
- package/components/presentation/container-glow/ContainerGlowCore.vue +211 -0
- package/components/presentation/display-grid/DisplayGridCore.vue +22 -0
- package/components/presentation/display-prompt/DisplayPromptCore.vue +150 -0
- package/components/presentation/display-prompt/variants/DisplayPromptError.vue +53 -0
- package/components/presentation/layout-grids/LayoutGridA.vue +103 -0
- package/components/presentation/layout-grids/LayoutGridB.vue +132 -0
- package/components/presentation/layout-row/LayoutRow.vue +157 -0
- package/components/presentation/masonry-grid/MasonryGrid.vue +62 -0
- package/components/presentation/masonry-grid-sorted/MasonryGridSorted.vue +115 -0
- package/components/presentation/tabs/TabsCore.vue +308 -0
- package/components/responsive-header/NavigationItems.vue +164 -0
- package/components/responsive-header/ResponsiveHeader.vue +586 -0
- package/components/rotating-carousel/RotatingCarouselImage.vue +200 -0
- package/composables/useDialogControls.ts +23 -0
- package/composables/useStyleClassPassthrough.ts +35 -0
- package/composables/useTabs.ts +201 -0
- package/nuxt.config.ts +0 -3
- package/package.json +2 -2
- package/types/gallery-data.ts +13 -0
- package/types/responsiveHeader.ts +38 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="layout-grid-b" :class="[elementClasses]">
|
|
3
|
+
<section class="top-row">
|
|
4
|
+
<div class="top-row-slot-1">
|
|
5
|
+
<div class="top-row-slot-1-inner">
|
|
6
|
+
<div v-for="key in topRowSlot1ItemCount" class="panel">
|
|
7
|
+
<slot :name="`top-row-slot1-${key}-content`"></slot>
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
<div class="top-row-slot-2">
|
|
13
|
+
<div class="panel">
|
|
14
|
+
<slot name="top-row-slot-2"></slot>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
<div class="top-row-slot-3">
|
|
18
|
+
<div class="panel">
|
|
19
|
+
<slot name="top-row-slot-3"></slot>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</section>
|
|
23
|
+
|
|
24
|
+
<section class="bottom-row">
|
|
25
|
+
<div v-for="key in bottomRowItemCount" class="panel">
|
|
26
|
+
<slot :name="`bottom-row-${key}-content`"></slot>
|
|
27
|
+
</div>
|
|
28
|
+
</section>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script setup lang="ts">
|
|
33
|
+
const props = defineProps({
|
|
34
|
+
topRowSlot1ItemCount: {
|
|
35
|
+
type: Number as PropType<number>,
|
|
36
|
+
default: 6,
|
|
37
|
+
},
|
|
38
|
+
bottomRowItemCount: {
|
|
39
|
+
type: Number as PropType<number>,
|
|
40
|
+
default: 4,
|
|
41
|
+
},
|
|
42
|
+
styleClassPassthrough: {
|
|
43
|
+
type: Array as PropType<string[]>,
|
|
44
|
+
default: () => [],
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const { elementClasses, resetElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
|
|
49
|
+
|
|
50
|
+
watch(
|
|
51
|
+
() => props.styleClassPassthrough,
|
|
52
|
+
() => {
|
|
53
|
+
resetElementClasses(props.styleClassPassthrough);
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<style lang="css">
|
|
59
|
+
.layout-grid-b {
|
|
60
|
+
--_border-color: light-dark(hsl(0, 29%, 3%), hsl(0, 0%, 92%));
|
|
61
|
+
--_color: light-dark(hsl(0, 29%, 3%), hsl(0, 0%, 92%));
|
|
62
|
+
--_gap: 12px;
|
|
63
|
+
|
|
64
|
+
.panel {
|
|
65
|
+
border: 1px solid var(--_border-color);
|
|
66
|
+
border-radius: 12px;
|
|
67
|
+
padding: 12px;
|
|
68
|
+
height: auto;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
container-type: inline-size;
|
|
72
|
+
display: grid;
|
|
73
|
+
grid-template-columns: 1fr;
|
|
74
|
+
gap: var(--_gap);
|
|
75
|
+
width: 100%;
|
|
76
|
+
margin-inline: auto;
|
|
77
|
+
|
|
78
|
+
.top-row {
|
|
79
|
+
display: grid;
|
|
80
|
+
gap: var(--_gap);
|
|
81
|
+
width: 100%;
|
|
82
|
+
|
|
83
|
+
grid-template-columns: 1fr;
|
|
84
|
+
grid-template-areas:
|
|
85
|
+
'slot1'
|
|
86
|
+
'slot2'
|
|
87
|
+
'slot3';
|
|
88
|
+
|
|
89
|
+
@container (min-width: 1024px) {
|
|
90
|
+
grid-template-columns: 1fr minmax(460px, 33%);
|
|
91
|
+
grid-template-areas:
|
|
92
|
+
'slot1 slot2'
|
|
93
|
+
'slot3 slot2';
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.top-row-slot-1 {
|
|
98
|
+
grid-area: slot1;
|
|
99
|
+
container-type: inline-size;
|
|
100
|
+
|
|
101
|
+
.top-row-slot-1-inner {
|
|
102
|
+
display: grid;
|
|
103
|
+
grid-template-columns: repeat(2, 1fr);
|
|
104
|
+
|
|
105
|
+
gap: var(--_gap);
|
|
106
|
+
|
|
107
|
+
@container (min-width: 680px) {
|
|
108
|
+
grid-template-columns: repeat(3, 1fr);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.panel {
|
|
112
|
+
display: grid;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.top-row-slot-2 {
|
|
118
|
+
grid-area: slot2;
|
|
119
|
+
display: grid;
|
|
120
|
+
}
|
|
121
|
+
.top-row-slot-3 {
|
|
122
|
+
grid-area: slot3;
|
|
123
|
+
display: grid;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.bottom-row {
|
|
127
|
+
display: grid;
|
|
128
|
+
grid-template-columns: repeat(2, 1fr);
|
|
129
|
+
gap: var(--_gap);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
</style>
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="layout-row" :class="elementClasses">
|
|
3
|
+
<component :is="tag" :data-testid="dataTestid" class="layout-row-inner" :class="variant">
|
|
4
|
+
<div>
|
|
5
|
+
<slot name="default"></slot>
|
|
6
|
+
</div>
|
|
7
|
+
</component>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script lang="ts">
|
|
12
|
+
const TAGS_ALLOWED = <string[]>['div', 'section', 'article', 'aside', 'header', 'footer', 'main', 'nav', 'ul', 'ol'];
|
|
13
|
+
|
|
14
|
+
const VARIANT_CLASSES = <string[]>[
|
|
15
|
+
'full',
|
|
16
|
+
'full-start',
|
|
17
|
+
'full-end',
|
|
18
|
+
'popout',
|
|
19
|
+
'popout-start',
|
|
20
|
+
'popout-end',
|
|
21
|
+
'content',
|
|
22
|
+
'content-start',
|
|
23
|
+
'content-end',
|
|
24
|
+
'inset-content',
|
|
25
|
+
'inset-content-start',
|
|
26
|
+
'inset-content-end',
|
|
27
|
+
'full-width',
|
|
28
|
+
'full-content',
|
|
29
|
+
'full-content-nopad',
|
|
30
|
+
'full-content',
|
|
31
|
+
];
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<script setup lang="ts">
|
|
35
|
+
const props = defineProps({
|
|
36
|
+
dataTestid: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: 'layout-row',
|
|
39
|
+
},
|
|
40
|
+
tag: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: 'div',
|
|
43
|
+
validator(value: string) {
|
|
44
|
+
return TAGS_ALLOWED.includes(value);
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
variant: {
|
|
48
|
+
type: String,
|
|
49
|
+
required: true,
|
|
50
|
+
validator(value: string) {
|
|
51
|
+
return VARIANT_CLASSES.includes(value);
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
styleClassPassthrough: {
|
|
55
|
+
type: Array as PropType<string[]>,
|
|
56
|
+
default: () => [],
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
const { elementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<style lang="css">
|
|
64
|
+
/*
|
|
65
|
+
* Page Layout by https://layout-breakouts-builder.vercel.app
|
|
66
|
+
**/
|
|
67
|
+
.layout-row > *,
|
|
68
|
+
.full-width > * {
|
|
69
|
+
grid-column: content;
|
|
70
|
+
}
|
|
71
|
+
.layout-row,
|
|
72
|
+
.full-width {
|
|
73
|
+
--minimum-content-padding: 1rem;
|
|
74
|
+
|
|
75
|
+
/** TRACK WIDTHS **/
|
|
76
|
+
--full-max-width: 1fr;
|
|
77
|
+
--popout-max-width: 1400px;
|
|
78
|
+
--content-max-width: 1060px;
|
|
79
|
+
--inset-content-max-width: 840px;
|
|
80
|
+
|
|
81
|
+
/** TRACK SIZES **/
|
|
82
|
+
--full: minmax(var(--minimum-content-padding), 1fr);
|
|
83
|
+
--popout: minmax(0, calc((var(--popout-max-width) - var(--content-max-width)) * 0.5));
|
|
84
|
+
--content: minmax(0, calc((var(--content-max-width) - var(--inset-content-max-width)) * 0.5));
|
|
85
|
+
--inset-content: min(var(--inset-content-max-width), 100% - var(--minimum-content-padding) * 2);
|
|
86
|
+
|
|
87
|
+
display: grid;
|
|
88
|
+
grid-template-columns:
|
|
89
|
+
[full-start]
|
|
90
|
+
var(--full)
|
|
91
|
+
[popout-start]
|
|
92
|
+
var(--popout)
|
|
93
|
+
[content-start]
|
|
94
|
+
var(--content)
|
|
95
|
+
[inset-content-start]
|
|
96
|
+
var(--inset-content)
|
|
97
|
+
[inset-content-end]
|
|
98
|
+
var(--content)
|
|
99
|
+
[content-end]
|
|
100
|
+
var(--popout)
|
|
101
|
+
[popout-end]
|
|
102
|
+
var(--full)
|
|
103
|
+
[full-end];
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** CLASSES **/
|
|
107
|
+
.full {
|
|
108
|
+
grid-column: full;
|
|
109
|
+
}
|
|
110
|
+
.full-start {
|
|
111
|
+
grid-column-start: full-start;
|
|
112
|
+
}
|
|
113
|
+
.full-end {
|
|
114
|
+
grid-column-end: full-end;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.popout {
|
|
118
|
+
grid-column: popout;
|
|
119
|
+
}
|
|
120
|
+
.popout-start {
|
|
121
|
+
grid-column-start: popout-start;
|
|
122
|
+
}
|
|
123
|
+
.popout-end {
|
|
124
|
+
grid-column-end: popout-end;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.content {
|
|
128
|
+
grid-column: content;
|
|
129
|
+
}
|
|
130
|
+
.content-start {
|
|
131
|
+
grid-column-start: content-start;
|
|
132
|
+
}
|
|
133
|
+
.content-end {
|
|
134
|
+
grid-column-end: content-end;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.inset-content {
|
|
138
|
+
grid-column: inset-content;
|
|
139
|
+
}
|
|
140
|
+
.inset-content-start {
|
|
141
|
+
grid-column-start: inset-content-start;
|
|
142
|
+
}
|
|
143
|
+
.inset-content-end {
|
|
144
|
+
grid-column-end: inset-content-end;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.full-width {
|
|
148
|
+
grid-column: full;
|
|
149
|
+
}
|
|
150
|
+
.full-content,
|
|
151
|
+
.full-content-nopad {
|
|
152
|
+
grid-column: full;
|
|
153
|
+
}
|
|
154
|
+
.full-content {
|
|
155
|
+
padding-inline: var(--minimum-content-padding);
|
|
156
|
+
}
|
|
157
|
+
</style>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="masonry-grid-wrapper" :class="[elementClasses]" :style="`--_masonry-grid-gap: ${gap}${unit}; --_item-min-width: ${itemMinWidth}px`">
|
|
3
|
+
<template v-for="item in gridData" :key="item.id">
|
|
4
|
+
<div class="masonry-grid-item">
|
|
5
|
+
<slot :name="item.id"></slot>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script setup lang="ts">
|
|
12
|
+
const props = defineProps({
|
|
13
|
+
gridData: {
|
|
14
|
+
type: Object,
|
|
15
|
+
default: {},
|
|
16
|
+
},
|
|
17
|
+
itemMinWidth: {
|
|
18
|
+
type: Number,
|
|
19
|
+
default: 300,
|
|
20
|
+
},
|
|
21
|
+
gap: {
|
|
22
|
+
type: Number,
|
|
23
|
+
default: 1.2,
|
|
24
|
+
},
|
|
25
|
+
unit: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: 'rem',
|
|
28
|
+
},
|
|
29
|
+
styleClassPassthrough: {
|
|
30
|
+
type: Array as PropType<string[]>,
|
|
31
|
+
default: () => [],
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
const { elementClasses, resetElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
|
|
36
|
+
|
|
37
|
+
const gridData = toRef(() => props.gridData);
|
|
38
|
+
|
|
39
|
+
watch(
|
|
40
|
+
() => props.styleClassPassthrough,
|
|
41
|
+
() => {
|
|
42
|
+
resetElementClasses(props.styleClassPassthrough);
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<style lang="css">
|
|
48
|
+
.masonry-grid-wrapper {
|
|
49
|
+
--_border-color: light-dark(hsl(0, 29%, 3%), hsl(0, 0%, 92%));
|
|
50
|
+
--_color: light-dark(hsl(0, 29%, 3%), hsl(0, 0%, 92%));
|
|
51
|
+
|
|
52
|
+
columns: var(--_item-min-width);
|
|
53
|
+
gap: 12px;
|
|
54
|
+
|
|
55
|
+
.masonry-grid-item {
|
|
56
|
+
break-inside: avoid;
|
|
57
|
+
outline: 0.1rem solid var(--_border-color);
|
|
58
|
+
padding: 1.2rem;
|
|
59
|
+
margin-block-end: var(--_masonry-grid-gap);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
</style>
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="masonry-grid-wrapper" :class="[elementClasses]" :style="`--_masonry-grid-gap: ${gap}${unit}; --_item-min-width: ${itemMinWidth}px`" ref="gridWrapper">
|
|
3
|
+
<template v-for="item in rearrangedItems" :key="item.id">
|
|
4
|
+
<div class="masonry-grid-item">
|
|
5
|
+
<slot :name="item.id"></slot>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script setup lang="ts">
|
|
12
|
+
import { useResizeObserver } from '@vueuse/core';
|
|
13
|
+
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
gridData: {
|
|
16
|
+
type: Array as PropType<any[]>,
|
|
17
|
+
default: () => [],
|
|
18
|
+
},
|
|
19
|
+
itemMinWidth: {
|
|
20
|
+
type: Number,
|
|
21
|
+
default: 300,
|
|
22
|
+
},
|
|
23
|
+
gap: {
|
|
24
|
+
type: Number,
|
|
25
|
+
default: 1.2,
|
|
26
|
+
},
|
|
27
|
+
unit: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: 'rem',
|
|
30
|
+
},
|
|
31
|
+
styleClassPassthrough: {
|
|
32
|
+
type: Array as PropType<string[]>,
|
|
33
|
+
default: () => [],
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const { elementClasses, resetElementClasses } = useStyleClassPassthrough(props.styleClassPassthrough);
|
|
38
|
+
|
|
39
|
+
const gridData = toRef(() => props.gridData);
|
|
40
|
+
|
|
41
|
+
const gridWrapper = ref<HTMLDivElement>();
|
|
42
|
+
|
|
43
|
+
const getColumnCountWithinGridWrapper = () => {
|
|
44
|
+
return gridWrapper.value ? Math.floor(gridWrapper.value.clientWidth / props.itemMinWidth) : 0;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// const columns = ref(4);
|
|
48
|
+
const columns = computed(() => {
|
|
49
|
+
return gridWrapper.value ? Math.floor(gridWrapper.value.clientWidth / props.itemMinWidth) : 0;
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const rearrangeArray = (items: any[], columns: number): any[] => {
|
|
53
|
+
const rows = Math.ceil(items.length / columns);
|
|
54
|
+
const rearrangedArray = [];
|
|
55
|
+
|
|
56
|
+
for (let col = 0; col < columns; col++) {
|
|
57
|
+
for (let row = 0; row < rows; row++) {
|
|
58
|
+
const index = row * columns + col;
|
|
59
|
+
if (index < items.length) {
|
|
60
|
+
rearrangedArray.push(items[index]);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return rearrangedArray;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const rearrangedItems = computed(() => rearrangeArray(props.gridData, columns.value));
|
|
69
|
+
// const rearrangedItems = computed(() => {
|
|
70
|
+
// const rows = Math.ceil(props.gridData.length / columns.value);
|
|
71
|
+
// const rearrangedArray = [];
|
|
72
|
+
|
|
73
|
+
// for (let col = 0; col < columns.value; col++) {
|
|
74
|
+
// for (let row = 0; row < rows; row++) {
|
|
75
|
+
// const index = row * columns.value + col;
|
|
76
|
+
// if (index < props.gridData.length) {
|
|
77
|
+
// rearrangedArray.push(props.gridData[index]);
|
|
78
|
+
// }
|
|
79
|
+
// }
|
|
80
|
+
// }
|
|
81
|
+
|
|
82
|
+
// return rearrangedArray;
|
|
83
|
+
// });
|
|
84
|
+
|
|
85
|
+
watch(
|
|
86
|
+
() => props.styleClassPassthrough,
|
|
87
|
+
() => {
|
|
88
|
+
resetElementClasses(props.styleClassPassthrough);
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
// onMounted(() => {
|
|
93
|
+
// console.log(getColumnCountWithinGridWrapper());
|
|
94
|
+
// });
|
|
95
|
+
|
|
96
|
+
// useResizeObserver(gridWrapper, () => {
|
|
97
|
+
// console.log(getColumnCountWithinGridWrapper());
|
|
98
|
+
// });
|
|
99
|
+
</script>
|
|
100
|
+
|
|
101
|
+
<style lang="css">
|
|
102
|
+
.masonry-grid-wrapper {
|
|
103
|
+
--_border-color: light-dark(hsl(0, 29%, 3%), hsl(0, 0%, 92%));
|
|
104
|
+
|
|
105
|
+
columns: var(--_item-min-width);
|
|
106
|
+
gap: var(--_masonry-grid-gap);
|
|
107
|
+
|
|
108
|
+
.masonry-grid-item {
|
|
109
|
+
break-inside: avoid;
|
|
110
|
+
outline: 0.1rem solid var(--_border-color);
|
|
111
|
+
padding: 1.2rem;
|
|
112
|
+
margin-block-end: var(--_masonry-grid-gap);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
</style>
|