SPB Git

Repository Public MIT

manifest.json 3.9 KB 71 lines json

1{2  "accessibility" : [3    "The native table keeps the system's table semantics, keyboard navigation and VoiceOver column reading.",4    "In the list form each row is one element combining the main text and the labelled values; selection is exposed by the `.isSelected` trait and a checkmark, not by colour.",5    "The sort direction is given by a symbol and by text (\"Sorted ascending\").",6    "Text follows Dynamic Type; values are formatted by the host with `FormatStyle`."7  ],8  "category" : "data",9  "changelog" : [10    {11      "changes" : [12        "Initial release."13      ],14      "date" : "2026-12-02",15      "version" : "1.0.0"16    }17  ],18  "dependencies" : [19    {20      "id" : "glass-foundation",21      "version" : "1.0.0"22    }23  ],24  "description" : "System Table where available and a List elsewhere, with typed sorting and selection.",25  "examples" : [26    {27      "code" : "import SwiftUI\nimport SPGlassKit\n\npublic struct GlassTableExample: GlassExample {\n    public static let componentID = \"glass-table\"\n\n    struct Station: Identifiable {\n        let id: String\n        let name: String\n        let line: String\n        let dailyRiders: Int\n        let opened: Int\n    }\n\n    // Fictitious data.\n    private let stations = [\n        Station(id: \"s1\", name: \"Harbour Square\", line: \"Blue\", dailyRiders: 48_200, opened: 1987),\n        Station(id: \"s2\", name: \"Élan–Université\", line: \"Green\", dailyRiders: 31_750, opened: 2004),\n        Station(id: \"s3\", name: \"North Mills\", line: \"Blue\", dailyRiders: 9_640, opened: 1991),\n        Station(id: \"s4\", name: \"Parc des Érables\", line: \"Orange\", dailyRiders: 22_310, opened: 2016),\n        Station(id: \"s5\", name: \"Old Foundry\", line: \"Green\", dailyRiders: 9_640, opened: 1979),\n    ]\n\n    private let columns: [GlassTableColumn<Station>] = [\n        GlassTableColumn(\"Station\", id: \"name\") { $0.name },\n        GlassTableColumn(\"Line\", id: \"line\") { $0.line },\n        GlassTableColumn(\"Daily riders\", id: \"riders\", sortingBy: { $0.dailyRiders }) { $0.dailyRiders.formatted(.number) },\n        GlassTableColumn(\"Opened\", id: \"opened\", sortingBy: { $0.opened }) { $0.opened.formatted(.number.grouping(.never)) },\n    ]\n\n    @State private var sort: GlassTableSort? = GlassTableSort(columnID: \"riders\", order: .reverse)\n    @State private var selection: Set<String> = [\"s2\"]\n    @State private var showsEmpty = false\n\n    public init() {}\n\n    public var body: some View {\n        VStack(alignment: .leading, spacing: 12) {\n            Toggle(\"Show the empty state\", isOn: $showsEmpty)\n            Text(\"\\(selection.count) selected\")\n                .font(.callout)\n                .foregroundStyle(.secondary)\n            GlassTable(showsEmpty ? [] : stations, columns: columns, sort: $sort, selection: .multiple($selection), emptyTitle: \"No station\")\n                .frame(minHeight: 320)\n        }\n        .padding()\n    }\n}\n\n#Preview(\"GlassTable\") { GlassTableExample() }\n",28      "title" : "GlassTable example"29    }30  ],31  "files" : [32    {33      "bytes" : 9889,34      "path" : "Data/Data/GlassTable.swift",35      "sha256" : "b4a577665623d96c106c85513c81015dada5b2a2b8d0063b2577e665c58985e0"36    },37    {38      "bytes" : 7579,39      "path" : "Data/Data/GlassTableModel.swift",40      "sha256" : "7169ae98fb0971834fd0e9085eac1ef173229b68f7f0d42f9dc78f88e30a62d1"41    }42  ],43  "frameworks" : [4445  ],46  "id" : "glass-table",47  "kind" : "native-wrapper",48  "license" : "MIT",49  "minimumOS" : {50    "iOS" : "26.0",51    "iPadOS" : "26.0",52    "macOS" : "26.0"53  },54  "name" : "GlassTable",55  "platforms" : [56    "iOS",57    "iPadOS",58    "macOS"59  ],60  "schemaVersion" : 1,61  "sha256" : "9bd3c6dd1972962f226d4ad9fdcbe52c8eb5d5995c82dc7b00b3368f054d7201",62  "symbols" : [63    "GlassTable",64    "GlassTableColumn",65    "GlassTableSort",66    "GlassTableSelection",67    "GlassTableLogic"68  ],69  "version" : "1.0.0"70}71
Files main
Menu

Theme