chore: entferne nicht genutzte NennungsMaske-Komponente, extrahiere AktionsButtonLeiste in separaten Komponentenordner
This commit is contained in:
+32
-25
@@ -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()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+14
-3
@@ -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,
|
||||
|
||||
+37
-1
@@ -24,11 +24,47 @@ data class ZnsRemoteVerein(
|
||||
val bundesland: String?,
|
||||
)
|
||||
|
||||
data class ZnsRemoteReiter(
|
||||
val id: String,
|
||||
val satznummer: String?,
|
||||
val nachname: String,
|
||||
val vorname: String,
|
||||
val lizenz: String?,
|
||||
val lizenzKlasse: String,
|
||||
)
|
||||
|
||||
data class ZnsRemotePferd(
|
||||
val id: String,
|
||||
val kopfnummer: String?,
|
||||
val name: String,
|
||||
val lebensnummer: String?,
|
||||
val geschlecht: String,
|
||||
)
|
||||
|
||||
data class ZnsRemoteFunktionaer(
|
||||
val id: String,
|
||||
val satzId: String,
|
||||
val satzNummer: Int,
|
||||
val name: String?,
|
||||
val qualifikationen: List<String>,
|
||||
)
|
||||
|
||||
interface ZnsImportProvider {
|
||||
val state: ZnsImportState
|
||||
fun onFileSelected(path: String)
|
||||
fun startImport(mode: String = "FULL")
|
||||
fun searchRemote(query: String)
|
||||
fun syncFromCloud(onResult: (List<ZnsRemoteVerein>) -> Unit)
|
||||
fun syncFromCloud(onResult: (
|
||||
List<ZnsRemoteVerein>,
|
||||
List<ZnsRemoteReiter>,
|
||||
List<ZnsRemotePferd>,
|
||||
List<ZnsRemoteFunktionaer>
|
||||
) -> Unit)
|
||||
fun addSyncResults(
|
||||
vereine: List<ZnsRemoteVerein>,
|
||||
reiter: List<ZnsRemoteReiter>,
|
||||
pferde: List<ZnsRemotePferd>,
|
||||
funktionaere: List<ZnsRemoteFunktionaer>
|
||||
)
|
||||
fun reset()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user