@xyo-network/react-table 4.4.11 → 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.
Files changed (39) hide show
  1. package/dist/browser/index.mjs +6 -6
  2. package/dist/browser/index.mjs.map +1 -1
  3. package/dist/types/components/TableEx/TableEx.d.ts +20 -0
  4. package/dist/types/components/TableEx/TableEx.d.ts.map +1 -0
  5. package/package.json +21 -19
  6. package/src/components/TableEx/TableEx.tsx +9 -7
  7. package/src/context/TableHeight/Provider.tsx +2 -2
  8. package/dist/browser/components/TableEx/TableEx.d.ts +0 -10
  9. package/dist/browser/components/TableEx/TableEx.d.ts.map +0 -1
  10. /package/dist/{browser → types}/components/TableEx/TableCellEx.d.ts +0 -0
  11. /package/dist/{browser → types}/components/TableEx/TableCellEx.d.ts.map +0 -0
  12. /package/dist/{browser → types}/components/TableEx/TableFooterEx.d.ts +0 -0
  13. /package/dist/{browser → types}/components/TableEx/TableFooterEx.d.ts.map +0 -0
  14. /package/dist/{browser → types}/components/TableEx/index.d.ts +0 -0
  15. /package/dist/{browser → types}/components/TableEx/index.d.ts.map +0 -0
  16. /package/dist/{browser → types}/components/TableEx/types/TableExVariants.d.ts +0 -0
  17. /package/dist/{browser → types}/components/TableEx/types/TableExVariants.d.ts.map +0 -0
  18. /package/dist/{browser → types}/components/TableEx/types/index.d.ts +0 -0
  19. /package/dist/{browser → types}/components/TableEx/types/index.d.ts.map +0 -0
  20. /package/dist/{browser → types}/components/index.d.ts +0 -0
  21. /package/dist/{browser → types}/components/index.d.ts.map +0 -0
  22. /package/dist/{browser → types}/context/TableHeight/Context.d.ts +0 -0
  23. /package/dist/{browser → types}/context/TableHeight/Context.d.ts.map +0 -0
  24. /package/dist/{browser → types}/context/TableHeight/Provider.d.ts +0 -0
  25. /package/dist/{browser → types}/context/TableHeight/Provider.d.ts.map +0 -0
  26. /package/dist/{browser → types}/context/TableHeight/State.d.ts +0 -0
  27. /package/dist/{browser → types}/context/TableHeight/State.d.ts.map +0 -0
  28. /package/dist/{browser → types}/context/TableHeight/index.d.ts +0 -0
  29. /package/dist/{browser → types}/context/TableHeight/index.d.ts.map +0 -0
  30. /package/dist/{browser → types}/context/TableHeight/use.d.ts +0 -0
  31. /package/dist/{browser → types}/context/TableHeight/use.d.ts.map +0 -0
  32. /package/dist/{browser → types}/context/index.d.ts +0 -0
  33. /package/dist/{browser → types}/context/index.d.ts.map +0 -0
  34. /package/dist/{browser → types}/index.d.ts +0 -0
  35. /package/dist/{browser → types}/index.d.ts.map +0 -0
  36. /package/dist/{browser → types}/types/TableHead.d.ts +0 -0
  37. /package/dist/{browser → types}/types/TableHead.d.ts.map +0 -0
  38. /package/dist/{browser → types}/types/index.d.ts +0 -0
  39. /package/dist/{browser → types}/types/index.d.ts.map +0 -0
@@ -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, { forwardRef } from "react";
18
- var TableExInner = /* @__PURE__ */ forwardRef(({ children, ...props }, ref) => {
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__ */ forwardRef(({ variant, children, ...props }, ref) => {
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.Provider, {
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, { forwardRef } from 'react'\n\nimport type { TableExVariants } from './types/index.ts'\n\nexport interface TableExProps extends PropsWithChildren, TableProps {\n variant?: TableExVariants\n}\n\nconst TableExInner = forwardRef<HTMLTableElement, TableExProps>(({ children, ...props }, ref) => {\n return (\n <Table ref={ref} {...props}>\n {children}\n </Table>\n )\n})\n\nTableExInner.displayName = 'TableExInner'\n\nexport const TableExWithRef = forwardRef<HTMLTableElement, TableExProps>(({\n variant, children, ...props\n}, ref) => {\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.Provider value={value}>\n {children}\n </TableHeightContext.Provider>\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,SAASC,kBAAkB;AAQlC,IAAMC,eAAeD,2BAA2C,CAAC,EAAEE,UAAU,GAAGC,MAAAA,GAASC,QAAAA;AACvF,SACE,sBAAA,cAACN,OAAAA;IAAMM;IAAW,GAAGD;KAClBD,QAAAA;AAGP,CAAA;AAEAD,aAAaI,cAAc;AAEpB,IAAMC,iBAAiBN,2BAA2C,CAAC,EACxEO,SAASL,UAAU,GAAGC,MAAAA,GACrBC,QAAAA;AACD,SACE,sBAAA,cAACH,cAAAA;IAAaO,cAAcD,YAAY;IAAcH;IAAW,GAAGD;KACjED,QAAAA;AAGP,CAAA;AAEAI,eAAeD,cAAc;AAEtB,IAAMI,UAAUH;;;AChCvB,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,mBAAmBC,UAAQ;IAACJ;KAC1Bd,QAAAA;AAGP,GA1BuE;;;ACdvE,SAASmB,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","forwardRef","TableExInner","children","props","ref","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","Provider","useContextEx","useTableHeight","required","useContextEx","TableHeightContext"]}
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,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/react-table",
3
- "version": "4.4.11",
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/browser/index.d.ts",
31
+ "types": "./dist/types/index.d.ts",
32
32
  "default": "./dist/browser/index.mjs"
33
33
  },
34
- "types": "./dist/browser/index.d.ts",
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": "^5.3.25",
47
- "@xyo-network/react-shared": "^4.4.11"
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.6",
51
- "@mui/material": "^6.4.6",
52
- "@mui/styles": "^6.4.6",
53
- "@storybook/react": "^8.6.3",
54
- "@xylabs/ts-scripts-yarn3": "^5.0.39",
55
- "@xylabs/tsconfig-react": "^5.0.39",
56
- "@xyo-network/react-storybook": "^4.4.11",
57
- "react": "^18.3.1",
58
- "react-dom": "^18.3.1",
59
- "react-router-dom": "^7.2.0",
60
- "storybook": "^8.6.3",
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",
61
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": "^18",
68
- "react-dom": "^18",
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, { forwardRef } from '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 = forwardRef<HTMLTableElement, TableExProps>(({ children, ...props }, ref) => {
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 = forwardRef<HTMLTableElement, TableExProps>(({
23
- variant, children, ...props
24
- }, ref) => {
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.Provider value={value}>
37
+ <TableHeightContext value={value}>
38
38
  {children}
39
- </TableHeightContext.Provider>
39
+ </TableHeightContext>
40
40
  )
41
41
  }
@@ -1,10 +0,0 @@
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: React.ForwardRefExoticComponent<Omit<TableExProps, "ref"> & React.RefAttributes<HTMLTableElement>>;
9
- export declare const TableEx: React.ForwardRefExoticComponent<Omit<TableExProps, "ref"> & React.RefAttributes<HTMLTableElement>>;
10
- //# sourceMappingURL=TableEx.d.ts.map
@@ -1 +0,0 @@
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,KAAqB,MAAM,OAAO,CAAA;AAEzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAEvD,MAAM,WAAW,YAAa,SAAQ,iBAAiB,EAAE,UAAU;IACjE,OAAO,CAAC,EAAE,eAAe,CAAA;CAC1B;AAYD,eAAO,MAAM,cAAc,oGAQzB,CAAA;AAIF,eAAO,MAAM,OAAO,oGAAiB,CAAA"}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes