diff --git a/resources/js/components/content/Blocks.vue b/resources/js/components/content/Blocks.vue index e598bb0..df9106e 100644 --- a/resources/js/components/content/Blocks.vue +++ b/resources/js/components/content/Blocks.vue @@ -2,9 +2,20 @@ import Table from "@/components/content/partials/Table.vue"; import PlaylistEditor from "@/components/content/partials/PlaylistEditor.vue"; import ConfirmDelete from "@/components/content/partials/dialogs/ConfirmDelete.vue"; -import {reactive, ref, watch} from "vue"; +import {onBeforeMount, reactive, ref, watch} from "vue"; import {blocks_page} from "@/composables/content/blocks_page.ts"; +const props = defineProps({ + hideColumns: { + type: Array, + required: false + }, + isDraggable: { + type: Boolean, + required: false + } +}); + const { items, listData, headers, selected, loading, search, getItems, editItem, deleteItem } = blocks_page() const itemEdited = ref({ @@ -18,6 +29,8 @@ const dialog = reactive({ text: '' }) +const visibleHeaders = ref(headers) + const openDialog = (type, title = '', text = '', bulk = false) => { dialog.open = true dialog.type = type @@ -67,6 +80,14 @@ const updateSearch = (text) => { search.value = text } +onBeforeMount(() => { + if(props.hideColumns != undefined) { + visibleHeaders.value = headers.filter(el => { + return !props.hideColumns.includes(el.value) + }); + } +}) + const resetItemEdited = () => { itemEdited.value = { id: null, @@ -87,7 +108,7 @@ watch(search, (newValue, oldValue) => { /> { :get-items="getItems" :actions="true" :show-select="true" + :is-draggable="isDraggable" @update-table="getItems" @update-search="updateSearch" @delete-item="cancel"