@carlonicora/nextjs-jsonapi 1.132.0 → 1.133.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.
- package/dist/{BlockNoteEditor-JAELO23S.js → BlockNoteEditor-H626BS5Y.js} +9 -9
- package/dist/{BlockNoteEditor-JAELO23S.js.map → BlockNoteEditor-H626BS5Y.js.map} +1 -1
- package/dist/{BlockNoteEditor-WZFEJS2B.mjs → BlockNoteEditor-VXK7INMR.mjs} +2 -2
- package/dist/billing/index.js +310 -310
- package/dist/billing/index.mjs +1 -1
- package/dist/{chunk-MP5VURBB.js → chunk-TVJFCWST.js} +85 -81
- package/dist/chunk-TVJFCWST.js.map +1 -0
- package/dist/{chunk-67LIVKYU.mjs → chunk-WEDLGKSS.mjs} +17 -13
- package/dist/{chunk-67LIVKYU.mjs.map → chunk-WEDLGKSS.mjs.map} +1 -1
- package/dist/client/index.js +2 -2
- package/dist/client/index.mjs +1 -1
- package/dist/components/index.d.mts +3 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +2 -2
- package/dist/components/index.mjs +1 -1
- package/dist/contexts/index.js +2 -2
- package/dist/contexts/index.mjs +1 -1
- package/dist/features/help/index.js +31 -31
- package/dist/features/help/index.mjs +1 -1
- package/package.json +1 -1
- package/src/components/tables/ContentListTable.tsx +33 -19
- package/src/components/tables/__tests__/ContentListTable.test.tsx +77 -0
- package/dist/chunk-MP5VURBB.js.map +0 -1
- /package/dist/{BlockNoteEditor-WZFEJS2B.mjs.map → BlockNoteEditor-VXK7INMR.mjs.map} +0 -0
|
@@ -338,6 +338,37 @@ describe("ContentListTable", () => {
|
|
|
338
338
|
});
|
|
339
339
|
});
|
|
340
340
|
|
|
341
|
+
describe("hideHeader", () => {
|
|
342
|
+
it("should render the column header row by default", () => {
|
|
343
|
+
const dataRetriever = createMockDataRetriever({
|
|
344
|
+
data: [{ id: "1", title: "Article 1" }],
|
|
345
|
+
});
|
|
346
|
+
|
|
347
|
+
render(<ContentListTable data={dataRetriever} tableGeneratorType={mockModule as any} fields={["id", "title"]} />);
|
|
348
|
+
|
|
349
|
+
expect(screen.getByText("Title")).toBeInTheDocument();
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
it("should not render the column header row when hideHeader is set", () => {
|
|
353
|
+
const dataRetriever = createMockDataRetriever({
|
|
354
|
+
data: [{ id: "1", title: "Article 1" }],
|
|
355
|
+
});
|
|
356
|
+
|
|
357
|
+
render(
|
|
358
|
+
<ContentListTable
|
|
359
|
+
data={dataRetriever}
|
|
360
|
+
tableGeneratorType={mockModule as any}
|
|
361
|
+
fields={["id", "title"]}
|
|
362
|
+
hideHeader
|
|
363
|
+
/>,
|
|
364
|
+
);
|
|
365
|
+
|
|
366
|
+
expect(screen.queryByText("Title")).not.toBeInTheDocument();
|
|
367
|
+
// Body rows must still render — only the header row is suppressed.
|
|
368
|
+
expect(screen.getByText("Article 1")).toBeInTheDocument();
|
|
369
|
+
});
|
|
370
|
+
});
|
|
371
|
+
|
|
341
372
|
describe("grouping", () => {
|
|
342
373
|
it("should not group rows when groupBy is not provided", () => {
|
|
343
374
|
const dataRetriever = createMockDataRetriever({
|
|
@@ -511,6 +542,52 @@ describe("ContentListTable", () => {
|
|
|
511
542
|
const article3Count = allText.filter((t) => t === "Article 3").length;
|
|
512
543
|
expect(article3Count).toBe(2);
|
|
513
544
|
});
|
|
545
|
+
|
|
546
|
+
it("should render group headers through groupLabel when provided", () => {
|
|
547
|
+
const dataRetriever = createMockDataRetriever({
|
|
548
|
+
data: [
|
|
549
|
+
{ id: "1", title: "Article 1", category: "CIVIL" },
|
|
550
|
+
{ id: "2", title: "Article 2", category: "CRIMINAL" },
|
|
551
|
+
],
|
|
552
|
+
});
|
|
553
|
+
|
|
554
|
+
render(
|
|
555
|
+
<ContentListTable
|
|
556
|
+
data={dataRetriever}
|
|
557
|
+
tableGeneratorType={mockModule as any}
|
|
558
|
+
fields={["id", "title"]}
|
|
559
|
+
groupBy="category"
|
|
560
|
+
groupLabel={(key) => `Branch: ${key}`}
|
|
561
|
+
/>,
|
|
562
|
+
);
|
|
563
|
+
|
|
564
|
+
expect(screen.getByText("Branch: CIVIL")).toBeInTheDocument();
|
|
565
|
+
expect(screen.getByText("Branch: CRIMINAL")).toBeInTheDocument();
|
|
566
|
+
expect(screen.queryByText("CIVIL")).not.toBeInTheDocument();
|
|
567
|
+
});
|
|
568
|
+
|
|
569
|
+
it("should order groups by groupOrder instead of alphabetically", () => {
|
|
570
|
+
const dataRetriever = createMockDataRetriever({
|
|
571
|
+
data: [
|
|
572
|
+
{ id: "1", title: "A Article", category: "A" },
|
|
573
|
+
{ id: "2", title: "B Article", category: "B" },
|
|
574
|
+
{ id: "3", title: "C Article", category: "C" },
|
|
575
|
+
],
|
|
576
|
+
});
|
|
577
|
+
|
|
578
|
+
render(
|
|
579
|
+
<ContentListTable
|
|
580
|
+
data={dataRetriever}
|
|
581
|
+
tableGeneratorType={mockModule as any}
|
|
582
|
+
fields={["id", "title"]}
|
|
583
|
+
groupBy="category"
|
|
584
|
+
groupOrder={["C", "A", "B"]}
|
|
585
|
+
/>,
|
|
586
|
+
);
|
|
587
|
+
|
|
588
|
+
const headings = screen.getAllByRole("heading", { level: 4 });
|
|
589
|
+
expect(headings.map((h) => h.textContent)).toEqual(["C", "A", "B"]);
|
|
590
|
+
});
|
|
514
591
|
});
|
|
515
592
|
|
|
516
593
|
describe("onRowClick", () => {
|