venice-ui 3.0.53 → 3.0.55
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 +33 -6
- package/dist/cjs/components/Table/Table.styles.js +28 -4
- package/dist/cjs/config/config.js +19 -0
- package/dist/esm/components/Table/Table.js +34 -7
- package/dist/esm/components/Table/Table.styles.js +27 -3
- package/dist/esm/config/config.js +19 -0
- package/dist/types/components/Table/Table.d.ts +4 -1
- package/dist/types/components/Table/Table.styles.d.ts +5 -0
- package/dist/types/config/config.d.ts +57 -0
- package/package.json +1 -1
|
@@ -44,16 +44,18 @@ const Filters_1 = require("../Filters");
|
|
|
44
44
|
const Pagination_1 = require("../Pagination");
|
|
45
45
|
const HeaderCell_1 = require("./HeaderCell");
|
|
46
46
|
const Cell_1 = require("./Cell");
|
|
47
|
+
const SearchInput_1 = require("../SearchInput");
|
|
47
48
|
const Table = ({ theme, themeVariant = 'default', headers, elements, hover = true, selectable = true, filtrable = false, pagination = false, sortable = true, sort = {
|
|
48
49
|
name: '',
|
|
49
50
|
order: 'none',
|
|
50
|
-
}, pageSize = 20, moreActions = [], onRowClick, filterLabels, paginationCounters, tableHeight, tableWrapperHeight, paginationLabel, calendarLabels, calendarLocaleLabels, paginationZIndex, }) => {
|
|
51
|
+
}, pageSize = 20, moreActions = [], onRowClick, filterLabels, paginationCounters, tableHeight, tableWrapperHeight, paginationLabel, calendarLabels, calendarLocaleLabels, paginationZIndex, headerExtraContent, searchable = true, searchInputPlaceholder = config_2.wordbook.searchInput.placeholder, }) => {
|
|
51
52
|
const resolvedThemeData = (0, config_1.resolveThemeWithComponentsConfig)({
|
|
52
53
|
theme,
|
|
53
54
|
themeVariant,
|
|
54
55
|
});
|
|
55
56
|
const resolvedTheme = resolvedThemeData.resolvedTheme;
|
|
56
57
|
const { componentsConfig } = resolvedThemeData;
|
|
58
|
+
const [searchValue, setSearchValue] = (0, react_1.useState)('');
|
|
57
59
|
const tableConfig = componentsConfig.table;
|
|
58
60
|
const tableHeaders = (0, react_1.useMemo)(() => {
|
|
59
61
|
const nextHeaders = [...headers];
|
|
@@ -116,16 +118,41 @@ const Table = ({ theme, themeVariant = 'default', headers, elements, hover = tru
|
|
|
116
118
|
const paginatedElements = (0, react_1.useMemo)(() => {
|
|
117
119
|
return tableElementsState.slice((currentPage - 1) * currentPageSize, currentPage * currentPageSize);
|
|
118
120
|
}, [tableElementsState, currentPage, currentPageSize]);
|
|
119
|
-
const
|
|
121
|
+
const handleSearchChange = (value) => {
|
|
122
|
+
setSearchValue(value);
|
|
123
|
+
};
|
|
124
|
+
const getVisableElements = () => {
|
|
125
|
+
const visable = pagination ? paginatedElements : tableElementsState;
|
|
126
|
+
if (searchValue) {
|
|
127
|
+
const searchValueLower = searchValue.toLowerCase();
|
|
128
|
+
return visable.filter((item) => {
|
|
129
|
+
return tableHeaders.some((header) => {
|
|
130
|
+
const value = item[header.valueSource];
|
|
131
|
+
if (value && typeof value === 'string') {
|
|
132
|
+
return value.toLowerCase().includes(searchValueLower);
|
|
133
|
+
}
|
|
134
|
+
else if (value && typeof value === 'number') {
|
|
135
|
+
return value.toString().toLowerCase().includes(searchValueLower);
|
|
136
|
+
}
|
|
137
|
+
return false;
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
return visable;
|
|
142
|
+
};
|
|
143
|
+
const visibleElements = getVisableElements();
|
|
120
144
|
return (react_1.default.createElement(styled_components_1.ThemeProvider, { theme: resolvedTheme },
|
|
121
145
|
react_1.default.createElement(Table_styles_1.TableRoot, { theme: resolvedTheme, config: tableConfig, componentHeight: tableWrapperHeight },
|
|
122
146
|
react_1.default.createElement(react_1.default.Fragment, null,
|
|
123
147
|
(filtrable || pagination) && (react_1.default.createElement(Table_styles_1.TableHeader, { theme: resolvedTheme, config: tableConfig, right: pagination && !filtrable },
|
|
124
148
|
react_1.default.createElement(react_1.default.Fragment, null,
|
|
125
|
-
filtrable && (react_1.default.createElement(Table_styles_1.HeaderSection, null,
|
|
126
|
-
react_1.default.createElement(Filters_1.Filters, { labels: filterLabels, headers: headers, elements: fullElements, fullElements: fullElements, handleSubmitFilters: handleApplyFilters, externalClearSignal: filtersClearSignal, onClear: handleClearFilters, calendarLabels: calendarLabels, calendarLocaleLabels: calendarLocaleLabels }))
|
|
127
|
-
|
|
128
|
-
|
|
149
|
+
(filtrable || headerExtraContent) && (react_1.default.createElement(Table_styles_1.HeaderSection, null,
|
|
150
|
+
filtrable && (react_1.default.createElement(Filters_1.Filters, { labels: filterLabels, headers: headers, elements: fullElements, fullElements: fullElements, handleSubmitFilters: handleApplyFilters, externalClearSignal: filtersClearSignal, onClear: handleClearFilters, calendarLabels: calendarLabels, calendarLocaleLabels: calendarLocaleLabels })),
|
|
151
|
+
headerExtraContent && (react_1.default.createElement(Table_styles_1.HeaderSection, null, headerExtraContent)))),
|
|
152
|
+
(pagination || searchable) && (react_1.default.createElement(Table_styles_1.HeaderSection, { right: true },
|
|
153
|
+
searchable && (react_1.default.createElement(Table_styles_1.TableSearch, { theme: resolvedTheme, config: tableConfig },
|
|
154
|
+
react_1.default.createElement(SearchInput_1.SearchInput, { placeholder: searchInputPlaceholder, handleSearch: handleSearchChange }))),
|
|
155
|
+
pagination && (react_1.default.createElement(Pagination_1.Pagination, { currentPage: currentPage, totalPages: totalPages, pageSize: currentPageSize, onPageChange: setCurrentPage, onPageSizeChange: setCurrentPageSize, label: paginationLabel?.label, availableValues: paginationCounters, zIndex: paginationZIndex }))))))),
|
|
129
156
|
react_1.default.createElement(Table_styles_1.TableContentWrapper, { componentHeight: tableHeight },
|
|
130
157
|
react_1.default.createElement(Table_styles_1.TableContent, { theme: resolvedTheme, config: tableConfig, cellPadding: "0", cellSpacing: "0" },
|
|
131
158
|
react_1.default.createElement(Table_styles_1.TableHead, null,
|
|
@@ -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.TableCellContent = exports.TableCell = exports.TableRow = exports.OptionTableCellWrapper = exports.OptionTableCell = exports.IconTableHeaderCell = exports.OptionTableHeaderCell = exports.HeaderCellContent = exports.TableHeaderCell = exports.TableHeaderRow = exports.TableBody = exports.TableHead = exports.TableContent = exports.HeaderSection = exports.TableContentWrapper = exports.TableHeader = exports.TableRoot = void 0;
|
|
6
|
+
exports.TableSearch = exports.TableCellContent = exports.TableCell = exports.TableRow = exports.OptionTableCellWrapper = exports.OptionTableCell = exports.IconTableHeaderCell = exports.OptionTableHeaderCell = exports.HeaderCellContent = exports.TableHeaderCell = exports.TableHeaderRow = exports.TableBody = exports.TableHead = exports.TableContent = exports.HeaderSection = exports.TableContentWrapper = exports.TableHeader = exports.TableRoot = void 0;
|
|
7
7
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
8
|
exports.TableRoot = styled_components_1.default.div `
|
|
9
9
|
display: flex;
|
|
@@ -15,7 +15,8 @@ exports.TableHeader = styled_components_1.default.div `
|
|
|
15
15
|
display: flex;
|
|
16
16
|
align-items: center;
|
|
17
17
|
flex-shrink: 0;
|
|
18
|
-
justify-content: ${({ right }) => (right ? 'flex-end' : 'flex-start')};
|
|
18
|
+
// justify-content: ${({ right }) => (right ? 'flex-end' : 'flex-start')};
|
|
19
|
+
justify-content: space-between;
|
|
19
20
|
height: ${({ theme, config }) => config.size.header.height}px;
|
|
20
21
|
`;
|
|
21
22
|
exports.TableContentWrapper = styled_components_1.default.div `
|
|
@@ -33,8 +34,8 @@ exports.HeaderSection = styled_components_1.default.div `
|
|
|
33
34
|
display: flex;
|
|
34
35
|
align-items: center;
|
|
35
36
|
justify-content: ${({ right }) => (right ? 'flex-end' : 'flex-start')};
|
|
36
|
-
width: 50%;
|
|
37
37
|
flex-shrink: 0;
|
|
38
|
+
gap: 8px;
|
|
38
39
|
`;
|
|
39
40
|
exports.TableContent = styled_components_1.default.table `
|
|
40
41
|
box-sizing: border-box;
|
|
@@ -59,7 +60,7 @@ exports.TableHead = styled_components_1.default.thead `
|
|
|
59
60
|
position: sticky;
|
|
60
61
|
top: 0;
|
|
61
62
|
z-index: 2;
|
|
62
|
-
}
|
|
63
|
+
}
|
|
63
64
|
flex-shrink: 0;
|
|
64
65
|
`;
|
|
65
66
|
exports.TableBody = styled_components_1.default.tbody `
|
|
@@ -182,3 +183,26 @@ exports.TableCellContent = styled_components_1.default.div `
|
|
|
182
183
|
color: ${({ theme, config, disabled }) => disabled ? config.color.disabled.text : config.color.default.header.text};
|
|
183
184
|
width: 100%;
|
|
184
185
|
`;
|
|
186
|
+
exports.TableSearch = styled_components_1.default.div `
|
|
187
|
+
width: 100%;
|
|
188
|
+
appearance: textfield;
|
|
189
|
+
padding: 0px ${({ config }) => config.size.searchInput.paddingX}px;
|
|
190
|
+
height: ${({ config }) => config.size.searchInput.height}px;
|
|
191
|
+
border-radius: ${({ config }) => config.size.searchInput.radius}px;
|
|
192
|
+
font-size: ${({ config }) => config.size.searchInput.fontSize}px;
|
|
193
|
+
line-height: ${({ config }) => config.size.searchInput.lineHeight}px;
|
|
194
|
+
flex-direction: row;
|
|
195
|
+
-webkit-box-align: center;
|
|
196
|
+
align-items: center;
|
|
197
|
+
overflow: hidden;
|
|
198
|
+
width: 100%;
|
|
199
|
+
color: ${({ theme, config }) => config.color.default.searchInput.text};
|
|
200
|
+
border: 1px solid ${({ theme, config }) => config.color.default.searchInput.border};
|
|
201
|
+
background: ${({ theme, config }) => config.color.default.searchInput.background};
|
|
202
|
+
box-sizing: border-box;
|
|
203
|
+
:hover {
|
|
204
|
+
border-color: ${({ theme, config }) => config.color.hover.searchInput.border};
|
|
205
|
+
&:focus-within {
|
|
206
|
+
border-color: ${({ theme, config }) => config.color.active.searchInput.border};
|
|
207
|
+
}
|
|
208
|
+
`;
|
|
@@ -1420,6 +1420,13 @@ const createComponentsConfig = (theme = 'default') => {
|
|
|
1420
1420
|
},
|
|
1421
1421
|
},
|
|
1422
1422
|
},
|
|
1423
|
+
searchInput: {
|
|
1424
|
+
height: exports.measurements.space.xl4,
|
|
1425
|
+
paddingX: exports.measurements.space.sm,
|
|
1426
|
+
radius: exports.measurements.size.radius.sm,
|
|
1427
|
+
fontSize: exports.measurements.font.size.sm,
|
|
1428
|
+
lineHeight: exports.measurements.font.lineHeight.sm,
|
|
1429
|
+
}
|
|
1423
1430
|
},
|
|
1424
1431
|
color: {
|
|
1425
1432
|
default: {
|
|
@@ -1432,10 +1439,19 @@ const createComponentsConfig = (theme = 'default') => {
|
|
|
1432
1439
|
text: Theme.text.primary,
|
|
1433
1440
|
sortIcon: Theme.text.primary,
|
|
1434
1441
|
},
|
|
1442
|
+
searchInput: {
|
|
1443
|
+
background: Theme.surface.default,
|
|
1444
|
+
border: Theme.border.default,
|
|
1445
|
+
text: Theme.text.primary,
|
|
1446
|
+
placeholder: Theme.text.placeholder,
|
|
1447
|
+
}
|
|
1435
1448
|
},
|
|
1436
1449
|
hover: {
|
|
1437
1450
|
background: Theme.surface.hover,
|
|
1438
1451
|
activeBackground: Theme.action.primary.selectedHover,
|
|
1452
|
+
searchInput: {
|
|
1453
|
+
border: Theme.border.strong,
|
|
1454
|
+
}
|
|
1439
1455
|
},
|
|
1440
1456
|
active: {
|
|
1441
1457
|
background: Theme.action.primary.selected,
|
|
@@ -1443,6 +1459,9 @@ const createComponentsConfig = (theme = 'default') => {
|
|
|
1443
1459
|
textHeader: Theme.action.primary.default,
|
|
1444
1460
|
sortIcon: Theme.action.primary.default,
|
|
1445
1461
|
},
|
|
1462
|
+
searchInput: {
|
|
1463
|
+
border: Theme.border.focus,
|
|
1464
|
+
}
|
|
1446
1465
|
},
|
|
1447
1466
|
disabled: {
|
|
1448
1467
|
text: Theme.text.disabled,
|
|
@@ -3,21 +3,23 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
|
3
3
|
import { applySort, setSortParams } from './tableHelper';
|
|
4
4
|
import { wordbook } from '../../config';
|
|
5
5
|
import { ThemeProvider } from 'styled-components';
|
|
6
|
-
import { HeaderSection, TableBody, TableContent, TableContentWrapper, TableHead, TableHeader, TableHeaderRow, TableRoot, TableRow, } from './Table.styles';
|
|
6
|
+
import { HeaderSection, TableBody, TableContent, TableContentWrapper, TableHead, TableHeader, TableHeaderRow, TableRoot, TableRow, TableSearch, } from './Table.styles';
|
|
7
7
|
import { Filters } from '../Filters';
|
|
8
8
|
import { Pagination } from '../Pagination';
|
|
9
9
|
import { HeaderCell } from './HeaderCell';
|
|
10
10
|
import { Cell } from './Cell';
|
|
11
|
+
import { SearchInput } from '../SearchInput';
|
|
11
12
|
export const Table = ({ theme, themeVariant = 'default', headers, elements, hover = true, selectable = true, filtrable = false, pagination = false, sortable = true, sort = {
|
|
12
13
|
name: '',
|
|
13
14
|
order: 'none',
|
|
14
|
-
}, pageSize = 20, moreActions = [], onRowClick, filterLabels, paginationCounters, tableHeight, tableWrapperHeight, paginationLabel, calendarLabels, calendarLocaleLabels, paginationZIndex, }) => {
|
|
15
|
+
}, pageSize = 20, moreActions = [], onRowClick, filterLabels, paginationCounters, tableHeight, tableWrapperHeight, paginationLabel, calendarLabels, calendarLocaleLabels, paginationZIndex, headerExtraContent, searchable = true, searchInputPlaceholder = wordbook.searchInput.placeholder, }) => {
|
|
15
16
|
const resolvedThemeData = resolveThemeWithComponentsConfig({
|
|
16
17
|
theme,
|
|
17
18
|
themeVariant,
|
|
18
19
|
});
|
|
19
20
|
const resolvedTheme = resolvedThemeData.resolvedTheme;
|
|
20
21
|
const { componentsConfig } = resolvedThemeData;
|
|
22
|
+
const [searchValue, setSearchValue] = useState('');
|
|
21
23
|
const tableConfig = componentsConfig.table;
|
|
22
24
|
const tableHeaders = useMemo(() => {
|
|
23
25
|
const nextHeaders = [...headers];
|
|
@@ -80,16 +82,41 @@ export const Table = ({ theme, themeVariant = 'default', headers, elements, hove
|
|
|
80
82
|
const paginatedElements = useMemo(() => {
|
|
81
83
|
return tableElementsState.slice((currentPage - 1) * currentPageSize, currentPage * currentPageSize);
|
|
82
84
|
}, [tableElementsState, currentPage, currentPageSize]);
|
|
83
|
-
const
|
|
85
|
+
const handleSearchChange = (value) => {
|
|
86
|
+
setSearchValue(value);
|
|
87
|
+
};
|
|
88
|
+
const getVisableElements = () => {
|
|
89
|
+
const visable = pagination ? paginatedElements : tableElementsState;
|
|
90
|
+
if (searchValue) {
|
|
91
|
+
const searchValueLower = searchValue.toLowerCase();
|
|
92
|
+
return visable.filter((item) => {
|
|
93
|
+
return tableHeaders.some((header) => {
|
|
94
|
+
const value = item[header.valueSource];
|
|
95
|
+
if (value && typeof value === 'string') {
|
|
96
|
+
return value.toLowerCase().includes(searchValueLower);
|
|
97
|
+
}
|
|
98
|
+
else if (value && typeof value === 'number') {
|
|
99
|
+
return value.toString().toLowerCase().includes(searchValueLower);
|
|
100
|
+
}
|
|
101
|
+
return false;
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
return visable;
|
|
106
|
+
};
|
|
107
|
+
const visibleElements = getVisableElements();
|
|
84
108
|
return (React.createElement(ThemeProvider, { theme: resolvedTheme },
|
|
85
109
|
React.createElement(TableRoot, { theme: resolvedTheme, config: tableConfig, componentHeight: tableWrapperHeight },
|
|
86
110
|
React.createElement(React.Fragment, null,
|
|
87
111
|
(filtrable || pagination) && (React.createElement(TableHeader, { theme: resolvedTheme, config: tableConfig, right: pagination && !filtrable },
|
|
88
112
|
React.createElement(React.Fragment, null,
|
|
89
|
-
filtrable && (React.createElement(HeaderSection, null,
|
|
90
|
-
React.createElement(Filters, { labels: filterLabels, headers: headers, elements: fullElements, fullElements: fullElements, handleSubmitFilters: handleApplyFilters, externalClearSignal: filtersClearSignal, onClear: handleClearFilters, calendarLabels: calendarLabels, calendarLocaleLabels: calendarLocaleLabels }))
|
|
91
|
-
|
|
92
|
-
|
|
113
|
+
(filtrable || headerExtraContent) && (React.createElement(HeaderSection, null,
|
|
114
|
+
filtrable && (React.createElement(Filters, { labels: filterLabels, headers: headers, elements: fullElements, fullElements: fullElements, handleSubmitFilters: handleApplyFilters, externalClearSignal: filtersClearSignal, onClear: handleClearFilters, calendarLabels: calendarLabels, calendarLocaleLabels: calendarLocaleLabels })),
|
|
115
|
+
headerExtraContent && (React.createElement(HeaderSection, null, headerExtraContent)))),
|
|
116
|
+
(pagination || searchable) && (React.createElement(HeaderSection, { right: true },
|
|
117
|
+
searchable && (React.createElement(TableSearch, { theme: resolvedTheme, config: tableConfig },
|
|
118
|
+
React.createElement(SearchInput, { placeholder: searchInputPlaceholder, handleSearch: handleSearchChange }))),
|
|
119
|
+
pagination && (React.createElement(Pagination, { currentPage: currentPage, totalPages: totalPages, pageSize: currentPageSize, onPageChange: setCurrentPage, onPageSizeChange: setCurrentPageSize, label: paginationLabel?.label, availableValues: paginationCounters, zIndex: paginationZIndex }))))))),
|
|
93
120
|
React.createElement(TableContentWrapper, { componentHeight: tableHeight },
|
|
94
121
|
React.createElement(TableContent, { theme: resolvedTheme, config: tableConfig, cellPadding: "0", cellSpacing: "0" },
|
|
95
122
|
React.createElement(TableHead, null,
|
|
@@ -9,7 +9,8 @@ export const TableHeader = styled.div `
|
|
|
9
9
|
display: flex;
|
|
10
10
|
align-items: center;
|
|
11
11
|
flex-shrink: 0;
|
|
12
|
-
justify-content: ${({ right }) => (right ? 'flex-end' : 'flex-start')};
|
|
12
|
+
// justify-content: ${({ right }) => (right ? 'flex-end' : 'flex-start')};
|
|
13
|
+
justify-content: space-between;
|
|
13
14
|
height: ${({ theme, config }) => config.size.header.height}px;
|
|
14
15
|
`;
|
|
15
16
|
export const TableContentWrapper = styled.div `
|
|
@@ -27,8 +28,8 @@ export const HeaderSection = styled.div `
|
|
|
27
28
|
display: flex;
|
|
28
29
|
align-items: center;
|
|
29
30
|
justify-content: ${({ right }) => (right ? 'flex-end' : 'flex-start')};
|
|
30
|
-
width: 50%;
|
|
31
31
|
flex-shrink: 0;
|
|
32
|
+
gap: 8px;
|
|
32
33
|
`;
|
|
33
34
|
export const TableContent = styled.table `
|
|
34
35
|
box-sizing: border-box;
|
|
@@ -53,7 +54,7 @@ export const TableHead = styled.thead `
|
|
|
53
54
|
position: sticky;
|
|
54
55
|
top: 0;
|
|
55
56
|
z-index: 2;
|
|
56
|
-
}
|
|
57
|
+
}
|
|
57
58
|
flex-shrink: 0;
|
|
58
59
|
`;
|
|
59
60
|
export const TableBody = styled.tbody `
|
|
@@ -176,3 +177,26 @@ export const TableCellContent = styled.div `
|
|
|
176
177
|
color: ${({ theme, config, disabled }) => disabled ? config.color.disabled.text : config.color.default.header.text};
|
|
177
178
|
width: 100%;
|
|
178
179
|
`;
|
|
180
|
+
export const TableSearch = styled.div `
|
|
181
|
+
width: 100%;
|
|
182
|
+
appearance: textfield;
|
|
183
|
+
padding: 0px ${({ config }) => config.size.searchInput.paddingX}px;
|
|
184
|
+
height: ${({ config }) => config.size.searchInput.height}px;
|
|
185
|
+
border-radius: ${({ config }) => config.size.searchInput.radius}px;
|
|
186
|
+
font-size: ${({ config }) => config.size.searchInput.fontSize}px;
|
|
187
|
+
line-height: ${({ config }) => config.size.searchInput.lineHeight}px;
|
|
188
|
+
flex-direction: row;
|
|
189
|
+
-webkit-box-align: center;
|
|
190
|
+
align-items: center;
|
|
191
|
+
overflow: hidden;
|
|
192
|
+
width: 100%;
|
|
193
|
+
color: ${({ theme, config }) => config.color.default.searchInput.text};
|
|
194
|
+
border: 1px solid ${({ theme, config }) => config.color.default.searchInput.border};
|
|
195
|
+
background: ${({ theme, config }) => config.color.default.searchInput.background};
|
|
196
|
+
box-sizing: border-box;
|
|
197
|
+
:hover {
|
|
198
|
+
border-color: ${({ theme, config }) => config.color.hover.searchInput.border};
|
|
199
|
+
&:focus-within {
|
|
200
|
+
border-color: ${({ theme, config }) => config.color.active.searchInput.border};
|
|
201
|
+
}
|
|
202
|
+
`;
|
|
@@ -1415,6 +1415,13 @@ export const createComponentsConfig = (theme = 'default') => {
|
|
|
1415
1415
|
},
|
|
1416
1416
|
},
|
|
1417
1417
|
},
|
|
1418
|
+
searchInput: {
|
|
1419
|
+
height: measurements.space.xl4,
|
|
1420
|
+
paddingX: measurements.space.sm,
|
|
1421
|
+
radius: measurements.size.radius.sm,
|
|
1422
|
+
fontSize: measurements.font.size.sm,
|
|
1423
|
+
lineHeight: measurements.font.lineHeight.sm,
|
|
1424
|
+
}
|
|
1418
1425
|
},
|
|
1419
1426
|
color: {
|
|
1420
1427
|
default: {
|
|
@@ -1427,10 +1434,19 @@ export const createComponentsConfig = (theme = 'default') => {
|
|
|
1427
1434
|
text: Theme.text.primary,
|
|
1428
1435
|
sortIcon: Theme.text.primary,
|
|
1429
1436
|
},
|
|
1437
|
+
searchInput: {
|
|
1438
|
+
background: Theme.surface.default,
|
|
1439
|
+
border: Theme.border.default,
|
|
1440
|
+
text: Theme.text.primary,
|
|
1441
|
+
placeholder: Theme.text.placeholder,
|
|
1442
|
+
}
|
|
1430
1443
|
},
|
|
1431
1444
|
hover: {
|
|
1432
1445
|
background: Theme.surface.hover,
|
|
1433
1446
|
activeBackground: Theme.action.primary.selectedHover,
|
|
1447
|
+
searchInput: {
|
|
1448
|
+
border: Theme.border.strong,
|
|
1449
|
+
}
|
|
1434
1450
|
},
|
|
1435
1451
|
active: {
|
|
1436
1452
|
background: Theme.action.primary.selected,
|
|
@@ -1438,6 +1454,9 @@ export const createComponentsConfig = (theme = 'default') => {
|
|
|
1438
1454
|
textHeader: Theme.action.primary.default,
|
|
1439
1455
|
sortIcon: Theme.action.primary.default,
|
|
1440
1456
|
},
|
|
1457
|
+
searchInput: {
|
|
1458
|
+
border: Theme.border.focus,
|
|
1459
|
+
}
|
|
1441
1460
|
},
|
|
1442
1461
|
disabled: {
|
|
1443
1462
|
text: Theme.text.disabled,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AppTheme, ThemeName } from '../../config';
|
|
2
|
-
import { FC } from 'react';
|
|
2
|
+
import React, { FC } from 'react';
|
|
3
3
|
import { FilterType, IAction, ICalendarLocaleLabels, IFilterLabels, InputSize } from 'types';
|
|
4
4
|
interface ITableProps {
|
|
5
5
|
theme?: AppTheme;
|
|
@@ -23,6 +23,9 @@ interface ITableProps {
|
|
|
23
23
|
calendarLabels?: IFilterLabels;
|
|
24
24
|
calendarLocaleLabels?: ICalendarLocaleLabels;
|
|
25
25
|
paginationZIndex?: number;
|
|
26
|
+
headerExtraContent?: React.ReactNode;
|
|
27
|
+
searchable?: boolean;
|
|
28
|
+
searchInputPlaceholder?: string;
|
|
26
29
|
}
|
|
27
30
|
export interface ITableHeaderProps {
|
|
28
31
|
name: string;
|
|
@@ -80,4 +80,9 @@ interface ITableCellContentProps {
|
|
|
80
80
|
disabled: boolean;
|
|
81
81
|
}
|
|
82
82
|
export declare const TableCellContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, ITableCellContentProps, never>;
|
|
83
|
+
interface ITableSearchProps {
|
|
84
|
+
theme: AppTheme;
|
|
85
|
+
config: any;
|
|
86
|
+
}
|
|
87
|
+
export declare const TableSearch: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, ITableSearchProps, never>;
|
|
83
88
|
export {};
|
|
@@ -1458,6 +1458,13 @@ export declare const createComponentsConfig: (theme?: ThemeName | AppTheme) => {
|
|
|
1458
1458
|
};
|
|
1459
1459
|
};
|
|
1460
1460
|
};
|
|
1461
|
+
searchInput: {
|
|
1462
|
+
height: 32;
|
|
1463
|
+
paddingX: 8;
|
|
1464
|
+
radius: 8;
|
|
1465
|
+
fontSize: 13;
|
|
1466
|
+
lineHeight: 18;
|
|
1467
|
+
};
|
|
1461
1468
|
};
|
|
1462
1469
|
color: {
|
|
1463
1470
|
default: {
|
|
@@ -1470,10 +1477,19 @@ export declare const createComponentsConfig: (theme?: ThemeName | AppTheme) => {
|
|
|
1470
1477
|
text: "#111827";
|
|
1471
1478
|
sortIcon: "#111827";
|
|
1472
1479
|
};
|
|
1480
|
+
searchInput: {
|
|
1481
|
+
background: "#FFFFFF";
|
|
1482
|
+
border: "#E5E7EB";
|
|
1483
|
+
text: "#111827";
|
|
1484
|
+
placeholder: "#9CA3AF";
|
|
1485
|
+
};
|
|
1473
1486
|
};
|
|
1474
1487
|
hover: {
|
|
1475
1488
|
background: "#F2F8FD";
|
|
1476
1489
|
activeBackground: "#9FD0EC";
|
|
1490
|
+
searchInput: {
|
|
1491
|
+
border: "#D1D5DB";
|
|
1492
|
+
};
|
|
1477
1493
|
};
|
|
1478
1494
|
active: {
|
|
1479
1495
|
background: "#C7E3F5";
|
|
@@ -1481,6 +1497,9 @@ export declare const createComponentsConfig: (theme?: ThemeName | AppTheme) => {
|
|
|
1481
1497
|
textHeader: "#3B90CB";
|
|
1482
1498
|
sortIcon: "#3B90CB";
|
|
1483
1499
|
};
|
|
1500
|
+
searchInput: {
|
|
1501
|
+
border: "#3B90CB";
|
|
1502
|
+
};
|
|
1484
1503
|
};
|
|
1485
1504
|
disabled: {
|
|
1486
1505
|
text: "#9CA3AF";
|
|
@@ -2803,6 +2822,13 @@ export declare const componentsConfig: {
|
|
|
2803
2822
|
};
|
|
2804
2823
|
};
|
|
2805
2824
|
};
|
|
2825
|
+
searchInput: {
|
|
2826
|
+
height: 32;
|
|
2827
|
+
paddingX: 8;
|
|
2828
|
+
radius: 8;
|
|
2829
|
+
fontSize: 13;
|
|
2830
|
+
lineHeight: 18;
|
|
2831
|
+
};
|
|
2806
2832
|
};
|
|
2807
2833
|
color: {
|
|
2808
2834
|
default: {
|
|
@@ -2815,10 +2841,19 @@ export declare const componentsConfig: {
|
|
|
2815
2841
|
text: "#111827";
|
|
2816
2842
|
sortIcon: "#111827";
|
|
2817
2843
|
};
|
|
2844
|
+
searchInput: {
|
|
2845
|
+
background: "#FFFFFF";
|
|
2846
|
+
border: "#E5E7EB";
|
|
2847
|
+
text: "#111827";
|
|
2848
|
+
placeholder: "#9CA3AF";
|
|
2849
|
+
};
|
|
2818
2850
|
};
|
|
2819
2851
|
hover: {
|
|
2820
2852
|
background: "#F2F8FD";
|
|
2821
2853
|
activeBackground: "#9FD0EC";
|
|
2854
|
+
searchInput: {
|
|
2855
|
+
border: "#D1D5DB";
|
|
2856
|
+
};
|
|
2822
2857
|
};
|
|
2823
2858
|
active: {
|
|
2824
2859
|
background: "#C7E3F5";
|
|
@@ -2826,6 +2861,9 @@ export declare const componentsConfig: {
|
|
|
2826
2861
|
textHeader: "#3B90CB";
|
|
2827
2862
|
sortIcon: "#3B90CB";
|
|
2828
2863
|
};
|
|
2864
|
+
searchInput: {
|
|
2865
|
+
border: "#3B90CB";
|
|
2866
|
+
};
|
|
2829
2867
|
};
|
|
2830
2868
|
disabled: {
|
|
2831
2869
|
text: "#9CA3AF";
|
|
@@ -4293,6 +4331,13 @@ export declare const createConfig: (theme?: ThemeName | AppTheme) => {
|
|
|
4293
4331
|
};
|
|
4294
4332
|
};
|
|
4295
4333
|
};
|
|
4334
|
+
searchInput: {
|
|
4335
|
+
height: 32;
|
|
4336
|
+
paddingX: 8;
|
|
4337
|
+
radius: 8;
|
|
4338
|
+
fontSize: 13;
|
|
4339
|
+
lineHeight: 18;
|
|
4340
|
+
};
|
|
4296
4341
|
};
|
|
4297
4342
|
color: {
|
|
4298
4343
|
default: {
|
|
@@ -4305,10 +4350,19 @@ export declare const createConfig: (theme?: ThemeName | AppTheme) => {
|
|
|
4305
4350
|
text: "#111827";
|
|
4306
4351
|
sortIcon: "#111827";
|
|
4307
4352
|
};
|
|
4353
|
+
searchInput: {
|
|
4354
|
+
background: "#FFFFFF";
|
|
4355
|
+
border: "#E5E7EB";
|
|
4356
|
+
text: "#111827";
|
|
4357
|
+
placeholder: "#9CA3AF";
|
|
4358
|
+
};
|
|
4308
4359
|
};
|
|
4309
4360
|
hover: {
|
|
4310
4361
|
background: "#F2F8FD";
|
|
4311
4362
|
activeBackground: "#9FD0EC";
|
|
4363
|
+
searchInput: {
|
|
4364
|
+
border: "#D1D5DB";
|
|
4365
|
+
};
|
|
4312
4366
|
};
|
|
4313
4367
|
active: {
|
|
4314
4368
|
background: "#C7E3F5";
|
|
@@ -4316,6 +4370,9 @@ export declare const createConfig: (theme?: ThemeName | AppTheme) => {
|
|
|
4316
4370
|
textHeader: "#3B90CB";
|
|
4317
4371
|
sortIcon: "#3B90CB";
|
|
4318
4372
|
};
|
|
4373
|
+
searchInput: {
|
|
4374
|
+
border: "#3B90CB";
|
|
4375
|
+
};
|
|
4319
4376
|
};
|
|
4320
4377
|
disabled: {
|
|
4321
4378
|
text: "#9CA3AF";
|