venice-ui 2.0.17 → 2.0.18
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/Theme/Theme.js +3 -2
- package/dist/cjs/components/DropdownMenu/DropdownMenu.js +26 -3
- package/dist/cjs/components/DropdownMenu/DropdownMenu.styles.js +14 -14
- package/dist/cjs/components/ElementHeader/ElementHeader.js +1 -1
- package/dist/cjs/components/Icons/IconsPath.js +4 -2
- package/dist/cjs/components/Sort/Sort.js +26 -0
- package/dist/cjs/components/Sort/Sort.styles.js +27 -0
- package/dist/cjs/components/Sort/index.js +5 -0
- package/dist/cjs/components/Table/Cell.js +28 -0
- package/dist/cjs/components/Table/HeaderCell.js +23 -0
- package/dist/cjs/components/Table/Table.js +10 -38
- package/dist/cjs/components/Table/Table.styles.js +4 -23
- package/dist/cjs/components/Table/tableHelper.js +7 -3
- package/dist/cjs/index.js +1 -0
- package/dist/esm/Theme/Theme.js +3 -2
- package/dist/esm/components/DropdownMenu/DropdownMenu.js +26 -3
- package/dist/esm/components/DropdownMenu/DropdownMenu.styles.js +17 -17
- package/dist/esm/components/ElementHeader/ElementHeader.js +1 -1
- package/dist/esm/components/Icons/IconsPath.js +4 -2
- package/dist/esm/components/Sort/Sort.js +19 -0
- package/dist/esm/components/Sort/Sort.styles.js +21 -0
- package/dist/esm/components/Sort/index.js +1 -0
- package/dist/esm/components/Table/Cell.js +21 -0
- package/dist/esm/components/Table/HeaderCell.js +16 -0
- package/dist/esm/components/Table/Table.js +11 -39
- package/dist/esm/components/Table/Table.styles.js +3 -22
- package/dist/esm/components/Table/tableHelper.js +5 -2
- package/dist/esm/index.js +1 -0
- package/dist/types/Theme/Theme.d.ts +2 -1
- package/dist/types/components/DropdownMenu/DropdownMenu.styles.d.ts +1 -0
- package/dist/types/components/Icons/IconsPath.d.ts +2 -0
- package/dist/types/components/Sort/Sort.d.ts +9 -0
- package/dist/types/components/Sort/Sort.styles.d.ts +2 -0
- package/dist/types/components/Sort/index.d.ts +1 -0
- package/dist/types/components/Table/Cell.d.ts +11 -0
- package/dist/types/components/Table/HeaderCell.d.ts +11 -0
- package/dist/types/components/Table/Table.d.ts +5 -0
- package/dist/types/components/Table/Table.styles.d.ts +0 -2
- package/dist/types/components/Table/tableHelper.d.ts +3 -2
- package/dist/types/index.d.ts +1 -0
- package/dist/types/types/commonTypes.d.ts +1 -0
- package/package.json +1 -1
package/dist/cjs/Theme/Theme.js
CHANGED
|
@@ -102,12 +102,13 @@ exports.mainTheme = {
|
|
|
102
102
|
//table
|
|
103
103
|
tableBorderColor: exports.Theme.colors.gray_3,
|
|
104
104
|
tableHeaderBackground: exports.Theme.colors.white,
|
|
105
|
-
|
|
105
|
+
tableHeaderActive: exports.Theme.colors.primary,
|
|
106
106
|
tableCellBackground: exports.Theme.colors.white,
|
|
107
107
|
tableCellEvenBackground: exports.Theme.colors.gray_4,
|
|
108
108
|
tableCellHoverBackground: (0, polished_1.lighten)(0.3, exports.Theme.colors.primary),
|
|
109
109
|
tableCellActiveBackground: (0, polished_1.lighten)(0.3, exports.Theme.colors.primary),
|
|
110
|
-
|
|
110
|
+
tableCellSortIconActive: exports.Theme.colors.primary,
|
|
111
|
+
tableCellSortIcon: exports.Theme.colors.text,
|
|
111
112
|
tableMoreIconColor: exports.Theme.colors.text,
|
|
112
113
|
tableHoverMoreIconColor: exports.Theme.colors.primary,
|
|
113
114
|
// chips
|
|
@@ -62,19 +62,42 @@ const DropdownMenu = ({ size = 'medium', iconName = 'more_vert', header = false,
|
|
|
62
62
|
footerAction && footerAction();
|
|
63
63
|
close();
|
|
64
64
|
};
|
|
65
|
-
const handleClick = (action) => {
|
|
66
|
-
|
|
65
|
+
const handleClick = (action, disableID) => {
|
|
66
|
+
if (targetID) {
|
|
67
|
+
if (disableID !== targetID) {
|
|
68
|
+
action(targetID);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
action();
|
|
73
|
+
}
|
|
67
74
|
close();
|
|
68
75
|
};
|
|
76
|
+
const isDisable = (disableID) => {
|
|
77
|
+
if (targetID) {
|
|
78
|
+
return targetID === disableID;
|
|
79
|
+
}
|
|
80
|
+
return false;
|
|
81
|
+
};
|
|
69
82
|
(0, react_1.useEffect)(() => {
|
|
83
|
+
const panel = ref.current;
|
|
70
84
|
const handleClickOutside = (event) => {
|
|
71
85
|
if (ref.current && !ref.current.contains(event.target)) {
|
|
72
86
|
close();
|
|
73
87
|
}
|
|
74
88
|
};
|
|
89
|
+
const mouseleave = (e) => {
|
|
90
|
+
close();
|
|
91
|
+
};
|
|
75
92
|
document.addEventListener('click', handleClickOutside, true);
|
|
93
|
+
if (panel) {
|
|
94
|
+
panel.addEventListener('mouseleave', mouseleave);
|
|
95
|
+
}
|
|
76
96
|
return () => {
|
|
77
97
|
document.removeEventListener('click', handleClickOutside, true);
|
|
98
|
+
if (panel) {
|
|
99
|
+
panel.removeEventListener('mouseleave', mouseleave);
|
|
100
|
+
}
|
|
78
101
|
};
|
|
79
102
|
}, [open]);
|
|
80
103
|
return (react_1.default.createElement(DropdownMenu_styles_1.DropdownMenuElement, null,
|
|
@@ -87,7 +110,7 @@ const DropdownMenu = ({ size = 'medium', iconName = 'more_vert', header = false,
|
|
|
87
110
|
headerTitle && (react_1.default.createElement(Typography_1.TextAccent, { color: Theme_1.Theme.colors.text }, headerTitle)),
|
|
88
111
|
headerSubtitle && (react_1.default.createElement(Typography_1.TextLabel, { color: Theme_1.Theme.colors.text }, headerSubtitle)))),
|
|
89
112
|
react_1.default.createElement(DropdownMenu_styles_1.DropdownMenuContent, null, options &&
|
|
90
|
-
options.map((option) => (react_1.default.createElement(DropdownMenu_styles_1.DropdownMenuOption, { key: option.label, onClick: () => handleClick(option.action) }, option.label)))),
|
|
113
|
+
options.map((option) => (react_1.default.createElement(DropdownMenu_styles_1.DropdownMenuOption, { key: option.label, isDisable: isDisable(option.disableID), onClick: () => handleClick(option.action, option.disableID) }, option.label)))),
|
|
91
114
|
footer && (react_1.default.createElement(DropdownMenu_styles_1.DropdownMenuFooter, null, footerText && (react_1.default.createElement(Typography_1.Text, { action: true, onClick: handleFooterAction }, footerText)))))), document.body)));
|
|
92
115
|
};
|
|
93
116
|
exports.DropdownMenu = DropdownMenu;
|
|
@@ -8,36 +8,36 @@ const polished_1 = require("polished");
|
|
|
8
8
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
9
|
const Theme_1 = require("../../Theme");
|
|
10
10
|
exports.DropdownMenuElement = styled_components_1.default.div `
|
|
11
|
-
position:relative;
|
|
12
|
-
width:auto;
|
|
11
|
+
position: relative;
|
|
12
|
+
width: auto;
|
|
13
13
|
display: flex;
|
|
14
14
|
box-sizing: border-box;
|
|
15
|
-
min-width:40px;
|
|
15
|
+
min-width: 40px;
|
|
16
16
|
`;
|
|
17
17
|
exports.DropdownMenuHeader = styled_components_1.default.div `
|
|
18
|
-
border-bottom: 1px solid
|
|
18
|
+
border-bottom: 1px solid ${Theme_1.Theme.colors.gray_3};
|
|
19
19
|
padding: ${Theme_1.Theme.padding.m};
|
|
20
|
-
width:100%;
|
|
20
|
+
width: 100%;
|
|
21
21
|
box-sizing: border-box;
|
|
22
22
|
`;
|
|
23
23
|
exports.DropdownMenuFooter = styled_components_1.default.div `
|
|
24
|
-
border-top: 1px solid
|
|
24
|
+
border-top: 1px solid ${Theme_1.Theme.colors.gray_3};
|
|
25
25
|
padding: ${Theme_1.Theme.padding.m};
|
|
26
|
-
width:100%;
|
|
26
|
+
width: 100%;
|
|
27
27
|
box-sizing: border-box;
|
|
28
28
|
`;
|
|
29
29
|
exports.DropdownMenuContent = styled_components_1.default.div `
|
|
30
|
-
width:100%;
|
|
30
|
+
width: 100%;
|
|
31
31
|
`;
|
|
32
32
|
exports.DropdownMenuOption = styled_components_1.default.div `
|
|
33
33
|
padding: ${Theme_1.Theme.padding.s} ${Theme_1.Theme.padding.m};
|
|
34
|
-
text-align:left;
|
|
35
|
-
min-width:80px;
|
|
36
|
-
cursor: pointer;
|
|
34
|
+
text-align: left;
|
|
35
|
+
min-width: 80px;
|
|
36
|
+
cursor: ${(p) => (p.isDisable ? 'not-allowed' : 'pointer')};
|
|
37
37
|
white-space: nowrap;
|
|
38
|
-
color: ${Theme_1.Theme.colors.text};
|
|
39
|
-
font-size:16px;
|
|
38
|
+
color: ${(p) => (p.isDisable ? Theme_1.Theme.colors.gray_1 : Theme_1.Theme.colors.text)};
|
|
39
|
+
font-size: 16px;
|
|
40
40
|
:hover {
|
|
41
|
-
background-color: ${(0, polished_1.lighten)(0.4, Theme_1.Theme.colors.primary)};
|
|
41
|
+
background-color: ${(p) => p.isDisable ? Theme_1.Theme.colors.gray_4 : (0, polished_1.lighten)(0.4, Theme_1.Theme.colors.primary)};
|
|
42
42
|
}
|
|
43
43
|
`;
|
|
@@ -30,7 +30,7 @@ const ElementHeader = ({ title, actionLabel = '', handleClose, handleClick, hand
|
|
|
30
30
|
else if (!handleClose && handleClick && actionLabel) {
|
|
31
31
|
return (react_1.default.createElement(Aligment_1.Aligment, { align: "center", width: "auto" },
|
|
32
32
|
react_1.default.createElement(Button_1.Button, { mode: "secondary", text: actionLabel, onClick: () => handleClick() }),
|
|
33
|
-
options && (react_1.default.createElement(DropdownMenu_1.DropdownMenu, { options: options, right: true, iconColor: iconColor }))));
|
|
33
|
+
options && (react_1.default.createElement(DropdownMenu_1.DropdownMenu, { options: options, right: true, iconColor: iconColor, position: 'right' }))));
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
return (react_1.default.createElement(ElementHeader_styles_1.ElementHeaderWrapper, { justify: !title && !children ? 'flex-end' : 'space-between', vPadding: Theme_1.Theme.padding.m, hPadding: Theme_1.Theme.padding.l, backgroundColor: backgroundColor, bottomDivader: bottomDivader },
|
|
@@ -5,8 +5,8 @@ exports.iconsPath = {
|
|
|
5
5
|
account: 'M5.85 17.1q1.275-.975 2.85-1.538Q10.275 15 12 15q1.725 0 3.3.562 1.575.563 2.85 1.538.875-1.025 1.363-2.325Q20 13.475 20 12q0-3.325-2.337-5.663Q15.325 4 12 4T6.338 6.337Q4 8.675 4 12q0 1.475.488 2.775.487 1.3 1.362 2.325ZM12 13q-1.475 0-2.488-1.012Q8.5 10.975 8.5 9.5t1.012-2.488Q10.525 6 12 6t2.488 1.012Q15.5 8.025 15.5 9.5t-1.012 2.488Q13.475 13 12 13Zm0 9q-2.075 0-3.9-.788-1.825-.787-3.175-2.137-1.35-1.35-2.137-3.175Q2 14.075 2 12t.788-3.9q.787-1.825 2.137-3.175 1.35-1.35 3.175-2.138Q9.925 2 12 2t3.9.787q1.825.788 3.175 2.138 1.35 1.35 2.137 3.175Q22 9.925 22 12t-.788 3.9q-.787 1.825-2.137 3.175-1.35 1.35-3.175 2.137Q14.075 22 12 22Zm0-2q1.325 0 2.5-.387 1.175-.388 2.15-1.113-.975-.725-2.15-1.113Q13.325 17 12 17t-2.5.387q-1.175.388-2.15 1.113.975.725 2.15 1.113Q10.675 20 12 20Zm0-9q.65 0 1.075-.425.425-.425.425-1.075 0-.65-.425-1.075Q12.65 8 12 8q-.65 0-1.075.425Q10.5 8.85 10.5 9.5q0 .65.425 1.075Q11.35 11 12 11Zm0-1.5Zm0 9Z',
|
|
6
6
|
add: 'M11 19v-6H5v-2h6V5h2v6h6v2h-6v6Z',
|
|
7
7
|
add_circle: 'M11 17h2v-4h4v-2h-4V7h-2v4H7v2h4Zm1 5q-2.075 0-3.9-.788-1.825-.787-3.175-2.137-1.35-1.35-2.137-3.175Q2 14.075 2 12t.788-3.9q.787-1.825 2.137-3.175 1.35-1.35 3.175-2.138Q9.925 2 12 2t3.9.787q1.825.788 3.175 2.138 1.35 1.35 2.137 3.175Q22 9.925 22 12t-.788 3.9q-.787 1.825-2.137 3.175-1.35 1.35-3.175 2.137Q14.075 22 12 22Zm0-2q3.35 0 5.675-2.325Q20 15.35 20 12q0-3.35-2.325-5.675Q15.35 4 12 4 8.65 4 6.325 6.325 4 8.65 4 12q0 3.35 2.325 5.675Q8.65 20 12 20Zm0-8Z',
|
|
8
|
-
arrow_drop_down: '
|
|
9
|
-
arrow_drop_up: '
|
|
8
|
+
arrow_drop_down: 'M12 15L7 10H17L12 15Z',
|
|
9
|
+
arrow_drop_up: 'M7 14L12 9L17 14H7Z',
|
|
10
10
|
back: 'M16 22 6 12 16 2l1.775 1.775L9.55 12l8.225 8.225Z',
|
|
11
11
|
back_arrow: 'm12 20-8-8 8-8 1.425 1.4-5.6 5.6H20v2H7.825l5.6 5.6Z',
|
|
12
12
|
bookmark: 'M5 21V5q0-.825.588-1.413Q6.175 3 7 3h10q.825 0 1.413.587Q19 4.175 19 5v16l-7-3Zm2-3.05 5-2.15 5 2.15V5H7ZM7 5h10-5Z',
|
|
@@ -47,6 +47,8 @@ exports.iconsPath = {
|
|
|
47
47
|
remove: 'M19 13H5V11H19V13Z',
|
|
48
48
|
remove_circle: 'M7 11V13H17V11H7ZM12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.59 20 4 16.41 4 12C4 7.59 7.59 4 12 4C16.41 4 20 7.59 20 12C20 16.41 16.41 20 12 20Z',
|
|
49
49
|
new_tab: 'M5 21C4.45 21 3.97917 20.8042 3.5875 20.4125C3.19583 20.0208 3 19.55 3 19V5C3 4.45 3.19583 3.97917 3.5875 3.5875C3.97917 3.19583 4.45 3 5 3H12V5H5V19H19V12H21V19C21 19.55 20.8042 20.0208 20.4125 20.4125C20.0208 20.8042 19.55 21 19 21H5ZM9.7 15.7L8.3 14.3L17.6 5H14V3H21V10H19V6.4L9.7 15.7Z',
|
|
50
|
+
sort_up: 'M12 13.1178L5.06674 20L4 18.9411L12 11L20 18.9411L18.9333 20L12 13.1178Z',
|
|
51
|
+
sort_down: 'M12 13.0667L4 5.06674L5.06674 4L12 10.9333L18.9333 4L20 5.06674L12 13.0667Z',
|
|
50
52
|
triage: 'M12 7.77L18.39 18H5.61L12 7.77ZM12 4L2 20H22L12 4Z',
|
|
51
53
|
upgrade: 'M8.6 22.5L6.7 19.3L3.1 18.5L3.45 14.8L1 12L3.45 9.2L3.1 5.5L6.7 4.7L8.6 1.5L12 2.95L15.4 1.5L17.3 4.7L20.9 5.5L20.55 9.2L23 12L20.55 14.8L20.9 18.5L17.3 19.3L15.4 22.5L12 21.05L8.6 22.5ZM9.45 19.95L12 18.85L14.6 19.95L16 17.55L18.75 16.9L18.5 14.1L20.35 12L18.5 9.85L18.75 7.05L16 6.45L14.55 4.05L12 5.15L9.4 4.05L8 6.45L5.25 7.05L5.5 9.85L3.65 12L5.5 14.1L5.25 16.95L8 17.55L9.45 19.95ZM10.95 15.55L16.6 9.9L15.2 8.45L10.95 12.7L8.8 10.6L7.4 12L10.95 15.55Z',
|
|
52
54
|
visibility: 'M12 16q1.875 0 3.188-1.312Q16.5 13.375 16.5 11.5q0-1.875-1.312-3.188Q13.875 7 12 7q-1.875 0-3.188 1.312Q7.5 9.625 7.5 11.5q0 1.875 1.312 3.188Q10.125 16 12 16Zm0-1.8q-1.125 0-1.912-.788Q9.3 12.625 9.3 11.5t.788-1.913Q10.875 8.8 12 8.8t1.913.787q.787.788.787 1.913t-.787 1.912q-.788.788-1.913.788Zm0 4.8q-3.65 0-6.65-2.038-3-2.037-4.35-5.462 1.35-3.425 4.35-5.463Q8.35 4 12 4q3.65 0 6.65 2.037 3 2.038 4.35 5.463-1.35 3.425-4.35 5.462Q15.65 19 12 19Zm0-7.5Zm0 5.5q2.825 0 5.188-1.488Q19.55 14.025 20.8 11.5q-1.25-2.525-3.612-4.013Q14.825 6 12 6 9.175 6 6.812 7.487 4.45 8.975 3.2 11.5q1.25 2.525 3.612 4.012Q9.175 17 12 17Z',
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Sort = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const Theme_1 = require("../../Theme");
|
|
9
|
+
const Icons_1 = require("../Icons");
|
|
10
|
+
const Sort_styles_1 = require("./Sort.styles");
|
|
11
|
+
const Sort = ({ theme = Theme_1.mainTheme, handleSort, activeOrder, activeField, }) => {
|
|
12
|
+
return (react_1.default.createElement(Sort_styles_1.SortWrapper, null,
|
|
13
|
+
react_1.default.createElement(Sort_styles_1.SortIcon, { onClick: () => handleSort('desc') },
|
|
14
|
+
react_1.default.createElement(Icons_1.Icon, { name: 'sort_up', iconColor: activeField && activeOrder === 'desc'
|
|
15
|
+
? theme.tableCellSortIconActive
|
|
16
|
+
: theme.tableCellSortIcon, size: 14, noPadding: true, iconBgHoverColor: "transparent", iconHoverColor: activeField && activeOrder === 'deasc'
|
|
17
|
+
? theme.tableCellSortIconActive
|
|
18
|
+
: theme.tableCellSortIcon })),
|
|
19
|
+
react_1.default.createElement(Sort_styles_1.SortIcon, { onClick: () => handleSort('asc') },
|
|
20
|
+
react_1.default.createElement(Icons_1.Icon, { name: 'sort_down', iconColor: activeField && activeOrder === 'asc'
|
|
21
|
+
? theme.tableCellSortIconActive
|
|
22
|
+
: theme.tableCellSortIcon, size: 14, noPadding: true, iconBgHoverColor: "transparent", iconHoverColor: activeField && activeOrder === 'asc'
|
|
23
|
+
? theme.tableCellSortIconActive
|
|
24
|
+
: theme.tableCellSortIcon }))));
|
|
25
|
+
};
|
|
26
|
+
exports.Sort = Sort;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SortIcon = exports.SortWrapper = void 0;
|
|
7
|
+
const Theme_1 = require("../../Theme");
|
|
8
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
9
|
+
exports.SortWrapper = styled_components_1.default.div `
|
|
10
|
+
width:1.6rem;
|
|
11
|
+
height: 32px;
|
|
12
|
+
position: absolute;
|
|
13
|
+
right: 0;
|
|
14
|
+
transition: 300ms;
|
|
15
|
+
top: 0;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
align-items:center;
|
|
20
|
+
`;
|
|
21
|
+
exports.SortIcon = styled_components_1.default.div `
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
:hover {
|
|
25
|
+
background-color: ${Theme_1.mainTheme.iconBgHoverColor};
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Cell = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const Table_styles_1 = require("./Table.styles");
|
|
9
|
+
const DropdownMenu_1 = require("../DropdownMenu");
|
|
10
|
+
const Theme_1 = require("../../Theme");
|
|
11
|
+
const date_fns_1 = require("date-fns");
|
|
12
|
+
const tableHelper_1 = require("./tableHelper");
|
|
13
|
+
const Cell = ({ header, theme = Theme_1.mainTheme, moreActions, item, }) => {
|
|
14
|
+
if (header.action) {
|
|
15
|
+
return (react_1.default.createElement(Table_styles_1.OptionTableCell, null,
|
|
16
|
+
react_1.default.createElement(Table_styles_1.OptionTableCellWrapper, { onClick: (e) => e.stopPropagation() },
|
|
17
|
+
react_1.default.createElement(DropdownMenu_1.DropdownMenu, { options: moreActions, targetID: item.id, iconName: "more_vert", iconColor: theme.tableMoreIconColor, iconHoverColor: theme.tableHoverMoreIconColor, iconBgHoverColor: "transparent", position: "right" }))));
|
|
18
|
+
}
|
|
19
|
+
if (header.scope) {
|
|
20
|
+
return (react_1.default.createElement(Table_styles_1.TableCell, null, (0, tableHelper_1.getValueFormScope)(item[header.valueSource], header.scope)));
|
|
21
|
+
}
|
|
22
|
+
return (react_1.default.createElement(Table_styles_1.TableCell, null, header.date
|
|
23
|
+
? (0, date_fns_1.format)(item[header.valueSource], 'dd-MM-yyyy')
|
|
24
|
+
: header.isCount
|
|
25
|
+
? item[header.valueSource].length
|
|
26
|
+
: item[header.valueSource]));
|
|
27
|
+
};
|
|
28
|
+
exports.Cell = Cell;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.HeaderCell = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const Table_styles_1 = require("./Table.styles");
|
|
9
|
+
const Theme_1 = require("../../Theme");
|
|
10
|
+
const Sort_1 = require("../Sort");
|
|
11
|
+
const HeaderCell = ({ header, sortable, handleSort, theme = Theme_1.mainTheme, sort, }) => {
|
|
12
|
+
if (header.action) {
|
|
13
|
+
return react_1.default.createElement(Table_styles_1.OptionTableHeaderCell, null);
|
|
14
|
+
}
|
|
15
|
+
const setSort = (order) => {
|
|
16
|
+
console.log('setSort', order);
|
|
17
|
+
handleSort(header.valueSource, order);
|
|
18
|
+
};
|
|
19
|
+
return (react_1.default.createElement(Table_styles_1.TableHeaderCell, { sortable: sortable, isSorted: sort.name === header.valueSource && sort.order !== 'none' },
|
|
20
|
+
header.name,
|
|
21
|
+
sortable && react_1.default.createElement(Sort_1.Sort, { handleSort: setSort, activeOrder: sort.order, activeField: sort.name === header.valueSource })));
|
|
22
|
+
};
|
|
23
|
+
exports.HeaderCell = HeaderCell;
|
|
@@ -28,13 +28,10 @@ const react_1 = __importStar(require("react"));
|
|
|
28
28
|
const styled_components_1 = require("styled-components");
|
|
29
29
|
const Table_styles_1 = require("./Table.styles");
|
|
30
30
|
const Theme_1 = require("../../Theme");
|
|
31
|
-
const date_fns_1 = require("date-fns");
|
|
32
|
-
const Icons_1 = require("../Icons");
|
|
33
31
|
const tableHelper_1 = require("./tableHelper");
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
hover = true, selectable = true, sortable = true, sort = {
|
|
32
|
+
const HeaderCell_1 = require("./HeaderCell");
|
|
33
|
+
const Cell_1 = require("./Cell");
|
|
34
|
+
const Table = ({ theme = Theme_1.mainTheme, headers, elements, hover = true, selectable = true, sortable = true, sort = {
|
|
38
35
|
name: '',
|
|
39
36
|
order: 'none',
|
|
40
37
|
}, moreActions = [], onRowClick, }) => {
|
|
@@ -42,7 +39,7 @@ hover = true, selectable = true, sortable = true, sort = {
|
|
|
42
39
|
const tableHeaders = [...headers];
|
|
43
40
|
if (moreActions.length > 0) {
|
|
44
41
|
tableHeaders.push({
|
|
45
|
-
name: '
|
|
42
|
+
name: 'option',
|
|
46
43
|
valueSource: 'empty',
|
|
47
44
|
action: true,
|
|
48
45
|
});
|
|
@@ -67,9 +64,9 @@ hover = true, selectable = true, sortable = true, sort = {
|
|
|
67
64
|
}
|
|
68
65
|
onRowClick && onRowClick(id);
|
|
69
66
|
};
|
|
70
|
-
const handleHeaderCellClick = (targetValue) => {
|
|
67
|
+
const handleHeaderCellClick = (targetValue, order) => {
|
|
71
68
|
if (sortable) {
|
|
72
|
-
const newSort = (0, tableHelper_1.setSortParams)(targetValue, tableProps.sort);
|
|
69
|
+
const newSort = (0, tableHelper_1.setSortParams)(targetValue, order, tableProps.sort);
|
|
73
70
|
setTableProps({
|
|
74
71
|
...tableProps,
|
|
75
72
|
elements: (0, tableHelper_1.applySort)(newSort, tableProps.elements),
|
|
@@ -77,37 +74,12 @@ hover = true, selectable = true, sortable = true, sort = {
|
|
|
77
74
|
});
|
|
78
75
|
}
|
|
79
76
|
};
|
|
80
|
-
// const resetSorting = () => {
|
|
81
|
-
// setTableProps({
|
|
82
|
-
// ...tableProps,
|
|
83
|
-
// elements: setElements(
|
|
84
|
-
// elements,
|
|
85
|
-
// { name: '', order: 'asc' },
|
|
86
|
-
// tableProps.filters,
|
|
87
|
-
// ),
|
|
88
|
-
// sort: {
|
|
89
|
-
// name: '',
|
|
90
|
-
// order: 'asc',
|
|
91
|
-
// },
|
|
92
|
-
// })
|
|
93
|
-
// }
|
|
94
77
|
return (react_1.default.createElement(styled_components_1.ThemeProvider, { theme: theme },
|
|
95
78
|
react_1.default.createElement(Table_styles_1.TableWrapper, { cellPadding: "0", cellSpacing: "0" },
|
|
96
79
|
react_1.default.createElement(Table_styles_1.TableHead, null,
|
|
97
|
-
react_1.default.createElement(Table_styles_1.TableRow, { hover: false, selectable: false, active: false }, tableProps.headers.map((header) => (react_1.default.createElement(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
tableProps.sort.order != 'none' && (react_1.default.createElement(Table_styles_1.TableHeaderSortIcon, null,
|
|
102
|
-
react_1.default.createElement(Icons_1.Icon, { name: tableProps.sort.order === 'asc'
|
|
103
|
-
? 'arrow_drop_down'
|
|
104
|
-
: 'arrow_drop_up', iconColor: theme.tableCellSortIcon, size: 20 })))))))))),
|
|
105
|
-
react_1.default.createElement("tbody", null, tableProps.elements.map((item) => (react_1.default.createElement(Table_styles_1.TableRow, { key: item.id, hover: hover, active: selectedRow === item.id, selectable: selectable, onClick: () => handleRowClick(item.id) }, tableProps.headers.map((header) => (react_1.default.createElement(react_1.default.Fragment, null, header.action ? (react_1.default.createElement(Table_styles_1.OptionTableCell, { key: `${item.id}-${header.name}-action` },
|
|
106
|
-
react_1.default.createElement(Table_styles_1.OptionTableCellWrapper, { onClick: (e) => e.stopPropagation() },
|
|
107
|
-
react_1.default.createElement(DropdownMenu_1.DropdownMenu, { options: moreActions, targetID: item.id, iconName: "more_vert", iconColor: theme.tableMoreIconColor, iconHoverColor: theme.tableHoverMoreIconColor, iconBgHoverColor: "transparent", position: 'right' })))) : (react_1.default.createElement(Table_styles_1.TableCell, { key: `${item.id}-${header.name}` }, header.date
|
|
108
|
-
? (0, date_fns_1.format)(item[header.valueSource], 'dd-MM-yyyy')
|
|
109
|
-
: header.isCount
|
|
110
|
-
? item[header.valueSource].length
|
|
111
|
-
: item[header.valueSource]))))))))))));
|
|
80
|
+
react_1.default.createElement(Table_styles_1.TableRow, { hover: false, selectable: false, active: false }, tableProps.headers.map((header) => (react_1.default.createElement(HeaderCell_1.HeaderCell, { key: `header_${header.name}`, header: header, sortable: sortable, handleSort: handleHeaderCellClick, sort: tableProps.sort }))))),
|
|
81
|
+
react_1.default.createElement("tbody", null, tableProps.elements.map((item) => (react_1.default.createElement(Table_styles_1.TableRow, { key: `table_row_${item.id}`, hover: hover, active: selectedRow === item.id, selectable: selectable, onClick: () => handleRowClick(item.id) }, tableProps.headers.map((header) => {
|
|
82
|
+
return (react_1.default.createElement(Cell_1.Cell, { key: `cell_${header.name}_${item.id}`, header: header, moreActions: moreActions, item: item, theme: theme }));
|
|
83
|
+
}))))))));
|
|
112
84
|
};
|
|
113
85
|
exports.Table = Table;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.OptionTableCellWrapper = exports.OptionTableCell = exports.TableCell = exports.TableRow = exports.
|
|
6
|
+
exports.OptionTableCellWrapper = exports.OptionTableCell = exports.TableCell = exports.TableRow = exports.OptionTableHeaderCell = exports.TableHeaderCell = exports.TableHead = exports.TableWrapper = void 0;
|
|
7
7
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
8
|
exports.TableWrapper = styled_components_1.default.table `
|
|
9
9
|
width: 100%;
|
|
@@ -21,21 +21,10 @@ exports.TableHeaderCell = styled_components_1.default.th `
|
|
|
21
21
|
padding: 8px;
|
|
22
22
|
transition: 300ms;
|
|
23
23
|
font-size: 14px;
|
|
24
|
-
|
|
25
|
-
? p.theme.
|
|
26
|
-
: p.theme.
|
|
24
|
+
color:${(p) => p.isSorted
|
|
25
|
+
? p.theme.tableHeaderActive
|
|
26
|
+
: p.theme.text};
|
|
27
27
|
border-bottom: 1px solid rgba(0, 0, 0, 0.14);
|
|
28
|
-
|
|
29
|
-
:hover {
|
|
30
|
-
background-color: ${(p) => p.isSorted
|
|
31
|
-
? p.theme.tableHeaderActiveBackground
|
|
32
|
-
: p.theme.tableHeaderBackground};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
${(p) => p.sortable &&
|
|
36
|
-
`
|
|
37
|
-
cursor:pointer;
|
|
38
|
-
`}
|
|
39
28
|
position:relative;
|
|
40
29
|
`;
|
|
41
30
|
exports.OptionTableHeaderCell = styled_components_1.default.th `
|
|
@@ -47,14 +36,6 @@ exports.OptionTableHeaderCell = styled_components_1.default.th `
|
|
|
47
36
|
background-color: ${(p) => p.theme.tableHeaderBackground};
|
|
48
37
|
border-bottom: 1px solid rgba(0, 0, 0, 0.14);
|
|
49
38
|
`;
|
|
50
|
-
exports.TableHeaderSortIcon = styled_components_1.default.div `
|
|
51
|
-
width: 20px;
|
|
52
|
-
height: 20px;
|
|
53
|
-
position: absolute;
|
|
54
|
-
right: 0;
|
|
55
|
-
transition: 300ms;
|
|
56
|
-
top: calc(50% - 10px);
|
|
57
|
-
`;
|
|
58
39
|
exports.TableRow = styled_components_1.default.tr `
|
|
59
40
|
background-color: ${(p) => p.active
|
|
60
41
|
? p.theme.tableCellActiveBackground
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setElements = exports.applySort = exports.setSortParams = void 0;
|
|
3
|
+
exports.getValueFormScope = exports.setElements = exports.applySort = exports.setSortParams = void 0;
|
|
4
4
|
const lodash_1 = require("lodash");
|
|
5
5
|
const Filters_1 = require("../Filters");
|
|
6
|
-
const setSortParams = (target, sort) => {
|
|
6
|
+
const setSortParams = (target, order, sort) => {
|
|
7
7
|
const newSort = {
|
|
8
8
|
name: target,
|
|
9
|
-
order:
|
|
9
|
+
order: order,
|
|
10
10
|
};
|
|
11
11
|
return newSort;
|
|
12
12
|
};
|
|
@@ -27,3 +27,7 @@ const setElements = (elements, sort, filters) => {
|
|
|
27
27
|
return tableElements;
|
|
28
28
|
};
|
|
29
29
|
exports.setElements = setElements;
|
|
30
|
+
const getValueFormScope = (item, valuesScope) => {
|
|
31
|
+
return valuesScope.find((_value) => _value.key === item)?.value || '';
|
|
32
|
+
};
|
|
33
|
+
exports.getValueFormScope = getValueFormScope;
|
package/dist/cjs/index.js
CHANGED
|
@@ -33,6 +33,7 @@ __exportStar(require("./components/Modal"), exports);
|
|
|
33
33
|
__exportStar(require("./components/Section"), exports);
|
|
34
34
|
__exportStar(require("./components/Selector"), exports);
|
|
35
35
|
__exportStar(require("./components/Sidepanel"), exports);
|
|
36
|
+
__exportStar(require("./components/Sort"), exports);
|
|
36
37
|
__exportStar(require("./components/Table"), exports);
|
|
37
38
|
__exportStar(require("./components/Tile"), exports);
|
|
38
39
|
__exportStar(require("./components/Toogle"), exports);
|
package/dist/esm/Theme/Theme.js
CHANGED
|
@@ -99,12 +99,13 @@ export const mainTheme = {
|
|
|
99
99
|
//table
|
|
100
100
|
tableBorderColor: Theme.colors.gray_3,
|
|
101
101
|
tableHeaderBackground: Theme.colors.white,
|
|
102
|
-
|
|
102
|
+
tableHeaderActive: Theme.colors.primary,
|
|
103
103
|
tableCellBackground: Theme.colors.white,
|
|
104
104
|
tableCellEvenBackground: Theme.colors.gray_4,
|
|
105
105
|
tableCellHoverBackground: lighten(0.3, Theme.colors.primary),
|
|
106
106
|
tableCellActiveBackground: lighten(0.3, Theme.colors.primary),
|
|
107
|
-
|
|
107
|
+
tableCellSortIconActive: Theme.colors.primary,
|
|
108
|
+
tableCellSortIcon: Theme.colors.text,
|
|
108
109
|
tableMoreIconColor: Theme.colors.text,
|
|
109
110
|
tableHoverMoreIconColor: Theme.colors.primary,
|
|
110
111
|
// chips
|
|
@@ -36,19 +36,42 @@ export const DropdownMenu = ({ size = 'medium', iconName = 'more_vert', header =
|
|
|
36
36
|
footerAction && footerAction();
|
|
37
37
|
close();
|
|
38
38
|
};
|
|
39
|
-
const handleClick = (action) => {
|
|
40
|
-
|
|
39
|
+
const handleClick = (action, disableID) => {
|
|
40
|
+
if (targetID) {
|
|
41
|
+
if (disableID !== targetID) {
|
|
42
|
+
action(targetID);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
action();
|
|
47
|
+
}
|
|
41
48
|
close();
|
|
42
49
|
};
|
|
50
|
+
const isDisable = (disableID) => {
|
|
51
|
+
if (targetID) {
|
|
52
|
+
return targetID === disableID;
|
|
53
|
+
}
|
|
54
|
+
return false;
|
|
55
|
+
};
|
|
43
56
|
useEffect(() => {
|
|
57
|
+
const panel = ref.current;
|
|
44
58
|
const handleClickOutside = (event) => {
|
|
45
59
|
if (ref.current && !ref.current.contains(event.target)) {
|
|
46
60
|
close();
|
|
47
61
|
}
|
|
48
62
|
};
|
|
63
|
+
const mouseleave = (e) => {
|
|
64
|
+
close();
|
|
65
|
+
};
|
|
49
66
|
document.addEventListener('click', handleClickOutside, true);
|
|
67
|
+
if (panel) {
|
|
68
|
+
panel.addEventListener('mouseleave', mouseleave);
|
|
69
|
+
}
|
|
50
70
|
return () => {
|
|
51
71
|
document.removeEventListener('click', handleClickOutside, true);
|
|
72
|
+
if (panel) {
|
|
73
|
+
panel.removeEventListener('mouseleave', mouseleave);
|
|
74
|
+
}
|
|
52
75
|
};
|
|
53
76
|
}, [open]);
|
|
54
77
|
return (React.createElement(DropdownMenuElement, null,
|
|
@@ -61,6 +84,6 @@ export const DropdownMenu = ({ size = 'medium', iconName = 'more_vert', header =
|
|
|
61
84
|
headerTitle && (React.createElement(TextAccent, { color: Theme.colors.text }, headerTitle)),
|
|
62
85
|
headerSubtitle && (React.createElement(TextLabel, { color: Theme.colors.text }, headerSubtitle)))),
|
|
63
86
|
React.createElement(DropdownMenuContent, null, options &&
|
|
64
|
-
options.map((option) => (React.createElement(DropdownMenuOption, { key: option.label, onClick: () => handleClick(option.action) }, option.label)))),
|
|
87
|
+
options.map((option) => (React.createElement(DropdownMenuOption, { key: option.label, isDisable: isDisable(option.disableID), onClick: () => handleClick(option.action, option.disableID) }, option.label)))),
|
|
65
88
|
footer && (React.createElement(DropdownMenuFooter, null, footerText && (React.createElement(Text, { action: true, onClick: handleFooterAction }, footerText)))))), document.body)));
|
|
66
89
|
};
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { lighten } from
|
|
2
|
-
import styled from
|
|
3
|
-
import { Theme } from
|
|
1
|
+
import { lighten } from 'polished';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { Theme } from '../../Theme';
|
|
4
4
|
export const DropdownMenuElement = styled.div `
|
|
5
|
-
position:relative;
|
|
6
|
-
width:auto;
|
|
5
|
+
position: relative;
|
|
6
|
+
width: auto;
|
|
7
7
|
display: flex;
|
|
8
8
|
box-sizing: border-box;
|
|
9
|
-
min-width:40px;
|
|
9
|
+
min-width: 40px;
|
|
10
10
|
`;
|
|
11
11
|
export const DropdownMenuHeader = styled.div `
|
|
12
|
-
border-bottom: 1px solid
|
|
12
|
+
border-bottom: 1px solid ${Theme.colors.gray_3};
|
|
13
13
|
padding: ${Theme.padding.m};
|
|
14
|
-
width:100%;
|
|
14
|
+
width: 100%;
|
|
15
15
|
box-sizing: border-box;
|
|
16
16
|
`;
|
|
17
17
|
export const DropdownMenuFooter = styled.div `
|
|
18
|
-
border-top: 1px solid
|
|
18
|
+
border-top: 1px solid ${Theme.colors.gray_3};
|
|
19
19
|
padding: ${Theme.padding.m};
|
|
20
|
-
width:100%;
|
|
20
|
+
width: 100%;
|
|
21
21
|
box-sizing: border-box;
|
|
22
22
|
`;
|
|
23
23
|
export const DropdownMenuContent = styled.div `
|
|
24
|
-
width:100%;
|
|
24
|
+
width: 100%;
|
|
25
25
|
`;
|
|
26
26
|
export const DropdownMenuOption = styled.div `
|
|
27
27
|
padding: ${Theme.padding.s} ${Theme.padding.m};
|
|
28
|
-
text-align:left;
|
|
29
|
-
min-width:80px;
|
|
30
|
-
cursor: pointer;
|
|
28
|
+
text-align: left;
|
|
29
|
+
min-width: 80px;
|
|
30
|
+
cursor: ${(p) => (p.isDisable ? 'not-allowed' : 'pointer')};
|
|
31
31
|
white-space: nowrap;
|
|
32
|
-
color: ${Theme.colors.text};
|
|
33
|
-
font-size:16px;
|
|
32
|
+
color: ${(p) => (p.isDisable ? Theme.colors.gray_1 : Theme.colors.text)};
|
|
33
|
+
font-size: 16px;
|
|
34
34
|
:hover {
|
|
35
|
-
background-color: ${lighten(0.4, Theme.colors.primary)};
|
|
35
|
+
background-color: ${(p) => p.isDisable ? Theme.colors.gray_4 : lighten(0.4, Theme.colors.primary)};
|
|
36
36
|
}
|
|
37
37
|
`;
|
|
@@ -24,7 +24,7 @@ export const ElementHeader = ({ title, actionLabel = '', handleClose, handleClic
|
|
|
24
24
|
else if (!handleClose && handleClick && actionLabel) {
|
|
25
25
|
return (React.createElement(Aligment, { align: "center", width: "auto" },
|
|
26
26
|
React.createElement(Button, { mode: "secondary", text: actionLabel, onClick: () => handleClick() }),
|
|
27
|
-
options && (React.createElement(DropdownMenu, { options: options, right: true, iconColor: iconColor }))));
|
|
27
|
+
options && (React.createElement(DropdownMenu, { options: options, right: true, iconColor: iconColor, position: 'right' }))));
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
return (React.createElement(ElementHeaderWrapper, { justify: !title && !children ? 'flex-end' : 'space-between', vPadding: Theme.padding.m, hPadding: Theme.padding.l, backgroundColor: backgroundColor, bottomDivader: bottomDivader },
|
|
@@ -2,8 +2,8 @@ export const iconsPath = {
|
|
|
2
2
|
account: 'M5.85 17.1q1.275-.975 2.85-1.538Q10.275 15 12 15q1.725 0 3.3.562 1.575.563 2.85 1.538.875-1.025 1.363-2.325Q20 13.475 20 12q0-3.325-2.337-5.663Q15.325 4 12 4T6.338 6.337Q4 8.675 4 12q0 1.475.488 2.775.487 1.3 1.362 2.325ZM12 13q-1.475 0-2.488-1.012Q8.5 10.975 8.5 9.5t1.012-2.488Q10.525 6 12 6t2.488 1.012Q15.5 8.025 15.5 9.5t-1.012 2.488Q13.475 13 12 13Zm0 9q-2.075 0-3.9-.788-1.825-.787-3.175-2.137-1.35-1.35-2.137-3.175Q2 14.075 2 12t.788-3.9q.787-1.825 2.137-3.175 1.35-1.35 3.175-2.138Q9.925 2 12 2t3.9.787q1.825.788 3.175 2.138 1.35 1.35 2.137 3.175Q22 9.925 22 12t-.788 3.9q-.787 1.825-2.137 3.175-1.35 1.35-3.175 2.137Q14.075 22 12 22Zm0-2q1.325 0 2.5-.387 1.175-.388 2.15-1.113-.975-.725-2.15-1.113Q13.325 17 12 17t-2.5.387q-1.175.388-2.15 1.113.975.725 2.15 1.113Q10.675 20 12 20Zm0-9q.65 0 1.075-.425.425-.425.425-1.075 0-.65-.425-1.075Q12.65 8 12 8q-.65 0-1.075.425Q10.5 8.85 10.5 9.5q0 .65.425 1.075Q11.35 11 12 11Zm0-1.5Zm0 9Z',
|
|
3
3
|
add: 'M11 19v-6H5v-2h6V5h2v6h6v2h-6v6Z',
|
|
4
4
|
add_circle: 'M11 17h2v-4h4v-2h-4V7h-2v4H7v2h4Zm1 5q-2.075 0-3.9-.788-1.825-.787-3.175-2.137-1.35-1.35-2.137-3.175Q2 14.075 2 12t.788-3.9q.787-1.825 2.137-3.175 1.35-1.35 3.175-2.138Q9.925 2 12 2t3.9.787q1.825.788 3.175 2.138 1.35 1.35 2.137 3.175Q22 9.925 22 12t-.788 3.9q-.787 1.825-2.137 3.175-1.35 1.35-3.175 2.137Q14.075 22 12 22Zm0-2q3.35 0 5.675-2.325Q20 15.35 20 12q0-3.35-2.325-5.675Q15.35 4 12 4 8.65 4 6.325 6.325 4 8.65 4 12q0 3.35 2.325 5.675Q8.65 20 12 20Zm0-8Z',
|
|
5
|
-
arrow_drop_down: '
|
|
6
|
-
arrow_drop_up: '
|
|
5
|
+
arrow_drop_down: 'M12 15L7 10H17L12 15Z',
|
|
6
|
+
arrow_drop_up: 'M7 14L12 9L17 14H7Z',
|
|
7
7
|
back: 'M16 22 6 12 16 2l1.775 1.775L9.55 12l8.225 8.225Z',
|
|
8
8
|
back_arrow: 'm12 20-8-8 8-8 1.425 1.4-5.6 5.6H20v2H7.825l5.6 5.6Z',
|
|
9
9
|
bookmark: 'M5 21V5q0-.825.588-1.413Q6.175 3 7 3h10q.825 0 1.413.587Q19 4.175 19 5v16l-7-3Zm2-3.05 5-2.15 5 2.15V5H7ZM7 5h10-5Z',
|
|
@@ -44,6 +44,8 @@ export const iconsPath = {
|
|
|
44
44
|
remove: 'M19 13H5V11H19V13Z',
|
|
45
45
|
remove_circle: 'M7 11V13H17V11H7ZM12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.59 20 4 16.41 4 12C4 7.59 7.59 4 12 4C16.41 4 20 7.59 20 12C20 16.41 16.41 20 12 20Z',
|
|
46
46
|
new_tab: 'M5 21C4.45 21 3.97917 20.8042 3.5875 20.4125C3.19583 20.0208 3 19.55 3 19V5C3 4.45 3.19583 3.97917 3.5875 3.5875C3.97917 3.19583 4.45 3 5 3H12V5H5V19H19V12H21V19C21 19.55 20.8042 20.0208 20.4125 20.4125C20.0208 20.8042 19.55 21 19 21H5ZM9.7 15.7L8.3 14.3L17.6 5H14V3H21V10H19V6.4L9.7 15.7Z',
|
|
47
|
+
sort_up: 'M12 13.1178L5.06674 20L4 18.9411L12 11L20 18.9411L18.9333 20L12 13.1178Z',
|
|
48
|
+
sort_down: 'M12 13.0667L4 5.06674L5.06674 4L12 10.9333L18.9333 4L20 5.06674L12 13.0667Z',
|
|
47
49
|
triage: 'M12 7.77L18.39 18H5.61L12 7.77ZM12 4L2 20H22L12 4Z',
|
|
48
50
|
upgrade: 'M8.6 22.5L6.7 19.3L3.1 18.5L3.45 14.8L1 12L3.45 9.2L3.1 5.5L6.7 4.7L8.6 1.5L12 2.95L15.4 1.5L17.3 4.7L20.9 5.5L20.55 9.2L23 12L20.55 14.8L20.9 18.5L17.3 19.3L15.4 22.5L12 21.05L8.6 22.5ZM9.45 19.95L12 18.85L14.6 19.95L16 17.55L18.75 16.9L18.5 14.1L20.35 12L18.5 9.85L18.75 7.05L16 6.45L14.55 4.05L12 5.15L9.4 4.05L8 6.45L5.25 7.05L5.5 9.85L3.65 12L5.5 14.1L5.25 16.95L8 17.55L9.45 19.95ZM10.95 15.55L16.6 9.9L15.2 8.45L10.95 12.7L8.8 10.6L7.4 12L10.95 15.55Z',
|
|
49
51
|
visibility: 'M12 16q1.875 0 3.188-1.312Q16.5 13.375 16.5 11.5q0-1.875-1.312-3.188Q13.875 7 12 7q-1.875 0-3.188 1.312Q7.5 9.625 7.5 11.5q0 1.875 1.312 3.188Q10.125 16 12 16Zm0-1.8q-1.125 0-1.912-.788Q9.3 12.625 9.3 11.5t.788-1.913Q10.875 8.8 12 8.8t1.913.787q.787.788.787 1.913t-.787 1.912q-.788.788-1.913.788Zm0 4.8q-3.65 0-6.65-2.038-3-2.037-4.35-5.462 1.35-3.425 4.35-5.463Q8.35 4 12 4q3.65 0 6.65 2.037 3 2.038 4.35 5.463-1.35 3.425-4.35 5.462Q15.65 19 12 19Zm0-7.5Zm0 5.5q2.825 0 5.188-1.488Q19.55 14.025 20.8 11.5q-1.25-2.525-3.612-4.013Q14.825 6 12 6 9.175 6 6.812 7.487 4.45 8.975 3.2 11.5q1.25 2.525 3.612 4.012Q9.175 17 12 17Z',
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { mainTheme } from '../../Theme';
|
|
3
|
+
import { Icon } from '../Icons';
|
|
4
|
+
import { SortIcon, SortWrapper } from './Sort.styles';
|
|
5
|
+
export const Sort = ({ theme = mainTheme, handleSort, activeOrder, activeField, }) => {
|
|
6
|
+
return (React.createElement(SortWrapper, null,
|
|
7
|
+
React.createElement(SortIcon, { onClick: () => handleSort('desc') },
|
|
8
|
+
React.createElement(Icon, { name: 'sort_up', iconColor: activeField && activeOrder === 'desc'
|
|
9
|
+
? theme.tableCellSortIconActive
|
|
10
|
+
: theme.tableCellSortIcon, size: 14, noPadding: true, iconBgHoverColor: "transparent", iconHoverColor: activeField && activeOrder === 'deasc'
|
|
11
|
+
? theme.tableCellSortIconActive
|
|
12
|
+
: theme.tableCellSortIcon })),
|
|
13
|
+
React.createElement(SortIcon, { onClick: () => handleSort('asc') },
|
|
14
|
+
React.createElement(Icon, { name: 'sort_down', iconColor: activeField && activeOrder === 'asc'
|
|
15
|
+
? theme.tableCellSortIconActive
|
|
16
|
+
: theme.tableCellSortIcon, size: 14, noPadding: true, iconBgHoverColor: "transparent", iconHoverColor: activeField && activeOrder === 'asc'
|
|
17
|
+
? theme.tableCellSortIconActive
|
|
18
|
+
: theme.tableCellSortIcon }))));
|
|
19
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { mainTheme } from '../../Theme';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
export const SortWrapper = styled.div `
|
|
4
|
+
width:1.6rem;
|
|
5
|
+
height: 32px;
|
|
6
|
+
position: absolute;
|
|
7
|
+
right: 0;
|
|
8
|
+
transition: 300ms;
|
|
9
|
+
top: 0;
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
align-items:center;
|
|
14
|
+
`;
|
|
15
|
+
export const SortIcon = styled.div `
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
:hover {
|
|
19
|
+
background-color: ${mainTheme.iconBgHoverColor};
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Sort } from './Sort';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { OptionTableCell, OptionTableCellWrapper, TableCell, } from './Table.styles';
|
|
3
|
+
import { DropdownMenu } from '../DropdownMenu';
|
|
4
|
+
import { mainTheme } from '../../Theme';
|
|
5
|
+
import { format } from 'date-fns';
|
|
6
|
+
import { getValueFormScope } from './tableHelper';
|
|
7
|
+
export const Cell = ({ header, theme = mainTheme, moreActions, item, }) => {
|
|
8
|
+
if (header.action) {
|
|
9
|
+
return (React.createElement(OptionTableCell, null,
|
|
10
|
+
React.createElement(OptionTableCellWrapper, { onClick: (e) => e.stopPropagation() },
|
|
11
|
+
React.createElement(DropdownMenu, { options: moreActions, targetID: item.id, iconName: "more_vert", iconColor: theme.tableMoreIconColor, iconHoverColor: theme.tableHoverMoreIconColor, iconBgHoverColor: "transparent", position: "right" }))));
|
|
12
|
+
}
|
|
13
|
+
if (header.scope) {
|
|
14
|
+
return (React.createElement(TableCell, null, getValueFormScope(item[header.valueSource], header.scope)));
|
|
15
|
+
}
|
|
16
|
+
return (React.createElement(TableCell, null, header.date
|
|
17
|
+
? format(item[header.valueSource], 'dd-MM-yyyy')
|
|
18
|
+
: header.isCount
|
|
19
|
+
? item[header.valueSource].length
|
|
20
|
+
: item[header.valueSource]));
|
|
21
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { OptionTableHeaderCell, TableHeaderCell } from './Table.styles';
|
|
3
|
+
import { mainTheme } from '../../Theme';
|
|
4
|
+
import { Sort } from '../Sort';
|
|
5
|
+
export const HeaderCell = ({ header, sortable, handleSort, theme = mainTheme, sort, }) => {
|
|
6
|
+
if (header.action) {
|
|
7
|
+
return React.createElement(OptionTableHeaderCell, null);
|
|
8
|
+
}
|
|
9
|
+
const setSort = (order) => {
|
|
10
|
+
console.log('setSort', order);
|
|
11
|
+
handleSort(header.valueSource, order);
|
|
12
|
+
};
|
|
13
|
+
return (React.createElement(TableHeaderCell, { sortable: sortable, isSorted: sort.name === header.valueSource && sort.order !== 'none' },
|
|
14
|
+
header.name,
|
|
15
|
+
sortable && React.createElement(Sort, { handleSort: setSort, activeOrder: sort.order, activeField: sort.name === header.valueSource })));
|
|
16
|
+
};
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { ThemeProvider } from 'styled-components';
|
|
3
|
-
import {
|
|
3
|
+
import { TableHead, TableRow, TableWrapper } from './Table.styles';
|
|
4
4
|
import { mainTheme } from '../../Theme';
|
|
5
|
-
import { format } from 'date-fns';
|
|
6
|
-
import { Icon } from '../Icons';
|
|
7
5
|
import { applySort, setSortParams } from './tableHelper';
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
hover = true, selectable = true, sortable = true, sort = {
|
|
6
|
+
import { HeaderCell } from './HeaderCell';
|
|
7
|
+
import { Cell } from './Cell';
|
|
8
|
+
export const Table = ({ theme = mainTheme, headers, elements, hover = true, selectable = true, sortable = true, sort = {
|
|
12
9
|
name: '',
|
|
13
10
|
order: 'none',
|
|
14
11
|
}, moreActions = [], onRowClick, }) => {
|
|
@@ -16,7 +13,7 @@ hover = true, selectable = true, sortable = true, sort = {
|
|
|
16
13
|
const tableHeaders = [...headers];
|
|
17
14
|
if (moreActions.length > 0) {
|
|
18
15
|
tableHeaders.push({
|
|
19
|
-
name: '
|
|
16
|
+
name: 'option',
|
|
20
17
|
valueSource: 'empty',
|
|
21
18
|
action: true,
|
|
22
19
|
});
|
|
@@ -41,9 +38,9 @@ hover = true, selectable = true, sortable = true, sort = {
|
|
|
41
38
|
}
|
|
42
39
|
onRowClick && onRowClick(id);
|
|
43
40
|
};
|
|
44
|
-
const handleHeaderCellClick = (targetValue) => {
|
|
41
|
+
const handleHeaderCellClick = (targetValue, order) => {
|
|
45
42
|
if (sortable) {
|
|
46
|
-
const newSort = setSortParams(targetValue, tableProps.sort);
|
|
43
|
+
const newSort = setSortParams(targetValue, order, tableProps.sort);
|
|
47
44
|
setTableProps({
|
|
48
45
|
...tableProps,
|
|
49
46
|
elements: applySort(newSort, tableProps.elements),
|
|
@@ -51,36 +48,11 @@ hover = true, selectable = true, sortable = true, sort = {
|
|
|
51
48
|
});
|
|
52
49
|
}
|
|
53
50
|
};
|
|
54
|
-
// const resetSorting = () => {
|
|
55
|
-
// setTableProps({
|
|
56
|
-
// ...tableProps,
|
|
57
|
-
// elements: setElements(
|
|
58
|
-
// elements,
|
|
59
|
-
// { name: '', order: 'asc' },
|
|
60
|
-
// tableProps.filters,
|
|
61
|
-
// ),
|
|
62
|
-
// sort: {
|
|
63
|
-
// name: '',
|
|
64
|
-
// order: 'asc',
|
|
65
|
-
// },
|
|
66
|
-
// })
|
|
67
|
-
// }
|
|
68
51
|
return (React.createElement(ThemeProvider, { theme: theme },
|
|
69
52
|
React.createElement(TableWrapper, { cellPadding: "0", cellSpacing: "0" },
|
|
70
53
|
React.createElement(TableHead, null,
|
|
71
|
-
React.createElement(TableRow, { hover: false, selectable: false, active: false }, tableProps.headers.map((header) => (React.createElement(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
tableProps.sort.order != 'none' && (React.createElement(TableHeaderSortIcon, null,
|
|
76
|
-
React.createElement(Icon, { name: tableProps.sort.order === 'asc'
|
|
77
|
-
? 'arrow_drop_down'
|
|
78
|
-
: 'arrow_drop_up', iconColor: theme.tableCellSortIcon, size: 20 })))))))))),
|
|
79
|
-
React.createElement("tbody", null, tableProps.elements.map((item) => (React.createElement(TableRow, { key: item.id, hover: hover, active: selectedRow === item.id, selectable: selectable, onClick: () => handleRowClick(item.id) }, tableProps.headers.map((header) => (React.createElement(React.Fragment, null, header.action ? (React.createElement(OptionTableCell, { key: `${item.id}-${header.name}-action` },
|
|
80
|
-
React.createElement(OptionTableCellWrapper, { onClick: (e) => e.stopPropagation() },
|
|
81
|
-
React.createElement(DropdownMenu, { options: moreActions, targetID: item.id, iconName: "more_vert", iconColor: theme.tableMoreIconColor, iconHoverColor: theme.tableHoverMoreIconColor, iconBgHoverColor: "transparent", position: 'right' })))) : (React.createElement(TableCell, { key: `${item.id}-${header.name}` }, header.date
|
|
82
|
-
? format(item[header.valueSource], 'dd-MM-yyyy')
|
|
83
|
-
: header.isCount
|
|
84
|
-
? item[header.valueSource].length
|
|
85
|
-
: item[header.valueSource]))))))))))));
|
|
54
|
+
React.createElement(TableRow, { hover: false, selectable: false, active: false }, tableProps.headers.map((header) => (React.createElement(HeaderCell, { key: `header_${header.name}`, header: header, sortable: sortable, handleSort: handleHeaderCellClick, sort: tableProps.sort }))))),
|
|
55
|
+
React.createElement("tbody", null, tableProps.elements.map((item) => (React.createElement(TableRow, { key: `table_row_${item.id}`, hover: hover, active: selectedRow === item.id, selectable: selectable, onClick: () => handleRowClick(item.id) }, tableProps.headers.map((header) => {
|
|
56
|
+
return (React.createElement(Cell, { key: `cell_${header.name}_${item.id}`, header: header, moreActions: moreActions, item: item, theme: theme }));
|
|
57
|
+
}))))))));
|
|
86
58
|
};
|
|
@@ -15,21 +15,10 @@ export const TableHeaderCell = styled.th `
|
|
|
15
15
|
padding: 8px;
|
|
16
16
|
transition: 300ms;
|
|
17
17
|
font-size: 14px;
|
|
18
|
-
|
|
19
|
-
? p.theme.
|
|
20
|
-
: p.theme.
|
|
18
|
+
color:${(p) => p.isSorted
|
|
19
|
+
? p.theme.tableHeaderActive
|
|
20
|
+
: p.theme.text};
|
|
21
21
|
border-bottom: 1px solid rgba(0, 0, 0, 0.14);
|
|
22
|
-
|
|
23
|
-
:hover {
|
|
24
|
-
background-color: ${(p) => p.isSorted
|
|
25
|
-
? p.theme.tableHeaderActiveBackground
|
|
26
|
-
: p.theme.tableHeaderBackground};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
${(p) => p.sortable &&
|
|
30
|
-
`
|
|
31
|
-
cursor:pointer;
|
|
32
|
-
`}
|
|
33
22
|
position:relative;
|
|
34
23
|
`;
|
|
35
24
|
export const OptionTableHeaderCell = styled.th `
|
|
@@ -41,14 +30,6 @@ export const OptionTableHeaderCell = styled.th `
|
|
|
41
30
|
background-color: ${(p) => p.theme.tableHeaderBackground};
|
|
42
31
|
border-bottom: 1px solid rgba(0, 0, 0, 0.14);
|
|
43
32
|
`;
|
|
44
|
-
export const TableHeaderSortIcon = styled.div `
|
|
45
|
-
width: 20px;
|
|
46
|
-
height: 20px;
|
|
47
|
-
position: absolute;
|
|
48
|
-
right: 0;
|
|
49
|
-
transition: 300ms;
|
|
50
|
-
top: calc(50% - 10px);
|
|
51
|
-
`;
|
|
52
33
|
export const TableRow = styled.tr `
|
|
53
34
|
background-color: ${(p) => p.active
|
|
54
35
|
? p.theme.tableCellActiveBackground
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { orderBy } from 'lodash';
|
|
2
2
|
import { applyFiltersToTable } from '../Filters';
|
|
3
|
-
export const setSortParams = (target, sort) => {
|
|
3
|
+
export const setSortParams = (target, order, sort) => {
|
|
4
4
|
const newSort = {
|
|
5
5
|
name: target,
|
|
6
|
-
order:
|
|
6
|
+
order: order,
|
|
7
7
|
};
|
|
8
8
|
return newSort;
|
|
9
9
|
};
|
|
@@ -21,3 +21,6 @@ export const setElements = (elements, sort, filters) => {
|
|
|
21
21
|
}
|
|
22
22
|
return tableElements;
|
|
23
23
|
};
|
|
24
|
+
export const getValueFormScope = (item, valuesScope) => {
|
|
25
|
+
return valuesScope.find((_value) => _value.key === item)?.value || '';
|
|
26
|
+
};
|
package/dist/esm/index.js
CHANGED
|
@@ -17,6 +17,7 @@ export * from './components/Modal';
|
|
|
17
17
|
export * from './components/Section';
|
|
18
18
|
export * from './components/Selector';
|
|
19
19
|
export * from './components/Sidepanel';
|
|
20
|
+
export * from './components/Sort';
|
|
20
21
|
export * from './components/Table';
|
|
21
22
|
export * from './components/Tile';
|
|
22
23
|
export * from './components/Toogle';
|
|
@@ -91,11 +91,12 @@ export declare const mainTheme: {
|
|
|
91
91
|
optionHoverBackground: string;
|
|
92
92
|
tableBorderColor: string;
|
|
93
93
|
tableHeaderBackground: string;
|
|
94
|
-
|
|
94
|
+
tableHeaderActive: string;
|
|
95
95
|
tableCellBackground: string;
|
|
96
96
|
tableCellEvenBackground: string;
|
|
97
97
|
tableCellHoverBackground: string;
|
|
98
98
|
tableCellActiveBackground: string;
|
|
99
|
+
tableCellSortIconActive: string;
|
|
99
100
|
tableCellSortIcon: string;
|
|
100
101
|
tableMoreIconColor: string;
|
|
101
102
|
tableHoverMoreIconColor: string;
|
|
@@ -4,6 +4,7 @@ export declare const DropdownMenuFooter: import("styled-components").StyledCompo
|
|
|
4
4
|
export declare const DropdownMenuContent: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
5
|
interface IPanelOptionStyle {
|
|
6
6
|
onClick?: any;
|
|
7
|
+
isDisable: boolean;
|
|
7
8
|
}
|
|
8
9
|
export declare const DropdownMenuOption: import("styled-components").StyledComponent<"div", any, IPanelOptionStyle, never>;
|
|
9
10
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Sort } from './Sort';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ITableHeaderProps } from './Table';
|
|
3
|
+
import { IAction } from '../../types';
|
|
4
|
+
interface ICell {
|
|
5
|
+
header: ITableHeaderProps;
|
|
6
|
+
theme?: any;
|
|
7
|
+
moreActions: IAction[];
|
|
8
|
+
item: any;
|
|
9
|
+
}
|
|
10
|
+
export declare const Cell: FC<ICell>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ITableHeaderProps, ITableSortProps } from './Table';
|
|
3
|
+
interface IHeaderCell {
|
|
4
|
+
theme?: any;
|
|
5
|
+
header: ITableHeaderProps;
|
|
6
|
+
sortable: boolean;
|
|
7
|
+
handleSort: (targetValue: string, order: string) => void;
|
|
8
|
+
sort: ITableSortProps;
|
|
9
|
+
}
|
|
10
|
+
export declare const HeaderCell: FC<IHeaderCell>;
|
|
11
|
+
export {};
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { IAction } from '../../types';
|
|
3
|
+
export interface ITableScopeProps {
|
|
4
|
+
key: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}
|
|
3
7
|
export interface ITableHeaderProps {
|
|
4
8
|
name: string;
|
|
5
9
|
valueSource: string;
|
|
@@ -7,6 +11,7 @@ export interface ITableHeaderProps {
|
|
|
7
11
|
date?: boolean;
|
|
8
12
|
action?: boolean;
|
|
9
13
|
isCount?: boolean;
|
|
14
|
+
scope?: ITableScopeProps[];
|
|
10
15
|
}
|
|
11
16
|
export interface ITableSortProps {
|
|
12
17
|
name: string;
|
|
@@ -3,12 +3,10 @@ export declare const TableHead: import("styled-components").StyledComponent<"the
|
|
|
3
3
|
interface ITableHeaderCellProps {
|
|
4
4
|
theme: any;
|
|
5
5
|
sortable: boolean;
|
|
6
|
-
onClick: (targetValue: string) => void;
|
|
7
6
|
isSorted: boolean;
|
|
8
7
|
}
|
|
9
8
|
export declare const TableHeaderCell: import("styled-components").StyledComponent<"th", any, ITableHeaderCellProps, never>;
|
|
10
9
|
export declare const OptionTableHeaderCell: import("styled-components").StyledComponent<"th", any, {}, never>;
|
|
11
|
-
export declare const TableHeaderSortIcon: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
12
10
|
interface ITableRowProps {
|
|
13
11
|
hover: boolean;
|
|
14
12
|
onClick?: (id: string) => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IApplyFilterResults } from '../Filters';
|
|
2
|
-
import { ITableSortProps } from './Table';
|
|
3
|
-
export declare const setSortParams: (target: string, sort: ITableSortProps) => ITableSortProps;
|
|
2
|
+
import { ITableScopeProps, ITableSortProps } from './Table';
|
|
3
|
+
export declare const setSortParams: (target: string, order: string, sort: ITableSortProps) => ITableSortProps;
|
|
4
4
|
export declare const applySort: (sort: ITableSortProps, elements: any) => any;
|
|
5
5
|
export declare const setElements: (elements: any, sort: ITableSortProps, filters: IApplyFilterResults[]) => any;
|
|
6
|
+
export declare const getValueFormScope: (item: string, valuesScope: ITableScopeProps[]) => string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export * from './components/Modal';
|
|
|
17
17
|
export * from './components/Section';
|
|
18
18
|
export * from './components/Selector';
|
|
19
19
|
export * from './components/Sidepanel';
|
|
20
|
+
export * from './components/Sort';
|
|
20
21
|
export * from './components/Table';
|
|
21
22
|
export * from './components/Tile';
|
|
22
23
|
export * from './components/Toogle';
|