@pdg/react-table 1.0.13 → 1.0.15

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/index.js CHANGED
@@ -8343,7 +8343,7 @@ var equal = function (v1, v2) {
8343
8343
  var TableCommonCell = function (_a) {
8344
8344
  var children = _a.children, initClassName = _a.className, initStyle = _a.style, initSx = _a.sx, type = _a.type, column = _a.column, defaultAlign = _a.defaultAlign, initDefaultEllipsis = _a.defaultEllipsis, index = _a.index, item = _a.item, onClick = _a.onClick;
8345
8345
  var align = React.useMemo(function () { return getTableColumnAlign(column, defaultAlign); }, [column, defaultAlign]);
8346
- var ellipsis = React.useMemo(function () { return (column.ellipsis != null ? column.ellipsis : !!initDefaultEllipsis); }, [column, initDefaultEllipsis]);
8346
+ var ellipsis = React.useMemo(function () { return type !== 'head' && (column.ellipsis != null ? column.ellipsis : !!initDefaultEllipsis); }, [type, column, initDefaultEllipsis]);
8347
8347
  var className = React.useMemo(function () {
8348
8348
  var _a, _b, _c, _d, _e, _f;
8349
8349
  var className;
@@ -8852,25 +8852,25 @@ var Table = React__default["default"].forwardRef(function (_a, ref) {
8852
8852
  var simpleBarStyle = React.useMemo(function () {
8853
8853
  if (fullHeight) {
8854
8854
  return {
8855
- height: (containerHeight || 0) - (pagingHeight || 0),
8855
+ height: (containerHeight || 0) - (pagingHeight || 0) - 2,
8856
8856
  flex: 1,
8857
8857
  position: 'absolute',
8858
+ top: 1,
8858
8859
  left: 0,
8859
8860
  right: 0,
8860
- marginBottom: pagingHeight,
8861
+ marginBottom: pagingHeight || 0,
8861
8862
  };
8862
8863
  }
8863
8864
  else {
8864
- return { height: height, minHeight: minHeight, maxHeight: maxHeight };
8865
+ return { height: height, minHeight: minHeight, maxHeight: maxHeight, marginBottom: -1 };
8865
8866
  }
8866
8867
  }, [containerHeight, fullHeight, height, maxHeight, minHeight, pagingHeight]);
8867
8868
  var pagingStyle = React.useMemo(function () {
8869
+ var style = { padding: '13px 0', borderTop: '1px solid rgba(224, 224, 224, 1)' };
8868
8870
  if (fullHeight) {
8869
- return { position: 'sticky', padding: '13px 0' };
8870
- }
8871
- else {
8872
- return { padding: '13px 0' };
8871
+ return __assign$1({ position: 'sticky' }, style);
8873
8872
  }
8873
+ return style;
8874
8874
  }, [fullHeight]);
8875
8875
  // Render ----------------------------------------------------------------------------------------------------------
8876
8876
  return finalColumns ? (React__default["default"].createElement(material.Paper, { ref: fullHeight ? containerHeightDetector : undefined, className: classNames('Table', className), variant: 'outlined', style: style, sx: sx },
@@ -8891,9 +8891,9 @@ var Table = React__default["default"].forwardRef(function (_a, ref) {
8891
8891
  });
8892
8892
  Table.displayName = 'Table';
8893
8893
  Table.defaultProps = TableDefaultProps;var SearchTableDefaultProps = {};var SearchTable = React__default["default"].forwardRef(function (_a, ref) {
8894
- var color = _a.color, hash = _a.hash, search = _a.search, table = _a.table, betweenSearchTableComponent = _a.betweenSearchTableComponent, onGetData = _a.onGetData, onRequestHashChange = _a.onRequestHashChange,
8894
+ var color = _a.color, hash = _a.hash, fullHeight = _a.fullHeight, search = _a.search, table = _a.table, betweenSearchTableComponent = _a.betweenSearchTableComponent, onGetData = _a.onGetData, onRequestHashChange = _a.onRequestHashChange,
8895
8895
  // ---------------------------------------------------------------------------------------------------------------
8896
- className = _a.className, style = _a.style, sx = _a.sx;
8896
+ className = _a.className, initStyle = _a.style, sx = _a.sx;
8897
8897
  var searchRef = React.useRef();
8898
8898
  var tableRef = React.useRef();
8899
8899
  //------------------------------------------------------------------------------------------------------------------
@@ -9174,6 +9174,20 @@ Table.defaultProps = TableDefaultProps;var SearchTableDefaultProps = {};var Sear
9174
9174
  }
9175
9175
  }
9176
9176
  }, [searchRef, hash, hashChange, getData, isFirstSearchSubmit]);
9177
+ // Memo --------------------------------------------------------------------------------------------------------------
9178
+ var style = React.useMemo(function () {
9179
+ if (fullHeight) {
9180
+ return __assign$1(__assign$1({}, initStyle), { flex: 1, display: 'flex' });
9181
+ }
9182
+ else {
9183
+ return initStyle;
9184
+ }
9185
+ }, [initStyle, fullHeight]);
9186
+ var tableContainerStyle = React.useMemo(function () {
9187
+ if (fullHeight) {
9188
+ return { flex: 1, display: 'flex', flexDirection: 'column' };
9189
+ }
9190
+ }, [fullHeight]);
9177
9191
  //------------------------------------------------------------------------------------------------------------------
9178
9192
  return (React__default["default"].createElement(material.Grid, { container: true, direction: 'column', spacing: 1, className: classNames('SearchTable', className), style: style, sx: sx },
9179
9193
  React__default["default"].createElement(material.Grid, { item: true, sx: { display: searchInfo.searchGroups ? undefined : 'none' } },
@@ -9192,8 +9206,8 @@ Table.defaultProps = TableDefaultProps;var SearchTableDefaultProps = {};var Sear
9192
9206
  React__default["default"].createElement(reactForm.FormHidden, { name: 'page', value: 1 })),
9193
9207
  searchInfo.searchGroups)),
9194
9208
  betweenSearchTableComponent && React__default["default"].createElement(material.Grid, { item: true }, betweenSearchTableComponent),
9195
- React__default["default"].createElement(material.Grid, { item: true },
9196
- React__default["default"].createElement(Table, __assign$1({}, tableInfo.props, { ref: function (commands) {
9209
+ React__default["default"].createElement(material.Grid, { item: true, style: tableContainerStyle },
9210
+ React__default["default"].createElement(Table, __assign$1({}, tableInfo.props, { fullHeight: fullHeight, ref: function (commands) {
9197
9211
  if (tableInfo.ref) {
9198
9212
  if (typeof tableInfo.ref === 'function') {
9199
9213
  tableInfo.ref(commands);