chore: entferne nicht genutzte NennungsMaske-Komponente, extrahiere AktionsButtonLeiste in separaten Komponentenordner

This commit is contained in:
2026-04-19 00:52:12 +02:00
parent 1b20e480f4
commit 64d749be3a
31 changed files with 2704 additions and 2970 deletions
@@ -96,38 +96,45 @@ fun <T> MsDataTable(
}
// --- 2. Body (LazyColumn) ---
LazyColumn(modifier = Modifier.fillMaxSize()) {
itemsIndexed(items) { index, item ->
val bgColor = if (index % 2 == 0) rowBackgroundColor else alternateRowBackgroundColor
Box(modifier = Modifier.weight(1f).fillMaxWidth()) {
val state = androidx.compose.foundation.lazy.rememberLazyListState()
LazyColumn(state = state, modifier = Modifier.fillMaxSize()) {
itemsIndexed(items) { index, item ->
val bgColor = if (index % 2 == 0) rowBackgroundColor else alternateRowBackgroundColor
Surface(
color = bgColor,
modifier = Modifier.fillMaxWidth()
) {
Row(
modifier = Modifier
.fillMaxWidth()
.clickable(enabled = onRowClick != null) { onRowClick?.invoke(item) }
.padding(horizontal = Dimens.SpacingS, vertical = 6.dp), // Kompakte Zeilenhöhe
verticalAlignment = Alignment.CenterVertically
Surface(
color = bgColor,
modifier = Modifier.fillMaxWidth()
) {
columns.forEach { col ->
val colModifier = when {
col.weight != null -> Modifier.weight(col.weight)
col.width != null -> Modifier.width(col.width)
else -> Modifier.wrapContentWidth()
}
Box(
modifier = colModifier,
contentAlignment = col.alignment
) {
col.cellRenderer(item)
Row(
modifier = Modifier
.fillMaxWidth()
.clickable(enabled = onRowClick != null) { onRowClick?.invoke(item) }
.padding(horizontal = Dimens.SpacingS, vertical = 6.dp), // Kompakte Zeilenhöhe
verticalAlignment = Alignment.CenterVertically
) {
columns.forEach { col ->
val colModifier = when {
col.weight != null -> Modifier.weight(col.weight)
col.width != null -> Modifier.width(col.width)
else -> Modifier.wrapContentWidth()
}
Box(
modifier = colModifier,
contentAlignment = col.alignment
) {
col.cellRenderer(item)
}
}
}
}
HorizontalDivider(color = MaterialTheme.colorScheme.outlineVariant.copy(alpha = 0.3f), thickness = 0.5.dp)
}
HorizontalDivider(color = MaterialTheme.colorScheme.outlineVariant.copy(alpha = 0.3f), thickness = 0.5.dp)
}
androidx.compose.foundation.VerticalScrollbar(
adapter = androidx.compose.foundation.rememberScrollbarAdapter(state),
modifier = Modifier.align(Alignment.CenterEnd).fillMaxHeight()
)
}
}
}
@@ -6,13 +6,14 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.material3.*
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.key.*
import androidx.compose.ui.unit.dp
/**
* Ein generisches Dropdown zur Auswahl von Enum-Werten.
* Ein generischer Dropdown zur Auswahl von Enum-Werten.
*
* @param label Das Label über dem Dropdown.
* @param options Alle verfügbaren Enum-Optionen (z.B. SparteE.values()).
* @param options Alle verfügbaren Enum-Optionen (z. B. SparteE.values()).
* @param selectedOption Der aktuell gewählte Wert.
* @param onOptionSelected Callback bei Auswahl einer Option.
* @param optionLabel Transformation des Enums in einen lesbaren Text (Standard: toString()).
@@ -50,7 +51,17 @@ fun <T : Enum<T>> MsEnumDropdown(
colors = ExposedDropdownMenuDefaults.outlinedTextFieldColors(),
modifier = Modifier
.menuAnchor(ExposedDropdownMenuAnchorType.PrimaryEditable, enabled)
.fillMaxWidth(),
.fillMaxWidth()
.onKeyEvent {
if (it.key == Key.Enter || it.key == Key.DirectionCenter) {
if (it.type == KeyEventType.KeyUp) {
expanded = !expanded
}
true
} else {
false
}
},
isError = isError,
enabled = enabled,
singleLine = true,