@pdg/react-table 1.0.100 → 1.0.102
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/TableButton/TableButton.d.ts +1 -1
- package/dist/TableButton/TableButton.types.d.ts +2 -6
- package/dist/TableMenuButton/TableMenuButton.d.ts +1 -1
- package/dist/TableMenuButton/TableMenuButton.types.d.ts +2 -6
- package/dist/index.esm.js +6 -6
- package/dist/index.js +6 -6
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TableButtonProps as Props } from './TableButton.types';
|
|
3
|
-
declare const TableButton: React.ForwardRefExoticComponent<
|
|
3
|
+
declare const TableButton: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLButtonElement>>;
|
|
4
4
|
export default TableButton;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export interface TableButtonProps extends Omit<ButtonProps, 'size' | 'startIcon' | 'endIcon'> {
|
|
4
|
-
icon?: PdgIconProps['children'];
|
|
5
|
-
startIcon?: PdgIconProps['children'];
|
|
6
|
-
endIcon?: PdgIconProps['children'];
|
|
1
|
+
import { PdgButtonProps } from '@pdg/react-component';
|
|
2
|
+
export interface TableButtonProps extends Omit<PdgButtonProps, 'size'> {
|
|
7
3
|
}
|
|
8
4
|
export declare const TableButtonDefaultProps: Pick<TableButtonProps, 'variant' | 'color'>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TableMenuButtonProps as Props } from './TableMenuButton.types';
|
|
3
|
-
declare const TableMenuButton: React.ForwardRefExoticComponent<
|
|
3
|
+
declare const TableMenuButton: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLButtonElement>>;
|
|
4
4
|
export default TableMenuButton;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import { ButtonProps } from '@mui/material';
|
|
2
1
|
import { ReactElement } from 'react';
|
|
3
2
|
import { PopperPlacementType } from '@mui/base/Popper/Popper.types';
|
|
4
|
-
import {
|
|
5
|
-
export interface TableMenuButtonProps extends Omit<
|
|
6
|
-
icon?: PdgIconProps['children'];
|
|
7
|
-
startIcon?: PdgIconProps['children'];
|
|
8
|
-
endIcon?: PdgIconProps['children'];
|
|
3
|
+
import { PdgButtonProps } from '@pdg/react-component';
|
|
4
|
+
export interface TableMenuButtonProps extends Omit<PdgButtonProps, 'size' | 'onClick'> {
|
|
9
5
|
placement?: PopperPlacementType;
|
|
10
6
|
inModal?: boolean;
|
|
11
7
|
zIndex?: number;
|
package/dist/index.esm.js
CHANGED
|
@@ -1761,12 +1761,12 @@ SearchTable.defaultProps = SearchTableDefaultProps;var TableButtonDefaultProps =
|
|
|
1761
1761
|
/********************************************************************************************************************
|
|
1762
1762
|
* Memo
|
|
1763
1763
|
* ******************************************************************************************************************/
|
|
1764
|
-
var children = _a.children, className = _a.className, initSx = _a.sx, color = _a.color,
|
|
1764
|
+
var children = _a.children, className = _a.className, initSx = _a.sx, color = _a.color, onClick = _a.onClick, props = __rest(_a, ["children", "className", "sx", "color", "onClick"]);
|
|
1765
1765
|
var sx = useMemo(function () { return (__assign({ minWidth: 0, px: '5px !important' }, initSx)); }, [initSx]);
|
|
1766
1766
|
/********************************************************************************************************************
|
|
1767
1767
|
* Render
|
|
1768
1768
|
* ******************************************************************************************************************/
|
|
1769
|
-
return (React.createElement(PdgButton, __assign({ ref: ref, className: classNames(className, 'TableButton'), type: 'button', size: 'small', sx: sx, color: color,
|
|
1769
|
+
return (React.createElement(PdgButton, __assign({ ref: ref, className: classNames(className, 'TableButton'), type: 'button', size: 'small', sx: sx, color: color, onClick: onClick }, props), children));
|
|
1770
1770
|
});
|
|
1771
1771
|
TableButton.displayName = 'TableButton';
|
|
1772
1772
|
TableButton.defaultProps = TableButtonDefaultProps;var TableMenuButtonDefaultProps = {
|
|
@@ -1777,7 +1777,7 @@ TableButton.defaultProps = TableButtonDefaultProps;var TableMenuButtonDefaultPro
|
|
|
1777
1777
|
/********************************************************************************************************************
|
|
1778
1778
|
* ID
|
|
1779
1779
|
* ******************************************************************************************************************/
|
|
1780
|
-
var children = _a.children, className = _a.className, initSx = _a.sx, color = _a.color, variant = _a.variant,
|
|
1780
|
+
var children = _a.children, className = _a.className, initSx = _a.sx, color = _a.color, variant = _a.variant, startIcon = _a.startIcon, placement = _a.placement, inModal = _a.inModal, zIndex = _a.zIndex, menuList = _a.menuList, props = __rest(_a, ["children", "className", "sx", "color", "variant", "startIcon", "placement", "inModal", "zIndex", "menuList"]);
|
|
1781
1781
|
var buttonId = useId();
|
|
1782
1782
|
var menuId = useId();
|
|
1783
1783
|
/********************************************************************************************************************
|
|
@@ -1795,8 +1795,8 @@ TableButton.defaultProps = TableButtonDefaultProps;var TableMenuButtonDefaultPro
|
|
|
1795
1795
|
/********************************************************************************************************************
|
|
1796
1796
|
* Memo
|
|
1797
1797
|
* ******************************************************************************************************************/
|
|
1798
|
-
var icon = useMemo(function () { return (!
|
|
1799
|
-
var sx = useMemo(function () { return (__assign({ minWidth: 0, pl: !children ? 0.7 : icon || startIcon ? 0.7 : variant === 'text' ? 1.2 : 0.7
|
|
1798
|
+
var icon = useMemo(function () { return (!startIcon && !children ? 'MoreVert' : undefined); }, [startIcon, children]);
|
|
1799
|
+
var sx = useMemo(function () { return (__assign({ minWidth: 0, pl: !children ? 0.7 : icon || startIcon ? 0.7 : variant === 'text' ? 1.2 : 0.7 }, initSx)); }, [children, icon, initSx, startIcon, variant]);
|
|
1800
1800
|
/********************************************************************************************************************
|
|
1801
1801
|
* Effect
|
|
1802
1802
|
* ******************************************************************************************************************/
|
|
@@ -1864,7 +1864,7 @@ TableButton.defaultProps = TableButtonDefaultProps;var TableMenuButtonDefaultPro
|
|
|
1864
1864
|
}
|
|
1865
1865
|
}
|
|
1866
1866
|
anchorRef.current = r;
|
|
1867
|
-
}, id: buttonId, variant: variant, "aria-controls": open ? menuId : undefined, "aria-expanded": open ? 'true' : undefined, "aria-haspopup": 'true', className: classNames(className, 'TableMenuButton'), type: 'button', size: 'small', sx: sx, color: color,
|
|
1867
|
+
}, id: buttonId, variant: variant, "aria-controls": open ? menuId : undefined, "aria-expanded": open ? 'true' : undefined, "aria-haspopup": 'true', className: classNames(className, 'TableMenuButton'), type: 'button', size: 'small', sx: sx, color: color, startIcon: icon, onClick: handleClick }, props), children),
|
|
1868
1868
|
React.createElement(Popper, { className: 'TableMenuButton-Popper', open: open, anchorEl: anchorRef.current, role: undefined, placement: placement, transition: true, style: { zIndex: inModal ? (zIndex === undefined ? 1301 : zIndex) : zIndex } }, function (_a) {
|
|
1869
1869
|
var TransitionProps = _a.TransitionProps, placement = _a.placement;
|
|
1870
1870
|
var placements = placement.split('-');
|
package/dist/index.js
CHANGED
|
@@ -1761,12 +1761,12 @@ SearchTable.defaultProps = SearchTableDefaultProps;var TableButtonDefaultProps =
|
|
|
1761
1761
|
/********************************************************************************************************************
|
|
1762
1762
|
* Memo
|
|
1763
1763
|
* ******************************************************************************************************************/
|
|
1764
|
-
var children = _a.children, className = _a.className, initSx = _a.sx, color = _a.color,
|
|
1764
|
+
var children = _a.children, className = _a.className, initSx = _a.sx, color = _a.color, onClick = _a.onClick, props = __rest(_a, ["children", "className", "sx", "color", "onClick"]);
|
|
1765
1765
|
var sx = React.useMemo(function () { return (__assign({ minWidth: 0, px: '5px !important' }, initSx)); }, [initSx]);
|
|
1766
1766
|
/********************************************************************************************************************
|
|
1767
1767
|
* Render
|
|
1768
1768
|
* ******************************************************************************************************************/
|
|
1769
|
-
return (React.createElement(reactComponent.PdgButton, __assign({ ref: ref, className: classNames(className, 'TableButton'), type: 'button', size: 'small', sx: sx, color: color,
|
|
1769
|
+
return (React.createElement(reactComponent.PdgButton, __assign({ ref: ref, className: classNames(className, 'TableButton'), type: 'button', size: 'small', sx: sx, color: color, onClick: onClick }, props), children));
|
|
1770
1770
|
});
|
|
1771
1771
|
TableButton.displayName = 'TableButton';
|
|
1772
1772
|
TableButton.defaultProps = TableButtonDefaultProps;var TableMenuButtonDefaultProps = {
|
|
@@ -1777,7 +1777,7 @@ TableButton.defaultProps = TableButtonDefaultProps;var TableMenuButtonDefaultPro
|
|
|
1777
1777
|
/********************************************************************************************************************
|
|
1778
1778
|
* ID
|
|
1779
1779
|
* ******************************************************************************************************************/
|
|
1780
|
-
var children = _a.children, className = _a.className, initSx = _a.sx, color = _a.color, variant = _a.variant,
|
|
1780
|
+
var children = _a.children, className = _a.className, initSx = _a.sx, color = _a.color, variant = _a.variant, startIcon = _a.startIcon, placement = _a.placement, inModal = _a.inModal, zIndex = _a.zIndex, menuList = _a.menuList, props = __rest(_a, ["children", "className", "sx", "color", "variant", "startIcon", "placement", "inModal", "zIndex", "menuList"]);
|
|
1781
1781
|
var buttonId = React.useId();
|
|
1782
1782
|
var menuId = React.useId();
|
|
1783
1783
|
/********************************************************************************************************************
|
|
@@ -1795,8 +1795,8 @@ TableButton.defaultProps = TableButtonDefaultProps;var TableMenuButtonDefaultPro
|
|
|
1795
1795
|
/********************************************************************************************************************
|
|
1796
1796
|
* Memo
|
|
1797
1797
|
* ******************************************************************************************************************/
|
|
1798
|
-
var icon = React.useMemo(function () { return (!
|
|
1799
|
-
var sx = React.useMemo(function () { return (__assign({ minWidth: 0, pl: !children ? 0.7 : icon || startIcon ? 0.7 : variant === 'text' ? 1.2 : 0.7
|
|
1798
|
+
var icon = React.useMemo(function () { return (!startIcon && !children ? 'MoreVert' : undefined); }, [startIcon, children]);
|
|
1799
|
+
var sx = React.useMemo(function () { return (__assign({ minWidth: 0, pl: !children ? 0.7 : icon || startIcon ? 0.7 : variant === 'text' ? 1.2 : 0.7 }, initSx)); }, [children, icon, initSx, startIcon, variant]);
|
|
1800
1800
|
/********************************************************************************************************************
|
|
1801
1801
|
* Effect
|
|
1802
1802
|
* ******************************************************************************************************************/
|
|
@@ -1864,7 +1864,7 @@ TableButton.defaultProps = TableButtonDefaultProps;var TableMenuButtonDefaultPro
|
|
|
1864
1864
|
}
|
|
1865
1865
|
}
|
|
1866
1866
|
anchorRef.current = r;
|
|
1867
|
-
}, id: buttonId, variant: variant, "aria-controls": open ? menuId : undefined, "aria-expanded": open ? 'true' : undefined, "aria-haspopup": 'true', className: classNames(className, 'TableMenuButton'), type: 'button', size: 'small', sx: sx, color: color,
|
|
1867
|
+
}, id: buttonId, variant: variant, "aria-controls": open ? menuId : undefined, "aria-expanded": open ? 'true' : undefined, "aria-haspopup": 'true', className: classNames(className, 'TableMenuButton'), type: 'button', size: 'small', sx: sx, color: color, startIcon: icon, onClick: handleClick }, props), children),
|
|
1868
1868
|
React.createElement(material.Popper, { className: 'TableMenuButton-Popper', open: open, anchorEl: anchorRef.current, role: undefined, placement: placement, transition: true, style: { zIndex: inModal ? (zIndex === undefined ? 1301 : zIndex) : zIndex } }, function (_a) {
|
|
1869
1869
|
var TransitionProps = _a.TransitionProps, placement = _a.placement;
|
|
1870
1870
|
var placements = placement.split('-');
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pdg/react-table",
|
|
3
3
|
"title": "React Table",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.102",
|
|
5
5
|
"description": "React Table",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"@mui/icons-material": "^5.15.13",
|
|
48
48
|
"@mui/material": "^5.15.13",
|
|
49
49
|
"@mui/x-date-pickers": "^6.19.7",
|
|
50
|
-
"@pdg/react-component": "^1.0.
|
|
51
|
-
"@pdg/react-form": "^1.0.
|
|
50
|
+
"@pdg/react-component": "^1.0.21",
|
|
51
|
+
"@pdg/react-form": "^1.0.120",
|
|
52
52
|
"@pdg/react-hook": "^1.0.16",
|
|
53
53
|
"@pdg/util": "^1.0.20",
|
|
54
54
|
"@tinymce/tinymce-react": "^4.3.2",
|