venice-ui 3.0.7 → 3.0.8
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/cjs/components/Table/Table.js +2 -2
- package/dist/cjs/components/Table/Table.styles.js +9 -2
- package/dist/esm/components/Table/Table.js +2 -2
- package/dist/esm/components/Table/Table.styles.js +9 -2
- package/dist/types/components/Table/Table.d.ts +1 -0
- package/dist/types/components/Table/Table.styles.d.ts +6 -1
- package/package.json +1 -1
|
@@ -47,7 +47,7 @@ const Cell_1 = require("./Cell");
|
|
|
47
47
|
const Table = ({ theme, themeVariant = 'default', headers, elements, hover = true, selectable = true, filtrable = false, pagination = false, sortable = true, sort = {
|
|
48
48
|
name: '',
|
|
49
49
|
order: 'none',
|
|
50
|
-
}, pageSize = 20, moreActions = [], onRowClick, labels, paginationCounters }) => {
|
|
50
|
+
}, pageSize = 20, moreActions = [], onRowClick, labels, paginationCounters, tableHeight }) => {
|
|
51
51
|
const resolvedThemeData = (0, config_1.resolveThemeWithComponentsConfig)({
|
|
52
52
|
theme,
|
|
53
53
|
themeVariant,
|
|
@@ -148,7 +148,7 @@ const Table = ({ theme, themeVariant = 'default', headers, elements, hover = tru
|
|
|
148
148
|
return tableProps.elements;
|
|
149
149
|
}, [pagination, paginatedElements, tableProps.elements]);
|
|
150
150
|
return (react_1.default.createElement(styled_components_1.ThemeProvider, { theme: resolvedTheme },
|
|
151
|
-
react_1.default.createElement(Table_styles_1.TableRoot,
|
|
151
|
+
react_1.default.createElement(Table_styles_1.TableRoot, { theme: resolvedTheme, config: tableConfig, height: tableHeight },
|
|
152
152
|
react_1.default.createElement(react_1.default.Fragment, null,
|
|
153
153
|
(filtrable || pagination) && (react_1.default.createElement(Table_styles_1.TableHeader, { theme: resolvedTheme, config: tableConfig, right: pagination && !filtrable },
|
|
154
154
|
react_1.default.createElement(react_1.default.Fragment, null,
|
|
@@ -9,6 +9,7 @@ exports.TableRoot = styled_components_1.default.div `
|
|
|
9
9
|
display: flex;
|
|
10
10
|
width: 100%;
|
|
11
11
|
flex-direction: column;
|
|
12
|
+
${({ height }) => height && `height: ${height};`}
|
|
12
13
|
`;
|
|
13
14
|
exports.TableHeader = styled_components_1.default.div `
|
|
14
15
|
display: flex;
|
|
@@ -25,6 +26,7 @@ exports.TableContentWrapper = styled_components_1.default.div `
|
|
|
25
26
|
overflow-y: hidden;
|
|
26
27
|
overflow-x: auto;
|
|
27
28
|
height: 100%;
|
|
29
|
+
flex-shrink: 0;
|
|
28
30
|
`;
|
|
29
31
|
exports.HeaderSection = styled_components_1.default.div `
|
|
30
32
|
display: flex;
|
|
@@ -40,17 +42,22 @@ exports.TableContent = styled_components_1.default.table `
|
|
|
40
42
|
overflow-x: auto;
|
|
41
43
|
overflow-y: auto;
|
|
42
44
|
height: 100%;
|
|
43
|
-
// border: 1px solid ${({ theme, config }) => config.color.default.common.border};
|
|
44
45
|
border-radius: ${({ theme, config }) => config.size.common.borderRadius}px;
|
|
45
46
|
border-collapse: separate;
|
|
46
47
|
border-spacing: 0;
|
|
48
|
+
position: sticky;
|
|
49
|
+
top: 0;
|
|
50
|
+
z-index: 2;
|
|
47
51
|
`;
|
|
48
52
|
exports.TableHead = styled_components_1.default.thead `
|
|
49
53
|
box-sizing: border-box;
|
|
54
|
+
position: sticky;
|
|
55
|
+
top: 0;
|
|
56
|
+
z-index: 2;
|
|
50
57
|
tr:first-child {
|
|
51
58
|
position: sticky;
|
|
52
59
|
top: 0;
|
|
53
|
-
z-index:
|
|
60
|
+
z-index: 2;
|
|
54
61
|
}
|
|
55
62
|
`;
|
|
56
63
|
exports.TableBody = styled_components_1.default.tbody `
|
|
@@ -11,7 +11,7 @@ import { Cell } from './Cell';
|
|
|
11
11
|
export const Table = ({ theme, themeVariant = 'default', headers, elements, hover = true, selectable = true, filtrable = false, pagination = false, sortable = true, sort = {
|
|
12
12
|
name: '',
|
|
13
13
|
order: 'none',
|
|
14
|
-
}, pageSize = 20, moreActions = [], onRowClick, labels, paginationCounters }) => {
|
|
14
|
+
}, pageSize = 20, moreActions = [], onRowClick, labels, paginationCounters, tableHeight }) => {
|
|
15
15
|
const resolvedThemeData = resolveThemeWithComponentsConfig({
|
|
16
16
|
theme,
|
|
17
17
|
themeVariant,
|
|
@@ -112,7 +112,7 @@ export const Table = ({ theme, themeVariant = 'default', headers, elements, hove
|
|
|
112
112
|
return tableProps.elements;
|
|
113
113
|
}, [pagination, paginatedElements, tableProps.elements]);
|
|
114
114
|
return (React.createElement(ThemeProvider, { theme: resolvedTheme },
|
|
115
|
-
React.createElement(TableRoot,
|
|
115
|
+
React.createElement(TableRoot, { theme: resolvedTheme, config: tableConfig, height: tableHeight },
|
|
116
116
|
React.createElement(React.Fragment, null,
|
|
117
117
|
(filtrable || pagination) && (React.createElement(TableHeader, { theme: resolvedTheme, config: tableConfig, right: pagination && !filtrable },
|
|
118
118
|
React.createElement(React.Fragment, null,
|
|
@@ -3,6 +3,7 @@ export const TableRoot = styled.div `
|
|
|
3
3
|
display: flex;
|
|
4
4
|
width: 100%;
|
|
5
5
|
flex-direction: column;
|
|
6
|
+
${({ height }) => height && `height: ${height};`}
|
|
6
7
|
`;
|
|
7
8
|
export const TableHeader = styled.div `
|
|
8
9
|
display: flex;
|
|
@@ -19,6 +20,7 @@ export const TableContentWrapper = styled.div `
|
|
|
19
20
|
overflow-y: hidden;
|
|
20
21
|
overflow-x: auto;
|
|
21
22
|
height: 100%;
|
|
23
|
+
flex-shrink: 0;
|
|
22
24
|
`;
|
|
23
25
|
export const HeaderSection = styled.div `
|
|
24
26
|
display: flex;
|
|
@@ -34,17 +36,22 @@ export const TableContent = styled.table `
|
|
|
34
36
|
overflow-x: auto;
|
|
35
37
|
overflow-y: auto;
|
|
36
38
|
height: 100%;
|
|
37
|
-
// border: 1px solid ${({ theme, config }) => config.color.default.common.border};
|
|
38
39
|
border-radius: ${({ theme, config }) => config.size.common.borderRadius}px;
|
|
39
40
|
border-collapse: separate;
|
|
40
41
|
border-spacing: 0;
|
|
42
|
+
position: sticky;
|
|
43
|
+
top: 0;
|
|
44
|
+
z-index: 2;
|
|
41
45
|
`;
|
|
42
46
|
export const TableHead = styled.thead `
|
|
43
47
|
box-sizing: border-box;
|
|
48
|
+
position: sticky;
|
|
49
|
+
top: 0;
|
|
50
|
+
z-index: 2;
|
|
44
51
|
tr:first-child {
|
|
45
52
|
position: sticky;
|
|
46
53
|
top: 0;
|
|
47
|
-
z-index:
|
|
54
|
+
z-index: 2;
|
|
48
55
|
}
|
|
49
56
|
`;
|
|
50
57
|
export const TableBody = styled.tbody `
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { AppTheme } from 'config/themes';
|
|
2
2
|
import { InputSize } from 'types';
|
|
3
|
-
|
|
3
|
+
interface ITableRoot {
|
|
4
|
+
theme: AppTheme;
|
|
5
|
+
config: any;
|
|
6
|
+
height?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const TableRoot: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, ITableRoot, never>;
|
|
4
9
|
interface ITableHeaderProps {
|
|
5
10
|
theme: AppTheme;
|
|
6
11
|
config: any;
|