// Public label overrides localize this fixture; toolkit/host defaults keep their language.
// SPDX-License-Identifier: GPL-3.0-or-later
import { DataAlignment, DataSortDirection, KitDataTable, KitTheme, KitThemes } from "@kit/kit.slint";

export component Example inherits Window {
    title: "KitDataTable — exemple";
    preferred-width: 620px;
    preferred-height: 400px;
    max-width: 100000px;
    max-height: 100000px;
    background: root.theme.canvas;
    in-out property <KitTheme> theme: KitThemes.light;
    in-out property <string> status;
    VerticalLayout {
        padding: 24px; spacing: 16px; alignment: start;
        Text { text: "Tableau de données"; color: root.theme.text-primary; font-size: 20px * root.theme.text-scale; font-weight: 600; }
        KitDataTable { label: "Tableau de données"; theme: root.theme; height: 250px; generation: 1; columns: [{ token: 11, label: "Projet", sortable: true, sort: DataSortDirection.ascending, alignment: DataAlignment.leading }, { token: 23, label: "État", sortable: true, sort: DataSortDirection.unsorted, alignment: DataAlignment.leading }, { token: 38, label: "Responsable", sortable: false, sort: DataSortDirection.unsorted, alignment: DataAlignment.leading }]; rows: [{ token: 101, cells: ["Notes de terrain", "En cours", "Alex"], selected: true, disabled: false }, { token: 205, cells: ["Système de design", "Révision", "Jamie"], selected: false, disabled: false }, { token: 309, cells: ["Plan de lancement", "Brouillon", "Taylor"], selected: false, disabled: false }]; activate(token, generation) => { root.status = "Identifiant du projet " + token; } }
        if root.status != "": Text { text: root.status; color: root.theme.text-secondary; font-size: 12px * root.theme.text-scale; wrap: word-wrap; }
    }
}
