@multiplatform.one/table 7.69.2 → 7.71.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. package/dist/cjs/components/DataTable/DataTableCardControls.cjs +74 -12
  2. package/dist/cjs/components/DataTable/DataTableCardControls.native.js +83 -12
  3. package/dist/cjs/components/DataTable/DataTableCardControls.native.js.map +1 -1
  4. package/dist/cjs/components/DataTable/DataTableDocumentList.cjs +180 -114
  5. package/dist/cjs/components/DataTable/DataTableDocumentList.native.js +193 -124
  6. package/dist/cjs/components/DataTable/DataTableDocumentList.native.js.map +1 -1
  7. package/dist/cjs/components/DataTable/DataTableMobileCards.cjs +260 -127
  8. package/dist/cjs/components/DataTable/DataTableMobileCards.native.js +287 -156
  9. package/dist/cjs/components/DataTable/DataTableMobileCards.native.js.map +1 -1
  10. package/dist/cjs/components/DataTable/DataTableRoot.cjs +34 -5
  11. package/dist/cjs/components/DataTable/DataTableRoot.native.js +36 -5
  12. package/dist/cjs/components/DataTable/DataTableRoot.native.js.map +1 -1
  13. package/dist/cjs/components/DataTable/PhonePager.cjs +56 -0
  14. package/dist/cjs/components/DataTable/PhonePager.native.js +60 -0
  15. package/dist/cjs/components/DataTable/PhonePager.native.js.map +1 -0
  16. package/dist/cjs/components/DataTable/index.native.js +64 -7
  17. package/dist/cjs/components/DataTable/index.native.js.map +1 -1
  18. package/dist/cjs/components/DataTable/rowSlotParts.cjs +158 -0
  19. package/dist/cjs/components/DataTable/rowSlotParts.native.js +170 -0
  20. package/dist/cjs/components/DataTable/rowSlotParts.native.js.map +1 -0
  21. package/dist/cjs/components/DataTable/rowSlots.cjs +150 -0
  22. package/dist/cjs/components/DataTable/rowSlots.native.js +239 -0
  23. package/dist/cjs/components/DataTable/rowSlots.native.js.map +1 -0
  24. package/dist/cjs/components/DataTableFilterButton/index.cjs +25 -3
  25. package/dist/cjs/components/DataTableFilterButton/index.native.js +25 -3
  26. package/dist/cjs/components/DataTableFilterButton/index.native.js.map +1 -1
  27. package/dist/cjs/components/DataTablePagination/index.cjs +23 -0
  28. package/dist/cjs/components/DataTablePagination/index.native.js +25 -0
  29. package/dist/cjs/components/DataTablePagination/index.native.js.map +1 -1
  30. package/dist/cjs/components/DataTableToolbar/glyph.cjs +54 -0
  31. package/dist/cjs/components/DataTableToolbar/glyph.native.js +57 -0
  32. package/dist/cjs/components/DataTableToolbar/glyph.native.js.map +1 -0
  33. package/dist/cjs/components/DataTableToolbar/index.cjs +206 -114
  34. package/dist/cjs/components/DataTableToolbar/index.native.js +217 -112
  35. package/dist/cjs/components/DataTableToolbar/index.native.js.map +1 -1
  36. package/dist/cjs/index.cjs +5 -1
  37. package/dist/cjs/index.native.js +5 -1
  38. package/dist/cjs/index.native.js.map +1 -1
  39. package/dist/esm/components/DataTable/DataTableCardControls.mjs +74 -13
  40. package/dist/esm/components/DataTable/DataTableCardControls.mjs.map +1 -1
  41. package/dist/esm/components/DataTable/DataTableCardControls.native.js +83 -13
  42. package/dist/esm/components/DataTable/DataTableCardControls.native.js.map +1 -1
  43. package/dist/esm/components/DataTable/DataTableDocumentList.mjs +179 -113
  44. package/dist/esm/components/DataTable/DataTableDocumentList.mjs.map +1 -1
  45. package/dist/esm/components/DataTable/DataTableDocumentList.native.js +192 -123
  46. package/dist/esm/components/DataTable/DataTableDocumentList.native.js.map +1 -1
  47. package/dist/esm/components/DataTable/DataTableMobileCards.mjs +261 -129
  48. package/dist/esm/components/DataTable/DataTableMobileCards.mjs.map +1 -1
  49. package/dist/esm/components/DataTable/DataTableMobileCards.native.js +288 -158
  50. package/dist/esm/components/DataTable/DataTableMobileCards.native.js.map +1 -1
  51. package/dist/esm/components/DataTable/DataTableRoot.mjs +36 -7
  52. package/dist/esm/components/DataTable/DataTableRoot.mjs.map +1 -1
  53. package/dist/esm/components/DataTable/DataTableRoot.native.js +38 -7
  54. package/dist/esm/components/DataTable/DataTableRoot.native.js.map +1 -1
  55. package/dist/esm/components/DataTable/PhonePager.mjs +31 -0
  56. package/dist/esm/components/DataTable/PhonePager.mjs.map +1 -0
  57. package/dist/esm/components/DataTable/PhonePager.native.js +32 -0
  58. package/dist/esm/components/DataTable/PhonePager.native.js.map +1 -0
  59. package/dist/esm/components/DataTable/index.native.js +67 -10
  60. package/dist/esm/components/DataTable/index.native.js.map +1 -1
  61. package/dist/esm/components/DataTable/rowSlotParts.mjs +130 -0
  62. package/dist/esm/components/DataTable/rowSlotParts.mjs.map +1 -0
  63. package/dist/esm/components/DataTable/rowSlotParts.native.js +139 -0
  64. package/dist/esm/components/DataTable/rowSlotParts.native.js.map +1 -0
  65. package/dist/esm/components/DataTable/rowSlots.mjs +121 -0
  66. package/dist/esm/components/DataTable/rowSlots.mjs.map +1 -0
  67. package/dist/esm/components/DataTable/rowSlots.native.js +207 -0
  68. package/dist/esm/components/DataTable/rowSlots.native.js.map +1 -0
  69. package/dist/esm/components/DataTableFilterButton/index.mjs +24 -3
  70. package/dist/esm/components/DataTableFilterButton/index.mjs.map +1 -1
  71. package/dist/esm/components/DataTableFilterButton/index.native.js +24 -3
  72. package/dist/esm/components/DataTableFilterButton/index.native.js.map +1 -1
  73. package/dist/esm/components/DataTablePagination/index.mjs +23 -0
  74. package/dist/esm/components/DataTablePagination/index.mjs.map +1 -1
  75. package/dist/esm/components/DataTablePagination/index.native.js +25 -0
  76. package/dist/esm/components/DataTablePagination/index.native.js.map +1 -1
  77. package/dist/esm/components/DataTableToolbar/glyph.mjs +27 -0
  78. package/dist/esm/components/DataTableToolbar/glyph.mjs.map +1 -0
  79. package/dist/esm/components/DataTableToolbar/glyph.native.js +27 -0
  80. package/dist/esm/components/DataTableToolbar/glyph.native.js.map +1 -0
  81. package/dist/esm/components/DataTableToolbar/index.mjs +211 -119
  82. package/dist/esm/components/DataTableToolbar/index.mjs.map +1 -1
  83. package/dist/esm/components/DataTableToolbar/index.native.js +222 -117
  84. package/dist/esm/components/DataTableToolbar/index.native.js.map +1 -1
  85. package/dist/esm/index.mjs +2 -1
  86. package/dist/esm/index.mjs.map +1 -1
  87. package/dist/esm/index.native.js +2 -1
  88. package/dist/esm/index.native.js.map +1 -1
  89. package/dist/jsx/components/DataTable/DataTableCardControls.mjs +74 -13
  90. package/dist/jsx/components/DataTable/DataTableCardControls.mjs.map +1 -1
  91. package/dist/jsx/components/DataTable/DataTableCardControls.native.js +83 -12
  92. package/dist/jsx/components/DataTable/DataTableCardControls.native.js.map +1 -1
  93. package/dist/jsx/components/DataTable/DataTableDocumentList.mjs +179 -113
  94. package/dist/jsx/components/DataTable/DataTableDocumentList.mjs.map +1 -1
  95. package/dist/jsx/components/DataTable/DataTableDocumentList.native.js +193 -124
  96. package/dist/jsx/components/DataTable/DataTableDocumentList.native.js.map +1 -1
  97. package/dist/jsx/components/DataTable/DataTableMobileCards.mjs +261 -129
  98. package/dist/jsx/components/DataTable/DataTableMobileCards.mjs.map +1 -1
  99. package/dist/jsx/components/DataTable/DataTableMobileCards.native.js +287 -156
  100. package/dist/jsx/components/DataTable/DataTableMobileCards.native.js.map +1 -1
  101. package/dist/jsx/components/DataTable/DataTableRoot.mjs +36 -7
  102. package/dist/jsx/components/DataTable/DataTableRoot.mjs.map +1 -1
  103. package/dist/jsx/components/DataTable/DataTableRoot.native.js +36 -5
  104. package/dist/jsx/components/DataTable/DataTableRoot.native.js.map +1 -1
  105. package/dist/jsx/components/DataTable/PhonePager.mjs +31 -0
  106. package/dist/jsx/components/DataTable/PhonePager.mjs.map +1 -0
  107. package/dist/jsx/components/DataTable/PhonePager.native.js +60 -0
  108. package/dist/jsx/components/DataTable/PhonePager.native.js.map +1 -0
  109. package/dist/jsx/components/DataTable/index.native.js +64 -7
  110. package/dist/jsx/components/DataTable/index.native.js.map +1 -1
  111. package/dist/jsx/components/DataTable/rowSlotParts.mjs +130 -0
  112. package/dist/jsx/components/DataTable/rowSlotParts.mjs.map +1 -0
  113. package/dist/jsx/components/DataTable/rowSlotParts.native.js +170 -0
  114. package/dist/jsx/components/DataTable/rowSlotParts.native.js.map +1 -0
  115. package/dist/jsx/components/DataTable/rowSlots.mjs +121 -0
  116. package/dist/jsx/components/DataTable/rowSlots.mjs.map +1 -0
  117. package/dist/jsx/components/DataTable/rowSlots.native.js +239 -0
  118. package/dist/jsx/components/DataTable/rowSlots.native.js.map +1 -0
  119. package/dist/jsx/components/DataTableFilterButton/index.mjs +24 -3
  120. package/dist/jsx/components/DataTableFilterButton/index.mjs.map +1 -1
  121. package/dist/jsx/components/DataTableFilterButton/index.native.js +25 -3
  122. package/dist/jsx/components/DataTableFilterButton/index.native.js.map +1 -1
  123. package/dist/jsx/components/DataTablePagination/index.mjs +23 -0
  124. package/dist/jsx/components/DataTablePagination/index.mjs.map +1 -1
  125. package/dist/jsx/components/DataTablePagination/index.native.js +25 -0
  126. package/dist/jsx/components/DataTablePagination/index.native.js.map +1 -1
  127. package/dist/jsx/components/DataTableToolbar/glyph.mjs +27 -0
  128. package/dist/jsx/components/DataTableToolbar/glyph.mjs.map +1 -0
  129. package/dist/jsx/components/DataTableToolbar/glyph.native.js +57 -0
  130. package/dist/jsx/components/DataTableToolbar/glyph.native.js.map +1 -0
  131. package/dist/jsx/components/DataTableToolbar/index.mjs +211 -119
  132. package/dist/jsx/components/DataTableToolbar/index.mjs.map +1 -1
  133. package/dist/jsx/components/DataTableToolbar/index.native.js +217 -112
  134. package/dist/jsx/components/DataTableToolbar/index.native.js.map +1 -1
  135. package/dist/jsx/index.js +2 -1
  136. package/dist/jsx/index.js.map +1 -1
  137. package/dist/jsx/index.mjs +2 -1
  138. package/dist/jsx/index.mjs.map +1 -1
  139. package/dist/jsx/index.native.js +5 -1
  140. package/dist/jsx/index.native.js.map +1 -1
  141. package/package.json +12 -12
  142. package/src/components/DataTable/DataTable.spec.tsx +12 -9
  143. package/src/components/DataTable/DataTable.stories.tsx +110 -43
  144. package/src/components/DataTable/DataTableCardControls.tsx +103 -24
  145. package/src/components/DataTable/DataTableDocumentList.stories.tsx +113 -0
  146. package/src/components/DataTable/DataTableDocumentList.tsx +210 -120
  147. package/src/components/DataTable/DataTableMobileCards.tsx +280 -147
  148. package/src/components/DataTable/DataTableRoot.tsx +56 -5
  149. package/src/components/DataTable/PhonePager.tsx +44 -0
  150. package/src/components/DataTable/cardLayout.spec.tsx +20 -12
  151. package/src/components/DataTable/cardToolbar.spec.tsx +31 -26
  152. package/src/components/DataTable/dataTableCardControls.spec.tsx +10 -9
  153. package/src/components/DataTable/dataTableDocumentList.spec.tsx +98 -10
  154. package/src/components/DataTable/dataTableMobileCards.spec.tsx +29 -14
  155. package/src/components/DataTable/index.native.tsx +90 -9
  156. package/src/components/DataTable/nativeCardParity.spec.tsx +15 -0
  157. package/src/components/DataTable/pageRange.spec.tsx +12 -1
  158. package/src/components/DataTable/rowSlotParts.tsx +184 -0
  159. package/src/components/DataTable/rowSlots.ts +239 -0
  160. package/src/components/DataTable/smallTableFooter.spec.tsx +10 -0
  161. package/src/components/DataTableFilterButton/DataTableFilterButton.spec.tsx +3 -3
  162. package/src/components/DataTableFilterButton/index.tsx +30 -2
  163. package/src/components/DataTablePagination/index.tsx +30 -0
  164. package/src/components/DataTableToolbar/DataTableToolbar.spec.tsx +10 -0
  165. package/src/components/DataTableToolbar/DataTableToolbar.stories.tsx +16 -7
  166. package/src/components/DataTableToolbar/compactRow.spec.tsx +197 -0
  167. package/src/components/DataTableToolbar/glyph.ts +33 -0
  168. package/src/components/DataTableToolbar/index.tsx +269 -131
  169. package/src/components/Table/accessibility.spec.tsx +4 -3
  170. package/src/components/noMiddotJoin.spec.tsx +315 -0
  171. package/src/components/phoneBottomAccessory.spec.tsx +218 -0
  172. package/src/components/phoneCardPolish.spec.tsx +214 -0
  173. package/src/components/phoneCardsDefault.spec.tsx +34 -6
  174. package/src/components/phonePager.spec.tsx +141 -0
  175. package/src/components/tableDropdowns.spec.tsx +4 -3
  176. package/src/index.ts +5 -0
  177. package/src/types.ts +23 -0
  178. package/types/components/DataTable/DataTableCardControls.d.ts +12 -0
  179. package/types/components/DataTable/DataTableCardControls.d.ts.map +1 -1
  180. package/types/components/DataTable/DataTableDocumentList.d.ts +13 -7
  181. package/types/components/DataTable/DataTableDocumentList.d.ts.map +1 -1
  182. package/types/components/DataTable/DataTableMobileCards.d.ts +38 -12
  183. package/types/components/DataTable/DataTableMobileCards.d.ts.map +1 -1
  184. package/types/components/DataTable/DataTableRoot.d.ts +1 -1
  185. package/types/components/DataTable/DataTableRoot.d.ts.map +1 -1
  186. package/types/components/DataTable/PhonePager.d.ts +24 -0
  187. package/types/components/DataTable/PhonePager.d.ts.map +1 -0
  188. package/types/components/DataTable/index.native.d.ts +1 -1
  189. package/types/components/DataTable/index.native.d.ts.map +1 -1
  190. package/types/components/DataTable/rowSlotParts.d.ts +30 -0
  191. package/types/components/DataTable/rowSlotParts.d.ts.map +1 -0
  192. package/types/components/DataTable/rowSlots.d.ts +74 -0
  193. package/types/components/DataTable/rowSlots.d.ts.map +1 -0
  194. package/types/components/DataTableFilterButton/index.d.ts +1 -0
  195. package/types/components/DataTableFilterButton/index.d.ts.map +1 -1
  196. package/types/components/DataTablePagination/index.d.ts +5 -0
  197. package/types/components/DataTablePagination/index.d.ts.map +1 -1
  198. package/types/components/DataTableToolbar/glyph.d.ts +65 -0
  199. package/types/components/DataTableToolbar/glyph.d.ts.map +1 -0
  200. package/types/components/DataTableToolbar/index.d.ts +24 -0
  201. package/types/components/DataTableToolbar/index.d.ts.map +1 -1
  202. package/types/index.d.ts +1 -0
  203. package/types/index.d.ts.map +1 -1
  204. package/types/types.d.ts +23 -0
  205. package/types/types.d.ts.map +1 -1
@@ -0,0 +1,214 @@
1
+ /**
2
+ * FZ-7889, Clay's review of the FZ-7816 phone cards (`rv_ff32d3e741fbf100`):
3
+ * a card is the LC-155 Mail row on a card, not the grid's first column in a
4
+ * box.
5
+ *
6
+ * - The title is the first text column. A numeric column ahead of it (an id)
7
+ * is the card's key, a caption at the top right, never the title.
8
+ * - No rule inside a card, and no rule under the card toolbar: the cards are
9
+ * their own surfaces and the toolbar's bottom padding is the gap.
10
+ * - Filter and Sort in the card toolbar are one height (LC-153).
11
+ * - On the page line the card list adds no side inset of its own, so a card
12
+ * sits one gutter from the screen edge, under the page title; the
13
+ * DataTable stories' padding decorator steps aside for a story that is a
14
+ * whole page.
15
+ */
16
+
17
+ import { renderWithProviders } from "@multiplatform.one/test-utils";
18
+ import { PageGutter } from "@multiplatform.one/theme";
19
+ import { cleanup, screen } from "@testing-library/react";
20
+ import type React from "react";
21
+ import { afterEach, describe, expect, it } from "vitest";
22
+ import type { DataTableColumn } from "../types";
23
+ import { DataTable } from "./DataTable";
24
+ import meta, { OnPhonePage } from "./DataTable/DataTable.stories";
25
+ import { pickCardTitle } from "./DataTable/DataTableMobileCards";
26
+
27
+ afterEach(cleanup);
28
+
29
+ type Person = { id: number; name: string; role: string; active: string; age: number };
30
+
31
+ const people: Person[] = [
32
+ { id: 1, name: "Ada Lovelace", role: "Engineer", active: "yes", age: 36 },
33
+ { id: 2, name: "Grace Hopper", role: "Admiral", active: "yes", age: 85 },
34
+ { id: 3, name: "Alan Turing", role: "Scientist", active: "no", age: 41 },
35
+ ];
36
+
37
+ const columns: DataTableColumn<Person>[] = [
38
+ { accessorKey: "id", header: "ID" },
39
+ { accessorKey: "name", header: "Name" },
40
+ { accessorKey: "role", header: "Role" },
41
+ { accessorKey: "active", header: "Active" },
42
+ { accessorKey: "age", header: "Age" },
43
+ ];
44
+
45
+ function onPage(ui: React.ReactElement) {
46
+ return renderWithProviders(<PageGutter inset="$4">{ui}</PageGutter>);
47
+ }
48
+
49
+ const cards = (container: HTMLElement) =>
50
+ Array.from(container.querySelectorAll<HTMLElement>('[data-testid="data-table-card"]'));
51
+
52
+ function atoms(el: Element, prefix: string): string[] {
53
+ return String((el as HTMLElement).className || "")
54
+ .split(/\s+/)
55
+ .filter((c) => c.startsWith(prefix))
56
+ .sort();
57
+ }
58
+
59
+ function cell(id: string, value: unknown, columnMeta?: DataTableColumn["meta"]) {
60
+ return {
61
+ id: `0_${id}`,
62
+ column: { id, columnDef: { id, header: id, meta: columnMeta } },
63
+ getValue: () => value,
64
+ };
65
+ }
66
+
67
+ describe("phone card title (FZ-7889, LC-155)", () => {
68
+ it("skips a leading numeric column: the first text column is the title, the number is the key", () => {
69
+ const id = cell("id", 1);
70
+ const name = cell("name", "Ada Lovelace");
71
+ const role = cell("role", "Engineer");
72
+ const parts = pickCardTitle([id, name, role]);
73
+ expect(parts.title).toBe(name);
74
+ expect(parts.keys).toEqual([id]);
75
+ expect(parts.details).toEqual([role]);
76
+ });
77
+
78
+ it("a numeric string id is a number too", () => {
79
+ const id = cell("code", "0042");
80
+ const name = cell("name", "Ada");
81
+ expect(pickCardTitle([id, name]).title).toBe(name);
82
+ });
83
+
84
+ it("skips dates, states and controls when looking for the title", () => {
85
+ const date = cell("created", "2026-10-26");
86
+ const status = cell("status", "Open");
87
+ const action = cell("_actions", "x", { role: "actions" });
88
+ const subject = cell("subject", "Fix the cards");
89
+ const parts = pickCardTitle([date, status, action, subject]);
90
+ expect(parts.title).toBe(subject);
91
+ expect(parts.keys).toEqual([]);
92
+ expect(parts.details).toEqual([date, status, action]);
93
+ });
94
+
95
+ it("an explicit title role wins", () => {
96
+ const name = cell("name", "Ada");
97
+ const nick = cell("nick", "Countess", { role: "title" });
98
+ expect(pickCardTitle([name, nick]).title).toBe(nick);
99
+ });
100
+
101
+ it("with no text column the first column stays the title", () => {
102
+ const a = cell("a", 1);
103
+ const b = cell("b", 2);
104
+ expect(pickCardTitle([a, b])).toEqual({ title: a, keys: [], details: [b] });
105
+ });
106
+
107
+ it("renders the name as the card title, the id as a trailing key, one subtitle and a glyph fact (LC-261)", () => {
108
+ const { container } = onPage(<DataTable data={people} columns={columns} />);
109
+ const [first] = cards(container);
110
+ expect(first.querySelector('[data-card-slot="title"]')?.textContent).toBe("Ada Lovelace");
111
+ const key = first.querySelector('[data-card-slot="key"]');
112
+ expect(key?.textContent).toContain("1");
113
+ expect(key?.textContent).toContain("ID:");
114
+ const subtitle = first.querySelector('[data-card-slot="subtitle"]')!;
115
+ expect(subtitle.textContent).toBe("Role: Engineer");
116
+ const fact = first.querySelector('[data-card-slot="fact"]')!;
117
+ expect(fact.textContent).toBe("Age: 36");
118
+ });
119
+ });
120
+
121
+ describe("no stray rules (FZ-7889)", () => {
122
+ it("no hairline divides a card's title from its subtitle", () => {
123
+ const { container } = onPage(<DataTable data={people} columns={columns} />);
124
+ for (const card of cards(container)) {
125
+ // The one rule a row carries is its body's top edge, between rows (FZ-8039).
126
+ for (const line of card.querySelectorAll("[data-card-body] > *")) {
127
+ expect(line.querySelector('[class*="mp-hairline"]')).toBeNull();
128
+ expect(String((line as HTMLElement).className)).not.toContain("mp-hairline");
129
+ }
130
+ for (const el of card.querySelectorAll("*")) {
131
+ expect(atoms(el, "_bbw-").filter((a) => a !== "_bbw-0px")).toEqual([]);
132
+ }
133
+ }
134
+ });
135
+
136
+ it("the card toolbar draws no rule above the cards", () => {
137
+ onPage(<DataTable data={people} columns={columns} />);
138
+ const toolbar = screen.getByRole("toolbar", { name: "Table toolbar" });
139
+ expect(String(toolbar.className)).not.toContain("mp-hairline-b");
140
+ expect(atoms(toolbar, "_bbw-").filter((a) => a !== "_bbw-0px")).toEqual([]);
141
+ });
142
+
143
+ it("the grid toolbar keeps its rule over the header row", () => {
144
+ onPage(<DataTable data={people} columns={columns} layout="table" />);
145
+ const toolbar = screen.getByRole("toolbar", { name: "Table toolbar" });
146
+ expect(String(toolbar.className)).toContain("mp-hairline-b");
147
+ });
148
+ });
149
+
150
+ describe("card toolbar controls are one height (FZ-7889, LC-153)", () => {
151
+ it("Filter and Sort share the toolbar's size token", () => {
152
+ onPage(
153
+ <DataTable
154
+ data={people}
155
+ columns={columns}
156
+ filterableFields={[{ id: "role", label: "Role", type: "text" }] as any}
157
+ />,
158
+ );
159
+ const filter = screen.getByRole("button", { name: "Filter" });
160
+ const sort = screen.getByLabelText("Sort rows");
161
+ const filterHeight = atoms(filter, "_h-");
162
+ expect(filterHeight.length).toBeGreaterThan(0);
163
+ expect(atoms(sort, "_h-")).toEqual(filterHeight);
164
+ });
165
+ });
166
+
167
+ describe("card search spans the toolbar (FZ-7889)", () => {
168
+ // A row wrapper let the field shrink to its content: on iOS a TextInput has
169
+ // no intrinsic width, so Search drew as a lone icon box above Filter/Sort.
170
+ it("the search field's wrapper is a column, so the field stretches to the row", () => {
171
+ onPage(<DataTable data={people} columns={columns} enableGlobalSearch />);
172
+ const toolbar = screen.getByRole("toolbar", { name: "Table toolbar" });
173
+ let wrapper: HTMLElement | null = screen.getByLabelText("Search table data");
174
+ while (wrapper && wrapper.parentElement !== toolbar) wrapper = wrapper.parentElement;
175
+ expect(wrapper).not.toBeNull();
176
+ expect(atoms(wrapper!, "_fd-")).toEqual(["_fd-column"]);
177
+ });
178
+ });
179
+
180
+ describe("one gutter (FZ-7889, LC-151)", () => {
181
+ it("on the page line the card list adds no side inset of its own", () => {
182
+ const { container } = onPage(<DataTable data={people} columns={columns} />);
183
+ const list = container.querySelector('[data-testid="data-table-cards"]')!;
184
+ let el: Element | null = list;
185
+ while (el && el !== container) {
186
+ for (const prefix of ["_pl-", "_pr-", "_ml-", "_mr-"]) {
187
+ expect(
188
+ atoms(el, prefix).filter((a) => !a.endsWith("-0px")),
189
+ `${prefix} on ${el.getAttribute("data-testid") ?? el.tagName}`,
190
+ ).toEqual([]);
191
+ }
192
+ el = el.parentElement;
193
+ }
194
+ });
195
+
196
+ it("the stories' padding decorator steps aside for a story that is a whole page", () => {
197
+ const decorate = meta.decorators![0] as any;
198
+ const Story = () => null;
199
+ expect(OnPhonePage.parameters?.pageShell).toBe(true);
200
+ const page = decorate(Story, { parameters: { pageShell: true } });
201
+ expect(page.type).toBe(Story);
202
+ const Probe = () => <span data-testid="story-probe" />;
203
+ const loose = renderWithProviders(decorate(Probe, { parameters: {} }));
204
+ const pad = loose.getByTestId("story-probe").parentElement!;
205
+ expect(pad.className).toMatch(/(^|\s)_p[lt]?-/);
206
+ loose.unmount();
207
+ const onPage = renderWithProviders(
208
+ <PageGutter inset="$4">
209
+ <div data-testid="page">{decorate(Probe, { parameters: {} })}</div>
210
+ </PageGutter>,
211
+ );
212
+ expect(onPage.getByTestId("story-probe").parentElement).toBe(onPage.getByTestId("page"));
213
+ });
214
+ });
@@ -89,14 +89,42 @@ describe("phone DataTable: cards by default (FZ-7816)", () => {
89
89
  expect(new Set(fills.map((f) => f.join(" "))).size).toBe(1);
90
90
  });
91
91
 
92
- it("cards keep the page gutter and, on the page line, take the table card frame", () => {
92
+ it("records keep the page gutter as one inset group that takes the table card frame", () => {
93
93
  const { container } = onPage(<DataTable data={rows} columns={columns} />);
94
94
  expect(container.querySelectorAll("[data-phone-bleed]").length).toBe(0);
95
- const card = container.querySelector('[data-testid="data-table-card"]') as HTMLElement;
96
- // The `surface` border: not the bled row's hairline-only bottom rule.
97
- expect(classes(card)).toMatch(/_btw-/);
98
- expect(classes(card)).toMatch(/_blw-/);
99
- expect(classes(card)).not.toMatch(/_btlr-0px|_borderTopLeftRadius-0px/);
95
+ const group = container.querySelector('[data-testid="data-table-card-group"]') as HTMLElement;
96
+ // The `surface` border sits on the group: not the bled row's hairline-only bottom rule.
97
+ expect(classes(group)).toMatch(/_btw-/);
98
+ expect(classes(group)).toMatch(/_blw-/);
99
+ expect(classes(group)).not.toMatch(/_btlr-0px|_borderTopLeftRadius-0px/);
100
+ // The group takes the theme's card lift and nothing of its own, so
101
+ // the theme decides it per scheme (none in dark, FZ-8103).
102
+ expect(/_bxsh-|_shadow/.test(classes(group)) || (group.style.boxShadow || "") !== "").toBe(
103
+ true,
104
+ );
105
+ // FZ-8039: a record is a row of the group, not a card of its own. No edge, no lift.
106
+ const records = container.querySelectorAll('[data-testid="data-table-card"]');
107
+ expect(records.length).toBe(rows.length);
108
+ for (const record of records) {
109
+ expect(classes(record)).not.toMatch(/_btw-|_blw-|_shadow|_bxsh-/);
110
+ expect((record as HTMLElement).style.boxShadow || "").toBe("");
111
+ }
112
+ expect(
113
+ container.querySelectorAll(
114
+ '[data-testid="data-table-card-group"] > [data-testid="data-table-card"]',
115
+ ).length,
116
+ ).toBe(rows.length);
117
+ // The rule between rows starts at the text, past the avatar (Mail,
118
+ // Contacts), and is a container edge rule: a filled 0.5px line rounded
119
+ // away between some rows in Blink.
120
+ const bodies = Array.from(records).map(
121
+ (record) => record.querySelector("[data-card-body]") as HTMLElement,
122
+ );
123
+ expect(String(bodies[0].className)).not.toContain("mp-hairline-t");
124
+ for (const body of bodies.slice(1)) expect(String(body.className)).toContain("mp-hairline-t");
125
+ for (const record of records) {
126
+ expect(String((record as HTMLElement).className)).not.toContain("mp-hairline");
127
+ }
100
128
  });
101
129
 
102
130
  it("SimpleTable's and the Table primitive's cards do not stripe or bleed either", () => {
@@ -0,0 +1,141 @@
1
+ /**
2
+ * FZ-7889 round 3, Clay on the Kitchen Sink pager at phone width: "why do we
3
+ * have three rows of pagination". At the compact width class a DataTable's
4
+ * footer is ONE row, the dot pager between its chevrons, and nothing else:
5
+ * no page numbers, no "Rows per page" Select, no range readout. Rows per page
6
+ * moves into the toolbar's "…" view menu. A wide screen keeps today's footer.
7
+ *
8
+ * Tamagui's useMedia resolves `{ sm: false }` (a phone) in this env; `wide`
9
+ * flips it to a desktop.
10
+ */
11
+
12
+ import { renderWithProviders } from "@multiplatform.one/test-utils";
13
+ import { cleanup, fireEvent, screen, waitFor } from "@testing-library/react";
14
+ import { afterEach, describe, expect, it, vi } from "vitest";
15
+ import type { DataTableColumn } from "../types";
16
+ import { DataTable } from "./DataTable";
17
+
18
+ const media = vi.hoisted(() => ({ wide: false }));
19
+
20
+ vi.mock("tamagui", async (importOriginal) => {
21
+ const actual = await importOriginal<typeof import("tamagui")>();
22
+ return {
23
+ ...actual,
24
+ useMedia: (...args: any[]) => {
25
+ const resolved = (actual.useMedia as any)(...args);
26
+ return media.wide ? { ...resolved, sm: true } : resolved;
27
+ },
28
+ };
29
+ });
30
+
31
+ afterEach(() => {
32
+ media.wide = false;
33
+ cleanup();
34
+ });
35
+
36
+ type Person = { id: number; name: string; role: string };
37
+
38
+ const people: Person[] = Array.from({ length: 5 }, (_, i) => ({
39
+ id: i + 1,
40
+ name: `Person ${i + 1}`,
41
+ role: i % 2 ? "Engineer" : "Admiral",
42
+ }));
43
+
44
+ const columns: DataTableColumn<Person>[] = [
45
+ { accessorKey: "id", header: "ID" },
46
+ { accessorKey: "name", header: "Name" },
47
+ { accessorKey: "role", header: "Role" },
48
+ ];
49
+
50
+ function table() {
51
+ return renderWithProviders(
52
+ <DataTable
53
+ data={people}
54
+ columns={columns}
55
+ enablePagination
56
+ pageSizeOptions={[2, 5, 10]}
57
+ initialState={{ pagination: { pageIndex: 1, pageSize: 2 } }}
58
+ />,
59
+ );
60
+ }
61
+
62
+ describe("compact DataTable pager (FZ-7889)", () => {
63
+ it("is one row: the dot pager, with no numbers, size Select or range", () => {
64
+ const { container } = table();
65
+ const footer = container.querySelector<HTMLElement>("[data-pagination-compact='true']");
66
+ expect(footer).not.toBeNull();
67
+ expect(footer!.querySelectorAll("[data-pagination-dot]")).toHaveLength(3);
68
+ expect(container.querySelector("[aria-current='page']")?.getAttribute("aria-label")).toBe(
69
+ "Go to page 2",
70
+ );
71
+ expect(screen.queryByText(/Rows per page/)).toBeNull();
72
+ expect(container.querySelector("[data-pagination-control='size']")).toBeNull();
73
+ expect(container.querySelector('[data-table-range="true"]')).toBeNull();
74
+ expect(screen.queryByText(/of 5/)).toBeNull();
75
+ expect(screen.queryByText("2 of 3")).toBeNull();
76
+ });
77
+
78
+ it("a dot pages the table", () => {
79
+ const { container } = table();
80
+ fireEvent.click(container.querySelector("[aria-label='Go to page 3']")!);
81
+ expect(screen.getByText("Person 5")).toBeTruthy();
82
+ });
83
+
84
+ it("rows per page lives in the toolbar's view menu", () => {
85
+ const { container } = table();
86
+ const menu = container.querySelector("[data-table-view-menu]");
87
+ expect(menu).not.toBeNull();
88
+ expect(menu!.querySelector("[aria-label='View options']")).not.toBeNull();
89
+ });
90
+
91
+ it("with a More menu, rows per page rides it and the field keeps three glyphs (FZ-8039)", async () => {
92
+ const { container } = renderWithProviders(
93
+ <DataTable
94
+ data={people}
95
+ columns={columns}
96
+ enablePagination
97
+ enableViews
98
+ pageSizeOptions={[2, 5, 10]}
99
+ initialState={{ pagination: { pageIndex: 0, pageSize: 2 } }}
100
+ />,
101
+ );
102
+ expect(container.querySelector("[data-table-view-menu]")).toBeNull();
103
+ fireEvent.click(screen.getByLabelText("More table actions"));
104
+ await waitFor(() => expect(screen.getByText(/Rows per page/)).toBeTruthy());
105
+ });
106
+
107
+ it("a table that fits its smallest page has no view menu", () => {
108
+ const { container } = renderWithProviders(
109
+ <DataTable data={people} columns={columns} enablePagination pageSizeOptions={[5, 10]} />,
110
+ );
111
+ expect(container.querySelector("[data-table-view-menu]")).toBeNull();
112
+ });
113
+
114
+ it("the menu offers the footer's default sizes", async () => {
115
+ const many = Array.from({ length: 40 }, (_, i) => ({
116
+ id: i + 1,
117
+ name: `P${i + 1}`,
118
+ role: "x",
119
+ }));
120
+ const { container } = renderWithProviders(
121
+ <DataTable data={many} columns={columns} enablePagination />,
122
+ );
123
+ fireEvent.click(container.querySelector("[aria-label='View options']")!);
124
+ await waitFor(() => {
125
+ expect(document.querySelectorAll('[role="menuitemcheckbox"]')).toHaveLength(4);
126
+ });
127
+ const sizes = [...document.querySelectorAll('[role="menuitemcheckbox"]')].map((item) =>
128
+ (item.textContent ?? "").replace(/\D/g, ""),
129
+ );
130
+ expect(sizes).toEqual(["10", "25", "50", "100"]);
131
+ });
132
+
133
+ it("a wide screen keeps the numbered footer, the size Select and the range", () => {
134
+ media.wide = true;
135
+ const { container } = table();
136
+ expect(container.querySelector("[data-pagination-compact='true']")).toBeNull();
137
+ expect(container.querySelector("[data-table-view-menu]")).toBeNull();
138
+ expect(container.querySelector('[data-pagination-control="size"]')).not.toBeNull();
139
+ expect(container.querySelector('[data-table-range="true"]')).not.toBeNull();
140
+ });
141
+ });
@@ -79,7 +79,8 @@ const surfaces: Surface[] = [
79
79
  content: "Search Options",
80
80
  },
81
81
  {
82
- name: "toolbar save-view",
82
+ // FZ-8039: on a phone (happy-dom's default media) Save view rides "…".
83
+ name: "toolbar more (save view)",
83
84
  ui: (
84
85
  <DataTableToolbar
85
86
  onSaveView={vi.fn()}
@@ -89,7 +90,7 @@ const surfaces: Surface[] = [
89
90
  showViewSelector
90
91
  />
91
92
  ),
92
- trigger: () => screen.getByRole("button", { name: "Save view" }),
93
+ trigger: () => screen.getByRole("button", { name: "More table actions" }),
93
94
  content: "",
94
95
  },
95
96
  {
@@ -138,7 +139,7 @@ describe("table dropdowns open FloatingPanel (MPO-221)", () => {
138
139
  showViewSelector
139
140
  />,
140
141
  );
141
- fireEvent.click(screen.getByRole("button", { name: "Save view" }));
142
+ fireEvent.click(screen.getByRole("button", { name: "More table actions" }));
142
143
  await waitFor(() => expect(panel()).not.toBeNull());
143
144
  fireEvent.change(screen.getByLabelText("View name"), { target: { value: "Mine" } });
144
145
  fireEvent.click(screen.getByRole("button", { name: "Save" }));
package/src/index.ts CHANGED
@@ -63,6 +63,11 @@ export type { SimpleTableProps, SimpleTableColumn } from "./components/SimpleTab
63
63
 
64
64
  // Export sub-components (for standalone usage)
65
65
  export { DataTableToolbar } from "./components/DataTableToolbar";
66
+ export {
67
+ ToolbarGlyphFieldHeight,
68
+ toolbarGlyphProps,
69
+ useToolbarGlyphProps,
70
+ } from "./components/DataTableToolbar/glyph";
66
71
  export { DataTableFilters } from "./components/DataTableFilters";
67
72
  export { DataTableFilterButton } from "./components/DataTableFilterButton";
68
73
  export { DataTableFilterChips } from "./components/DataTableFilterChips";
package/src/types.ts CHANGED
@@ -3,6 +3,7 @@ import type { RowAccumulator } from "./utils/rowAccumulator";
3
3
  import type { UrlStateStrategy } from "./hooks/useDataTable";
4
4
  import type { AnyFormApi } from "@multiplatform.one/forms";
5
5
  import type React from "react";
6
+ import type { ComponentType } from "react";
6
7
  import type { SizeTokens } from "tamagui";
7
8
 
8
9
  // Core Data Types
@@ -221,7 +222,22 @@ export type DataTableColumn<TData extends DataTableData = DataTableData> = Colum
221
222
  meta?: {
222
223
  label?: string;
223
224
  align?: "left" | "center" | "right";
225
+ /**
226
+ * Where the value goes. In the grid it feeds alignment; on a phone row
227
+ * or card it picks the LC-261 slot (`title`, `media`, `indicator`,
228
+ * `subtitle`, `fact`, `stamp`, `key`, `trailing`, `actions`, `hidden`).
229
+ * Unset, the slot comes from the field, `fieldtype`, `options` and value
230
+ * (see `resolveRowSlots`).
231
+ */
224
232
  role?: string;
233
+ /** The Frappe fieldtype behind the column ("Int", "Datetime", "Select"). */
234
+ fieldtype?: string;
235
+ /** The Frappe field options ("Email", "Phone" on a Data field). */
236
+ options?: string;
237
+ /** A fact's glyph on a phone row or card, in place of its label (LC-260). */
238
+ icon?: ComponentType<any>;
239
+ /** A status value's tone for its dot (LC-169); a word map when unset. */
240
+ statusTone?: (value: unknown) => "positive" | "warning" | "critical" | "neutral";
225
241
  };
226
242
  };
227
243
 
@@ -661,6 +677,13 @@ export interface DataTableProps<TData extends DataTableData = DataTableData> {
661
677
  // Row selection + bulk actions (DG-TBL-02, DG-TBL-03)
662
678
  /** Enable row checkboxes and automatic selection toolbar. */
663
679
  enableRowSelection?: boolean;
680
+ /**
681
+ * Select mode for a phone list (`layout="list"` at the compact size): rows
682
+ * show their selection marks before anything is selected, as when the
683
+ * screen's Select entry is chosen. A long press on a row enters it too,
684
+ * and a selected row keeps it on.
685
+ */
686
+ selectMode?: boolean;
664
687
  /**
665
688
  * Scope for the header select-all checkbox.
666
689
  * - `page`: current page only (default)
@@ -28,5 +28,17 @@ export interface DataTableCardControlsProps {
28
28
  export declare function DataTableCardSortControl({ table, disabled, contained, }: Pick<DataTableCardControlsProps, "table" | "disabled"> & {
29
29
  contained?: boolean;
30
30
  }): import("react/jsx-runtime").JSX.Element | null;
31
+ /**
32
+ * The compact toolbar's view menu (FZ-7889). At the compact width class the
33
+ * pager is one row of dots, so the rows-per-page choice moves here. Its
34
+ * trigger is a bare rows glyph inside the search field with Filter and Sort
35
+ * (FZ-8039, LC-176), so it never reads as a second "…" beside More.
36
+ */
37
+ export declare function DataTableViewMenu({ pageSize, pageSizeOptions, onPageSizeChange, disabled, }: {
38
+ pageSize: number;
39
+ pageSizeOptions: number[];
40
+ onPageSizeChange: (pageSize: number) => void;
41
+ disabled?: boolean;
42
+ }): import("react/jsx-runtime").JSX.Element;
31
43
  export declare function DataTableCardControls({ table, enableSorting, enableFiltering, availableColumns, disabled, }: DataTableCardControlsProps): import("react/jsx-runtime").JSX.Element | null;
32
44
  //# sourceMappingURL=DataTableCardControls.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableCardControls.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTableCardControls.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AASH,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAK5E,MAAM,WAAW,0BAA0B;IACzC,mDAAmD;IACnD,KAAK,EAAE,GAAG,CAAC;IACX,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,6DAA6D;IAC7D,gBAAgB,CAAC,EAAE,KAAK,CAAC;QACvB,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,mBAAmB,CAAC;QAC1B,OAAO,CAAC,EAAE,mBAAmB,EAAE,CAAC;KACjC,CAAC,CAAC;IACH,kFAAkF;IAClF,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAOD,wBAAgB,wBAAwB,CAAC,EACvC,KAAK,EACL,QAAgB,EAChB,SAAiB,GAClB,EAAE,IAAI,CAAC,0BAA0B,EAAE,OAAO,GAAG,UAAU,CAAC,GAAG;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,kDAqFlF;AAED,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,aAAqB,EACrB,eAAuB,EACvB,gBAAqB,EACrB,QAAgB,GACjB,EAAE,0BAA0B,kDA2B5B"}
1
+ {"version":3,"file":"DataTableCardControls.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTableCardControls.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAeH,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAM5E,MAAM,WAAW,0BAA0B;IACzC,mDAAmD;IACnD,KAAK,EAAE,GAAG,CAAC;IACX,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,6DAA6D;IAC7D,gBAAgB,CAAC,EAAE,KAAK,CAAC;QACvB,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,mBAAmB,CAAC;QAC1B,OAAO,CAAC,EAAE,mBAAmB,EAAE,CAAC;KACjC,CAAC,CAAC;IACH,kFAAkF;IAClF,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAOD,wBAAgB,wBAAwB,CAAC,EACvC,KAAK,EACL,QAAgB,EAChB,SAAiB,GAClB,EAAE,IAAI,CAAC,0BAA0B,EAAE,OAAO,GAAG,UAAU,CAAC,GAAG;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,kDA6FlF;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,eAAe,EACf,gBAAgB,EAChB,QAAgB,GACjB,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,2CA8CA;AAED,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,aAAqB,EACrB,eAAuB,EACvB,gBAAqB,EACrB,QAAgB,GACjB,EAAE,0BAA0B,kDA2B5B"}
@@ -7,16 +7,20 @@
7
7
  * no wrapping into a column grid (Polaris Index / Frappe list). Stacked-group
8
8
  * radius (LC-72): first row top corners, last row bottom, interiors square.
9
9
  * A `media` column (the doctype's image) leads the row as a thumbnail. In
10
- * the compact size class the trailing number and date columns join the meta
11
- * line under the subject, each after its column label ("Poke ID 25"), so a
12
- * bare number never stands alone; indicators and actions stay on the right
13
- * like desk's phone row (FZ-7684). An empty meta field is left out (FZ-7374).
10
+ * the compact size class each value takes its LC-261 slot (`resolveRowSlots`):
11
+ * one descriptor and its glyph-and-value facts (two, or one beside a
12
+ * descriptor) under the subject, the status as a tone dot and a word beside
13
+ * it, the time at the top right
14
+ * and the actions on the right like desk's phone row (FZ-7684). Nothing is
15
+ * strung together with separators or column labels ("Poke ID 25"); a value
16
+ * with no slot stays off the row. An empty field is left out (FZ-7374).
14
17
  * LC-71: selected = fill; keyboard ring rides the row when it is the tab stop.
15
18
  *
16
19
  * LC-155 ROW-ANATOMY (compact): the subject paints the headline role, the
17
20
  * meta line the meta role, and the row is a two-line Mail row. Selection
18
- * checkboxes appear only in select mode: a long-press selects its row and
19
- * enters it, a tap then toggles rows, and clearing the selection leaves it.
21
+ * marks (Mail's round check, centred before the thumbnail) appear only in
22
+ * select mode: the screen's Select entry or a long-press enters it, a tap
23
+ * then toggles rows, and clearing the selection leaves it. No stripes.
20
24
  */
21
25
  import { type PhoneTableBleed } from "@multiplatform.one/theme";
22
26
  import type React from "react";
@@ -40,6 +44,8 @@ export interface DataTableDocumentListProps<TData> {
40
44
  queryInFlight?: boolean;
41
45
  /** LC-146: rows run edge to edge and take the gutter as their inset. */
42
46
  bleed?: PhoneTableBleed | null;
47
+ /** Compact select mode before any row is selected (the screen's Select entry). */
48
+ selectMode?: boolean;
43
49
  }
44
50
  /**
45
51
  * LC-155: wide rows always carry their selection checkbox; a compact row
@@ -50,5 +56,5 @@ export declare function documentListShowsCheckboxes({ enableRowSelection, compac
50
56
  compact: boolean;
51
57
  selectMode: boolean;
52
58
  }): boolean;
53
- export declare function DataTableDocumentList<TData extends Record<string, any>>({ tableRows, enableRowSelection, disabled, hasActiveFilters, renderCellContent, selectRowLabel, getRowPressProps, queryInFlight, bleed, }: DataTableDocumentListProps<TData>): import("react/jsx-runtime").JSX.Element;
59
+ export declare function DataTableDocumentList<TData extends Record<string, any>>({ tableRows, enableRowSelection, disabled, hasActiveFilters, renderCellContent, selectRowLabel, getRowPressProps, queryInFlight, bleed, selectMode: selectModeOn, }: DataTableDocumentListProps<TData>): import("react/jsx-runtime").JSX.Element;
54
60
  //# sourceMappingURL=DataTableDocumentList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableDocumentList.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTableDocumentList.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAIH,OAAO,EAML,KAAK,eAAe,EACrB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,iFAAiF;AACjF,wBAAgB,yBAAyB,CACvC,KAAK,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,OAAO,CAAA;KAAE,CAAA;CAAE,EACxE,YAAY,EAAE,KAAK,EAAE,GAAG,KAAK,GAAG,SAAS,CAY1C;AAED,MAAM,WAAW,0BAA0B,CAAC,KAAK;IAC/C,SAAS,EAAE,GAAG,EAAE,CAAC;IACjB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,iBAAiB,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,KAAK,KAAK,CAAC,SAAS,CAAC;IACpF,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;IACxD,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,GAAG,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjG,qEAAqE;IACrE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,wEAAwE;IACxE,KAAK,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;CAChC;AAaD;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,EAC1C,kBAAkB,EAClB,OAAO,EACP,UAAU,GACX,EAAE;IACD,kBAAkB,EAAE,OAAO,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;CACrB,GAAG,OAAO,CAEV;AAgBD,wBAAgB,qBAAqB,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,EACvE,SAAS,EACT,kBAA0B,EAC1B,QAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,aAAqB,EACrB,KAAY,GACb,EAAE,0BAA0B,CAAC,KAAK,CAAC,2CAkRnC"}
1
+ {"version":3,"file":"DataTableDocumentList.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTableDocumentList.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAKH,OAAO,EAML,KAAK,eAAe,EACrB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,iFAAiF;AACjF,wBAAgB,yBAAyB,CACvC,KAAK,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,OAAO,CAAA;KAAE,CAAA;CAAE,EACxE,YAAY,EAAE,KAAK,EAAE,GAAG,KAAK,GAAG,SAAS,CAY1C;AAED,MAAM,WAAW,0BAA0B,CAAC,KAAK;IAC/C,SAAS,EAAE,GAAG,EAAE,CAAC;IACjB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,iBAAiB,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,KAAK,KAAK,CAAC,SAAS,CAAC;IACpF,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;IACxD,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,GAAG,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjG,qEAAqE;IACrE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,wEAAwE;IACxE,KAAK,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IAC/B,kFAAkF;IAClF,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAOD;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,EAC1C,kBAAkB,EAClB,OAAO,EACP,UAAU,GACX,EAAE;IACD,kBAAkB,EAAE,OAAO,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;CACrB,GAAG,OAAO,CAEV;AAgBD,wBAAgB,qBAAqB,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,EACvE,SAAS,EACT,kBAA0B,EAC1B,QAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,aAAqB,EACrB,KAAY,EACZ,UAAU,EAAE,YAAoB,GACjC,EAAE,0BAA0B,CAAC,KAAK,CAAC,2CAwWnC"}
@@ -5,23 +5,33 @@
5
5
  * resolved layout is "cards" (below the `$sm` breakpoint with
6
6
  * layout="auto", or forced via layout="cards").
7
7
  *
8
- * Card anatomy: the first visible column is the card title in the header
9
- * row (with selection checkbox / row number / delete). The remaining
10
- * visible columns are NOT a stack of label/value rows any more — see
11
- * `classifyCardField`. Column visibility and order from table state apply
8
+ * Card anatomy is the LC-155 Mail row on a card (FZ-7889), two lines with
9
+ * every value in its own slot (LC-261, `resolveRowSlots`): the media leads
10
+ * as a circle beside both lines; line 1 is the title in the headline role,
11
+ * the status as a tone dot and one word, the time as a caption at the top
12
+ * right (LC-155), the key (#n) and the row's actions; line 2 is the one
13
+ * descriptor with the facts, glyph and value, in its trailing slot. No
14
+ * number gets a row of its own, no value is strung to another with a
15
+ * separator, and a value with no slot stays off the card. No rule divides
16
+ * the lines. Column visibility and order from table state apply
12
17
  * unchanged — cells come from `row.getVisibleCells()`. Values render
13
18
  * through the same cell renderers as the grid, inside `TableCellContext`
14
19
  * so fields stay chromeless (useIsInTableCell).
15
20
  *
16
- * Inside a panel the card is FLAT: no border, no elevation. The panel
17
- * already has its own frame, and an outlined, shadowed card inside it reads
18
- * as a box inside a box; the `cardSurface` fill (one step off the panel) and
19
- * the gap separate one record from the next. On the page line that fill is
20
- * the page's own, so the card takes the table card frame (border and
21
- * elevation, as SimpleTable's and the Table primitive's cards do).
21
+ * The records are rows of ONE inset grouped list (Settings, Mail, Contacts),
22
+ * not a stack of lifted cards (FZ-8039, rv_2951972109d90970: "the shadows
23
+ * are atrocious", "rows taking up tons of space"). The group takes the Card
24
+ * theme, so its `cardSurface` fill steps off the page as a grouped cell does,
25
+ * with the card radius, edge and the theme's card lift, and nothing of its
26
+ * own: no Tamagui `elevation`, so light mode shows the theme shadow alone
27
+ * and dark mode, where the theme drops it, shows none. No `overflow`
28
+ * clip either, which would hide that shadow on iOS. A hairline from
29
+ * the text's leading edge parts the rows, past the avatar. Each row paints
30
+ * the group's fill with its own corners (first and last), so its press fill
31
+ * stays inside the group's radius.
22
32
  *
23
- * A card is its own surface: it keeps the page gutter (LC-146 bleeds rows,
24
- * not cards) and never stripes (LC-144 stripes rows, not cards).
33
+ * The group keeps the page gutter (LC-146 bleeds table rows, not this list)
34
+ * and never stripes (LC-144 stripes table rows).
25
35
  */
26
36
  import type React from "react";
27
37
  /**
@@ -54,6 +64,22 @@ export type CardFieldKind = "skip" | "control" | "bare" | "figure";
54
64
  * 40%-wide column of its own.
55
65
  */
56
66
  export declare function classifyCardField(cell: any): CardFieldKind;
67
+ export interface CardTitleParts<TCell> {
68
+ /** The headline: a `meta.role: "title"` column, else the first text column. */
69
+ title: TCell | undefined;
70
+ /** Numeric columns ahead of the title (an id): a caption at the top right. */
71
+ keys: TCell[];
72
+ /** Every other visible column, in order, for the subtitle and controls. */
73
+ details: TCell[];
74
+ }
75
+ /**
76
+ * LC-155 on a card: a number is not a subject. The first visible column used
77
+ * to be the title whatever it held, so a table that leads with its id
78
+ * titled every card "1", "2", "3" (FZ-7889). The title is the explicit
79
+ * `title` role, else the first text column; numeric columns that come
80
+ * before it are the card's key.
81
+ */
82
+ export declare function pickCardTitle<TCell>(cells: TCell[]): CardTitleParts<TCell>;
57
83
  export interface DataTableMobileCardsProps<TData> {
58
84
  tableRows: any[];
59
85
  enableRowSelection?: boolean;