venice-ui 3.0.7 → 3.0.9
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/Card/Card.js +2 -2
- package/dist/cjs/components/Card/Card.styles.js +1 -1
- package/dist/cjs/components/Table/Table.js +2 -2
- package/dist/cjs/components/Table/Table.styles.js +11 -2
- package/dist/esm/components/Card/Card.js +2 -2
- package/dist/esm/components/Card/Card.styles.js +1 -1
- package/dist/esm/components/Table/Table.js +2 -2
- package/dist/esm/components/Table/Table.styles.js +11 -2
- package/dist/types/components/Card/Card.d.ts +1 -0
- package/dist/types/components/Card/Card.styles.d.ts +1 -0
- 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
|
@@ -9,7 +9,7 @@ const react_1 = __importDefault(require("react"));
|
|
|
9
9
|
const Card_styles_1 = require("./Card.styles");
|
|
10
10
|
const Header_1 = require("../Header");
|
|
11
11
|
const styled_components_1 = require("styled-components");
|
|
12
|
-
const Card = ({ theme, themeVariant = 'default', title, actionLabel, children, customHeader, headerDivader, actionDisabled, handleClick, handleBack, height, options, shadow, }) => {
|
|
12
|
+
const Card = ({ theme, themeVariant = 'default', title, actionLabel, children, customHeader, headerDivader, actionDisabled, handleClick, handleBack, height, options, shadow, noVerticalPadding, }) => {
|
|
13
13
|
const resolvedThemeData = (0, config_1.resolveThemeWithComponentsConfig)({
|
|
14
14
|
theme,
|
|
15
15
|
themeVariant,
|
|
@@ -20,6 +20,6 @@ const Card = ({ theme, themeVariant = 'default', title, actionLabel, children, c
|
|
|
20
20
|
return (react_1.default.createElement(styled_components_1.ThemeProvider, { theme: resolvedTheme },
|
|
21
21
|
react_1.default.createElement(Card_styles_1.CardRoot, { height: height, shadow: shadow, theme: resolvedTheme, config: headerConfig },
|
|
22
22
|
(title || actionLabel) && (react_1.default.createElement(Header_1.Header, { title: title, actionLabel: actionLabel, handleClick: handleClick, handleBack: handleBack, options: options, theme: theme, bottomDivader: headerDivader, actionDisabled: actionDisabled, themeVariant: themeVariant, header: customHeader })),
|
|
23
|
-
react_1.default.createElement(Card_styles_1.CardContent, { theme: resolvedTheme, config: headerConfig }, children))));
|
|
23
|
+
react_1.default.createElement(Card_styles_1.CardContent, { theme: resolvedTheme, config: headerConfig, noVerticalPadding: noVerticalPadding }, children))));
|
|
24
24
|
};
|
|
25
25
|
exports.Card = Card;
|
|
@@ -19,7 +19,7 @@ exports.CardRoot = styled_components_1.default.div `
|
|
|
19
19
|
exports.CardContent = styled_components_1.default.div `
|
|
20
20
|
box-sizing: border-box;
|
|
21
21
|
display: flex;
|
|
22
|
-
padding: ${({ config }) => config.size.paddingY}px
|
|
22
|
+
padding: ${({ config, noVerticalPadding }) => (noVerticalPadding ? '0' : `${config.size.paddingY}px`)}
|
|
23
23
|
${({ config }) => config.size.paddingX}px;
|
|
24
24
|
width: 100%;
|
|
25
25
|
flex-direction: row;
|
|
@@ -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,12 +26,14 @@ 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;
|
|
31
33
|
align-items: center;
|
|
32
34
|
justify-content: ${({ right }) => (right ? 'flex-end' : 'flex-start')};
|
|
33
35
|
width: 50%;
|
|
36
|
+
flex-shrink: 0;
|
|
34
37
|
`;
|
|
35
38
|
exports.TableContent = styled_components_1.default.table `
|
|
36
39
|
box-sizing: border-box;
|
|
@@ -40,18 +43,24 @@ exports.TableContent = styled_components_1.default.table `
|
|
|
40
43
|
overflow-x: auto;
|
|
41
44
|
overflow-y: auto;
|
|
42
45
|
height: 100%;
|
|
43
|
-
// border: 1px solid ${({ theme, config }) => config.color.default.common.border};
|
|
44
46
|
border-radius: ${({ theme, config }) => config.size.common.borderRadius}px;
|
|
45
47
|
border-collapse: separate;
|
|
46
48
|
border-spacing: 0;
|
|
49
|
+
position: sticky;
|
|
50
|
+
top: 0;
|
|
51
|
+
z-index: 2;
|
|
47
52
|
`;
|
|
48
53
|
exports.TableHead = styled_components_1.default.thead `
|
|
49
54
|
box-sizing: border-box;
|
|
55
|
+
position: sticky;
|
|
56
|
+
top: 0;
|
|
57
|
+
z-index: 2;
|
|
50
58
|
tr:first-child {
|
|
51
59
|
position: sticky;
|
|
52
60
|
top: 0;
|
|
53
|
-
z-index:
|
|
61
|
+
z-index: 2;
|
|
54
62
|
}
|
|
63
|
+
flex-shrink: 0;
|
|
55
64
|
`;
|
|
56
65
|
exports.TableBody = styled_components_1.default.tbody `
|
|
57
66
|
box-sizing: border-box;
|
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { CardContent, CardRoot } from './Card.styles';
|
|
4
4
|
import { Header } from '../Header';
|
|
5
5
|
import { ThemeProvider } from 'styled-components';
|
|
6
|
-
export const Card = ({ theme, themeVariant = 'default', title, actionLabel, children, customHeader, headerDivader, actionDisabled, handleClick, handleBack, height, options, shadow, }) => {
|
|
6
|
+
export const Card = ({ theme, themeVariant = 'default', title, actionLabel, children, customHeader, headerDivader, actionDisabled, handleClick, handleBack, height, options, shadow, noVerticalPadding, }) => {
|
|
7
7
|
const resolvedThemeData = resolveThemeWithComponentsConfig({
|
|
8
8
|
theme,
|
|
9
9
|
themeVariant,
|
|
@@ -14,5 +14,5 @@ export const Card = ({ theme, themeVariant = 'default', title, actionLabel, chil
|
|
|
14
14
|
return (React.createElement(ThemeProvider, { theme: resolvedTheme },
|
|
15
15
|
React.createElement(CardRoot, { height: height, shadow: shadow, theme: resolvedTheme, config: headerConfig },
|
|
16
16
|
(title || actionLabel) && (React.createElement(Header, { title: title, actionLabel: actionLabel, handleClick: handleClick, handleBack: handleBack, options: options, theme: theme, bottomDivader: headerDivader, actionDisabled: actionDisabled, themeVariant: themeVariant, header: customHeader })),
|
|
17
|
-
React.createElement(CardContent, { theme: resolvedTheme, config: headerConfig }, children))));
|
|
17
|
+
React.createElement(CardContent, { theme: resolvedTheme, config: headerConfig, noVerticalPadding: noVerticalPadding }, children))));
|
|
18
18
|
};
|
|
@@ -13,7 +13,7 @@ export const CardRoot = styled.div `
|
|
|
13
13
|
export const CardContent = styled.div `
|
|
14
14
|
box-sizing: border-box;
|
|
15
15
|
display: flex;
|
|
16
|
-
padding: ${({ config }) => config.size.paddingY}px
|
|
16
|
+
padding: ${({ config, noVerticalPadding }) => (noVerticalPadding ? '0' : `${config.size.paddingY}px`)}
|
|
17
17
|
${({ config }) => config.size.paddingX}px;
|
|
18
18
|
width: 100%;
|
|
19
19
|
flex-direction: row;
|
|
@@ -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,12 +20,14 @@ 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;
|
|
25
27
|
align-items: center;
|
|
26
28
|
justify-content: ${({ right }) => (right ? 'flex-end' : 'flex-start')};
|
|
27
29
|
width: 50%;
|
|
30
|
+
flex-shrink: 0;
|
|
28
31
|
`;
|
|
29
32
|
export const TableContent = styled.table `
|
|
30
33
|
box-sizing: border-box;
|
|
@@ -34,18 +37,24 @@ export const TableContent = styled.table `
|
|
|
34
37
|
overflow-x: auto;
|
|
35
38
|
overflow-y: auto;
|
|
36
39
|
height: 100%;
|
|
37
|
-
// border: 1px solid ${({ theme, config }) => config.color.default.common.border};
|
|
38
40
|
border-radius: ${({ theme, config }) => config.size.common.borderRadius}px;
|
|
39
41
|
border-collapse: separate;
|
|
40
42
|
border-spacing: 0;
|
|
43
|
+
position: sticky;
|
|
44
|
+
top: 0;
|
|
45
|
+
z-index: 2;
|
|
41
46
|
`;
|
|
42
47
|
export const TableHead = styled.thead `
|
|
43
48
|
box-sizing: border-box;
|
|
49
|
+
position: sticky;
|
|
50
|
+
top: 0;
|
|
51
|
+
z-index: 2;
|
|
44
52
|
tr:first-child {
|
|
45
53
|
position: sticky;
|
|
46
54
|
top: 0;
|
|
47
|
-
z-index:
|
|
55
|
+
z-index: 2;
|
|
48
56
|
}
|
|
57
|
+
flex-shrink: 0;
|
|
49
58
|
`;
|
|
50
59
|
export const TableBody = styled.tbody `
|
|
51
60
|
box-sizing: border-box;
|
|
@@ -8,6 +8,7 @@ export declare const CardRoot: import("styled-components").StyledComponent<"div"
|
|
|
8
8
|
interface ICardContentStyles {
|
|
9
9
|
theme?: any;
|
|
10
10
|
config: any;
|
|
11
|
+
noVerticalPadding?: boolean;
|
|
11
12
|
}
|
|
12
13
|
export declare const CardContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, ICardContentStyles, never>;
|
|
13
14
|
export {};
|
|
@@ -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;
|