@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/SearchTable/SearchTable.types.d.ts +1 -0
- package/dist/index.esm.js +26 -12
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +26 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -17,6 +17,7 @@ export interface SearchTableTableProps<T = TableItem> extends Omit<TableProps<T>
|
|
|
17
17
|
export interface SearchTableProps extends CommonSxProps {
|
|
18
18
|
color?: SearchProps['color'];
|
|
19
19
|
hash?: boolean;
|
|
20
|
+
fullHeight?: boolean;
|
|
20
21
|
search?: SearchTableSearchProps;
|
|
21
22
|
table: SearchTableTableProps;
|
|
22
23
|
betweenSearchTableComponent?: ReactNode;
|
package/dist/index.esm.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 = useMemo(function () { return getTableColumnAlign(column, defaultAlign); }, [column, defaultAlign]);
|
|
8346
|
-
var ellipsis = useMemo(function () { return (column.ellipsis != null ? column.ellipsis : !!initDefaultEllipsis); }, [column, initDefaultEllipsis]);
|
|
8346
|
+
var ellipsis = useMemo(function () { return type !== 'head' && (column.ellipsis != null ? column.ellipsis : !!initDefaultEllipsis); }, [type, column, initDefaultEllipsis]);
|
|
8347
8347
|
var className = useMemo(function () {
|
|
8348
8348
|
var _a, _b, _c, _d, _e, _f;
|
|
8349
8349
|
var className;
|
|
@@ -8852,25 +8852,25 @@ var Table = React__default.forwardRef(function (_a, ref) {
|
|
|
8852
8852
|
var simpleBarStyle = 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 = useMemo(function () {
|
|
8869
|
+
var style = { padding: '13px 0', borderTop: '1px solid rgba(224, 224, 224, 1)' };
|
|
8868
8870
|
if (fullHeight) {
|
|
8869
|
-
return { position: 'sticky',
|
|
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.createElement(Paper, { ref: fullHeight ? containerHeightDetector : undefined, className: classNames('Table', className), variant: 'outlined', style: style, sx: sx },
|
|
@@ -8891,9 +8891,9 @@ var Table = React__default.forwardRef(function (_a, ref) {
|
|
|
8891
8891
|
});
|
|
8892
8892
|
Table.displayName = 'Table';
|
|
8893
8893
|
Table.defaultProps = TableDefaultProps;var SearchTableDefaultProps = {};var SearchTable = React__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,
|
|
8896
|
+
className = _a.className, initStyle = _a.style, sx = _a.sx;
|
|
8897
8897
|
var searchRef = useRef();
|
|
8898
8898
|
var tableRef = 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 = 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 = useMemo(function () {
|
|
9187
|
+
if (fullHeight) {
|
|
9188
|
+
return { flex: 1, display: 'flex', flexDirection: 'column' };
|
|
9189
|
+
}
|
|
9190
|
+
}, [fullHeight]);
|
|
9177
9191
|
//------------------------------------------------------------------------------------------------------------------
|
|
9178
9192
|
return (React__default.createElement(Grid, { container: true, direction: 'column', spacing: 1, className: classNames('SearchTable', className), style: style, sx: sx },
|
|
9179
9193
|
React__default.createElement(Grid, { item: true, sx: { display: searchInfo.searchGroups ? undefined : 'none' } },
|
|
@@ -9192,8 +9206,8 @@ Table.defaultProps = TableDefaultProps;var SearchTableDefaultProps = {};var Sear
|
|
|
9192
9206
|
React__default.createElement(FormHidden, { name: 'page', value: 1 })),
|
|
9193
9207
|
searchInfo.searchGroups)),
|
|
9194
9208
|
betweenSearchTableComponent && React__default.createElement(Grid, { item: true }, betweenSearchTableComponent),
|
|
9195
|
-
React__default.createElement(Grid, { item: true },
|
|
9196
|
-
React__default.createElement(Table, __assign$1({}, tableInfo.props, { ref: function (commands) {
|
|
9209
|
+
React__default.createElement(Grid, { item: true, style: tableContainerStyle },
|
|
9210
|
+
React__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);
|