From d4057ff08f45c47706f0ab2750846d96a444e02b Mon Sep 17 00:00:00 2001 From: philipp lang Date: Sat, 13 Jul 2024 18:48:11 +0200 Subject: [PATCH] Add filter for participants --- resources/js/components/page/Filter.vue | 28 ++++++-- resources/js/composables/useBreakpoints.js | 20 ++++++ resources/js/views/form/Index.vue | 10 +-- resources/js/views/form/Participants.vue | 78 ++++++++++++---------- resources/js/views/invoice/Index.vue | 20 +++--- resources/js/views/member/VIndex.vue | 60 +++++++++-------- 6 files changed, 133 insertions(+), 83 deletions(-) diff --git a/resources/js/components/page/Filter.vue b/resources/js/components/page/Filter.vue index 94d07477..a8f939bb 100644 --- a/resources/js/components/page/Filter.vue +++ b/resources/js/components/page/Filter.vue @@ -1,14 +1,26 @@ @@ -18,12 +30,18 @@ import useBreakpoints from '../../composables/useBreakpoints.js'; const visible = ref(false); +const filterVisible = ref(false); + const props = defineProps({ breakpoint: { type: String, required: true, }, + filterable: { + type: Boolean, + default: () => true, + }, }); -const {visibleDesktop, visibleMobile} = useBreakpoints(props); +const {visibleDesktopBlock, visibleMobile} = useBreakpoints(props); diff --git a/resources/js/composables/useBreakpoints.js b/resources/js/composables/useBreakpoints.js index c54bd5fa..d00c9bb7 100644 --- a/resources/js/composables/useBreakpoints.js +++ b/resources/js/composables/useBreakpoints.js @@ -19,8 +19,28 @@ export default function (props) { }[props.breakpoint]; }); + const visibleMobileBlock = computed(() => { + return { + sm: 'block sm:hidden', + md: 'block md:hidden', + lg: 'block lg:hidden', + xl: 'block xl:hidden', + }[props.breakpoint]; + }); + + const visibleDesktopBlock = computed(() => { + return { + sm: 'hidden sm:block', + md: 'hidden md:block', + lg: 'hidden lg:block', + xl: 'hidden xl:block', + }[props.breakpoint]; + }); + return { visibleMobile, visibleDesktop, + visibleDesktopBlock, + visibleMobileBlock, }; } diff --git a/resources/js/views/form/Index.vue b/resources/js/views/form/Index.vue index bdba101d..c74a590c 100644 --- a/resources/js/views/form/Index.vue +++ b/resources/js/views/form/Index.vue @@ -140,10 +140,12 @@ - - - - + + diff --git a/resources/js/views/form/Participants.vue b/resources/js/views/form/Participants.vue index 1539bd27..edd35a5a 100644 --- a/resources/js/views/form/Participants.vue +++ b/resources/js/views/form/Participants.vue @@ -22,44 +22,48 @@ - Hinzufügen - - + -