@rttui/skin-anocca 1.0.15 → 1.0.17

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 (47) hide show
  1. package/dist/cjs/HeaderPinButtons.cjs +109 -0
  2. package/dist/cjs/HeaderPinButtons.cjs.map +10 -0
  3. package/dist/cjs/RowPinButtons.cjs +75 -0
  4. package/dist/cjs/RowPinButtons.cjs.map +10 -0
  5. package/dist/cjs/index.cjs +383 -0
  6. package/dist/cjs/index.cjs.map +10 -0
  7. package/dist/cjs/package.json +5 -0
  8. package/dist/cjs/stories/ReactTanstackTableUiStory.stories.cjs +234 -0
  9. package/dist/cjs/stories/ReactTanstackTableUiStory.stories.cjs.map +10 -0
  10. package/dist/cjs/stories/ReactTanstackTableUiStoryComponent.cjs +147 -0
  11. package/dist/cjs/stories/ReactTanstackTableUiStoryComponent.cjs.map +10 -0
  12. package/dist/cjs/stories/createSourceCode.cjs +92 -0
  13. package/dist/cjs/stories/createSourceCode.cjs.map +10 -0
  14. package/dist/mjs/HeaderPinButtons.mjs +79 -0
  15. package/dist/mjs/HeaderPinButtons.mjs.map +10 -0
  16. package/dist/mjs/RowPinButtons.mjs +45 -0
  17. package/dist/mjs/RowPinButtons.mjs.map +10 -0
  18. package/dist/mjs/index.mjs +352 -0
  19. package/dist/mjs/index.mjs.map +10 -0
  20. package/dist/mjs/package.json +5 -0
  21. package/dist/mjs/stories/ReactTanstackTableUiStory.stories.mjs +204 -0
  22. package/dist/mjs/stories/ReactTanstackTableUiStory.stories.mjs.map +10 -0
  23. package/dist/mjs/stories/ReactTanstackTableUiStoryComponent.mjs +110 -0
  24. package/dist/mjs/stories/ReactTanstackTableUiStoryComponent.mjs.map +10 -0
  25. package/{src/stories/createSourceCode.ts → dist/mjs/stories/createSourceCode.mjs} +13 -4
  26. package/dist/mjs/stories/createSourceCode.mjs.map +10 -0
  27. package/dist/types/HeaderPinButtons.d.ts +1 -0
  28. package/dist/types/RowPinButtons.d.ts +4 -0
  29. package/dist/types/index.d.ts +3 -0
  30. package/dist/types/stories/ReactTanstackTableUiStory.stories.d.ts +72 -0
  31. package/dist/types/stories/ReactTanstackTableUiStoryComponent.d.ts +15 -0
  32. package/dist/types/stories/createSourceCode.d.ts +5 -0
  33. package/package.json +5 -2
  34. package/.storybook/main.ts +0 -18
  35. package/.storybook/preview.ts +0 -14
  36. package/CHANGELOG.md +0 -120
  37. package/index.html +0 -13
  38. package/src/HeaderPinButtons.tsx +0 -81
  39. package/src/RowPinButtons.tsx +0 -40
  40. package/src/index.tsx +0 -460
  41. package/src/stories/ReactTanstackTableUiStory.mdx +0 -136
  42. package/src/stories/ReactTanstackTableUiStory.stories.tsx +0 -206
  43. package/src/stories/ReactTanstackTableUiStoryComponent.tsx +0 -113
  44. package/src/stories/ScrollbarWidthSpecified.mdx +0 -42
  45. package/tsconfig.json +0 -34
  46. package/tsconfig.types.json +0 -9
  47. package/vite.config.ts +0 -23
@@ -0,0 +1,110 @@
1
+ // packages/skin-anocca/src/stories/ReactTanstackTableUiStoryComponent.tsx
2
+ import { Box, ScopedCssBaseline, ThemeProvider, Typography } from "@mui/material";
3
+ import { useTheme } from "@mui/material/styles";
4
+ import {
5
+ decorateColumnHelper,
6
+ ReactTanstackTableUi as TableComponent
7
+ } from "@rttui/core";
8
+ import {
9
+ createColumnHelper,
10
+ useReactTable
11
+ } from "@tanstack/react-table";
12
+ import { HeaderPinButtons } from "../HeaderPinButtons.mjs";
13
+ import React from "react";
14
+ import { RowPinButtons } from "../RowPinButtons.mjs";
15
+ import { jsx, jsxs } from "react/jsx-runtime";
16
+ var smallData = [
17
+ { id: "1", name: "John", age: 20, city: "New York" },
18
+ { id: "2", name: "Jane", age: 21, city: "Los Angeles" },
19
+ { id: "3", name: "Jim", age: 22, city: "Chicago" }
20
+ ];
21
+ var bigData = Array.from({ length: 1000 }, (_, i) => ({
22
+ id: i.toString(),
23
+ name: `Person ${i}`,
24
+ age: 20 + i,
25
+ city: `City ${i}`,
26
+ ...Object.fromEntries(Array.from({ length: 100 }, (_2, j) => [`col${j}`, `Value ${i}-${j}`]))
27
+ }));
28
+ var ReactTanstackTableUi = (props) => {
29
+ const theme = useTheme();
30
+ const data = props.data === "big" ? bigData : smallData;
31
+ const columns = React.useMemo(() => {
32
+ const columnHelper = decorateColumnHelper(createColumnHelper(), {
33
+ header: (original) => /* @__PURE__ */ jsxs(Box, {
34
+ sx: { display: "flex", gap: 2 },
35
+ children: [
36
+ original,
37
+ props.enableColumnPinning && /* @__PURE__ */ jsx(HeaderPinButtons, {})
38
+ ]
39
+ })
40
+ });
41
+ const fewColumns = [
42
+ columnHelper.accessor("name", {
43
+ header: "Name",
44
+ cell: (info) => /* @__PURE__ */ jsxs(Box, {
45
+ sx: { display: "flex", gap: 2, flex: 1 },
46
+ children: [
47
+ /* @__PURE__ */ jsx(Typography, {
48
+ variant: "body2",
49
+ children: info.getValue()
50
+ }),
51
+ props.enableRowPinning && /* @__PURE__ */ jsx(Box, {
52
+ sx: { flexGrow: 1 }
53
+ }),
54
+ props.enableRowPinning && /* @__PURE__ */ jsx(RowPinButtons, {
55
+ row: info.row
56
+ })
57
+ ]
58
+ }),
59
+ meta: props.meta?.["name"]
60
+ }),
61
+ columnHelper.accessor("age", {
62
+ header: "Age",
63
+ meta: props.meta?.["age"],
64
+ cell: (info) => /* @__PURE__ */ jsx(Typography, {
65
+ variant: "body2",
66
+ children: info.getValue()
67
+ }),
68
+ size: 50
69
+ }),
70
+ columnHelper.accessor("city", {
71
+ header: "City",
72
+ meta: props.meta?.["city"],
73
+ cell: (info) => /* @__PURE__ */ jsx(Typography, {
74
+ variant: "body2",
75
+ children: info.getValue()
76
+ })
77
+ })
78
+ ];
79
+ const manyColumns = [
80
+ ...fewColumns,
81
+ ...Array.from({ length: 100 }, (_, i) => columnHelper.accessor(`col${i}`, {
82
+ header: `Column ${i}`,
83
+ cell: (info) => /* @__PURE__ */ jsx(Typography, {
84
+ variant: "body2",
85
+ children: info.getValue()
86
+ })
87
+ }))
88
+ ];
89
+ return props.columns === "few" ? fewColumns : manyColumns;
90
+ }, [props.columns, props.enableColumnPinning, props.enableRowPinning, props.meta]);
91
+ const table = useReactTable({
92
+ ...props,
93
+ data,
94
+ columns
95
+ });
96
+ return /* @__PURE__ */ jsx(ScopedCssBaseline, {
97
+ children: /* @__PURE__ */ jsx(ThemeProvider, {
98
+ theme,
99
+ children: /* @__PURE__ */ jsx(TableComponent, {
100
+ ...props,
101
+ table
102
+ })
103
+ })
104
+ });
105
+ };
106
+ export {
107
+ ReactTanstackTableUi
108
+ };
109
+
110
+ //# debugId=6CD65E7FABB356E264756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/stories/ReactTanstackTableUiStoryComponent.tsx"],
4
+ "sourcesContent": [
5
+ "import { Box, ScopedCssBaseline, ThemeProvider, Typography } from \"@mui/material\";\nimport { useTheme } from \"@mui/material/styles\";\nimport {\n decorateColumnHelper,\n ReactTanstackTableUi as TableComponent,\n} from \"@rttui/core\";\nimport {\n ColumnDef,\n ColumnMeta,\n createColumnHelper,\n Table,\n TableOptions,\n useReactTable,\n} from \"@tanstack/react-table\";\nimport { HeaderPinButtons } from \"../HeaderPinButtons.mjs\";\nimport React from \"react\";\nimport { RowPinButtons } from \"../RowPinButtons.mjs\";\ntype Person = {\n id: string;\n name: string;\n age: number;\n city: string;\n} & Record<`col${number}`, string>;\n\nconst smallData: Person[] = [\n { id: \"1\", name: \"John\", age: 20, city: \"New York\" },\n { id: \"2\", name: \"Jane\", age: 21, city: \"Los Angeles\" },\n { id: \"3\", name: \"Jim\", age: 22, city: \"Chicago\" },\n];\n\nconst bigData: Person[] = Array.from({ length: 1000 }, (_, i) => ({\n id: i.toString(),\n name: `Person ${i}`,\n age: 20 + i,\n city: `City ${i}`,\n ...Object.fromEntries(\n Array.from({ length: 100 }, (_, j) => [`col${j}`, `Value ${i}-${j}`]),\n ),\n}));\n\nexport const ReactTanstackTableUi = (\n props: {\n data: \"big\" | \"small\";\n columns: \"many\" | \"few\";\n meta?: Record<string, ColumnMeta<Person, string>>;\n } & Omit<TableOptions<Person>, \"data\" | \"columns\"> &\n Omit<React.ComponentProps<typeof TableComponent>, \"table\">,\n) => {\n const theme = useTheme();\n const data: Person[] = props.data === \"big\" ? bigData : smallData;\n\n const columns: ColumnDef<Person>[] = React.useMemo(() => {\n const columnHelper = decorateColumnHelper(createColumnHelper<Person>(), {\n header: (original) => (\n <Box sx={{ display: \"flex\", gap: 2 }}>\n {original}\n {props.enableColumnPinning && <HeaderPinButtons />}\n </Box>\n ),\n });\n\n const fewColumns = [\n columnHelper.accessor(\"name\", {\n header: \"Name\",\n cell: (info) => (\n <Box sx={{ display: \"flex\", gap: 2, flex: 1 }}>\n <Typography variant=\"body2\">{info.getValue()}</Typography>\n {props.enableRowPinning && <Box sx={{ flexGrow: 1 }} />}\n {props.enableRowPinning && <RowPinButtons row={info.row} />}\n </Box>\n ),\n meta: props.meta?.[\"name\"],\n }),\n columnHelper.accessor(\"age\", {\n header: \"Age\",\n meta: props.meta?.[\"age\"],\n cell: (info) => <Typography variant=\"body2\">{info.getValue()}</Typography>,\n size: 50,\n }),\n columnHelper.accessor(\"city\", {\n header: \"City\",\n meta: props.meta?.[\"city\"],\n cell: (info) => <Typography variant=\"body2\">{info.getValue()}</Typography>,\n }),\n ];\n\n const manyColumns = [\n ...fewColumns,\n ...Array.from({ length: 100 }, (_, i) =>\n columnHelper.accessor(`col${i}`, {\n header: `Column ${i}`,\n cell: (info) => <Typography variant=\"body2\">{info.getValue()}</Typography>,\n }),\n ),\n ];\n\n return props.columns === \"few\" ? fewColumns : manyColumns;\n }, [props.columns, props.enableColumnPinning, props.enableRowPinning, props.meta]);\n\n const table = useReactTable({\n ...props,\n data,\n columns,\n });\n\n return (\n <ScopedCssBaseline>\n <ThemeProvider theme={theme}>\n <TableComponent {...props} table={table as Table<unknown>} />\n </ThemeProvider>\n </ScopedCssBaseline>\n );\n};\n"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AQ,cAAc;AAAA,OACvB;AAAA,IACH;AAAA,IACA;AAAA,EACF,CAAC;AAAA,EAED,uBACE,IAIE,mBAJF;AAAA,8BACE,IAEE,eAFF;AAAA,MAAe;AAAA,MAAf,0BACE,IAAC,gBAAD;AAAA,WAAoB;AAAA,QAAO;AAAA,OAAgC;AAAA,KAC3D;AAAA,GACF;AAAA;",
8
+ "debugId": "6CD65E7FABB356E264756E2164756E21",
9
+ "names": []
10
+ }
@@ -1,4 +1,5 @@
1
- export const createSourceCode = (opts?: { hookOptions?: string, props?: string, nameMeta?: string }) => {
1
+ // packages/skin-anocca/src/stories/createSourceCode.ts
2
+ var createSourceCode = (opts) => {
2
3
  return `import { createColumnHelper, useReactTable, getCoreRowModel } from "@tanstack/react-table";
3
4
  import { Box } from "@mui/material";
4
5
  import { HeaderPinButtons } from "@rttui/skin-anocca";
@@ -28,7 +29,8 @@ const columnHelper = decorateColumnHelper(createColumnHelper<Person>(), {
28
29
 
29
30
  const columns = [
30
31
  columnHelper.accessor("name", {
31
- header: "Name",${opts?.nameMeta ? '\n' + opts.nameMeta : ''}
32
+ header: "Name",${opts?.nameMeta ? `
33
+ ` + opts.nameMeta : ""}
32
34
  }),
33
35
  columnHelper.accessor("age", {
34
36
  header: "Age",
@@ -42,12 +44,19 @@ const columns = [
42
44
  const table = useReactTable({
43
45
  data,
44
46
  columns,
45
- getCoreRowModel: getCoreRowModel()${opts?.hookOptions ? '\n' + opts.hookOptions : ''}
47
+ getCoreRowModel: getCoreRowModel()${opts?.hookOptions ? `
48
+ ` + opts.hookOptions : ""}
46
49
  });
47
50
 
48
51
  <ReactTanstackTableUi
49
52
  table={table}
50
- enableColumnPinning${opts?.props ? '\n' + opts.props : ''}
53
+ enableColumnPinning${opts?.props ? `
54
+ ` + opts.props : ""}
51
55
  />
52
56
  `;
53
57
  };
58
+ export {
59
+ createSourceCode
60
+ };
61
+
62
+ //# debugId=C53576C0D339686564756E2164756E21
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/stories/createSourceCode.ts"],
4
+ "sourcesContent": [
5
+ "export const createSourceCode = (opts?: { hookOptions?: string, props?: string, nameMeta?: string }) => {\n return `import { createColumnHelper, useReactTable, getCoreRowModel } from \"@tanstack/react-table\";\nimport { Box } from \"@mui/material\";\nimport { HeaderPinButtons } from \"@rttui/skin-anocca\";\nimport { ReactTanstackTableUi, decorateColumnHelper } from \"@rttui/core\";\n\ntype Person = {\n id: string;\n name: string;\n age: number;\n city: string;\n};\n\nconst data: Person[] = [\n { id: \"1\", name: \"John\", age: 20, city: \"New York\" },\n { id: \"2\", name: \"Jane\", age: 21, city: \"Los Angeles\" },\n { id: \"3\", name: \"Jim\", age: 22, city: \"Chicago\" },\n];\n\nconst columnHelper = decorateColumnHelper(createColumnHelper<Person>(), {\n header: (original) => (\n <Box sx={{ display: \"flex\", gap: 2 }}>\n {original}\n {props.enableColumnPinning && <HeaderPinButtons />}\n </Box>\n ),\n});\n\nconst columns = [\n columnHelper.accessor(\"name\", {\n header: \"Name\",${opts?.nameMeta ? '\\n' + opts.nameMeta : ''}\n }),\n columnHelper.accessor(\"age\", {\n header: \"Age\",\n size: 50,\n }),\n columnHelper.accessor(\"city\", {\n header: \"City\",\n }),\n];\n\nconst table = useReactTable({\n data,\n columns,\n getCoreRowModel: getCoreRowModel()${opts?.hookOptions ? '\\n' + opts.hookOptions : ''}\n});\n\n<ReactTanstackTableUi\n table={table}\n enableColumnPinning${opts?.props ? '\\n' + opts.props : ''}\n/>\n`;\n};\n"
6
+ ],
7
+ "mappings": ";AAAO,IAAM,mBAAmB,CAAC,SAAuE;AAAA,EACtG,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBA6BY,MAAM,WAAW;AAAA,IAAO,KAAK,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sCAcvB,MAAM,cAAc;AAAA,IAAO,KAAK,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA,uBAK7D,MAAM,QAAQ;AAAA,IAAO,KAAK,QAAQ;AAAA;AAAA;AAAA;",
8
+ "debugId": "C53576C0D339686564756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1 @@
1
+ export declare const HeaderPinButtons: () => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,4 @@
1
+ import { Row } from "@tanstack/react-table";
2
+ export declare function RowPinButtons({ row }: {
3
+ row: Row<any>;
4
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,3 @@
1
+ import { Skin } from "@rttui/core";
2
+ declare const AnoccaSkin: Skin;
3
+ export { AnoccaSkin };
@@ -0,0 +1,72 @@
1
+ import type { StoryObj } from "@storybook/react";
2
+ declare const meta: {
3
+ title: string;
4
+ component: (props: {
5
+ data: "big" | "small";
6
+ columns: "many" | "few";
7
+ meta?: Record<string, import("@tanstack/react-table").ColumnMeta<{
8
+ id: string;
9
+ name: string;
10
+ age: number;
11
+ city: string;
12
+ } & Record<`col${number}`, string>, string>>;
13
+ } & Omit<import("@tanstack/react-table").TableOptions<{
14
+ id: string;
15
+ name: string;
16
+ age: number;
17
+ city: string;
18
+ } & Record<`col${number}`, string>>, "data" | "columns"> & Omit<React.ComponentProps<typeof import("@rttui/core").ReactTanstackTableUi>, "table">) => import("react/jsx-runtime").JSX.Element;
19
+ parameters: {
20
+ layout: string;
21
+ };
22
+ argTypes: {
23
+ data: {
24
+ control: "select";
25
+ };
26
+ columns: {
27
+ control: "select";
28
+ };
29
+ pinColsRelativeTo: {
30
+ control: "select";
31
+ options: string[];
32
+ };
33
+ skin: {
34
+ control: "object";
35
+ table: {
36
+ disable: true;
37
+ };
38
+ };
39
+ };
40
+ args: {
41
+ width: number;
42
+ height: number;
43
+ skin: import("@rttui/core").Skin;
44
+ autoCrushColumns: false;
45
+ data: "big";
46
+ columns: "few";
47
+ getCoreRowModel: (table: import("@tanstack/react-table").Table<any>) => () => import("@tanstack/react-table").RowModel<any>;
48
+ pinColsRelativeTo: "cols";
49
+ fillAvailableSpaceAfterCrush: false;
50
+ scrollbarWidth: number;
51
+ getRowId: (row: {
52
+ id: string;
53
+ name: string;
54
+ age: number;
55
+ city: string;
56
+ } & Record<`col${number}`, string>) => string;
57
+ };
58
+ };
59
+ export default meta;
60
+ type Story = StoryObj<typeof meta>;
61
+ export declare const Basic: Story;
62
+ export declare const AutoCrushColumns: Story;
63
+ export declare const AutoCrushColumnsExceptName: Story;
64
+ export declare const PinRelativeToCols: Story;
65
+ export declare const PinRelativeToTable: Story;
66
+ export declare const FillAvailableSpaceAfterCrush: Story;
67
+ export declare const FillAvailableSpaceAfterCrushExceptName: Story;
68
+ export declare const FillAvailableSpaceAfterCrushWithoutSpecifiedScrollbarWidth: Story;
69
+ export declare const CanPinRowsRelativeToRows: Story;
70
+ export declare const CanPinRowsRelativeToTable: Story;
71
+ export declare const SizeByLargestHeader: Story;
72
+ export declare const SizeByLargestHeaderWithMeta: Story;
@@ -0,0 +1,15 @@
1
+ import { ReactTanstackTableUi as TableComponent } from "@rttui/core";
2
+ import { ColumnMeta, TableOptions } from "@tanstack/react-table";
3
+ import React from "react";
4
+ type Person = {
5
+ id: string;
6
+ name: string;
7
+ age: number;
8
+ city: string;
9
+ } & Record<`col${number}`, string>;
10
+ export declare const ReactTanstackTableUi: (props: {
11
+ data: "big" | "small";
12
+ columns: "many" | "few";
13
+ meta?: Record<string, ColumnMeta<Person, string>>;
14
+ } & Omit<TableOptions<Person>, "data" | "columns"> & Omit<React.ComponentProps<typeof TableComponent>, "table">) => import("react/jsx-runtime").JSX.Element;
15
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare const createSourceCode: (opts?: {
2
+ hookOptions?: string;
3
+ props?: string;
4
+ nameMeta?: string;
5
+ }) => string;
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@rttui/skin-anocca",
3
- "version": "1.0.15",
3
+ "version": "1.0.17",
4
4
  "main": "./dist/cjs/index.cjs",
5
5
  "dependencies": {
6
- "@rttui/core": "^1.0.15"
6
+ "@rttui/core": "^1.0.16"
7
7
  },
8
8
  "module": "./dist/mjs/index.mjs",
9
9
  "types": "./dist/types/index.d.ts",
@@ -17,6 +17,9 @@
17
17
  "publishConfig": {
18
18
  "access": "public"
19
19
  },
20
+ "files": [
21
+ "dist"
22
+ ],
20
23
  "scripts": {
21
24
  "dev": "vite",
22
25
  "build": "tsc -b && vite build",
@@ -1,18 +0,0 @@
1
- import type { StorybookConfig } from '@storybook/react-vite';
2
-
3
- const config: StorybookConfig = {
4
- "stories": [
5
- "../src/**/*.mdx",
6
- "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"
7
- ],
8
- "addons": [
9
- "@storybook/addon-essentials",
10
- "@storybook/addon-onboarding",
11
- "@storybook/addon-interactions"
12
- ],
13
- "framework": {
14
- "name": "@storybook/react-vite",
15
- "options": {}
16
- }
17
- };
18
- export default config;
@@ -1,14 +0,0 @@
1
- import type { Preview } from '@storybook/react'
2
-
3
- const preview: Preview = {
4
- parameters: {
5
- controls: {
6
- matchers: {
7
- color: /(background|color)$/i,
8
- date: /Date$/i,
9
- },
10
- },
11
- },
12
- };
13
-
14
- export default preview;
package/CHANGELOG.md DELETED
@@ -1,120 +0,0 @@
1
- # @rttui/skin-anocca
2
-
3
- ## 1.0.15
4
-
5
- ### Patch Changes
6
-
7
- - Improve column sizing API
8
- - Updated dependencies
9
- - @rttui/core@1.0.15
10
-
11
- ## 1.0.14
12
-
13
- ### Patch Changes
14
-
15
- - Add a storybook
16
- - Updated dependencies
17
- - @rttui/core@1.0.14
18
-
19
- ## 1.0.13
20
-
21
- ### Patch Changes
22
-
23
- - Updated dependencies
24
- - @rttui/core@1.0.13
25
-
26
- ## 1.0.12
27
-
28
- ### Patch Changes
29
-
30
- - Updated dependencies
31
- - @rttui/core@1.0.12
32
-
33
- ## 1.0.11
34
-
35
- ### Patch Changes
36
-
37
- - Better styling and auto measure columns
38
- - Updated dependencies
39
- - @rttui/core@1.0.11
40
-
41
- ## 1.0.10
42
-
43
- ### Patch Changes
44
-
45
- - Updated dependencies
46
- - @rttui/core@1.0.10
47
-
48
- ## 1.0.9
49
-
50
- ### Patch Changes
51
-
52
- - Updated dependencies
53
- - @rttui/core@1.0.9
54
-
55
- ## 1.0.8
56
-
57
- ### Patch Changes
58
-
59
- - Updated dependencies
60
- - @rttui/core@1.0.8
61
-
62
- ## 1.0.7
63
-
64
- ### Patch Changes
65
-
66
- - Updated dependencies
67
- - @rttui/core@1.0.7
68
-
69
- ## 1.0.6
70
-
71
- ### Patch Changes
72
-
73
- - Updated dependencies
74
- - @rttui/core@1.0.6
75
-
76
- ## 1.0.5
77
-
78
- ### Patch Changes
79
-
80
- - Fix build
81
- - Updated dependencies
82
- - @rttui/core@1.0.5
83
-
84
- ## 1.0.4
85
-
86
- ### Patch Changes
87
-
88
- - new build method
89
- - Updated dependencies
90
- - @rttui/core@1.0.4
91
-
92
- ## 1.0.3
93
-
94
- ### Patch Changes
95
-
96
- - 51c73d3: build with bun build instead
97
- - Updated dependencies [51c73d3]
98
- - @rttui/core@1.0.3
99
-
100
- ## 1.0.2
101
-
102
- ### Patch Changes
103
-
104
- - fix lib build
105
- - Updated dependencies
106
- - @rttui/core@1.0.2
107
-
108
- ## 1.0.1
109
-
110
- ### Patch Changes
111
-
112
- - Fix dependencies
113
- - Updated dependencies
114
- - @rttui/core@1.0.1
115
-
116
- ## 1.0.0
117
-
118
- ### Major Changes
119
-
120
- - First release
package/index.html DELETED
@@ -1,13 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>Vite + React + TS</title>
8
- </head>
9
- <body>
10
- <div id="root"></div>
11
- <script type="module" src="/src/main.tsx"></script>
12
- </body>
13
- </html>
@@ -1,81 +0,0 @@
1
- import { useVirtualHeader } from "@rttui/core";
2
- import { MdChevronLeft, MdChevronRight, MdClose } from "react-icons/md";
3
-
4
- export const HeaderPinButtons = () => {
5
- const vHeader = useVirtualHeader();
6
- const header = vHeader.header;
7
- if (!header) {
8
- return null;
9
- }
10
- const isPinned = vHeader.isPinned;
11
- return (
12
- <div style={{ display: "flex", gap: "-4px", justifyContent: "flex-start" }}>
13
- {isPinned !== "start" ? (
14
- <button
15
- style={{
16
- border: "none",
17
- background: "transparent",
18
- cursor: "pointer",
19
- padding: "2px",
20
- borderRadius: "4px",
21
- display: "flex",
22
- alignItems: "center",
23
- opacity: 0.5,
24
- }}
25
- onClick={() => {
26
- if (!header) {
27
- return;
28
- }
29
- header.column.pin("left");
30
- }}
31
- >
32
- <MdChevronLeft />
33
- </button>
34
- ) : null}
35
- {isPinned ? (
36
- <button
37
- style={{
38
- border: "none",
39
- background: "transparent",
40
- cursor: "pointer",
41
- padding: "2px",
42
- borderRadius: "4px",
43
- display: "flex",
44
- alignItems: "center",
45
- opacity: 0.7,
46
- }}
47
- onClick={() => {
48
- if (!header) {
49
- return;
50
- }
51
- header.column.pin(false);
52
- }}
53
- >
54
- <MdClose />
55
- </button>
56
- ) : null}
57
- {isPinned !== "end" ? (
58
- <button
59
- style={{
60
- border: "none",
61
- background: "transparent",
62
- cursor: "pointer",
63
- padding: "2px",
64
- borderRadius: "4px",
65
- display: "flex",
66
- alignItems: "center",
67
- opacity: 0.5,
68
- }}
69
- onClick={() => {
70
- if (!header) {
71
- return;
72
- }
73
- header.column.pin("right");
74
- }}
75
- >
76
- <MdChevronRight />
77
- </button>
78
- ) : null}
79
- </div>
80
- );
81
- };
@@ -1,40 +0,0 @@
1
- import { Row } from "@tanstack/react-table";
2
- import { IconButton, Stack } from "@mui/material";
3
- import { FiX, FiChevronUp, FiChevronDown } from "react-icons/fi";
4
-
5
- export function RowPinButtons({ row }: { row: Row<any> }) {
6
- if (!row.getCanPin()) {
7
- return null;
8
- }
9
-
10
- if (row.getIsPinned()) {
11
- return (
12
- <IconButton
13
- onClick={() => row.pin(false, true, true)}
14
- size="small"
15
- sx={{ color: "text.secondary" }}
16
- >
17
- <FiX size={16} />
18
- </IconButton>
19
- );
20
- }
21
-
22
- return (
23
- <Stack direction="row">
24
- <IconButton
25
- onClick={() => row.pin("top", true, true)}
26
- size="small"
27
- sx={{ color: "text.secondary" }}
28
- >
29
- <FiChevronUp size={16} />
30
- </IconButton>
31
- <IconButton
32
- onClick={() => row.pin("bottom", true, true)}
33
- size="small"
34
- sx={{ color: "text.secondary" }}
35
- >
36
- <FiChevronDown size={16} />
37
- </IconButton>
38
- </Stack>
39
- );
40
- }