@pdg/react-table 1.0.15 → 1.0.17
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/SearchTable/SearchTable.types.d.ts +1 -0
- package/dist/index.esm.js +12 -10
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +12 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8850,21 +8850,22 @@ var Table = React__default["default"].forwardRef(function (_a, ref) {
|
|
|
8850
8850
|
}
|
|
8851
8851
|
}, [initStyle, fullHeight]);
|
|
8852
8852
|
var simpleBarStyle = React.useMemo(function () {
|
|
8853
|
+
var finalPagingHeight = paging && paging.total > 0 ? pagingHeight : undefined;
|
|
8853
8854
|
if (fullHeight) {
|
|
8854
8855
|
return {
|
|
8855
|
-
height: (containerHeight || 0) - (
|
|
8856
|
+
height: (containerHeight || 0) - (finalPagingHeight || 0) - 2,
|
|
8856
8857
|
flex: 1,
|
|
8857
8858
|
position: 'absolute',
|
|
8858
8859
|
top: 1,
|
|
8859
8860
|
left: 0,
|
|
8860
8861
|
right: 0,
|
|
8861
|
-
marginBottom:
|
|
8862
|
+
marginBottom: finalPagingHeight || 0,
|
|
8862
8863
|
};
|
|
8863
8864
|
}
|
|
8864
8865
|
else {
|
|
8865
8866
|
return { height: height, minHeight: minHeight, maxHeight: maxHeight, marginBottom: -1 };
|
|
8866
8867
|
}
|
|
8867
|
-
}, [containerHeight, fullHeight, height, maxHeight, minHeight, pagingHeight]);
|
|
8868
|
+
}, [paging, containerHeight, fullHeight, height, maxHeight, minHeight, pagingHeight]);
|
|
8868
8869
|
var pagingStyle = React.useMemo(function () {
|
|
8869
8870
|
var style = { padding: '13px 0', borderTop: '1px solid rgba(224, 224, 224, 1)' };
|
|
8870
8871
|
if (fullHeight) {
|
|
@@ -8886,12 +8887,13 @@ var Table = React__default["default"].forwardRef(function (_a, ref) {
|
|
|
8886
8887
|
React__default["default"].createElement("div", null, "\uAC80\uC0C9\uB41C \uC815\uBCF4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."))))))) : undefined),
|
|
8887
8888
|
footer && (React__default["default"].createElement(material.TableFooter, null,
|
|
8888
8889
|
React__default["default"].createElement(material.TableRow, null, finalColumns.map(function (column, idx) { return (React__default["default"].createElement(TableFooterCell, { key: idx, column: column, defaultAlign: defaultAlign })); }))))))),
|
|
8889
|
-
paging && (React__default["default"].createElement(material.Stack, { ref: fullHeight ? pagingHeightResizeDetector : undefined, alignItems: pagingAlign, style: pagingStyle },
|
|
8890
|
+
paging && paging.total > 0 && (React__default["default"].createElement(material.Stack, { ref: fullHeight ? pagingHeightResizeDetector : undefined, alignItems: pagingAlign, style: pagingStyle },
|
|
8890
8891
|
React__default["default"].createElement(TablePagination, { className: pagination === null || pagination === void 0 ? void 0 : pagination.className, style: pagination === null || pagination === void 0 ? void 0 : pagination.style, sx: pagination === null || pagination === void 0 ? void 0 : pagination.sx, paging: paging, align: pagingAlign, onChange: onPageChange }))))) : null;
|
|
8891
8892
|
});
|
|
8892
8893
|
Table.displayName = 'Table';
|
|
8893
8894
|
Table.defaultProps = TableDefaultProps;var SearchTableDefaultProps = {};var SearchTable = React__default["default"].forwardRef(function (_a, ref) {
|
|
8894
|
-
var
|
|
8895
|
+
var _b, _c;
|
|
8896
|
+
var color = _a.color, hash = _a.hash, stickyHeader = _a.stickyHeader, fullHeight = _a.fullHeight, search = _a.search, table = _a.table, betweenSearchTableComponent = _a.betweenSearchTableComponent, onGetData = _a.onGetData, onRequestHashChange = _a.onRequestHashChange,
|
|
8895
8897
|
// ---------------------------------------------------------------------------------------------------------------
|
|
8896
8898
|
className = _a.className, initStyle = _a.style, sx = _a.sx;
|
|
8897
8899
|
var searchRef = React.useRef();
|
|
@@ -8919,11 +8921,11 @@ Table.defaultProps = TableDefaultProps;var SearchTableDefaultProps = {};var Sear
|
|
|
8919
8921
|
// Ref -------------------------------------------------------------------------------------------------------------
|
|
8920
8922
|
var lastGetDataDataRef = React.useRef({});
|
|
8921
8923
|
// State -----------------------------------------------------------------------------------------------------------
|
|
8922
|
-
var
|
|
8923
|
-
var
|
|
8924
|
+
var _d = React.useState(true), isFirstSearchSubmit = _d[0], setIsFirstSearchSubmit = _d[1];
|
|
8925
|
+
var _e = React.useState(), tableData = _e[0], setTableData = _e[1];
|
|
8924
8926
|
// searchInfo ------------------------------------------------------------------------------------------------------
|
|
8925
8927
|
var searchInfoFirstUseEffect = React.useRef(true);
|
|
8926
|
-
var
|
|
8928
|
+
var _f = React.useState(function () { return getSearchInfo(search); }), searchInfo = _f[0], setSearchInfo = _f[1];
|
|
8927
8929
|
React.useEffect(function () {
|
|
8928
8930
|
if (searchInfoFirstUseEffect.current) {
|
|
8929
8931
|
searchInfoFirstUseEffect.current = false;
|
|
@@ -8935,7 +8937,7 @@ Table.defaultProps = TableDefaultProps;var SearchTableDefaultProps = {};var Sear
|
|
|
8935
8937
|
}, [search]);
|
|
8936
8938
|
// tableInfo -------------------------------------------------------------------------------------------------------
|
|
8937
8939
|
var tableInfoFirstUseEffect = React.useRef(true);
|
|
8938
|
-
var
|
|
8940
|
+
var _g = React.useState(function () { return getTableInfo(table); }), tableInfo = _g[0], setTableInfo = _g[1];
|
|
8939
8941
|
React.useEffect(function () {
|
|
8940
8942
|
if (tableInfoFirstUseEffect.current) {
|
|
8941
8943
|
tableInfoFirstUseEffect.current = false;
|
|
@@ -9207,7 +9209,7 @@ Table.defaultProps = TableDefaultProps;var SearchTableDefaultProps = {};var Sear
|
|
|
9207
9209
|
searchInfo.searchGroups)),
|
|
9208
9210
|
betweenSearchTableComponent && React__default["default"].createElement(material.Grid, { item: true }, betweenSearchTableComponent),
|
|
9209
9211
|
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) {
|
|
9212
|
+
React__default["default"].createElement(Table, __assign$1({}, tableInfo.props, { stickyHeader: stickyHeader || ((_b = tableInfo.props) === null || _b === void 0 ? void 0 : _b.stickyHeader), fullHeight: fullHeight || ((_c = tableInfo.props) === null || _c === void 0 ? void 0 : _c.fullHeight), ref: function (commands) {
|
|
9211
9213
|
if (tableInfo.ref) {
|
|
9212
9214
|
if (typeof tableInfo.ref === 'function') {
|
|
9213
9215
|
tableInfo.ref(commands);
|