@pdg/react-table 1.0.62 → 1.0.64

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.
@@ -8,7 +8,7 @@ export interface TableItem {
8
8
  }
9
9
  export interface TableColumn<T = TableItem> {
10
10
  id: string;
11
- type?: 'text' | 'number' | 'date' | 'datetime' | 'img' | 'button' | 'button-ellipsis' | 'buttons' | 'check';
11
+ type?: 'text' | 'number' | 'date' | 'datetime' | 'img' | 'button' | 'buttons' | 'check';
12
12
  label?: ReactNode;
13
13
  name?: string;
14
14
  align?: TableCellProps['align'];
@@ -25,6 +25,8 @@ export interface TableColumn<T = TableItem> {
25
25
  lg?: boolean;
26
26
  xl?: boolean;
27
27
  };
28
+ paddingLeft?: number;
29
+ paddingRight?: number;
28
30
  head?: {
29
31
  className?: CommonSxProps['className'];
30
32
  style?: CommonSxProps['style'];
package/dist/index.esm.js CHANGED
@@ -2747,10 +2747,11 @@ var TableCommonCell = function (_a) {
2747
2747
  var align = useMemo(function () { return getTableColumnAlign(column, defaultAlign); }, [column, defaultAlign]);
2748
2748
  var ellipsis = useMemo(function () {
2749
2749
  return type !== 'head' &&
2750
- column.type !== 'img' &&
2751
- column.type !== 'button' &&
2752
- column.type !== 'buttons' &&
2753
- (column.ellipsis != null ? column.ellipsis : !!initDefaultEllipsis);
2750
+ (column.ellipsis ||
2751
+ (column.type !== 'img' &&
2752
+ column.type !== 'button' &&
2753
+ column.type !== 'buttons' &&
2754
+ (column.ellipsis == null ? !!initDefaultEllipsis : false)));
2754
2755
  }, [type, column, initDefaultEllipsis]);
2755
2756
  var className = useMemo(function () {
2756
2757
  var _a, _b, _c, _d, _e, _f;
@@ -2799,7 +2800,7 @@ var TableCommonCell = function (_a) {
2799
2800
  getStyle = ((_e = column.footer) === null || _e === void 0 ? void 0 : _e.onGetStyle) ? (_f = column.footer) === null || _f === void 0 ? void 0 : _f.onGetStyle() : undefined;
2800
2801
  break;
2801
2802
  }
2802
- return __assign$3(__assign$3(__assign$3(__assign$3({}, initStyle), { width: column.width, minWidth: column.minWidth, cursor: type === 'body' && (column.onClick || onClick) ? 'pointer' : undefined }), style), getStyle);
2803
+ return __assign$3(__assign$3(__assign$3(__assign$3({}, initStyle), { width: column.width, minWidth: column.minWidth, cursor: type === 'body' && (column.onClick || onClick) ? 'pointer' : undefined, paddingLeft: column.paddingLeft, paddingRight: column.paddingRight }), style), getStyle);
2803
2804
  }, [column, index, initStyle, item, onClick, type]);
2804
2805
  var sx = useMemo(function () {
2805
2806
  var _a, _b, _c, _d, _e, _f;
@@ -2864,7 +2865,6 @@ var TableCommonCell = function (_a) {
2864
2865
  if (!menuOpen &&
2865
2866
  column.type !== 'check' &&
2866
2867
  column.type !== 'button' &&
2867
- column.type !== 'button-ellipsis' &&
2868
2868
  column.type !== 'buttons' &&
2869
2869
  column.type !== 'img') {
2870
2870
  e.stopPropagation();
@@ -2965,7 +2965,6 @@ var TableBodyCell = function (_a) {
2965
2965
  } })));
2966
2966
  break;
2967
2967
  case 'button':
2968
- case 'button-ellipsis':
2969
2968
  data = (React__default.createElement(Box, { className: 'TableBoxyCell-button-box', onClick: menuOpen ? undefined : function (e) { return e.stopPropagation(); } }, data));
2970
2969
  break;
2971
2970
  case 'buttons':