- prettier formatting
All checks were successful
CI Pipeline / japa-tests (push) Successful in 51s

- npm updates
- new SearchMap.vue component
This commit is contained in:
Kaimbacher 2023-10-31 15:38:43 +01:00
parent 7bc9f90cca
commit a7142f694f
74 changed files with 3360 additions and 3577 deletions

View file

@ -1,11 +1,8 @@
<script setup>
import { Link } from "@inertiajs/vue3"
import BaseButton from "@/Components/BaseButton.vue"
import BaseButtons from "@/Components/BaseButtons.vue"
import {
mdiSquareEditOutline,
mdiTrashCan,
} from "@mdi/js"
import { Link } from '@inertiajs/vue3';
import BaseButton from '@/Components/BaseButton.vue';
import BaseButtons from '@/Components/BaseButtons.vue';
import { mdiSquareEditOutline, mdiTrashCan } from '@mdi/js';
const props = defineProps({
item: {
@ -22,9 +19,9 @@ const props = defineProps({
},
level: {
type: Number,
default: 0
default: 0,
},
})
});
</script>
<template>
@ -40,8 +37,13 @@ const props = defineProps({
</td>
<td v-if="can.edit || can.delete" class="before:hidden lg:w-1 whitespace-nowrap">
<BaseButtons type="justify-start lg:justify-end" no-wrap>
<BaseButton v-if="can.edit" :route-name="route('menu.item.edit', { menu: menu.id, item: item.id })"
color="info" :icon="mdiSquareEditOutline" small />
<BaseButton
v-if="can.edit"
:route-name="route('menu.item.edit', { menu: menu.id, item: item.id })"
color="info"
:icon="mdiSquareEditOutline"
small
/>
<BaseButton v-if="can.delete" color="danger" :icon="mdiTrashCan" small @click="destroy(item.id)" />
</BaseButtons>
</td>
@ -49,4 +51,4 @@ const props = defineProps({
<template v-for="item in item.children">
<MenuItemList :item="item" :menu="menu" :can="can" :level="level + 1" />
</template>
</template>
</template>

View file

@ -59,24 +59,33 @@ total:
<template>
<!-- <nav v-if="data.links.length > 3" -->
<nav v-if="data.total > 3" role="navigation" aria-label="Pagination Navigation"
class="flex items-center justify-between">
<nav v-if="data.total > 3" role="navigation" aria-label="Pagination Navigation" class="flex items-center justify-between">
<div class="flex justify-between flex-1 sm:hidden">
<span v-if="data.current_page <= 1"
class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 rounded-md">
<span
v-if="data.current_page <= 1"
class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 rounded-md"
>
Previous
</span>
<Link v-else :href="data.previous_page_url"
class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-500 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150">
Previous
<Link
v-else
:href="data.previous_page_url"
class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-500 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150"
>
Previous
</Link>
<Link v-if="data.current_page < data.last_page" :href="data.next_page_url"
class="relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-500 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150">
Next
<Link
v-if="data.current_page < data.last_page"
:href="data.next_page_url"
class="relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-500 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150"
>
Next
</Link>
<span v-else
class="relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 rounded-md">
<span
v-else
class="relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 rounded-md"
>
Next
</span>
</div>
@ -99,24 +108,33 @@ total:
<span v-if="props.data.current_page <= 1" aria-disabled="true" aria-label="Previous">
<span
class="relative inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default rounded-l-md leading-5"
aria-hidden="true">
aria-hidden="true"
>
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd"
<path
fill-rule="evenodd"
d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z"
clip-rule="evenodd" />
clip-rule="evenodd"
/>
</svg>
</span>
</span>
<!-- <Link v-else :href="data.previous_page_url" rel="prev" -->
<Link v-else :href="prevPageLink" rel="prev"
<Link
v-else
:href="prevPageLink"
rel="prev"
class="relative inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-l-md leading-5 hover:text-gray-400 focus:z-10 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-500 transition ease-in-out duration-150"
aria-label="Previous">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd"
d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z"
clip-rule="evenodd" />
</svg>
aria-label="Previous"
>
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path
fill-rule="evenodd"
d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z"
clip-rule="evenodd"
/>
</svg>
</Link>
<!-- <template v-for="(link, key) in data.links">
@ -133,24 +151,33 @@ total:
</template>
</template> -->
<Link v-if="props.data.current_page < props.data.last_page" :href="nextPageLink" rel="next"
<Link
v-if="props.data.current_page < props.data.last_page"
:href="nextPageLink"
rel="next"
class="relative inline-flex items-center px-2 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-r-md leading-5 hover:text-gray-400 focus:z-10 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-500 transition ease-in-out duration-150"
aria-label="Next">
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd"
d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
clip-rule="evenodd" />
</svg>
aria-label="Next"
>
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path
fill-rule="evenodd"
d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
clip-rule="evenodd"
/>
</svg>
</Link>
<!-- else disabled link -->
<span v-else aria-disabled="true" aria-label="Next">
<span
class="relative inline-flex items-center px-2 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default rounded-r-md leading-5"
aria-hidden="true">
aria-hidden="true"
>
<svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd"
<path
fill-rule="evenodd"
d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
clip-rule="evenodd" />
clip-rule="evenodd"
/>
</svg>
</span>
</span>

View file

@ -4,73 +4,59 @@ import { Link } from '@inertiajs/vue3';
import { stardust } from '@eidellev/adonis-stardust/client';
const props = defineProps({
label: {
type: String,
default: '',
},
attribute: {
type: String,
default: '',
},
search: {
type: String,
default: '',
},
label: {
type: String,
default: '',
},
attribute: {
type: String,
default: '',
},
search: {
type: String,
default: '',
},
});
const downFill = ref('lightgray');
const upFill = ref('lightgray');
const sortLink = computed(() => {
let url = new URL(document.location);
let sortValue = url.searchParams.get('sort');
let url = new URL(document.location);
let sortValue = url.searchParams.get('sort');
if (sortValue == props.attribute) {
url.searchParams.set('sort', '-' + props.attribute);
upFill.value = 'black';
} else if (sortValue === '-' + props.attribute) {
url.searchParams.set('sort', props.attribute);
downFill.value = 'black';
} else {
url.searchParams.set('sort', props.attribute);
}
if (sortValue == props.attribute) {
url.searchParams.set('sort', '-' + props.attribute);
upFill.value = 'black';
} else if (sortValue === '-' + props.attribute) {
url.searchParams.set('sort', props.attribute);
downFill.value = 'black';
} else {
url.searchParams.set('sort', props.attribute);
}
if (props.search == '') {
url.searchParams.delete('search');
} else {
url.searchParams.set('search', props.search);
}
if (props.search == '') {
url.searchParams.delete('search');
} else {
url.searchParams.set('search', props.search);
}
return url.href;
return url.href;
});
</script>
<template>
<div class="flex items-center gap-4">
<Link :href="sortLink" class="no-underline hover:underline text-cyan-600 dark:text-cyan-400">
{{ label }}
</Link>
<div class="flex flex-col">
<svg
class="inline-block"
xmlns="http://www.w3.org/2000/svg"
width="15px"
height="15px"
viewBox="0 0 15 15"
fill="none"
>
<path d="M7.5 3L15 11H0L7.5 3Z" :fill="upFill" />
</svg>
<svg
class="inline-block"
xmlns="http://www.w3.org/2000/svg"
width="15px"
height="15px"
viewBox="0 0 15 15"
fill="none"
>
<path d="M7.49988 12L-0.00012207 4L14.9999 4L7.49988 12Z" :fill="downFill" />
</svg>
</div>
</div>
<div class="flex items-center gap-4">
<Link :href="sortLink" class="no-underline hover:underline text-cyan-600 dark:text-cyan-400">
{{ label }}
</Link>
<div class="flex flex-col">
<svg class="inline-block" xmlns="http://www.w3.org/2000/svg" width="15px" height="15px" viewBox="0 0 15 15" fill="none">
<path d="M7.5 3L15 11H0L7.5 3Z" :fill="upFill" />
</svg>
<svg class="inline-block" xmlns="http://www.w3.org/2000/svg" width="15px" height="15px" viewBox="0 0 15 15" fill="none">
<path d="M7.49988 12L-0.00012207 4L14.9999 4L7.49988 12Z" :fill="downFill" />
</svg>
</div>
</div>
</template>