@bagelink/vue 0.0.302 → 0.0.304
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/dist/components/Alert.vue.d.ts +1 -0
- package/dist/components/Alert.vue.d.ts.map +1 -1
- package/dist/components/Btn.vue.d.ts.map +1 -1
- package/dist/components/Card.vue.d.ts +6 -2
- package/dist/components/Card.vue.d.ts.map +1 -1
- package/dist/components/Carousel.vue.d.ts +64 -0
- package/dist/components/Carousel.vue.d.ts.map +1 -0
- package/dist/components/ListView.vue.d.ts +2 -26
- package/dist/components/ListView.vue.d.ts.map +1 -1
- package/dist/components/Modal.vue.d.ts +0 -1
- package/dist/components/Modal.vue.d.ts.map +1 -1
- package/dist/components/ModalForm.vue.d.ts.map +1 -1
- package/dist/components/NavBar.vue.d.ts +0 -7
- package/dist/components/NavBar.vue.d.ts.map +1 -1
- package/dist/components/PageTitle.vue.d.ts.map +1 -1
- package/dist/components/Popover.vue.d.ts +10 -0
- package/dist/components/Popover.vue.d.ts.map +1 -0
- package/dist/components/TableSchema.vue.d.ts.map +1 -1
- package/dist/components/form/BglForm.vue.d.ts.map +1 -1
- package/dist/components/form/ItemRef.vue.d.ts +0 -1
- package/dist/components/form/ItemRef.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/DateInput.vue.d.ts +0 -1
- package/dist/components/form/inputs/SelectField.vue.d.ts +4 -1
- package/dist/components/form/inputs/SelectField.vue.d.ts.map +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index.cjs +355 -211
- package/dist/index.d.ts +0 -1
- package/dist/index.mjs +356 -212
- package/dist/style.css +1166 -859
- package/dist/types/NavLink.d.ts +9 -0
- package/dist/types/NavLink.d.ts.map +1 -0
- package/dist/types/materialIcon.d.ts +2 -0
- package/dist/types/materialIcon.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/Alert.vue +37 -16
- package/src/components/Avatar.vue +1 -1
- package/src/components/Badge.vue +50 -5
- package/src/components/Btn.vue +137 -135
- package/src/components/Card.vue +46 -3
- package/src/components/Carousel.vue +258 -0
- package/src/components/ListItem.vue +1 -1
- package/src/components/ListView.vue +47 -38
- package/src/components/Modal.vue +38 -2
- package/src/components/ModalForm.vue +4 -2
- package/src/components/NavBar.vue +42 -67
- package/src/components/PageTitle.vue +33 -11
- package/src/components/TabbedLayout.vue +1 -1
- package/src/components/TableSchema.vue +67 -77
- package/src/components/index.ts +1 -1
- package/src/components/whatsapp/form/MsgTemplate.vue +1 -1
- package/src/styles/bagel.css +11 -2
- package/src/styles/buttons.css +1 -0
- package/src/styles/inputs.css +91 -92
- package/src/styles/layout.css +337 -18
- package/src/styles/loginCard.css +48 -0
- package/src/styles/text.css +27 -11
- package/src/styles/theme.css +226 -515
- package/src/styles/transitions.css +18 -0
- package/src/types/NavLink.ts +9 -0
- package/dist/components/Drop.vue.d.ts +0 -34
- package/dist/components/Drop.vue.d.ts.map +0 -1
- package/dist/components/FileUploader.vue.d.ts +0 -60
- package/dist/components/FileUploader.vue.d.ts.map +0 -1
- package/src/components/LangText.vue +0 -32
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="BglCarousel" :style="{ height: yHeight }" :class="{ autoHeight }">
|
|
3
|
+
<div :class="{ dragging: isDragging, clicking: isPressed, [`slides-${items}`]: true, allowScroll }"
|
|
4
|
+
@scrollend="scrollEnd" @mousedown="startDragging" class="bgl-slider" ref="bglSlider">
|
|
5
|
+
<div v-if="isDragging" class="blocker" />
|
|
6
|
+
<slot />
|
|
7
|
+
</div>
|
|
8
|
+
<div class="Handlers">
|
|
9
|
+
<span @click="prev">
|
|
10
|
+
<slot name="prev" />
|
|
11
|
+
</span>
|
|
12
|
+
<span @click="next">
|
|
13
|
+
<slot name="next" />
|
|
14
|
+
</span>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup lang="ts">
|
|
20
|
+
import { onMounted, watch, onUnmounted } from 'vue';
|
|
21
|
+
|
|
22
|
+
const bglSlider = $ref<HTMLElement>();
|
|
23
|
+
let activeSlideIndex = $ref(0);
|
|
24
|
+
let isDragging = $ref(false);
|
|
25
|
+
let startX = $ref(0);
|
|
26
|
+
let scrollLeft = $ref(0);
|
|
27
|
+
let isPressed = $ref(false);
|
|
28
|
+
|
|
29
|
+
const emit = defineEmits(['update:index']);
|
|
30
|
+
|
|
31
|
+
const props = defineProps({
|
|
32
|
+
autoHeight: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: false,
|
|
35
|
+
},
|
|
36
|
+
allowScroll: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: true,
|
|
39
|
+
},
|
|
40
|
+
freeDrag: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: true,
|
|
43
|
+
},
|
|
44
|
+
items: {
|
|
45
|
+
type: Number,
|
|
46
|
+
default: 4,
|
|
47
|
+
},
|
|
48
|
+
index: {
|
|
49
|
+
type: Number,
|
|
50
|
+
default: 0,
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const disableDrag = () => {
|
|
55
|
+
bglSlider?.querySelectorAll('img').forEach((e) => e.setAttribute('draggable', 'false'));
|
|
56
|
+
|
|
57
|
+
for (const e of bglSlider?.children as any[] | undefined || []) {
|
|
58
|
+
e.setAttribute('draggable', 'false');
|
|
59
|
+
e.addEventListener('click', (e: any) => e.preventDefault());
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
let yHeight = $ref('auto');
|
|
64
|
+
const evalHeight = () => {
|
|
65
|
+
if (!props.autoHeight || !bglSlider) return;
|
|
66
|
+
const slidChildren = bglSlider.children[activeSlideIndex].children;
|
|
67
|
+
const height = Array.from(slidChildren).map((el) => el.clientHeight).reduce((a, b) => a + b, 0);
|
|
68
|
+
|
|
69
|
+
yHeight = `${height}px`;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const goToSlide = (index: number) => {
|
|
73
|
+
if (!bglSlider || index < 0 || index > bglSlider.children.length - 1) return;
|
|
74
|
+
|
|
75
|
+
const slider = bglSlider;
|
|
76
|
+
const scrollX = slider.offsetWidth * index;
|
|
77
|
+
slider.scrollTo({ left: scrollX, behavior: 'smooth' });
|
|
78
|
+
|
|
79
|
+
activeSlideIndex = index;
|
|
80
|
+
evalHeight();
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
watch(() => props.index, goToSlide);
|
|
84
|
+
|
|
85
|
+
watch(activeSlideIndex, (index) => emit('update:index', index));
|
|
86
|
+
|
|
87
|
+
const scrollEnd = () => {
|
|
88
|
+
const slider = bglSlider;
|
|
89
|
+
if (!slider || props.items !== 1) return;
|
|
90
|
+
const nextSlide = Math.round(slider.scrollLeft / slider.offsetWidth);
|
|
91
|
+
goToSlide(nextSlide);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const stopDragging = (e: MouseEvent) => {
|
|
95
|
+
isPressed = false;
|
|
96
|
+
const slider = bglSlider;
|
|
97
|
+
if (!slider) return;
|
|
98
|
+
const isDragForward = startX > (e.pageX + slider.offsetLeft);
|
|
99
|
+
if (isDragForward) activeSlideIndex = Math.ceil(slider.scrollLeft / slider.offsetWidth);
|
|
100
|
+
else activeSlideIndex = Math.floor(slider.scrollLeft / slider.offsetWidth);
|
|
101
|
+
if (props.items === 1) goToSlide(activeSlideIndex);
|
|
102
|
+
startX = 0;
|
|
103
|
+
document.removeEventListener('mousemove', move);
|
|
104
|
+
document.removeEventListener('mouseup', stopDragging);
|
|
105
|
+
document.removeEventListener('dragend', stopDragging);
|
|
106
|
+
setTimeout(() => isDragging = false, 100);
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
const move = (e: MouseEvent) => {
|
|
110
|
+
if (!bglSlider) return;
|
|
111
|
+
const x = e.pageX - bglSlider.offsetLeft;
|
|
112
|
+
const walk = x - startX;
|
|
113
|
+
if (walk > 20 || walk < -20) isDragging = true;
|
|
114
|
+
if (!isDragging) return;
|
|
115
|
+
const scroll = x - startX;
|
|
116
|
+
bglSlider.scrollLeft = scrollLeft - scroll;
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
// eslint-disable-next-line no-unused-vars
|
|
120
|
+
const startDragging = (e: MouseEvent) => {
|
|
121
|
+
if (e.button !== 0 || !props.freeDrag || !bglSlider) return;
|
|
122
|
+
startX = e.pageX - bglSlider.offsetLeft;
|
|
123
|
+
scrollLeft = bglSlider.scrollLeft;
|
|
124
|
+
isPressed = true;
|
|
125
|
+
document.addEventListener('mousemove', move);
|
|
126
|
+
document.addEventListener('mouseup', stopDragging);
|
|
127
|
+
document.addEventListener('dragend', stopDragging);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
// eslint-disable-next-line no-unused-vars
|
|
131
|
+
const next = () => {
|
|
132
|
+
if (!bglSlider) return;
|
|
133
|
+
const slideCount = bglSlider.children.length;
|
|
134
|
+
const isLastSlide = activeSlideIndex >= slideCount - 1;
|
|
135
|
+
if (isLastSlide) goToSlide(0);
|
|
136
|
+
else goToSlide(activeSlideIndex + 1);
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
// eslint-disable-next-line no-unused-vars
|
|
140
|
+
const prev = () => {
|
|
141
|
+
if (!bglSlider) return;
|
|
142
|
+
const slideCount = bglSlider.children.length;
|
|
143
|
+
if (activeSlideIndex === 0) goToSlide(slideCount - 1);
|
|
144
|
+
else goToSlide(activeSlideIndex - 1);
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const evalWidth = () => {
|
|
148
|
+
if (!bglSlider) return;
|
|
149
|
+
goToSlide(activeSlideIndex);
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
onMounted(() => {
|
|
153
|
+
window.addEventListener('resize', evalWidth);
|
|
154
|
+
evalHeight();
|
|
155
|
+
disableDrag();
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
onUnmounted(() => window.removeEventListener('resize', evalWidth));
|
|
159
|
+
</script>
|
|
160
|
+
|
|
161
|
+
<style scoped>
|
|
162
|
+
.blocker {
|
|
163
|
+
position: fixed;
|
|
164
|
+
top: 0;
|
|
165
|
+
left: 0;
|
|
166
|
+
width: 100%;
|
|
167
|
+
height: 100%;
|
|
168
|
+
z-index: 100;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.bgl-slider {
|
|
172
|
+
display: grid;
|
|
173
|
+
position: relative;
|
|
174
|
+
scroll-behavior: smooth;
|
|
175
|
+
grid-auto-flow: column;
|
|
176
|
+
grid-auto-columns: 100%;
|
|
177
|
+
scroll-snap-type: x mandatory;
|
|
178
|
+
overflow-x: hidden;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.autoHeight {
|
|
182
|
+
transition: height ease 0.7s;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.bgl-slider.allowScroll {
|
|
186
|
+
overflow-x: scroll;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.bgl-slider.slides-6 {
|
|
190
|
+
grid-auto-columns: 15.9%;
|
|
191
|
+
gap: 1%;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.bgl-slider.slides-5 {
|
|
195
|
+
grid-auto-columns: 19.3%;
|
|
196
|
+
gap: 1%;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.bgl-slider.slides-4 {
|
|
200
|
+
grid-auto-columns: 24.3%;
|
|
201
|
+
gap: 1%;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.bgl-slider.slides-3 {
|
|
205
|
+
grid-auto-columns: 33%;
|
|
206
|
+
gap: 1%;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.bgl-slider.slides-2 {
|
|
210
|
+
grid-auto-columns: 50%;
|
|
211
|
+
gap: 1%;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.bgl-slider.slides-1 {
|
|
215
|
+
grid-auto-columns: 100%;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.bgl-slider::-webkit-scrollbar {
|
|
219
|
+
display: none;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.bgl-slider * {
|
|
223
|
+
scroll-snap-align: start;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.dragging.bgl-slider {
|
|
227
|
+
cursor: grabbing;
|
|
228
|
+
cursor: -webkit-grabbing;
|
|
229
|
+
scroll-snap-type: unset;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.clicking.bgl-slider {
|
|
233
|
+
scroll-behavior: unset;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.dragging.bgl-slider * {
|
|
237
|
+
scroll-snap-align: unset;
|
|
238
|
+
user-select: none;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
@media screen and (max-width: 1280px) {
|
|
242
|
+
.bgl-slider.slides-4 {
|
|
243
|
+
grid-auto-columns: 33%;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
@media screen and (max-width: 991px) {
|
|
248
|
+
.bgl-slider.slides-4 {
|
|
249
|
+
grid-auto-columns: 50%;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
@media screen and (max-width: 600px) {
|
|
254
|
+
.bgl-slider.slides-4 {
|
|
255
|
+
grid-auto-columns: 100%;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
</style>
|
|
@@ -1,50 +1,59 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="
|
|
3
|
-
<div class="
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
class="bagel-input search-wrap"
|
|
7
|
-
>
|
|
8
|
-
<input
|
|
9
|
-
:placeholder="searchPlaceholder"
|
|
10
|
-
v-model="searchTerm"
|
|
11
|
-
@input="search()"
|
|
12
|
-
>
|
|
13
|
-
<MaterialIcon
|
|
14
|
-
class="txtgray"
|
|
15
|
-
icon="search"
|
|
16
|
-
/>
|
|
17
|
-
</div>
|
|
18
|
-
<Btn
|
|
19
|
-
v-if="enableAdd"
|
|
20
|
-
icon="add"
|
|
21
|
-
@click="emit('add')"
|
|
22
|
-
/>
|
|
23
|
-
</div>
|
|
24
|
-
<div class="list-content grid auto-flow-rows align-items-start">
|
|
2
|
+
<div class="list-wrap bgl_card thin grid overflow-hidden h-100 p-0">
|
|
3
|
+
<div class="p-1">
|
|
4
|
+
<slot name="header" />
|
|
5
|
+
</div> <div class="list-content auto-flow-rows align-items-start overflow-y h-100">
|
|
25
6
|
<slot />
|
|
26
7
|
</div>
|
|
27
8
|
</div>
|
|
28
9
|
</template>
|
|
29
10
|
|
|
30
11
|
<script lang="ts" setup>
|
|
31
|
-
import
|
|
32
|
-
|
|
33
|
-
defineProps<{
|
|
34
|
-
enableAdd?: boolean;
|
|
35
|
-
enableSearch?: boolean;
|
|
36
|
-
searchPlaceholder: string;
|
|
37
|
-
}>();
|
|
38
|
-
const emit = defineEmits(['search', 'add', 'debounce']);
|
|
39
|
-
const searchTerm = $ref('');
|
|
40
|
-
const search = () => {
|
|
41
|
-
emit('search', searchTerm);
|
|
42
|
-
debounce(() => emit('debounce', searchTerm));
|
|
43
|
-
};
|
|
12
|
+
import Card from './Card.vue';
|
|
13
|
+
|
|
44
14
|
</script>
|
|
45
15
|
|
|
46
16
|
<style>
|
|
47
|
-
.
|
|
48
|
-
|
|
17
|
+
.list-wrap{
|
|
18
|
+
grid-template-rows: auto 1fr;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.list-item {
|
|
22
|
+
padding: 0.5rem 1rem;
|
|
23
|
+
min-height: -webkit-fit-content;
|
|
24
|
+
min-height: -moz-fit-content;
|
|
25
|
+
min-height: fit-content;
|
|
26
|
+
margin: 0.25rem 0;
|
|
27
|
+
border-radius: 10px;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
transition: var(--bgl-transition);
|
|
30
|
+
color: var(--bgl-black);
|
|
31
|
+
text-decoration: none;
|
|
32
|
+
position: relative;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.list-item::after {
|
|
36
|
+
content: "";
|
|
37
|
+
position: absolute;
|
|
38
|
+
left: 0;
|
|
39
|
+
right: 0;
|
|
40
|
+
bottom: -0.15rem;
|
|
41
|
+
border-bottom: 1px solid var(--border-color);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.list-item:hover,
|
|
45
|
+
.list-item.router-link-active {
|
|
46
|
+
background-color: var(--bgl-blue-light);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.list-item:active {
|
|
50
|
+
-webkit-filter: var(--bgl-hover-filter);
|
|
51
|
+
filter: var(--bgl-hover-filter);
|
|
52
|
+
}
|
|
53
|
+
@media screen and (max-width: 910px) {
|
|
54
|
+
|
|
55
|
+
.list-item {
|
|
56
|
+
padding: 0.5rem;
|
|
57
|
+
}
|
|
49
58
|
}
|
|
50
59
|
</style>
|
package/src/components/Modal.vue
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
</template>
|
|
18
18
|
|
|
19
19
|
<script lang="ts" setup>
|
|
20
|
-
import { onUnmounted, watch } from 'vue';
|
|
20
|
+
import { onMounted, onUnmounted, watch } from 'vue';
|
|
21
21
|
import {
|
|
22
22
|
type BtnOptions, Btn, useEscape, Title, Card,
|
|
23
23
|
} from '@bagelink/vue';
|
|
@@ -52,10 +52,46 @@ const escapeKeyClose = (e: KeyboardEvent) => props?.dismissable && useEscape(e,
|
|
|
52
52
|
|
|
53
53
|
function openModal() {
|
|
54
54
|
setTimeout(() => isVisible = true, 1);
|
|
55
|
-
document.addEventListener('keydown', escapeKeyClose);
|
|
56
55
|
}
|
|
57
56
|
|
|
57
|
+
onMounted(() => document.addEventListener('keydown', escapeKeyClose));
|
|
58
|
+
|
|
58
59
|
onUnmounted(() => {
|
|
59
60
|
document.removeEventListener('keydown', escapeKeyClose);
|
|
60
61
|
});
|
|
61
62
|
</script>
|
|
63
|
+
|
|
64
|
+
<style>
|
|
65
|
+
.modal-title {
|
|
66
|
+
text-align: center;
|
|
67
|
+
font-weight: 600;
|
|
68
|
+
font-size: 20px;
|
|
69
|
+
margin-top: 0.5rem;
|
|
70
|
+
margin-bottom: 0 !important;
|
|
71
|
+
width: 100%;
|
|
72
|
+
-webkit-padding-end: 40px;
|
|
73
|
+
padding-inline-end: 40px;
|
|
74
|
+
line-height: 2;
|
|
75
|
+
display: -webkit-box;
|
|
76
|
+
max-width: 100%;
|
|
77
|
+
-webkit-line-clamp: 1;
|
|
78
|
+
-webkit-box-orient: vertical;
|
|
79
|
+
overflow: hidden;
|
|
80
|
+
text-overflow: ellipsis;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.modal-footer {
|
|
84
|
+
gap: 1rem;
|
|
85
|
+
display: flex;
|
|
86
|
+
justify-content: space-between;
|
|
87
|
+
align-items: center;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.modal-footer>div {
|
|
91
|
+
gap: 1rem;
|
|
92
|
+
display: flex;
|
|
93
|
+
justify-content: space-between;
|
|
94
|
+
align-items: center;
|
|
95
|
+
gap: 0;
|
|
96
|
+
}
|
|
97
|
+
</style>
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Modal
|
|
3
|
-
:
|
|
2
|
+
<Modal
|
|
3
|
+
@onUpdate:isModalVisible="props['onUpdate:isModalVisible']" :side="side" ref="modal" :dismissable="dismissable"
|
|
4
|
+
:title="title"
|
|
5
|
+
>
|
|
4
6
|
<BagelForm @submit="runSubmit" ref="form" v-model="formData" :schema="computedFormSchema" />
|
|
5
7
|
<template #footer v-if="onDelete || onSubmit">
|
|
6
8
|
<div>
|
|
@@ -1,84 +1,59 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<div class="bot-buttons-wrapper">
|
|
35
|
-
<component
|
|
36
|
-
:is="link.to?'router-link':'div'"
|
|
37
|
-
v-for="link in footerLinks"
|
|
38
|
-
class="nav-button"
|
|
39
|
-
:to="link.to"
|
|
40
|
-
@click="link.onClick?.()"
|
|
41
|
-
:key="link.label"
|
|
42
|
-
>
|
|
43
|
-
<MaterialIcon :icon="link.materialIcon" />
|
|
44
|
-
<div class="tooltip">
|
|
45
|
-
{{ link.label }}
|
|
46
|
-
</div>
|
|
47
|
-
</component>
|
|
48
|
-
<slot name="floor" />
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
2
|
+
<div :class="{ open: isOpen, closed: !isOpen }">
|
|
3
|
+
<slot name="top" />
|
|
4
|
+
<div class="nav-expend" @click="isOpen = !isOpen" @keypress.enter="isOpen = !isOpen" role="button"
|
|
5
|
+
aria-label="Toggle Navigation" tabindex="0">
|
|
6
|
+
<MaterialIcon icon="chevron_right" class="top-arrow" />
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<div class="full-nav">
|
|
10
|
+
<div class="nav-scroll">
|
|
11
|
+
<div class="nav-links-wrapper">
|
|
12
|
+
<component :is="link.to?'router-link':'div'" v-for="link in links" class="nav-button" :to="link.to"
|
|
13
|
+
:key="link.label" @click="link.onClick?.()">
|
|
14
|
+
<MaterialIcon :icon="link.materialIcon" />
|
|
15
|
+
<div class="tooltip">
|
|
16
|
+
{{ link.label }}
|
|
17
|
+
</div>
|
|
18
|
+
</component>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<div class="bot-buttons-wrapper">
|
|
23
|
+
<component :is="link.to?'router-link':'div'" v-for="link in footerLinks" class="nav-button" :to="link.to"
|
|
24
|
+
@click="link.onClick?.()" :key="link.label">
|
|
25
|
+
<MaterialIcon :icon="link.materialIcon" />
|
|
26
|
+
<div class="tooltip">
|
|
27
|
+
{{ link.label }}
|
|
28
|
+
</div>
|
|
29
|
+
</component>
|
|
30
|
+
<slot name="floor" />
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
52
34
|
</template>
|
|
53
35
|
|
|
54
36
|
<script lang="ts" setup>
|
|
55
|
-
import type { MaterialIcons } from '@bagelink/vue';
|
|
37
|
+
import type { MaterialIcons, NavLink } from '@bagelink/vue';
|
|
56
38
|
import { MaterialIcon } from '@bagelink/vue';
|
|
57
39
|
|
|
58
40
|
const isOpen = $ref(true);
|
|
59
|
-
export type NavLink = {
|
|
60
|
-
label: string;
|
|
61
|
-
to?: string;
|
|
62
|
-
materialIcon: MaterialIcons;
|
|
63
|
-
localized?: string;
|
|
64
|
-
onClick?: () => void;
|
|
65
|
-
}
|
|
66
41
|
|
|
67
42
|
withDefaults(
|
|
68
|
-
|
|
43
|
+
defineProps<{
|
|
69
44
|
footerLinks?: NavLink[];
|
|
70
|
-
links?:NavLink[];
|
|
45
|
+
links?: NavLink[];
|
|
71
46
|
homeIcon?: MaterialIcons;
|
|
72
47
|
homeLabel?: string;
|
|
73
48
|
homeTo?: string;
|
|
74
49
|
}>(),
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
50
|
+
{
|
|
51
|
+
homeIcon: 'home',
|
|
52
|
+
homeLabel: 'Home',
|
|
53
|
+
homeTo: '/',
|
|
54
|
+
links: () => [],
|
|
55
|
+
footerLinks: () => [],
|
|
56
|
+
},
|
|
82
57
|
);
|
|
83
58
|
</script>
|
|
84
59
|
|
|
@@ -1,17 +1,39 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
</div>
|
|
2
|
+
<div class="page-top">
|
|
3
|
+
<h1 class="top-title">
|
|
4
|
+
<slot /> {{ value }}
|
|
5
|
+
</h1>
|
|
6
|
+
</div>
|
|
8
7
|
</template>
|
|
9
|
-
|
|
10
8
|
<script lang="ts" setup>
|
|
11
9
|
defineProps({
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
value: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: '',
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
,
|
|
16
16
|
});
|
|
17
17
|
</script>
|
|
18
|
+
<style>
|
|
19
|
+
.top-title {
|
|
20
|
+
font-weight: 600;
|
|
21
|
+
font-size: 20px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.page-top {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
gap: 1rem;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@media screen and (max-width: 910px) {
|
|
31
|
+
.top-title {
|
|
32
|
+
font-size: 1.25em;
|
|
33
|
+
margin-bottom: 1rem;
|
|
34
|
+
font-weight: 400;
|
|
35
|
+
-webkit-margin-start: 0.5rem;
|
|
36
|
+
margin-inline-start: 0.5rem;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
</style>
|