@xyo-network/react-table 4.4.10 → 5.0.0-rc.1
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/browser/index.mjs +6 -6
- package/dist/browser/index.mjs.map +1 -1
- package/dist/types/components/TableEx/TableCellEx.d.ts +6 -0
- package/dist/types/components/TableEx/TableCellEx.d.ts.map +1 -0
- package/dist/types/components/TableEx/TableEx.d.ts +20 -0
- package/dist/types/components/TableEx/TableEx.d.ts.map +1 -0
- package/dist/types/components/TableEx/TableFooterEx.d.ts +9 -0
- package/dist/types/components/TableEx/TableFooterEx.d.ts.map +1 -0
- package/dist/types/components/TableEx/index.d.ts +5 -0
- package/dist/types/components/TableEx/index.d.ts.map +1 -0
- package/dist/types/components/TableEx/types/TableExVariants.d.ts +2 -0
- package/dist/types/components/TableEx/types/TableExVariants.d.ts.map +1 -0
- package/dist/types/components/TableEx/types/index.d.ts +2 -0
- package/dist/types/components/TableEx/types/index.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/index.d.ts.map +1 -0
- package/dist/types/context/TableHeight/Context.d.ts +3 -0
- package/dist/types/context/TableHeight/Context.d.ts.map +1 -0
- package/dist/types/context/TableHeight/Provider.d.ts +11 -0
- package/dist/types/context/TableHeight/Provider.d.ts.map +1 -0
- package/dist/types/context/TableHeight/State.d.ts +10 -0
- package/dist/types/context/TableHeight/State.d.ts.map +1 -0
- package/dist/types/context/TableHeight/index.d.ts +5 -0
- package/dist/types/context/TableHeight/index.d.ts.map +1 -0
- package/dist/types/context/TableHeight/use.d.ts +2 -0
- package/dist/types/context/TableHeight/use.d.ts.map +1 -0
- package/dist/types/context/index.d.ts +2 -0
- package/dist/types/context/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/types/TableHead.d.ts +11 -0
- package/dist/types/types/TableHead.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +2 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/package.json +22 -20
- package/src/components/TableEx/TableEx.tsx +9 -7
- package/src/context/TableHeight/Provider.tsx +2 -2
- package/dist/browser/index.d.ts +0 -57
package/dist/browser/index.mjs
CHANGED
|
@@ -14,21 +14,21 @@ var TableCellEx = styled(TableCell, {
|
|
|
14
14
|
|
|
15
15
|
// src/components/TableEx/TableEx.tsx
|
|
16
16
|
import { Table } from "@mui/material";
|
|
17
|
-
import React
|
|
18
|
-
var TableExInner = /* @__PURE__ */
|
|
17
|
+
import React from "react";
|
|
18
|
+
var TableExInner = /* @__PURE__ */ __name(({ ref, children, ...props }) => {
|
|
19
19
|
return /* @__PURE__ */ React.createElement(Table, {
|
|
20
20
|
ref,
|
|
21
21
|
...props
|
|
22
22
|
}, children);
|
|
23
|
-
});
|
|
23
|
+
}, "TableExInner");
|
|
24
24
|
TableExInner.displayName = "TableExInner";
|
|
25
|
-
var TableExWithRef = /* @__PURE__ */
|
|
25
|
+
var TableExWithRef = /* @__PURE__ */ __name(({ ref, variant, children, ...props }) => {
|
|
26
26
|
return /* @__PURE__ */ React.createElement(TableExInner, {
|
|
27
27
|
stickyHeader: variant === "scrollable",
|
|
28
28
|
ref,
|
|
29
29
|
...props
|
|
30
30
|
}, children);
|
|
31
|
-
});
|
|
31
|
+
}, "TableExWithRef");
|
|
32
32
|
TableExWithRef.displayName = "TableEx";
|
|
33
33
|
var TableEx = TableExWithRef;
|
|
34
34
|
|
|
@@ -88,7 +88,7 @@ var TableHeightProvider = /* @__PURE__ */ __name(({ children, additionalRows = 0
|
|
|
88
88
|
setVisibleRows,
|
|
89
89
|
visibleRows
|
|
90
90
|
]);
|
|
91
|
-
return /* @__PURE__ */ React3.createElement(TableHeightContext
|
|
91
|
+
return /* @__PURE__ */ React3.createElement(TableHeightContext, {
|
|
92
92
|
value
|
|
93
93
|
}, children);
|
|
94
94
|
}, "TableHeightProvider");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/TableEx/TableCellEx.tsx","../../src/components/TableEx/TableEx.tsx","../../src/components/TableEx/TableFooterEx.tsx","../../src/context/TableHeight/Context.ts","../../src/context/TableHeight/Provider.tsx","../../src/context/TableHeight/use.ts"],"sourcesContent":["import type { TableCellProps } from '@mui/material'\nimport { styled, TableCell } from '@mui/material'\n\nexport interface TableCellExProps extends TableCellProps {\n noBgColor?: boolean\n}\n\nexport const TableCellEx = styled(TableCell, { name: 'TableCellNoBgColor', shouldForwardProp: prop => prop !== 'noBgColor' })<TableCellExProps>(\n ({ noBgColor = true }) => ({ ...(noBgColor && { backgroundColor: 'transparent' }) }),\n)\n","import type { TableProps } from '@mui/material'\nimport { Table } from '@mui/material'\nimport type { PropsWithChildren } from 'react'\nimport React
|
|
1
|
+
{"version":3,"sources":["../../src/components/TableEx/TableCellEx.tsx","../../src/components/TableEx/TableEx.tsx","../../src/components/TableEx/TableFooterEx.tsx","../../src/context/TableHeight/Context.ts","../../src/context/TableHeight/Provider.tsx","../../src/context/TableHeight/use.ts"],"sourcesContent":["import type { TableCellProps } from '@mui/material'\nimport { styled, TableCell } from '@mui/material'\n\nexport interface TableCellExProps extends TableCellProps {\n noBgColor?: boolean\n}\n\nexport const TableCellEx = styled(TableCell, { name: 'TableCellNoBgColor', shouldForwardProp: prop => prop !== 'noBgColor' })<TableCellExProps>(\n ({ noBgColor = true }) => ({ ...(noBgColor && { backgroundColor: 'transparent' }) }),\n)\n","import type { TableProps } from '@mui/material'\nimport { Table } from '@mui/material'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport type { TableExVariants } from './types/index.ts'\n\nexport interface TableExProps extends PropsWithChildren, TableProps {\n variant?: TableExVariants\n}\n\nconst TableExInner = ({\n ref, children, ...props\n}: TableExProps & { ref?: React.RefObject<HTMLTableElement | null> }) => {\n return (\n <Table ref={ref} {...props}>\n {children}\n </Table>\n )\n}\n\nTableExInner.displayName = 'TableExInner'\n\nexport const TableExWithRef = ({\n ref, variant, children, ...props\n}: TableExProps & { ref?: React.RefObject<HTMLTableElement | null> }) => {\n return (\n <TableExInner stickyHeader={variant === 'scrollable'} ref={ref} {...props}>\n {children}\n </TableExInner>\n )\n}\n\nTableExWithRef.displayName = 'TableEx'\n\nexport const TableEx = TableExWithRef\n","import type { TableFooterProps } from '@mui/material'\nimport { styled, TableFooter } from '@mui/material'\nimport type { PropsWithChildren } from 'react'\nimport React from 'react'\n\nimport type { TableExVariants } from './types/index.ts'\n\nconst TableFooterExRoot = styled(TableFooter, {\n name: 'TableFooterEx',\n shouldForwardProp: propName => propName !== 'scrollable',\n slot: 'Root',\n})<TableFooterExProps>(({ variant, theme }) => ({\n backgroundColor: theme.palette.background.default,\n bottom: 'unset',\n position: 'relative',\n ...(variant === 'scrollable' && {\n bottom: 0,\n position: 'sticky',\n }),\n}))\n\nexport interface TableFooterExProps extends PropsWithChildren, TableFooterProps {\n variant?: TableExVariants\n}\n\nexport const TableFooterEx: React.FC<TableFooterExProps> = ({ children, ...props }) => <TableFooterExRoot {...props}>{children}</TableFooterExRoot>\n","import { createContextEx } from '@xyo-network/react-shared'\n\nimport type { TableHeightState } from './State.ts'\n\nexport const TableHeightContext = createContextEx<TableHeightState>()\n","import { useResetState } from '@xylabs/react-hooks'\nimport type { ContextExProviderProps } from '@xyo-network/react-shared'\nimport type { PropsWithChildren } from 'react'\nimport React, { useMemo, useState } from 'react'\n\nimport { TableHeightContext } from './Context.ts'\n\nexport interface TableHeightProviderProps extends ContextExProviderProps, PropsWithChildren {\n /** @field Account for optional header and footer rows */\n additionalRows?: number\n defaultVisibleRows?: number\n heightFormat?: string\n}\n\nexport const TableHeightProvider: React.FC<TableHeightProviderProps> = ({\n children,\n additionalRows = 0,\n defaultVisibleRows,\n heightFormat = 'px',\n}) => {\n const [visibleRows, setVisibleRows] = useResetState(defaultVisibleRows)\n const [rowHeight, setRowHeight] = useState<number | undefined>()\n\n const height = useMemo(() => {\n if (rowHeight !== undefined && visibleRows !== undefined) {\n return rowHeight * (visibleRows + additionalRows)\n }\n }, [defaultVisibleRows, rowHeight, visibleRows, additionalRows])\n\n const formattedHeight = useMemo(() => (height === undefined ? undefined : `${height}${heightFormat}`), [height, heightFormat])\n\n const value = useMemo(() => ({\n height: formattedHeight, provided: true, rowHeight, setRowHeight, setVisibleRows, visibleRows,\n }), [formattedHeight, rowHeight, setRowHeight, setVisibleRows, visibleRows])\n\n return (\n <TableHeightContext value={value}>\n {children}\n </TableHeightContext>\n )\n}\n","import { useContextEx } from '@xyo-network/react-shared'\n\nimport { TableHeightContext } from './Context.ts'\n\nexport const useTableHeight = (required = false) => useContextEx(TableHeightContext, 'TableHeight', required)\n"],"mappings":";;;;AACA,SAASA,QAAQC,iBAAiB;AAM3B,IAAMC,cAAcC,OAAOC,WAAW;EAAEC,MAAM;EAAsBC,mBAAmBC,wBAAAA,SAAQA,SAAS,aAAjBA;AAA6B,CAAA,EACzH,CAAC,EAAEC,YAAY,KAAI,OAAQ;EAAE,GAAIA,aAAa;IAAEC,iBAAiB;EAAc;AAAG,EAAA;;;ACPpF,SAASC,aAAa;AAEtB,OAAOC,WAAW;AAQlB,IAAMC,eAAe,wBAAC,EACpBC,KAAKC,UAAU,GAAGC,MAAAA,MACgD;AAClE,SACE,sBAAA,cAACC,OAAAA;IAAMH;IAAW,GAAGE;KAClBD,QAAAA;AAGP,GARqB;AAUrBF,aAAaK,cAAc;AAEpB,IAAMC,iBAAiB,wBAAC,EAC7BL,KAAKM,SAASL,UAAU,GAAGC,MAAAA,MACuC;AAClE,SACE,sBAAA,cAACH,cAAAA;IAAaQ,cAAcD,YAAY;IAAcN;IAAW,GAAGE;KACjED,QAAAA;AAGP,GAR8B;AAU9BI,eAAeD,cAAc;AAEtB,IAAMI,UAAUH;;;AClCvB,SAASI,UAAAA,SAAQC,mBAAmB;AAEpC,OAAOC,YAAW;AAIlB,IAAMC,oBAAoBC,QAAOC,aAAa;EAC5CC,MAAM;EACNC,mBAAmBC,wBAAAA,aAAYA,aAAa,cAAzBA;EACnBC,MAAM;AACR,CAAA,EAAuB,CAAC,EAAEC,SAASC,MAAK,OAAQ;EAC9CC,iBAAiBD,MAAME,QAAQC,WAAWC;EAC1CC,QAAQ;EACRC,UAAU;EACV,GAAIP,YAAY,gBAAgB;IAC9BM,QAAQ;IACRC,UAAU;EACZ;AACF,EAAA;AAMO,IAAMC,gBAA8C,wBAAC,EAAEC,UAAU,GAAGC,MAAAA,MAAY,gBAAAC,OAAA,cAAClB,mBAAsBiB,OAAQD,QAAAA,GAA3D;;;ACzB3D,SAASG,uBAAuB;AAIzB,IAAMC,qBAAqBD,gBAAAA;;;ACJlC,SAASE,qBAAqB;AAG9B,OAAOC,UAASC,SAASC,gBAAgB;AAWlC,IAAMC,sBAA0D,wBAAC,EACtEC,UACAC,iBAAiB,GACjBC,oBACAC,eAAe,KAAI,MACpB;AACC,QAAM,CAACC,aAAaC,cAAAA,IAAkBC,cAAcJ,kBAAAA;AACpD,QAAM,CAACK,WAAWC,YAAAA,IAAgBC,SAAAA;AAElC,QAAMC,SAASC,QAAQ,MAAA;AACrB,QAAIJ,cAAcK,UAAaR,gBAAgBQ,QAAW;AACxD,aAAOL,aAAaH,cAAcH;IACpC;EACF,GAAG;IAACC;IAAoBK;IAAWH;IAAaH;GAAe;AAE/D,QAAMY,kBAAkBF,QAAQ,MAAOD,WAAWE,SAAYA,SAAY,GAAGF,MAAAA,GAASP,YAAAA,IAAiB;IAACO;IAAQP;GAAa;AAE7H,QAAMW,QAAQH,QAAQ,OAAO;IAC3BD,QAAQG;IAAiBE,UAAU;IAAMR;IAAWC;IAAcH;IAAgBD;EACpF,IAAI;IAACS;IAAiBN;IAAWC;IAAcH;IAAgBD;GAAY;AAE3E,SACE,gBAAAY,OAAA,cAACC,oBAAAA;IAAmBH;KACjBd,QAAAA;AAGP,GA1BuE;;;ACdvE,SAASkB,oBAAoB;AAItB,IAAMC,iBAAiB,wBAACC,WAAW,UAAUC,aAAaC,oBAAoB,eAAeF,QAAAA,GAAtE;","names":["styled","TableCell","TableCellEx","styled","TableCell","name","shouldForwardProp","prop","noBgColor","backgroundColor","Table","React","TableExInner","ref","children","props","Table","displayName","TableExWithRef","variant","stickyHeader","TableEx","styled","TableFooter","React","TableFooterExRoot","styled","TableFooter","name","shouldForwardProp","propName","slot","variant","theme","backgroundColor","palette","background","default","bottom","position","TableFooterEx","children","props","React","createContextEx","TableHeightContext","useResetState","React","useMemo","useState","TableHeightProvider","children","additionalRows","defaultVisibleRows","heightFormat","visibleRows","setVisibleRows","useResetState","rowHeight","setRowHeight","useState","height","useMemo","undefined","formattedHeight","value","provided","React","TableHeightContext","useContextEx","useTableHeight","required","useContextEx","TableHeightContext"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { TableCellProps } from '@mui/material';
|
|
2
|
+
export interface TableCellExProps extends TableCellProps {
|
|
3
|
+
noBgColor?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const TableCellEx: import("@emotion/styled").StyledComponent<TableCellProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & TableCellExProps, {}, {}>;
|
|
6
|
+
//# sourceMappingURL=TableCellEx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableCellEx.d.ts","sourceRoot":"","sources":["../../../../src/components/TableEx/TableCellEx.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAGnD,MAAM,WAAW,gBAAiB,SAAQ,cAAc;IACtD,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,eAAO,MAAM,WAAW,kKAEvB,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { TableProps } from '@mui/material';
|
|
2
|
+
import type { PropsWithChildren } from 'react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import type { TableExVariants } from './types/index.ts';
|
|
5
|
+
export interface TableExProps extends PropsWithChildren, TableProps {
|
|
6
|
+
variant?: TableExVariants;
|
|
7
|
+
}
|
|
8
|
+
export declare const TableExWithRef: {
|
|
9
|
+
({ ref, variant, children, ...props }: TableExProps & {
|
|
10
|
+
ref?: React.RefObject<HTMLTableElement | null>;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const TableEx: {
|
|
15
|
+
({ ref, variant, children, ...props }: TableExProps & {
|
|
16
|
+
ref?: React.RefObject<HTMLTableElement | null>;
|
|
17
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
displayName: string;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=TableEx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableEx.d.ts","sourceRoot":"","sources":["../../../../src/components/TableEx/TableEx.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAEvD,MAAM,WAAW,YAAa,SAAQ,iBAAiB,EAAE,UAAU;IACjE,OAAO,CAAC,EAAE,eAAe,CAAA;CAC1B;AAcD,eAAO,MAAM,cAAc;2CAExB,YAAY,GAAG;QAAE,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAA;KAAE;;CAMnE,CAAA;AAID,eAAO,MAAM,OAAO;2CAVjB,YAAY,GAAG;QAAE,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAA;KAAE;;CAU/B,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TableFooterProps } from '@mui/material';
|
|
2
|
+
import type { PropsWithChildren } from 'react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import type { TableExVariants } from './types/index.ts';
|
|
5
|
+
export interface TableFooterExProps extends PropsWithChildren, TableFooterProps {
|
|
6
|
+
variant?: TableExVariants;
|
|
7
|
+
}
|
|
8
|
+
export declare const TableFooterEx: React.FC<TableFooterExProps>;
|
|
9
|
+
//# sourceMappingURL=TableFooterEx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableFooterEx.d.ts","sourceRoot":"","sources":["../../../../src/components/TableEx/TableFooterEx.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAErD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAgBvD,MAAM,WAAW,kBAAmB,SAAQ,iBAAiB,EAAE,gBAAgB;IAC7E,OAAO,CAAC,EAAE,eAAe,CAAA;CAC1B;AAED,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAA4F,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/TableEx/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,eAAe,CAAA;AAC7B,cAAc,qBAAqB,CAAA;AACnC,cAAc,kBAAkB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableExVariants.d.ts","sourceRoot":"","sources":["../../../../../src/components/TableEx/types/TableExVariants.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,YAAY,GAAG,QAAQ,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/TableEx/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../../src/context/TableHeight/Context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD,eAAO,MAAM,kBAAkB,gGAAsC,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ContextExProviderProps } from '@xyo-network/react-shared';
|
|
2
|
+
import type { PropsWithChildren } from 'react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
export interface TableHeightProviderProps extends ContextExProviderProps, PropsWithChildren {
|
|
5
|
+
/** @field Account for optional header and footer rows */
|
|
6
|
+
additionalRows?: number;
|
|
7
|
+
defaultVisibleRows?: number;
|
|
8
|
+
heightFormat?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const TableHeightProvider: React.FC<TableHeightProviderProps>;
|
|
11
|
+
//# sourceMappingURL=Provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../../src/context/TableHeight/Provider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,KAA4B,MAAM,OAAO,CAAA;AAIhD,MAAM,WAAW,wBAAyB,SAAQ,sBAAsB,EAAE,iBAAiB;IACzF,yDAAyD;IACzD,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CA0BlE,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ContextExState } from '@xyo-network/react-shared';
|
|
2
|
+
import type { Dispatch, SetStateAction } from 'react';
|
|
3
|
+
export interface TableHeightState extends ContextExState {
|
|
4
|
+
height?: string;
|
|
5
|
+
rowHeight?: number;
|
|
6
|
+
setRowHeight?: Dispatch<SetStateAction<number | undefined>>;
|
|
7
|
+
setVisibleRows?: Dispatch<SetStateAction<number | undefined>>;
|
|
8
|
+
visibleRows?: number;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=State.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"State.d.ts","sourceRoot":"","sources":["../../../../src/context/TableHeight/State.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAErD,MAAM,WAAW,gBAAiB,SAAQ,cAAc;IACtD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAA;IAC3D,cAAc,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,CAAA;IAC7D,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/context/TableHeight/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use.d.ts","sourceRoot":"","sources":["../../../../src/context/TableHeight/use.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,GAAI,kBAAgB,iHAA8D,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/context/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TableCellProps } from '@mui/material';
|
|
2
|
+
export interface TableHeadCell {
|
|
3
|
+
align?: 'left' | 'right' | 'center';
|
|
4
|
+
disablePadding: boolean;
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
numeric: boolean;
|
|
8
|
+
showOnMobile: boolean;
|
|
9
|
+
width?: TableCellProps['width'];
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=TableHead.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableHead.d.ts","sourceRoot":"","sources":["../../../src/types/TableHead.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEnD,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAA;IACnC,cAAc,EAAE,OAAO,CAAA;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,OAAO,CAAA;IAChB,YAAY,EAAE,OAAO,CAAA;IACrB,KAAK,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAA;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/react-table",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-rc.1",
|
|
4
4
|
"description": "Common React library for all XYO projects that use React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"xyo",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"exports": {
|
|
29
29
|
".": {
|
|
30
30
|
"browser": {
|
|
31
|
-
"types": "./dist/
|
|
31
|
+
"types": "./dist/types/index.d.ts",
|
|
32
32
|
"default": "./dist/browser/index.mjs"
|
|
33
33
|
},
|
|
34
|
-
"types": "./dist/
|
|
34
|
+
"types": "./dist/types/index.d.ts",
|
|
35
35
|
"default": "./dist/browser/index.mjs"
|
|
36
36
|
},
|
|
37
37
|
"./package.json": "./package.json"
|
|
@@ -43,33 +43,35 @@
|
|
|
43
43
|
"lint-pkg": "npmPkgJsonLint ."
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@xylabs/react-hooks": "^
|
|
47
|
-
"@xyo-network/react-shared": "^
|
|
46
|
+
"@xylabs/react-hooks": "^6.0.0-rc.2",
|
|
47
|
+
"@xyo-network/react-shared": "^5.0.0-rc.1"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@mui/icons-material": "^6.4.
|
|
51
|
-
"@mui/material": "^6.4.
|
|
52
|
-
"@mui/styles": "^6.4.
|
|
53
|
-
"@storybook/react": "^8.6.
|
|
54
|
-
"@
|
|
55
|
-
"@xylabs/
|
|
56
|
-
"@
|
|
57
|
-
"react": "^
|
|
58
|
-
"react
|
|
59
|
-
"react-
|
|
60
|
-
"
|
|
61
|
-
"
|
|
50
|
+
"@mui/icons-material": "^6.4.7",
|
|
51
|
+
"@mui/material": "^6.4.7",
|
|
52
|
+
"@mui/styles": "^6.4.7",
|
|
53
|
+
"@storybook/react": "^8.6.4",
|
|
54
|
+
"@types/react": "^19.0.10",
|
|
55
|
+
"@xylabs/ts-scripts-yarn3": "^6.0.3",
|
|
56
|
+
"@xylabs/tsconfig-react": "^6.0.3",
|
|
57
|
+
"@xyo-network/react-storybook": "^5.0.0-rc.1",
|
|
58
|
+
"react": "^19.0.0",
|
|
59
|
+
"react-dom": "^19.0.0",
|
|
60
|
+
"react-router-dom": "^7.3.0",
|
|
61
|
+
"storybook": "^8.6.4",
|
|
62
|
+
"typescript": "^5.8.2"
|
|
62
63
|
},
|
|
63
64
|
"peerDependencies": {
|
|
64
65
|
"@mui/icons-material": "^6",
|
|
65
66
|
"@mui/material": "^6",
|
|
66
67
|
"@mui/styles": "^6",
|
|
67
|
-
"react": "^
|
|
68
|
-
"react-dom": "^
|
|
68
|
+
"react": "^19",
|
|
69
|
+
"react-dom": "^19",
|
|
69
70
|
"react-router-dom": "^7"
|
|
70
71
|
},
|
|
71
72
|
"publishConfig": {
|
|
72
73
|
"access": "public"
|
|
73
74
|
},
|
|
74
|
-
"docs": "dist/docs.json"
|
|
75
|
+
"docs": "dist/docs.json",
|
|
76
|
+
"stableVersion": "4.4.11"
|
|
75
77
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TableProps } from '@mui/material'
|
|
2
2
|
import { Table } from '@mui/material'
|
|
3
3
|
import type { PropsWithChildren } from 'react'
|
|
4
|
-
import React
|
|
4
|
+
import React from 'react'
|
|
5
5
|
|
|
6
6
|
import type { TableExVariants } from './types/index.ts'
|
|
7
7
|
|
|
@@ -9,25 +9,27 @@ export interface TableExProps extends PropsWithChildren, TableProps {
|
|
|
9
9
|
variant?: TableExVariants
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
const TableExInner =
|
|
12
|
+
const TableExInner = ({
|
|
13
|
+
ref, children, ...props
|
|
14
|
+
}: TableExProps & { ref?: React.RefObject<HTMLTableElement | null> }) => {
|
|
13
15
|
return (
|
|
14
16
|
<Table ref={ref} {...props}>
|
|
15
17
|
{children}
|
|
16
18
|
</Table>
|
|
17
19
|
)
|
|
18
|
-
}
|
|
20
|
+
}
|
|
19
21
|
|
|
20
22
|
TableExInner.displayName = 'TableExInner'
|
|
21
23
|
|
|
22
|
-
export const TableExWithRef =
|
|
23
|
-
variant, children, ...props
|
|
24
|
-
}
|
|
24
|
+
export const TableExWithRef = ({
|
|
25
|
+
ref, variant, children, ...props
|
|
26
|
+
}: TableExProps & { ref?: React.RefObject<HTMLTableElement | null> }) => {
|
|
25
27
|
return (
|
|
26
28
|
<TableExInner stickyHeader={variant === 'scrollable'} ref={ref} {...props}>
|
|
27
29
|
{children}
|
|
28
30
|
</TableExInner>
|
|
29
31
|
)
|
|
30
|
-
}
|
|
32
|
+
}
|
|
31
33
|
|
|
32
34
|
TableExWithRef.displayName = 'TableEx'
|
|
33
35
|
|
|
@@ -34,8 +34,8 @@ export const TableHeightProvider: React.FC<TableHeightProviderProps> = ({
|
|
|
34
34
|
}), [formattedHeight, rowHeight, setRowHeight, setVisibleRows, visibleRows])
|
|
35
35
|
|
|
36
36
|
return (
|
|
37
|
-
<TableHeightContext
|
|
37
|
+
<TableHeightContext value={value}>
|
|
38
38
|
{children}
|
|
39
|
-
</TableHeightContext
|
|
39
|
+
</TableHeightContext>
|
|
40
40
|
)
|
|
41
41
|
}
|
package/dist/browser/index.d.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import * as _emotion_styled from '@emotion/styled';
|
|
2
|
-
import * as _mui_system from '@mui/system';
|
|
3
|
-
import * as _mui_material from '@mui/material';
|
|
4
|
-
import { TableCellProps, TableProps, TableFooterProps } from '@mui/material';
|
|
5
|
-
import * as React from 'react';
|
|
6
|
-
import React__default, { PropsWithChildren, Dispatch, SetStateAction } from 'react';
|
|
7
|
-
import * as _xyo_network_react_shared from '@xyo-network/react-shared';
|
|
8
|
-
import { ContextExState, ContextExProviderProps } from '@xyo-network/react-shared';
|
|
9
|
-
|
|
10
|
-
interface TableCellExProps extends TableCellProps {
|
|
11
|
-
noBgColor?: boolean;
|
|
12
|
-
}
|
|
13
|
-
declare const TableCellEx: _emotion_styled.StyledComponent<TableCellProps & _mui_system.MUIStyledCommonProps<_mui_material.Theme> & TableCellExProps, {}, {}>;
|
|
14
|
-
|
|
15
|
-
type TableExVariants = 'scrollable' | 'normal';
|
|
16
|
-
|
|
17
|
-
interface TableExProps extends PropsWithChildren, TableProps {
|
|
18
|
-
variant?: TableExVariants;
|
|
19
|
-
}
|
|
20
|
-
declare const TableExWithRef: React__default.ForwardRefExoticComponent<Omit<TableExProps, "ref"> & React__default.RefAttributes<HTMLTableElement>>;
|
|
21
|
-
declare const TableEx: React__default.ForwardRefExoticComponent<Omit<TableExProps, "ref"> & React__default.RefAttributes<HTMLTableElement>>;
|
|
22
|
-
|
|
23
|
-
interface TableFooterExProps extends PropsWithChildren, TableFooterProps {
|
|
24
|
-
variant?: TableExVariants;
|
|
25
|
-
}
|
|
26
|
-
declare const TableFooterEx: React__default.FC<TableFooterExProps>;
|
|
27
|
-
|
|
28
|
-
interface TableHeightState extends ContextExState {
|
|
29
|
-
height?: string;
|
|
30
|
-
rowHeight?: number;
|
|
31
|
-
setRowHeight?: Dispatch<SetStateAction<number | undefined>>;
|
|
32
|
-
setVisibleRows?: Dispatch<SetStateAction<number | undefined>>;
|
|
33
|
-
visibleRows?: number;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
declare const TableHeightContext: React.Context<TableHeightState & _xyo_network_react_shared.ContextExState>;
|
|
37
|
-
|
|
38
|
-
interface TableHeightProviderProps extends ContextExProviderProps, PropsWithChildren {
|
|
39
|
-
additionalRows?: number;
|
|
40
|
-
defaultVisibleRows?: number;
|
|
41
|
-
heightFormat?: string;
|
|
42
|
-
}
|
|
43
|
-
declare const TableHeightProvider: React__default.FC<TableHeightProviderProps>;
|
|
44
|
-
|
|
45
|
-
declare const useTableHeight: (required?: boolean) => Omit<TableHeightState & _xyo_network_react_shared.ContextExState, "provided">;
|
|
46
|
-
|
|
47
|
-
interface TableHeadCell {
|
|
48
|
-
align?: 'left' | 'right' | 'center';
|
|
49
|
-
disablePadding: boolean;
|
|
50
|
-
id: string;
|
|
51
|
-
label: string;
|
|
52
|
-
numeric: boolean;
|
|
53
|
-
showOnMobile: boolean;
|
|
54
|
-
width?: TableCellProps['width'];
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export { TableCellEx, type TableCellExProps, TableEx, type TableExProps, type TableExVariants, TableExWithRef, TableFooterEx, type TableFooterExProps, type TableHeadCell, TableHeightContext, TableHeightProvider, type TableHeightProviderProps, type TableHeightState, useTableHeight };
|