Updated Shipping Note

This commit is contained in:
Luca Haid
2025-01-21 09:23:10 +01:00
parent 38d5cd1861
commit f5e167d477
3 changed files with 90 additions and 11 deletions
@@ -29,7 +29,7 @@ Vue.component('tt-table-crud', {
<template v-slot:actions="{ row }">
<!-- calculate min width 1 + number of actions * 19 -->
<div style="display: flex; justify-content: space-around; align-items: center;"
:style="{minWidth: (1 + crudConfig?.additionalActions?.length || 0) * 19 + 'px'}">
:style="{minWidth: calculateMinActionsWidth(row)}">
<a style="cursor: pointer;" @click="openCrudModal(row)"><i class="far fa-edit text-primary"
title="Editieren"></i></a>
@@ -154,6 +154,22 @@ Vue.component('tt-table-crud', {
}
this.$set(this, 'crudModalColumnVisibility', crudModalColumnVisibility)
},
calculateMinActionsWidth(row) {
// Base width for the edit action
let minWidth = 19;
// Check additional actions
if (this.crudConfig && this.crudConfig.additionalActions) {
this.crudConfig.additionalActions.forEach(action => {
// Add width if action is visible (no condition or condition is true)
if (!action.condition || action.condition(row)) {
minWidth += 19;
}
});
}
return `${minWidth}px`;
}
}, computed: {
tableConfig() {