Repository Public MIT
1{2 "accessibility" : [3 "Cells keep the accessibility of the host's content. Selectable cells are buttons with the `.isSelected` trait.",4 "Selection is shown by a checkmark symbol, not by colour alone.",5 "An adaptive layout reflows with the window width and with Dynamic Type if the host's `minimum` leaves room for larger text; prefer adaptive layouts."6 ],7 "category" : "data",8 "changelog" : [9 {10 "changes" : [11 "Release 1.1.0: see the project changelog."12 ],13 "date" : "2026-12-03",14 "version" : "1.1.0"15 },16 {17 "changes" : [18 "Initial release."19 ],20 "date" : "2026-12-02",21 "version" : "1.0.0"22 }23 ],24 "dependencies" : [25 {26 "id" : "glass-foundation",27 "version" : "1.1.0"28 },29 {30 "id" : "glass-table",31 "version" : "1.1.0"32 }33 ],34 "description" : "Lazy grid for large collections with stable identifiers and generic cells.",35 "examples" : [36 {37 "code" : "import SwiftUI\nimport SPGlassKit\n\npublic struct GlassDataGridExample: GlassExample {\n public static let componentID = \"glass-data-grid\"\n\n struct Sample: Identifiable {\n let id: Int\n var reading: Double { Double((id * 37) % 100) / 100 }\n }\n\n /// Thirty thousand fictitious samples, produced on demand: no array of that size is ever built.\n struct Samples: RandomAccessCollection {\n let count: Int\n var startIndex: Int { 0 }\n var endIndex: Int { count }\n subscript(position: Int) -> Sample { Sample(id: position) }\n }\n\n @State private var selection: Set<Int> = [2]\n @State private var fixedColumns = false\n\n public init() {}\n\n public var body: some View {\n VStack(alignment: .leading, spacing: 12) {\n Toggle(\"Three fixed columns\", isOn: $fixedColumns)\n Text(\"\\(selection.count) of \\(Samples(count: 30_000).count) samples selected\")\n .font(.callout)\n .foregroundStyle(.secondary)\n GlassDataGrid(\n Samples(count: 30_000),\n layout: fixedColumns ? .fixed(3) : .adaptive(minimum: 110),\n selection: $selection\n ) { sample, isSelected in\n VStack(alignment: .leading, spacing: 4) {\n Text(\"Sample \\(sample.id + 1)\")\n .font(.headline)\n Text(sample.reading, format: .percent.precision(.fractionLength(0)))\n .font(.callout.monospacedDigit())\n .foregroundStyle(.secondary)\n Text(isSelected ? \"Selected\" : \"Tap to select\")\n .font(.caption)\n .foregroundStyle(.secondary)\n }\n .frame(maxWidth: .infinity, alignment: .leading)\n .padding(12)\n .background(.quaternary, in: RoundedRectangle(cornerRadius: 12, style: .continuous))\n }\n }\n .padding()\n }\n}\n\n#Preview(\"GlassDataGrid\") { GlassDataGridExample() }\n",38 "title" : "GlassDataGrid example"39 }40 ],41 "files" : [42 {43 "bytes" : 8143,44 "path" : "Data/Data/GlassDataGrid.swift",45 "sha256" : "00003512fd8dfaf5405d4d2e0010c0a63b992e8797bd5573d274392d0a407424"46 }47 ],48 "frameworks" : [4950 ],51 "id" : "glass-data-grid",52 "kind" : "content-component",53 "license" : "MIT",54 "minimumOS" : {55 "iOS" : "26.0",56 "iPadOS" : "26.0",57 "macOS" : "26.0"58 },59 "name" : "GlassDataGrid",60 "platforms" : [61 "iOS",62 "iPadOS",63 "macOS"64 ],65 "schemaVersion" : 1,66 "sha256" : "549249d49a7508e20f8f03e1c2a7b981e7cdb52dee6291ee6de9e325da945f1d",67 "symbols" : [68 "GlassGridLayout",69 "GlassDataGrid"70 ],71 "version" : "1.1.0"72}73