@purpurds/table 8.8.0 → 8.9.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/LICENSE.txt +16 -16
- package/dist/table.cjs.js +14 -228
- package/dist/table.cjs.js.map +1 -1
- package/dist/table.es.js +3748 -4133
- package/dist/table.es.js.map +1 -1
- package/package.json +39 -39
- package/src/draggable-table.test.tsx +1 -0
- package/src/table-content-drag.test.tsx +1 -0
- package/src/table-settings-drawer.test.tsx +7 -2
- package/vitest.setup.ts +23 -19
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@purpurds/table",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.9.0",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"main": "./dist/table.cjs.js",
|
|
6
6
|
"types": "./dist/table.d.ts",
|
|
@@ -20,53 +20,53 @@
|
|
|
20
20
|
"@dnd-kit/modifiers": "~9.0.0",
|
|
21
21
|
"@dnd-kit/utilities": "~3.2.2",
|
|
22
22
|
"@tanstack/react-table": "~8.21.2",
|
|
23
|
-
"classnames": "~2.5.
|
|
24
|
-
"@purpurds/badge": "8.
|
|
25
|
-
"@purpurds/
|
|
26
|
-
"@purpurds/cta-link": "8.
|
|
27
|
-
"@purpurds/
|
|
28
|
-
"@purpurds/
|
|
29
|
-
"@purpurds/heading": "8.
|
|
30
|
-
"@purpurds/icon": "8.
|
|
31
|
-
"@purpurds/
|
|
32
|
-
"@purpurds/
|
|
33
|
-
"@purpurds/
|
|
34
|
-
"@purpurds/
|
|
35
|
-
"@purpurds/text-field": "8.
|
|
36
|
-
"@purpurds/
|
|
37
|
-
"@purpurds/
|
|
38
|
-
"@purpurds/
|
|
39
|
-
"@purpurds/
|
|
23
|
+
"classnames": "~2.5.1",
|
|
24
|
+
"@purpurds/badge": "8.9.0",
|
|
25
|
+
"@purpurds/button": "8.9.0",
|
|
26
|
+
"@purpurds/cta-link": "8.9.0",
|
|
27
|
+
"@purpurds/drawer": "8.9.0",
|
|
28
|
+
"@purpurds/checkbox": "8.9.0",
|
|
29
|
+
"@purpurds/heading": "8.9.0",
|
|
30
|
+
"@purpurds/icon": "8.9.0",
|
|
31
|
+
"@purpurds/link": "8.9.0",
|
|
32
|
+
"@purpurds/select": "8.9.0",
|
|
33
|
+
"@purpurds/skeleton": "8.9.0",
|
|
34
|
+
"@purpurds/paragraph": "8.9.0",
|
|
35
|
+
"@purpurds/text-field": "8.9.0",
|
|
36
|
+
"@purpurds/tokens": "8.9.0",
|
|
37
|
+
"@purpurds/toggle": "8.9.0",
|
|
38
|
+
"@purpurds/visually-hidden": "8.9.0",
|
|
39
|
+
"@purpurds/tooltip": "8.9.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@rushstack/eslint-patch": "~1.10.0",
|
|
43
|
-
"@storybook/react-vite": "^10.0.
|
|
44
|
-
"@testing-library/dom": "~10.4.
|
|
45
|
-
"@testing-library/jest-dom": "~6.
|
|
46
|
-
"@testing-library/react": "~16.
|
|
43
|
+
"@storybook/react-vite": "^10.0.8",
|
|
44
|
+
"@testing-library/dom": "~10.4.1",
|
|
45
|
+
"@testing-library/jest-dom": "~6.9.1",
|
|
46
|
+
"@testing-library/react": "~16.3.0",
|
|
47
47
|
"@testing-library/user-event": "~14.5.1",
|
|
48
48
|
"@types/node": "22.17",
|
|
49
|
-
"@types/react-dom": "^19.
|
|
50
|
-
"@types/react": "^19.
|
|
51
|
-
"eslint": "9.
|
|
52
|
-
"jsdom": "~
|
|
53
|
-
"lint-staged": "
|
|
49
|
+
"@types/react-dom": "^19.2.3",
|
|
50
|
+
"@types/react": "^19.2.6",
|
|
51
|
+
"eslint": "9.39.1",
|
|
52
|
+
"jsdom": "~27.2.0",
|
|
53
|
+
"lint-staged": "16.2.6",
|
|
54
54
|
"prettier": "~2.8.8",
|
|
55
|
-
"react-dom": "^19.
|
|
56
|
-
"react": "^19.
|
|
57
|
-
"storybook": "^10.0.
|
|
58
|
-
"typescript": "^5.
|
|
59
|
-
"vite": "^
|
|
55
|
+
"react-dom": "^19.2.0",
|
|
56
|
+
"react": "^19.2.0",
|
|
57
|
+
"storybook": "^10.0.8",
|
|
58
|
+
"typescript": "^5.9.3",
|
|
59
|
+
"vite": "^7.2.2",
|
|
60
60
|
"vitest-axe": "~0.1.0",
|
|
61
61
|
"vitest-canvas-mock": "~0.3.3",
|
|
62
|
-
"vitest": "^
|
|
63
|
-
"@purpurds/autocomplete": "8.
|
|
62
|
+
"vitest": "^4.0.10",
|
|
63
|
+
"@purpurds/autocomplete": "8.9.0",
|
|
64
|
+
"@purpurds/grid": "8.9.0",
|
|
64
65
|
"@purpurds/component-rig": "1.0.0",
|
|
65
|
-
"@purpurds/illustrative-icon": "8.
|
|
66
|
-
"@purpurds/
|
|
67
|
-
"@purpurds/
|
|
68
|
-
"@purpurds/
|
|
69
|
-
"@purpurds/pagination": "8.8.0"
|
|
66
|
+
"@purpurds/illustrative-icon": "8.9.0",
|
|
67
|
+
"@purpurds/label": "8.9.0",
|
|
68
|
+
"@purpurds/listbox": "8.9.0",
|
|
69
|
+
"@purpurds/pagination": "8.9.0"
|
|
70
70
|
},
|
|
71
71
|
"scripts": {
|
|
72
72
|
"build:dev": "vite",
|
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import { type Column } from "@tanstack/react-table";
|
|
3
3
|
import { render, screen, within } from "@testing-library/react";
|
|
4
4
|
import userEvent from "@testing-library/user-event";
|
|
5
|
+
import { vi } from "vitest";
|
|
5
6
|
import { axe } from "vitest-axe";
|
|
6
7
|
|
|
7
8
|
import { TableSettingsDrawer } from "./table-settings-drawer";
|
|
@@ -292,7 +293,9 @@ describe("Data Table - Settings drawer", () => {
|
|
|
292
293
|
name: copy.settingsDrawerWithColumnDrag.visibleColumns.ariaLabels.buttons.rearrange,
|
|
293
294
|
});
|
|
294
295
|
expect(rearrangeButton).toBeInTheDocument();
|
|
295
|
-
expect(rearrangeButton).toHaveTextContent(
|
|
296
|
+
expect(rearrangeButton).toHaveTextContent(
|
|
297
|
+
copy.settingsDrawerWithColumnDrag.visibleColumns.buttons.rearrange
|
|
298
|
+
);
|
|
296
299
|
});
|
|
297
300
|
|
|
298
301
|
it("should update aria-label when entering rearrange mode", async () => {
|
|
@@ -306,7 +309,9 @@ describe("Data Table - Settings drawer", () => {
|
|
|
306
309
|
name: copy.settingsDrawerWithColumnDrag.visibleColumns.ariaLabels.buttons.done,
|
|
307
310
|
});
|
|
308
311
|
expect(doneButton).toBeInTheDocument();
|
|
309
|
-
expect(doneButton).toHaveTextContent(
|
|
312
|
+
expect(doneButton).toHaveTextContent(
|
|
313
|
+
copy.settingsDrawerWithColumnDrag.visibleColumns.buttons.done
|
|
314
|
+
);
|
|
310
315
|
});
|
|
311
316
|
});
|
|
312
317
|
});
|
package/vitest.setup.ts
CHANGED
|
@@ -33,28 +33,32 @@ vi.mock("./src/table-row-cell-skeleton.tsx", () => ({
|
|
|
33
33
|
},
|
|
34
34
|
}));
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
37
|
+
const ResizeObserverMock = vi.fn(function (this: any) {
|
|
38
|
+
this.disconnect = vi.fn();
|
|
39
|
+
this.observe = vi.fn();
|
|
40
|
+
this.takeRecords = vi.fn();
|
|
41
|
+
this.unobserve = vi.fn();
|
|
42
|
+
});
|
|
42
43
|
vi.stubGlobal("ResizeObserver", ResizeObserverMock);
|
|
43
44
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
46
|
+
const IntersectionObserverMock = vi.fn(function (this: any) {
|
|
47
|
+
this.disconnect = vi.fn();
|
|
48
|
+
this.observe = vi.fn();
|
|
49
|
+
this.takeRecords = vi.fn();
|
|
50
|
+
this.unobserve = vi.fn();
|
|
51
|
+
});
|
|
50
52
|
vi.stubGlobal("IntersectionObserver", IntersectionObserverMock);
|
|
51
53
|
|
|
52
|
-
const matchMedia = vi.fn((query)
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
const matchMedia = vi.fn(function (query) {
|
|
55
|
+
return {
|
|
56
|
+
matches: true,
|
|
57
|
+
media: query,
|
|
58
|
+
onchange: null,
|
|
59
|
+
addEventListener: vi.fn(),
|
|
60
|
+
removeEventListener: vi.fn(),
|
|
61
|
+
};
|
|
62
|
+
});
|
|
59
63
|
|
|
60
64
|
vi.stubGlobal("matchMedia", matchMedia);
|