diff --git a/.gitignore b/.gitignore index d33c90dd..65e1ae80 100644 --- a/.gitignore +++ b/.gitignore @@ -71,3 +71,5 @@ package-lock.json # visualizer stats.html + +.yarn \ No newline at end of file diff --git a/.storybook/manager.js b/.storybook/manager.js index 1e89baa8..1f5e5618 100644 --- a/.storybook/manager.js +++ b/.storybook/manager.js @@ -8,7 +8,7 @@ addons.setConfig({ theme: create({ base: 'light', brandTitle: 'React Data Table Component', - brandUrl: 'https://github.com/jbetancur/react-data-table-component', + brandUrl: 'https://github.com/AnotherCodeArtist/react-data-table-component', gridCellSize: 12, }), }); diff --git a/.vscode/launch.json b/.vscode/launch.json index a599d7fe..e46a5dde 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,6 +1,13 @@ { "version": "0.2.0", "configurations": [ + { + "name": "Attach to Chrome", + "port": 9222, + "request": "attach", + "type": "pwa-chrome", + "webRoot": "${workspaceFolder}" + }, { "name": "Debug Tests", "type": "node", diff --git a/.vscode/settings.json b/.vscode/settings.json index 16a58f7d..a409b70f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -32,7 +32,7 @@ "editor.defaultFormatter": "rvest.vs-code-prettier-eslint" }, "[typescriptreact]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" + "editor.defaultFormatter": "vscode.typescript-language-features" }, "[jsonc]": { "editor.defaultFormatter": "vscode.json-language-features" diff --git a/.yarn/install-state.gz b/.yarn/install-state.gz index 1ce7fea7..de2f7be1 100644 Binary files a/.yarn/install-state.gz and b/.yarn/install-state.gz differ diff --git a/README.md b/README.md index 147b6f79..b545edf1 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ -[![Netlify Status](https://api.netlify.com/api/v1/badges/26e0d16d-a986-46b1-9097-1a76c10d7cad/deploy-status)](https://app.netlify.com/sites/react-data-table-component/deploys) [![npm version](https://badge.fury.io/js/react-data-table-component.svg)](https://badge.fury.io/js/react-data-table-component) [![codecov](https://codecov.io/gh/jbetancur/react-data-table-component/branch/master/graph/badge.svg)](https://codecov.io/gh/jbetancur/react-data-table-component) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) - # React Data Table Component -[![GitHub release](https://img.shields.io/github/release/jbetancur/react-data-table-component.svg)](https://GitHub.com/jbetancur/react-data-table-component/releases/) +**Note**: This is a clone of [https://github.com/jbetancur/react-data-table-component](https://github.com/jbetancur/react-data-table-component) with one additional feature: [Column Filtering](https://anothercodeartist.github.io/react-data-table-component/?path=/story/general--kitchen-sink). It seems that there's no development going on any longer there. Creating yet another React table library came out of necessity while developing a web application for a growing startup. I discovered that while there are some great table libraries out there, some required heavy customization, were missing out of the box features such as built in sorting and pagination, or required understanding the atomic structure of html tables. @@ -10,6 +8,7 @@ If you want to achieve balance with the force and want a simple but flexible tab # Key Features +- **Filterable columns** - Declarative configuration - Built-in and configurable: - Sorting @@ -20,13 +19,13 @@ If you want to achieve balance with the force and want a simple but flexible tab - Accessibility - Responsive (via x-scroll/flex) -# Documentation Website +In this version filterability was further improved by adding an additional column property called `filterValues`, which is a list of values that filtering is restricted to. This is helpful in cases where a column has only a small set of different values. -[![Netlify Status](https://api.netlify.com/api/v1/badges/26e0d16d-a986-46b1-9097-1a76c10d7cad/deploy-status)](https://app.netlify.com/sites/react-data-table-component/deploys) +# Documentation Website The documentation contains information about installation, usage and contributions. -https://react-data-table-component.netlify.app +https://anothercodeartist.github.io/react-data-table-component # Supporting React Data Table Component @@ -37,8 +36,3 @@ If you would like to support the project financially, visit -# Contributors - - - - diff --git a/eslintrc-js.js b/eslintrc-js.js index 621b3af0..216bba5b 100644 --- a/eslintrc-js.js +++ b/eslintrc-js.js @@ -28,6 +28,13 @@ module.exports = { 'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies 'react/jsx-props-no-spreading': 0, 'react/display-name': 0, + '@typescript-eslint/no-unused-vars': [ + 'error', + { + ignoreRestSiblings: true, + argsIgnorePattern: '_', + }, + ], }, env: { 'jest/globals': true, diff --git a/eslintrc-ts.js b/eslintrc-ts.js new file mode 100644 index 00000000..18c488ce --- /dev/null +++ b/eslintrc-ts.js @@ -0,0 +1,11 @@ +module.exports = { + rules: { + '@typescript-eslint/no-unused-vars': [ + 'error', + { + ignoreRestSiblings: true, + argsIgnorePattern: '_', + }, + ], + }, +}; diff --git a/package.json b/package.json index c466c1fa..06902655 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "react-data-table-component", + "name": "react-data-table-component-with-filter", "version": "7.6.2", "description": "A simple to use declarative react based data table", "main": "dist/index.cjs.js", @@ -18,8 +18,8 @@ "react-data-table", "react-data-table-component" ], - "repository": "https://github.com/jbetancur/react-data-table-component", - "author": "jbetancur", + "repository": "https://github.com/anothercodeartist/react-data-table-component", + "author": "AnotherCodeArtist", "license": "Apache-2.0", "prepublish": "tsc", "scripts": { diff --git a/src/DataTable/DataTable.tsx b/src/DataTable/DataTable.tsx index 2ba1924d..4cdfdf5a 100644 --- a/src/DataTable/DataTable.tsx +++ b/src/DataTable/DataTable.tsx @@ -18,7 +18,7 @@ import { CellBase } from './Cell'; import NoData from './NoDataWrapper'; import NativePagination from './Pagination'; import useDidUpdateEffect from '../hooks/useDidUpdateEffect'; -import { prop, getNumberOfPages, sort, isEmpty, isRowSelected, recalculatePage } from './util'; +import { prop, getNumberOfPages, sort, isEmpty, isRowSelected, recalculatePage, getProperty } from './util'; import { defaultProps } from './defaultProps'; import { createStyles } from './styles'; import { @@ -30,6 +30,7 @@ import { TableProps, TableState, SortOrder, + FilterAction, } from './types'; import useColumns from '../hooks/useColumns'; @@ -97,8 +98,10 @@ function DataTable(props: TableProps): JSX.Element { onRowMouseLeave = defaultProps.onRowMouseLeave, sortIcon = defaultProps.sortIcon, onSort = defaultProps.onSort, + onFilter = defaultProps.onFilter, sortFunction = defaultProps.sortFunction, sortServer = defaultProps.sortServer, + filterServer = defaultProps.filterServer, expandableRowsComponent = defaultProps.expandableRowsComponent, expandableRowsComponentProps = defaultProps.expandableRowsComponentProps, expandableRowDisabled = defaultProps.expandableRowDisabled, @@ -139,6 +142,8 @@ function DataTable(props: TableProps): JSX.Element { selectedCount, selectedColumn, sortDirection, + filters, + filterActive, toggleOnSelectedRowsChange, }, dispatch, @@ -151,6 +156,9 @@ function DataTable(props: TableProps): JSX.Element { sortDirection: defaultSortDirection, currentPage: paginationDefaultPage, rowsPerPage: paginationPerPage, + filteredData: data, + filterActive: false, + filters: {}, selectedRowsFlag: false, contextMessage: defaultProps.contextMessage, }); @@ -162,22 +170,41 @@ function DataTable(props: TableProps): JSX.Element { const currentTheme = React.useMemo(() => createStyles(customStyles, theme), [customStyles, theme]); const wrapperProps = React.useMemo(() => ({ ...(direction !== 'auto' && { dir: direction }) }), [direction]); + const escapeRegex = (value: string) => value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + const currentData = React.useMemo(() => { + if (filterActive && !filterServer) { + return data.filter((row, idx) => + Object.entries(filters).reduce( + ( + acc: boolean, + [_, { column, value }], // eslint-disable-line @typescript-eslint/no-unused-vars + ) => + new RegExp(`.*${escapeRegex(value)}.*`, 'i').test(getProperty(row, column.selector, null, idx)?.toString() ?? '') + ? acc + : false, + true, + ), + ); + } else { + return data; + } + }, [filters, filterServer, data, filterActive]); const sortedData = React.useMemo(() => { // server-side sorting bypasses internal sorting if (sortServer) { - return data; + return currentData; } if (selectedColumn?.sortFunction && typeof selectedColumn.sortFunction === 'function') { const sortFn = selectedColumn.sortFunction; const customSortFunction = sortDirection === SortOrder.ASC ? sortFn : (a: T, b: T) => sortFn(a, b) * -1; - return [...data].sort(customSortFunction); + return [...currentData].sort(customSortFunction); } - return sort(data, selectedColumn?.selector, sortDirection, sortFunction); - }, [sortServer, selectedColumn, sortDirection, data, sortFunction]); + return sort(currentData, selectedColumn?.selector, sortDirection, sortFunction); + }, [sortServer, selectedColumn, sortDirection, currentData, sortFunction]); const tableRows = React.useMemo(() => { if (pagination && !paginationServer) { @@ -187,7 +214,6 @@ function DataTable(props: TableProps): JSX.Element { return sortedData.slice(firstIndex, lastIndex); } - return sortedData; }, [currentPage, pagination, paginationServer, rowsPerPage, sortedData]); @@ -195,6 +221,10 @@ function DataTable(props: TableProps): JSX.Element { dispatch(action); }, []); + const handleFilter = React.useCallback((action: FilterAction) => { + dispatch(action); + }, []); + const handleSelectAllRows = React.useCallback((action: AllRowsAction) => { dispatch(action); }, []); @@ -261,7 +291,7 @@ function DataTable(props: TableProps): JSX.Element { return true; } - return sortedData.length > 0 && !progressPending; + return filterActive || (sortedData.length > 0 && !progressPending); }; const showHeader = () => { @@ -302,6 +332,10 @@ function DataTable(props: TableProps): JSX.Element { onChangePage(currentPage, paginationTotalRows || sortedData.length); }, [currentPage]); + useDidUpdateEffect(() => { + onFilter(filters); + }, [filters]); + useDidUpdateEffect(() => { onChangeRowsPerPage(rowsPerPage, currentPage); }, [rowsPerPage]); @@ -414,7 +448,9 @@ function DataTable(props: TableProps): JSX.Element { sortDirection={sortDirection} sortIcon={sortIcon} sortServer={sortServer} + filterServer={filterServer} onSort={handleSort} + onFilter={handleFilter} onDragStart={handleDragStart} onDragOver={handleDragOver} onDragEnd={handleDragEnd} diff --git a/src/DataTable/TableCol.tsx b/src/DataTable/TableCol.tsx index 214c589f..bd61de10 100644 --- a/src/DataTable/TableCol.tsx +++ b/src/DataTable/TableCol.tsx @@ -3,7 +3,8 @@ import styled, { css } from 'styled-components'; import { CellExtended, CellProps } from './Cell'; import NativeSortIcon from '../icons/NativeSortIcon'; import { equalizeId } from './util'; -import { TableColumn, SortAction, SortOrder } from './types'; +import { TableColumn, SortAction, SortOrder, FilterAction } from './types'; +import { ChangeEvent } from 'react'; interface ColumnStyleProps extends CellProps { $isDragging?: boolean; @@ -14,7 +15,7 @@ interface ColumnStyleProps extends CellProps { onDragLeave: (e: React.DragEvent) => void; } -const ColumnStyled = styled(CellExtended)` +const ColumnStyled = styled(CellExtended) ` ${({ button }) => button && 'text-align: center'}; ${({ theme, $isDragging }) => $isDragging && theme.headCells.draggingStyle}; `; @@ -91,8 +92,10 @@ type TableColProps = { selectedColumn: TableColumn; sortDirection: SortOrder; sortServer: boolean; + filterServer: boolean; selectableRowsVisibleOnly: boolean; onSort: (action: SortAction) => void; + onFilter: (action: FilterAction) => void; onDragStart: (e: React.DragEvent) => void; onDragOver: (e: React.DragEvent) => void; onDragEnd: (e: React.DragEvent) => void; @@ -108,11 +111,13 @@ function TableCol({ sortDirection, sortIcon, sortServer, + filterServer, pagination, paginationServer, persistSelectedOnSort, selectableRowsVisibleOnly, onSort, + onFilter, onDragStart, onDragOver, onDragEnd, @@ -130,6 +135,7 @@ function TableCol({ const [showTooltip, setShowTooltip] = React.useState(false); const columnRef = React.useRef(null); + const [pristine, setPristine] = React.useState(true); React.useEffect(() => { if (columnRef.current) { @@ -141,6 +147,22 @@ function TableCol({ return null; } + React.useEffect(() => { + if (pristine) { + setPristine(false); + if (column.filterable && column.selector && column.filterValue && column.filterValue !== '') { + onFilter({ + type: 'FILTER_CHANGE', + filterServer: filterServer, + filterText: column.filterValue, + selectedColumn: column, + clearSelectedOnSort: + (pagination && paginationServer && !persistSelectedOnSort) || sortServer || selectableRowsVisibleOnly, + }); + } + } + }, [pristine]); + const handleSortChange = () => { if (!column.sortable && !column.selector) { return; @@ -161,6 +183,20 @@ function TableCol({ }); }; + const handleFilterChange = (e: ChangeEvent) => { + if (column.filterable && column.selector) { + column.filterValue = e.target.value; + onFilter({ + type: 'FILTER_CHANGE', + filterServer: filterServer, + filterText: e.target.value, + selectedColumn: column, + clearSelectedOnSort: + (pagination && paginationServer && !persistSelectedOnSort) || sortServer || selectableRowsVisibleOnly, + }); + } + }; + const handleKeyPress = (event: React.KeyboardEvent) => { if (event.key === 'Enter') { handleSortChange(); @@ -206,6 +242,7 @@ function TableCol({ onDragLeave={onDragLeave} > {column.name && ( +
({ {!disableSort && customSortIconRight && renderCustomSortIcon()} {!disableSort && nativeSortIconRight && renderNativeSortIcon(sortActive)} - {typeof column.name === 'string' ? ( - - {column.name} - - ) : ( - column.name - )} + {typeof column.name === 'string' ? ( + + {column.name} + + ) : ( + column.name + )} - {!disableSort && customSortIconLeft && renderCustomSortIcon()} - {!disableSort && nativeSortIconLeft && renderNativeSortIcon(sortActive)} - + {!disableSort && customSortIconLeft && renderCustomSortIcon()} + {!disableSort && nativeSortIconLeft && renderNativeSortIcon(sortActive)} + + {column.filterable && ( +
+ {column.filterValues && column.filterValues.length > 0 ? + + : + + } +
+ )} +
)} ); diff --git a/src/DataTable/__tests__/DataTable.test.tsx b/src/DataTable/__tests__/DataTable.test.tsx index a3864977..44d9de6c 100644 --- a/src/DataTable/__tests__/DataTable.test.tsx +++ b/src/DataTable/__tests__/DataTable.test.tsx @@ -286,6 +286,13 @@ describe('DataTable::columns', () => { expect(container.firstChild).toMatchSnapshot(); }); + test('should render correctly when column.filterable = true', () => { + const mock = dataMock({ filterable: true }); + const { container } = render(); + + expect(container.firstChild).toMatchSnapshot(); + }); + test('should render correctly when column.wrap = true', () => { const mock = dataMock({ wrap: true }); const { container } = render(); @@ -585,6 +592,57 @@ describe('DataTable::responsive', () => { }); }); +describe('DataTable:filter', () => { + test('should not call onFilter if the column is not filterable', () => { + const onFilterMock = jest.fn(); + const mock = dataMock({ filterable: false }); + const { container } = render(); + const filterInput = container.querySelector('input[data-filter-id="test"]') as HTMLInputElement; + expect(filterInput).toBeNull(); + }); + + test('it should filter if filterable is set true', () => { + const onFilterMock = jest.fn(); + const mock = dataMock({ filterable: true }); + const { container } = render(); + const filterInput = container.querySelector('input[data-filter-id="test"]') as HTMLInputElement; + fireEvent.change(filterInput, { target: { value: 'p' } }); + expect(container.firstChild).toMatchSnapshot(); + expect(onFilterMock).toBeCalledTimes(1); + const param = onFilterMock.mock.calls[0][0]; + expect(param['Test'].value).toBe('p'); + expect(container.querySelector('div#row1') as HTMLInputElement).toBeDefined(); + expect(container.querySelector('div#row2') as HTMLInputElement).toBeNull(); + fireEvent.change(filterInput, { target: { value: '' } }); + expect(container.querySelector('div#row1') as HTMLInputElement).toBeDefined(); + expect(container.querySelector('div#row2') as HTMLInputElement).toBeDefined(); + }); + + test('it should not filter if filterServer is set true', () => { + const onFilterMock = jest.fn(); + const mock = dataMock({ filterable: true }); + const { container } = render( + , + ); + const filterInput = container.querySelector('input[data-filter-id="test"]') as HTMLInputElement; + fireEvent.change(filterInput, { target: { value: 'p' } }); + expect(container.firstChild).toMatchSnapshot(); + expect(onFilterMock).toBeCalledTimes(1); + const param = onFilterMock.mock.calls[0][0]; + expect(param['Test'].value).toBe('p'); + expect(container.querySelector('div#row1') as HTMLInputElement).toBeDefined(); + expect(container.querySelector('div#row2') as HTMLInputElement).toBeDefined(); + }); + + test('should not be rendered if column.name is missing', () => { + const mock = dataMock({ filterable: true, name: null }); + const { container } = render(); + const filterInput = container.querySelector('input[name="Test"]'); + expect(filterInput).toBeNull(); + expect(container.firstChild).toMatchSnapshot(); + }); +}); + describe('DataTable::sorting', () => { test('should not call onSort if the column is not sortable', () => { const onSortMock = jest.fn(); diff --git a/src/DataTable/__tests__/__snapshots__/DataTable.test.tsx.snap b/src/DataTable/__tests__/__snapshots__/DataTable.test.tsx.snap index add75c2a..1df89af1 100644 --- a/src/DataTable/__tests__/__snapshots__/DataTable.test.tsx.snap +++ b/src/DataTable/__tests__/__snapshots__/DataTable.test.tsx.snap @@ -145,19 +145,21 @@ exports[`DataTable::Header header should not display with no title 1`] = ` class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -928,19 +930,21 @@ exports[`DataTable::Header should render without a header if noHeader is true 1` class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -1352,19 +1356,21 @@ exports[`DataTable::Pagination should change the page position when using pagina class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -1703,19 +1709,21 @@ exports[`DataTable::Pagination should have the correct amount of rows when pagin class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -1899,19 +1907,21 @@ exports[`DataTable::Pagination should have the correct amount of rows when pagin class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -2095,19 +2105,21 @@ exports[`DataTable::Pagination should have the correct amount of rows when pagin class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -2291,19 +2303,21 @@ exports[`DataTable::Pagination should have the correct amount of rows when pagin class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -2515,24 +2529,26 @@ exports[`DataTable::Pagination should navigate to page 1 if the table is sorted class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
+ + ▲ +
- - ▲ -
@@ -2715,19 +2731,21 @@ exports[`DataTable::Pagination should recalculate pagination position if there i class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -2911,19 +2929,21 @@ exports[`DataTable::Pagination should render correctly if pagination is enabled class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -3126,19 +3146,21 @@ exports[`DataTable::Pagination should render correctly when a paginationComponen class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -3341,19 +3363,21 @@ exports[`DataTable::Pagination should render correctly when a paginationComponen class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -3556,19 +3580,21 @@ exports[`DataTable::Pagination should render correctly when a paginationComponen class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -3771,19 +3797,21 @@ exports[`DataTable::Pagination should render correctly when a paginationComponen class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -3986,19 +4014,21 @@ exports[`DataTable::Pagination should render correctly when paginationResetDefau class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -4178,19 +4208,21 @@ exports[`DataTable::Theming should render correctly when a custom style is appli class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -4393,19 +4425,21 @@ exports[`DataTable::column.style should render correctly when a style is set on class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -4605,19 +4639,21 @@ exports[`DataTable::columns should render correctly if column.center 1`] = ` class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -4823,19 +4859,21 @@ exports[`DataTable::columns should render correctly if column.hide is an integer data-column-id="1" hide="300" > -
+
- Test +
+ Test +
@@ -5043,19 +5081,21 @@ exports[`DataTable::columns should render correctly if column.hide lg 1`] = ` data-column-id="1" hide="lg" > -
+
- Test +
+ Test +
@@ -5263,19 +5303,21 @@ exports[`DataTable::columns should render correctly if column.hide md 1`] = ` data-column-id="1" hide="md" > -
+
- Test +
+ Test +
@@ -5483,19 +5525,21 @@ exports[`DataTable::columns should render correctly if column.hide sm 1`] = ` data-column-id="1" hide="sm" > -
+
- Test +
+ Test +
@@ -5697,19 +5741,21 @@ exports[`DataTable::columns should render correctly if column.maxWidth 1`] = ` data-column-id="1" maxwidth="600px" > -
+
- Test +
+ Test +
@@ -5911,19 +5957,21 @@ exports[`DataTable::columns should render correctly if column.minWidth 1`] = ` data-column-id="1" minwidth="200px" > -
+
- Test +
+ Test +
@@ -6124,19 +6172,21 @@ exports[`DataTable::columns should render correctly if column.omit is true 1`] = class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -6336,19 +6386,21 @@ exports[`DataTable::columns should render correctly if column.right 1`] = ` class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -6550,19 +6602,21 @@ exports[`DataTable::columns should render correctly if column.width 1`] = ` data-column-id="1" width="200px" > -
+
- Test +
+ Test +
@@ -6763,19 +6817,21 @@ exports[`DataTable::columns should render correctly when column.allowOverflow = class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -6980,19 +7036,21 @@ exports[`DataTable::columns should render correctly when column.button = true 1` class="c5 c6 c7 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -7179,19 +7237,21 @@ exports[`DataTable::columns should render correctly when column.cell is set to a class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -7387,19 +7447,21 @@ exports[`DataTable::columns should render correctly when column.compact = true 1 class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -7453,29 +7515,43 @@ exports[`DataTable::columns should render correctly when column.compact = true 1 `; -exports[`DataTable::columns should render correctly when column.sortable = true 1`] = ` +exports[`DataTable::columns should render correctly when column.filterable = true 1`] = ` .c2 { position: relative; box-sizing: border-box; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; flex-direction: column; width: 100%; height: 100%; max-width: 100%; - color: rgba(0, 0, 0, 0.87); + color: rgba(0,0,0,0.87); background-color: #FFFFFF; } .c3 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; display: flex; width: 100%; - color: rgba(0, 0, 0, 0.87); + color: rgba(0,0,0,0.87); font-size: 12px; font-weight: 500; } .c4 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; display: flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; align-items: stretch; width: 100%; background-color: #FFFFFF; @@ -7487,7 +7563,13 @@ exports[`DataTable::columns should render correctly when column.sortable = true .c5 { position: relative; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; display: flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; align-items: center; box-sizing: border-box; line-height: normal; @@ -7495,9 +7577,15 @@ exports[`DataTable::columns should render correctly when column.sortable = true padding-right: 16px; } -.c12 { +.c11 { position: relative; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; display: flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; align-items: center; box-sizing: border-box; line-height: normal; @@ -7507,87 +7595,74 @@ exports[`DataTable::columns should render correctly when column.sortable = true } .c6 { + -webkit-box-flex: 1; + -webkit-flex-grow: 1; + -ms-flex-positive: 1; flex-grow: 1; + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; flex-shrink: 0; + -webkit-flex-basis: 0; + -ms-flex-preferred-size: 0; flex-basis: 0; max-width: 100%; min-width: 100px; } -.c13 div:first-child { +.c12 div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } -.c11 { +.c10 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; display: flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; align-items: stretch; + -webkit-align-content: stretch; + -ms-flex-line-pack: stretch; align-content: stretch; width: 100%; box-sizing: border-box; font-size: 13px; font-weight: 400; - color: rgba(0, 0, 0, 0.87); + color: rgba(0,0,0,0.87); background-color: #FFFFFF; min-height: 48px; } -.c11:not(:last-of-type) { +.c10:not(:last-of-type) { border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgba(0,0,0,.12); } -.c9 { - padding: 2px; - color: inherit; - flex-grow: 0; - flex-shrink: 0; - opacity: 0; -} - .c7 { + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; display: inline-flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; align-items: center; + -webkit-box-pack: inherit; + -webkit-justify-content: inherit; + -ms-flex-pack: inherit; justify-content: inherit; height: 100%; width: 100%; outline: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; user-select: none; overflow: hidden; - cursor: pointer; -} - -.c7 span.__rdt_custom_sort_icon__ i, -.c7 span.__rdt_custom_sort_icon__ svg { - transform: 'translate3d(0, 0, 0)'; - opacity: 0; - color: inherit; - font-size: 18px; - height: 18px; - width: 18px; - backface-visibility: hidden; - transform-style: preserve-3d; - transition-duration: 95ms; - transition-property: transform; -} - -.c7 span.__rdt_custom_sort_icon__.asc i, -.c7 span.__rdt_custom_sort_icon__.asc svg { - transform: rotate(180deg); -} - -.c7:hover, -.c7:focus { - opacity: 0.7; -} - -.c7:hover span, -.c7:focus span, -.c7:hover span.__rdt_custom_sort_icon__ *, -.c7:focus span.__rdt_custom_sort_icon__ * { - opacity: 0.7; } .c8 { @@ -7596,8 +7671,13 @@ exports[`DataTable::columns should render correctly when column.sortable = true text-overflow: ellipsis; } -.c10 { +.c9 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; flex-direction: column; } @@ -7638,39 +7718,46 @@ exports[`DataTable::columns should render correctly when column.sortable = true class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
- - ▲ - + +
`; -exports[`DataTable::columns should render correctly when column.wrap = true 1`] = ` +exports[`DataTable::columns should render correctly when column.sortable = true 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -7750,7 +7837,7 @@ exports[`DataTable::columns should render correctly when column.wrap = true 1`] padding-right: 16px; } -.c11 { +.c12 { position: relative; display: flex; align-items: center; @@ -7769,13 +7856,13 @@ exports[`DataTable::columns should render correctly when column.wrap = true 1`] min-width: 100px; } -.c12 div:first-child { - white-space: normal; +.c13 div:first-child { + white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } -.c10 { +.c11 { display: flex; align-items: stretch; align-content: stretch; @@ -7788,12 +7875,20 @@ exports[`DataTable::columns should render correctly when column.wrap = true 1`] min-height: 48px; } -.c10:not(:last-of-type) { +.c11:not(:last-of-type) { border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgba(0,0,0,.12); } +.c9 { + padding: 2px; + color: inherit; + flex-grow: 0; + flex-shrink: 0; + opacity: 0; +} + .c7 { display: inline-flex; align-items: center; @@ -7803,6 +7898,38 @@ exports[`DataTable::columns should render correctly when column.wrap = true 1`] outline: none; user-select: none; overflow: hidden; + cursor: pointer; +} + +.c7 span.__rdt_custom_sort_icon__ i, +.c7 span.__rdt_custom_sort_icon__ svg { + transform: 'translate3d(0, 0, 0)'; + opacity: 0; + color: inherit; + font-size: 18px; + height: 18px; + width: 18px; + backface-visibility: hidden; + transform-style: preserve-3d; + transition-duration: 95ms; + transition-property: transform; +} + +.c7 span.__rdt_custom_sort_icon__.asc i, +.c7 span.__rdt_custom_sort_icon__.asc svg { + transform: rotate(180deg); +} + +.c7:hover, +.c7:focus { + opacity: 0.7; +} + +.c7:hover span, +.c7:focus span, +.c7:hover span.__rdt_custom_sort_icon__ *, +.c7:focus span.__rdt_custom_sort_icon__ * { + opacity: 0.7; } .c8 { @@ -7811,7 +7938,7 @@ exports[`DataTable::columns should render correctly when column.wrap = true 1`] text-overflow: ellipsis; } -.c9 { +.c10 { display: flex; flex-direction: column; } @@ -7853,35 +7980,41 @@ exports[`DataTable::columns should render correctly when column.wrap = true 1`] class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
+ + ▲ +
`; -exports[`DataTable::columns should render correctly when ignoreRowClick = true 1`] = ` +exports[`DataTable::columns should render correctly when column.wrap = true 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -7981,7 +8114,7 @@ exports[`DataTable::columns should render correctly when ignoreRowClick = true 1 } .c12 div:first-child { - white-space: nowrap; + white-space: normal; overflow: hidden; text-overflow: ellipsis; } @@ -8064,19 +8197,21 @@ exports[`DataTable::columns should render correctly when ignoreRowClick = true 1 class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -8094,10 +8229,13 @@ exports[`DataTable::columns should render correctly when ignoreRowClick = true 1
-
+
Apple
@@ -8110,10 +8248,13 @@ exports[`DataTable::columns should render correctly when ignoreRowClick = true 1
-
+
Zuchinni
@@ -8124,7 +8265,7 @@ exports[`DataTable::columns should render correctly when ignoreRowClick = true 1
`; -exports[`DataTable::columns should render correctly with columns/data 1`] = ` +exports[`DataTable::columns should render correctly when ignoreRowClick = true 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -8269,19 +8410,21 @@ exports[`DataTable::columns should render correctly with columns/data 1`] = ` class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -8299,13 +8442,10 @@ exports[`DataTable::columns should render correctly with columns/data 1`] = `
-
+
Apple
@@ -8318,13 +8458,10 @@ exports[`DataTable::columns should render correctly with columns/data 1`] = `
-
+
Zuchinni
@@ -8335,7 +8472,7 @@ exports[`DataTable::columns should render correctly with columns/data 1`] = `
`; -exports[`DataTable::conditionalCellStyles should render correctly when conditionalCellStyles is defined and there is a match 1`] = ` +exports[`DataTable::columns should render correctly with columns/data 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -8480,19 +8617,21 @@ exports[`DataTable::conditionalCellStyles should render correctly when condition class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -8513,7 +8652,6 @@ exports[`DataTable::conditionalCellStyles should render correctly when condition data-tag="allowRowEvents" id="cell-1-1" role="cell" - style="background-color: rgba(63, 195, 128, 0.9);" >
`; -exports[`DataTable::conditionalCellStyles should render correctly when conditionalCellStyles is defined and there is no match 1`] = ` +exports[`DataTable::conditionalCellStyles should render correctly when conditionalCellStyles is defined and there is a match 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -8692,19 +8830,21 @@ exports[`DataTable::conditionalCellStyles should render correctly when condition class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -8725,6 +8865,7 @@ exports[`DataTable::conditionalCellStyles should render correctly when condition data-tag="allowRowEvents" id="cell-1-1" role="cell" + style="background-color: rgba(63, 195, 128, 0.9);" >
`; -exports[`DataTable::conditionalCellStyles should render correctly when conditionalCellStyles style is a function 1`] = ` +exports[`DataTable::conditionalCellStyles should render correctly when conditionalCellStyles is defined and there is no match 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -8903,19 +9044,21 @@ exports[`DataTable::conditionalCellStyles should render correctly when condition class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -8936,7 +9079,6 @@ exports[`DataTable::conditionalCellStyles should render correctly when condition data-tag="allowRowEvents" id="cell-1-1" role="cell" - style="color: pink;" >
`; -exports[`DataTable::conditionalCellStyles should render correctly when conditionalCellStyles with classNames is defined and there is a match 1`] = ` +exports[`DataTable::conditionalCellStyles should render correctly when conditionalCellStyles style is a function 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -9115,19 +9257,21 @@ exports[`DataTable::conditionalCellStyles should render correctly when condition class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -9143,11 +9287,12 @@ exports[`DataTable::conditionalCellStyles should render correctly when condition role="row" >
`; -exports[`DataTable::conditionalRowStyles should render correctly when conditionalRowStyles are an empty array 1`] = ` +exports[`DataTable::conditionalCellStyles should render correctly when conditionalCellStyles with classNames is defined and there is a match 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -9326,19 +9471,21 @@ exports[`DataTable::conditionalRowStyles should render correctly when conditiona class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -9354,7 +9501,7 @@ exports[`DataTable::conditionalRowStyles should render correctly when conditiona role="row" >
`; -exports[`DataTable::conditionalRowStyles should render correctly when conditionalRowStyles is defined and there is a match 1`] = ` +exports[`DataTable::conditionalRowStyles should render correctly when conditionalRowStyles are an empty array 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -9470,8 +9617,6 @@ exports[`DataTable::conditionalRowStyles should render correctly when conditiona color: rgba(0, 0, 0, 0.87); background-color: #FFFFFF; min-height: 48px; - background-color: rgba(63, 195, 128, 0.9); - color: white; } .c10:not(:last-of-type) { @@ -9480,29 +9625,6 @@ exports[`DataTable::conditionalRowStyles should render correctly when conditiona border-bottom-color: rgba(0,0,0,.12); } -.c10:hover { - cursor: pointer; -} - -.c13 { - display: flex; - align-items: stretch; - align-content: stretch; - width: 100%; - box-sizing: border-box; - font-size: 13px; - font-weight: 400; - color: rgba(0, 0, 0, 0.87); - background-color: #FFFFFF; - min-height: 48px; -} - -.c13:not(:last-of-type) { - border-bottom-style: solid; - border-bottom-width: 1px; - border-bottom-color: rgba(0,0,0,.12); -} - .c7 { display: inline-flex; align-items: center; @@ -9562,19 +9684,21 @@ exports[`DataTable::conditionalRowStyles should render correctly when conditiona class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -9604,7 +9728,7 @@ exports[`DataTable::conditionalRowStyles should render correctly when conditiona
@@ -9628,7 +9752,7 @@ exports[`DataTable::conditionalRowStyles should render correctly when conditiona
`; -exports[`DataTable::conditionalRowStyles should render correctly when conditionalRowStyles is defined and there is no match 1`] = ` +exports[`DataTable::conditionalRowStyles should render correctly when conditionalRowStyles is defined and there is a match 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -9706,6 +9830,8 @@ exports[`DataTable::conditionalRowStyles should render correctly when conditiona color: rgba(0, 0, 0, 0.87); background-color: #FFFFFF; min-height: 48px; + background-color: rgba(63, 195, 128, 0.9); + color: white; } .c10:not(:last-of-type) { @@ -9714,6 +9840,29 @@ exports[`DataTable::conditionalRowStyles should render correctly when conditiona border-bottom-color: rgba(0,0,0,.12); } +.c10:hover { + cursor: pointer; +} + +.c13 { + display: flex; + align-items: stretch; + align-content: stretch; + width: 100%; + box-sizing: border-box; + font-size: 13px; + font-weight: 400; + color: rgba(0, 0, 0, 0.87); + background-color: #FFFFFF; + min-height: 48px; +} + +.c13:not(:last-of-type) { + border-bottom-style: solid; + border-bottom-width: 1px; + border-bottom-color: rgba(0,0,0,.12); +} + .c7 { display: inline-flex; align-items: center; @@ -9773,19 +9922,21 @@ exports[`DataTable::conditionalRowStyles should render correctly when conditiona class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -9815,7 +9966,7 @@ exports[`DataTable::conditionalRowStyles should render correctly when conditiona
@@ -9839,7 +9990,7 @@ exports[`DataTable::conditionalRowStyles should render correctly when conditiona
`; -exports[`DataTable::dense should render correctly when dense 1`] = ` +exports[`DataTable::conditionalRowStyles should render correctly when conditionalRowStyles is defined and there is no match 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -9869,7 +10020,6 @@ exports[`DataTable::dense should render correctly when dense 1`] = ` border-bottom-width: 1px; border-bottom-color: rgba(0,0,0,.12); border-bottom-style: solid; - min-height: 32px; } .c5 { @@ -9918,7 +10068,6 @@ exports[`DataTable::dense should render correctly when dense 1`] = ` color: rgba(0, 0, 0, 0.87); background-color: #FFFFFF; min-height: 48px; - min-height: 32px; } .c10:not(:last-of-type) { @@ -9986,19 +10135,21 @@ exports[`DataTable::dense should render correctly when dense 1`] = ` class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -10052,7 +10203,7 @@ exports[`DataTable::dense should render correctly when dense 1`] = `
`; -exports[`DataTable::direction should render correctly when direction is auto 1`] = ` +exports[`DataTable::dense should render correctly when dense 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -10082,6 +10233,7 @@ exports[`DataTable::direction should render correctly when direction is auto 1`] border-bottom-width: 1px; border-bottom-color: rgba(0,0,0,.12); border-bottom-style: solid; + min-height: 32px; } .c5 { @@ -10130,6 +10282,7 @@ exports[`DataTable::direction should render correctly when direction is auto 1`] color: rgba(0, 0, 0, 0.87); background-color: #FFFFFF; min-height: 48px; + min-height: 32px; } .c10:not(:last-of-type) { @@ -10175,10 +10328,6 @@ exports[`DataTable::direction should render correctly when direction is auto 1`] display: table; } -@media screen and (max-width: 599px) { - -} -
@@ -10201,19 +10350,21 @@ exports[`DataTable::direction should render correctly when direction is auto 1`] class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -10267,7 +10418,7 @@ exports[`DataTable::direction should render correctly when direction is auto 1`]
`; -exports[`DataTable::direction should render correctly when direction is ltr 1`] = ` +exports[`DataTable::direction should render correctly when direction is auto 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -10396,7 +10547,6 @@ exports[`DataTable::direction should render correctly when direction is ltr 1`]
-
+
- Test +
+ Test +
@@ -10483,7 +10635,7 @@ exports[`DataTable::direction should render correctly when direction is ltr 1`]
`; -exports[`DataTable::direction should render correctly when direction is rtl 1`] = ` +exports[`DataTable::direction should render correctly when direction is ltr 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -10612,7 +10764,7 @@ exports[`DataTable::direction should render correctly when direction is rtl 1`]
-
+
- Test +
+ Test +
@@ -10699,7 +10853,7 @@ exports[`DataTable::direction should render correctly when direction is rtl 1`]
`; -exports[`DataTable::direction should render correctly when direction is rtl when using a context menu 1`] = ` +exports[`DataTable::direction should render correctly when direction is rtl 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -10739,32 +10893,9 @@ exports[`DataTable::direction should render correctly when direction is rtl when line-height: normal; padding-left: 16px; padding-right: 16px; - padding: 0; -} - -.c7 { - position: relative; - display: flex; - align-items: center; - box-sizing: border-box; - line-height: normal; - padding-left: 16px; - padding-right: 16px; } -.c13 { - position: relative; - display: flex; - align-items: center; - box-sizing: border-box; - line-height: normal; - padding-left: 16px; - padding-right: 16px; - word-break: break-word; - padding: 0; -} - -.c15 { +.c11 { position: relative; display: flex; align-items: center; @@ -10775,7 +10906,7 @@ exports[`DataTable::direction should render correctly when direction is rtl when word-break: break-word; } -.c8 { +.c6 { flex-grow: 1; flex-shrink: 0; flex-basis: 0; @@ -10783,22 +10914,13 @@ exports[`DataTable::direction should render correctly when direction is rtl when min-width: 100px; } -.c16 div:first-child { +.c12 div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } -.c14 { - flex: 0 0 48px; - min-width: 48px; - justify-content: center; - align-items: center; - user-select: none; - white-space: nowrap; -} - -.c12 { +.c10 { display: flex; align-items: stretch; align-content: stretch; @@ -10811,13 +10933,13 @@ exports[`DataTable::direction should render correctly when direction is rtl when min-height: 48px; } -.c12:not(:last-of-type) { +.c10:not(:last-of-type) { border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgba(0,0,0,.12); } -.c9 { +.c7 { display: inline-flex; align-items: center; justify-content: inherit; @@ -10828,22 +10950,13 @@ exports[`DataTable::direction should render correctly when direction is rtl when overflow: hidden; } -.c10 { +.c8 { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } -.c6 { - flex: 0 0 48px; - justify-content: center; - align-items: center; - user-select: none; - white-space: nowrap; - font-size: unset; -} - -.c11 { +.c9 { display: flex; flex-direction: column; } @@ -10863,6 +10976,10 @@ exports[`DataTable::direction should render correctly when direction is rtl when display: table; } +@media screen and (max-width: 599px) { + +} +
- -
-
-
+
- Test +
+ Test +
- -
-
- -
-
`; -exports[`DataTable::expandableRows should expand a row if expandableRows is true and expandOnRowClicked is true 1`] = ` +exports[`DataTable::direction should render correctly when direction is rtl when using a context menu 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -11022,7 +11111,7 @@ exports[`DataTable::expandableRows should expand a row if expandableRows is true line-height: normal; padding-left: 16px; padding-right: 16px; - word-break: break-word; + padding: 0; } .c7 { @@ -11047,6 +11136,17 @@ exports[`DataTable::expandableRows should expand a row if expandableRows is true padding: 0; } +.c15 { + position: relative; + display: flex; + align-items: center; + box-sizing: border-box; + line-height: normal; + padding-left: 16px; + padding-right: 16px; + word-break: break-word; +} + .c8 { flex-grow: 1; flex-shrink: 0; @@ -11061,56 +11161,13 @@ exports[`DataTable::expandableRows should expand a row if expandableRows is true text-overflow: ellipsis; } -.c15 { - display: inline-flex; +.c14 { + flex: 0 0 48px; + min-width: 48px; + justify-content: center; align-items: center; user-select: none; white-space: nowrap; - border: none; - background-color: transparent; - color: rgba(0,0,0,.54); - fill: rgba(0,0,0,.54); - background-color: transparent; - border-radius: 2px; - transition: 0.25s; - height: 100%; - width: 100%; -} - -.c15:hover:enabled { - cursor: pointer; -} - -.c15:disabled { - color: rgba(0, 0, 0, .18); -} - -.c15:hover:not(:disabled) { - cursor: pointer; - background-color: rgba(0,0,0,.12); -} - -.c15:focus { - outline: none; - background-color: rgba(0,0,0,.12); -} - -.c15 svg { - margin: auto; -} - -.c14 { - white-space: nowrap; - font-weight: 400; - min-width: 48px; - flex: 0 0 48px; -} - -.c17 { - width: 100%; - box-sizing: border-box; - color: rgba(0, 0, 0, 0.87); - background-color: #FFFFFF; } .c12 { @@ -11132,10 +11189,6 @@ exports[`DataTable::expandableRows should expand a row if expandableRows is true border-bottom-color: rgba(0,0,0,.12); } -.c12:hover { - cursor: pointer; -} - .c9 { display: inline-flex; align-items: center; @@ -11153,6 +11206,15 @@ exports[`DataTable::expandableRows should expand a row if expandableRows is true text-overflow: ellipsis; } +.c6 { + flex: 0 0 48px; + justify-content: center; + align-items: center; + user-select: none; + white-space: nowrap; + font-size: unset; +} + .c11 { display: flex; flex-direction: column; @@ -11173,13 +11235,9 @@ exports[`DataTable::expandableRows should expand a row if expandableRows is true display: table; } -.c6 { - white-space: nowrap; - flex: 0 0 48px; -} -
+ class="c5 c6 rdt_TableCol" + > + +
-
+
- Test +
+ Test +
@@ -11231,35 +11298,17 @@ exports[`DataTable::expandableRows should expand a row if expandableRows is true role="row" >
- +
-
-
- To add an expander pass in a component instance via - - expandableRowsComponent - - . You can then access props.data from this component. -
-
- -
-
-
+
+
+
Zuchinni
@@ -11336,7 +11356,7 @@ exports[`DataTable::expandableRows should expand a row if expandableRows is true
`; -exports[`DataTable::expandableRows should expand a row if expandableRows is true and expandOnRowDoubleClicked is true 1`] = ` +exports[`DataTable::expandableRows should expand a row if expandableRows is true and expandOnRowClicked is true 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -11557,19 +11577,21 @@ exports[`DataTable::expandableRows should expand a row if expandableRows is true class="c7 c8 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -11690,7 +11712,7 @@ exports[`DataTable::expandableRows should expand a row if expandableRows is true
`; -exports[`DataTable::expandableRows should not expand a row if the expander row is disabled and expandOnRowClicked is true 1`] = ` +exports[`DataTable::expandableRows should expand a row if expandableRows is true and expandOnRowDoubleClicked is true 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -11814,26 +11836,14 @@ exports[`DataTable::expandableRows should not expand a row if the expander row i flex: 0 0 48px; } -.c12 { - display: flex; - align-items: stretch; - align-content: stretch; +.c17 { width: 100%; box-sizing: border-box; - font-size: 13px; - font-weight: 400; color: rgba(0, 0, 0, 0.87); background-color: #FFFFFF; - min-height: 48px; -} - -.c12:not(:last-of-type) { - border-bottom-style: solid; - border-bottom-width: 1px; - border-bottom-color: rgba(0,0,0,.12); } -.c17 { +.c12 { display: flex; align-items: stretch; align-content: stretch; @@ -11846,13 +11856,13 @@ exports[`DataTable::expandableRows should not expand a row if the expander row i min-height: 48px; } -.c17:not(:last-of-type) { +.c12:not(:last-of-type) { border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgba(0,0,0,.12); } -.c17:hover { +.c12:hover { cursor: pointer; } @@ -11923,19 +11933,21 @@ exports[`DataTable::expandableRows should not expand a row if the expander row i class="c7 c8 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -11954,11 +11966,10 @@ exports[`DataTable::expandableRows should not expand a row if the expander row i class="c13 c14" >
+
+ To add an expander pass in a component instance via + + expandableRowsComponent + + . You can then access props.data from this component. +
+
+
@@ -12046,7 +12068,7 @@ exports[`DataTable::expandableRows should not expand a row if the expander row i
`; -exports[`DataTable::expandableRows should not render expandableRows expandableRows is missing 1`] = ` +exports[`DataTable::expandableRows should not expand a row if the expander row is disabled and expandOnRowClicked is true 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -12086,9 +12108,20 @@ exports[`DataTable::expandableRows should not render expandableRows expandableRo line-height: normal; padding-left: 16px; padding-right: 16px; + word-break: break-word; } -.c11 { +.c7 { + position: relative; + display: flex; + align-items: center; + box-sizing: border-box; + line-height: normal; + padding-left: 16px; + padding-right: 16px; +} + +.c13 { position: relative; display: flex; align-items: center; @@ -12097,9 +12130,10 @@ exports[`DataTable::expandableRows should not render expandableRows expandableRo padding-left: 16px; padding-right: 16px; word-break: break-word; + padding: 0; } -.c6 { +.c8 { flex-grow: 1; flex-shrink: 0; flex-basis: 0; @@ -12107,13 +12141,58 @@ exports[`DataTable::expandableRows should not render expandableRows expandableRo min-width: 100px; } -.c12 div:first-child { +.c16 div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } -.c10 { +.c15 { + display: inline-flex; + align-items: center; + user-select: none; + white-space: nowrap; + border: none; + background-color: transparent; + color: rgba(0,0,0,.54); + fill: rgba(0,0,0,.54); + background-color: transparent; + border-radius: 2px; + transition: 0.25s; + height: 100%; + width: 100%; +} + +.c15:hover:enabled { + cursor: pointer; +} + +.c15:disabled { + color: rgba(0, 0, 0, .18); +} + +.c15:hover:not(:disabled) { + cursor: pointer; + background-color: rgba(0,0,0,.12); +} + +.c15:focus { + outline: none; + background-color: rgba(0,0,0,.12); +} + +.c15 svg { + margin: auto; +} + +.c14 { + white-space: nowrap; + font-weight: 400; + min-width: 48px; + flex: 0 0 48px; +} + +.c12 { display: flex; align-items: stretch; align-content: stretch; @@ -12126,13 +12205,36 @@ exports[`DataTable::expandableRows should not render expandableRows expandableRo min-height: 48px; } -.c10:not(:last-of-type) { +.c12:not(:last-of-type) { border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgba(0,0,0,.12); } -.c7 { +.c17 { + display: flex; + align-items: stretch; + align-content: stretch; + width: 100%; + box-sizing: border-box; + font-size: 13px; + font-weight: 400; + color: rgba(0, 0, 0, 0.87); + background-color: #FFFFFF; + min-height: 48px; +} + +.c17:not(:last-of-type) { + border-bottom-style: solid; + border-bottom-width: 1px; + border-bottom-color: rgba(0,0,0,.12); +} + +.c17:hover { + cursor: pointer; +} + +.c9 { display: inline-flex; align-items: center; justify-content: inherit; @@ -12143,13 +12245,13 @@ exports[`DataTable::expandableRows should not render expandableRows expandableRo overflow: hidden; } -.c8 { +.c10 { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } -.c9 { +.c11 { display: flex; flex-direction: column; } @@ -12169,6 +12271,11 @@ exports[`DataTable::expandableRows should not render expandableRows expandableRo display: table; } +.c6 { + white-space: nowrap; + flex: 0 0 48px; +} +
@@ -12188,38 +12295,313 @@ exports[`DataTable::expandableRows should not render expandableRows expandableRo role="row" >
+
-
+
- Test +
+ Test +
+ +
+
+
+ Apple +
+
+
+
+
+ +
+
+
+ Zuchinni +
+
+
+
+
+
+
+`; + +exports[`DataTable::expandableRows should not render expandableRows expandableRows is missing 1`] = ` +.c2 { + position: relative; + box-sizing: border-box; + display: flex; + flex-direction: column; + width: 100%; + height: 100%; + max-width: 100%; + color: rgba(0, 0, 0, 0.87); + background-color: #FFFFFF; +} + +.c3 { + display: flex; + width: 100%; + color: rgba(0, 0, 0, 0.87); + font-size: 12px; + font-weight: 500; +} + +.c4 { + display: flex; + align-items: stretch; + width: 100%; + background-color: #FFFFFF; + min-height: 52px; + border-bottom-width: 1px; + border-bottom-color: rgba(0,0,0,.12); + border-bottom-style: solid; +} + +.c5 { + position: relative; + display: flex; + align-items: center; + box-sizing: border-box; + line-height: normal; + padding-left: 16px; + padding-right: 16px; +} + +.c11 { + position: relative; + display: flex; + align-items: center; + box-sizing: border-box; + line-height: normal; + padding-left: 16px; + padding-right: 16px; + word-break: break-word; +} + +.c6 { + flex-grow: 1; + flex-shrink: 0; + flex-basis: 0; + max-width: 100%; + min-width: 100px; +} + +.c12 div:first-child { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.c10 { + display: flex; + align-items: stretch; + align-content: stretch; + width: 100%; + box-sizing: border-box; + font-size: 13px; + font-weight: 400; + color: rgba(0, 0, 0, 0.87); + background-color: #FFFFFF; + min-height: 48px; +} + +.c10:not(:last-of-type) { + border-bottom-style: solid; + border-bottom-width: 1px; + border-bottom-color: rgba(0,0,0,.12); +} + +.c7 { + display: inline-flex; + align-items: center; + justify-content: inherit; + height: 100%; + width: 100%; + outline: none; + user-select: none; + overflow: hidden; +} + +.c8 { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.c9 { + display: flex; + flex-direction: column; +} + +.c0 { + position: relative; + width: 100%; + border-radius: inherit; + overflow-x: auto; + overflow-y: hidden; + min-height: 0; +} + +.c1 { + position: relative; + width: 100%; + display: table; +} + +
+
+
+
+
+
+
+
+
+ Test +
+
+
+
+
+
+
+
+
-
+
- Test +
+ Test +
@@ -12756,19 +13140,21 @@ exports[`DataTable::expandableRows should render correctly when expandableRowExp class="c7 c8 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -13099,19 +13485,21 @@ exports[`DataTable::expandableRows should render correctly when expandableRows i class="c7 c8 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -13438,19 +13826,21 @@ exports[`DataTable::expandableRows should render correctly when expandableRows i class="c7 c8 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -13716,19 +14106,21 @@ exports[`DataTable::expandableRows should render correctly when expandableRowsHi class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -13933,19 +14325,21 @@ exports[`DataTable::fixedHeader should render correctly when fixedHeader 1`] = ` class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -14150,19 +14544,21 @@ exports[`DataTable::fixedHeader should render correctly when fixedHeader and fix class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -14372,19 +14768,21 @@ exports[`DataTable::highlightOnHover should render correctly when highlightOnHov class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -14587,19 +14985,21 @@ exports[`DataTable::pointerOnHover should render correctly when pointerOnHover 1 class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -15141,19 +15541,21 @@ exports[`DataTable::progress/nodata when persistTableHead should disable TableHe class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -15289,19 +15691,21 @@ exports[`DataTable::progress/nodata when persistTableHead should disable TableHe class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -15434,34 +15838,717 @@ exports[`DataTable::progress/nodata when persistTableHead should only Loading an role="row" >
+
+
+
+ Test +
+
+
+
+
+
+
+
+ Loading... +
+
+
+
+
+`; + +exports[`DataTable::responsive should render correctly responsive by default 1`] = ` +.c2 { + position: relative; + box-sizing: border-box; + display: flex; + flex-direction: column; + width: 100%; + height: 100%; + max-width: 100%; + color: rgba(0, 0, 0, 0.87); + background-color: #FFFFFF; +} + +.c3 { + display: flex; + width: 100%; + color: rgba(0, 0, 0, 0.87); + font-size: 12px; + font-weight: 500; +} + +.c4 { + display: flex; + align-items: stretch; + width: 100%; + background-color: #FFFFFF; + min-height: 52px; + border-bottom-width: 1px; + border-bottom-color: rgba(0,0,0,.12); + border-bottom-style: solid; +} + +.c5 { + position: relative; + display: flex; + align-items: center; + box-sizing: border-box; + line-height: normal; + padding-left: 16px; + padding-right: 16px; +} + +.c11 { + position: relative; + display: flex; + align-items: center; + box-sizing: border-box; + line-height: normal; + padding-left: 16px; + padding-right: 16px; + word-break: break-word; +} + +.c6 { + flex-grow: 1; + flex-shrink: 0; + flex-basis: 0; + max-width: 100%; + min-width: 100px; +} + +.c12 div:first-child { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.c10 { + display: flex; + align-items: stretch; + align-content: stretch; + width: 100%; + box-sizing: border-box; + font-size: 13px; + font-weight: 400; + color: rgba(0, 0, 0, 0.87); + background-color: #FFFFFF; + min-height: 48px; +} + +.c10:not(:last-of-type) { + border-bottom-style: solid; + border-bottom-width: 1px; + border-bottom-color: rgba(0,0,0,.12); +} + +.c7 { + display: inline-flex; + align-items: center; + justify-content: inherit; + height: 100%; + width: 100%; + outline: none; + user-select: none; + overflow: hidden; +} + +.c8 { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.c9 { + display: flex; + flex-direction: column; +} + +.c0 { + position: relative; + width: 100%; + border-radius: inherit; + overflow-x: auto; + overflow-y: hidden; + min-height: 0; +} + +.c1 { + position: relative; + width: 100%; + display: table; +} + +
+
+
+
+
+
+
+
+
+ Test +
+
+
+
+
+
+
+
+
+
+ Apple +
+
+
+
+
+
+ Zuchinni +
+
+
+
+
+
+
+`; + +exports[`DataTable::responsive should render correctly when responsive=false 1`] = ` +.c2 { + position: relative; + box-sizing: border-box; + display: flex; + flex-direction: column; + width: 100%; + height: 100%; + max-width: 100%; + color: rgba(0, 0, 0, 0.87); + background-color: #FFFFFF; +} + +.c3 { + display: flex; + width: 100%; + color: rgba(0, 0, 0, 0.87); + font-size: 12px; + font-weight: 500; +} + +.c4 { + display: flex; + align-items: stretch; + width: 100%; + background-color: #FFFFFF; + min-height: 52px; + border-bottom-width: 1px; + border-bottom-color: rgba(0,0,0,.12); + border-bottom-style: solid; +} + +.c5 { + position: relative; + display: flex; + align-items: center; + box-sizing: border-box; + line-height: normal; + padding-left: 16px; + padding-right: 16px; +} + +.c11 { + position: relative; + display: flex; + align-items: center; + box-sizing: border-box; + line-height: normal; + padding-left: 16px; + padding-right: 16px; + word-break: break-word; +} + +.c6 { + flex-grow: 1; + flex-shrink: 0; + flex-basis: 0; + max-width: 100%; + min-width: 100px; +} + +.c12 div:first-child { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.c10 { + display: flex; + align-items: stretch; + align-content: stretch; + width: 100%; + box-sizing: border-box; + font-size: 13px; + font-weight: 400; + color: rgba(0, 0, 0, 0.87); + background-color: #FFFFFF; + min-height: 48px; +} + +.c10:not(:last-of-type) { + border-bottom-style: solid; + border-bottom-width: 1px; + border-bottom-color: rgba(0,0,0,.12); +} + +.c7 { + display: inline-flex; + align-items: center; + justify-content: inherit; + height: 100%; + width: 100%; + outline: none; + user-select: none; + overflow: hidden; +} + +.c8 { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.c9 { + display: flex; + flex-direction: column; +} + +.c0 { + position: relative; + width: 100%; + border-radius: inherit; +} + +.c1 { + position: relative; + width: 100%; + display: table; +} + +
+
+
+
+
+
+
+
+
+ Test +
+
+
+
+
+
+
+
+
+
+ Apple +
+
+
+
+
+
+ Zuchinni +
+
+
+
+
+
+
+`; + +exports[`DataTable::selectableRows should not render a select all checkbox when selectableRowsNoSelectAll is true 1`] = ` +.c2 { + position: relative; + box-sizing: border-box; + display: flex; + flex-direction: column; + width: 100%; + height: 100%; + max-width: 100%; + color: rgba(0, 0, 0, 0.87); + background-color: #FFFFFF; +} + +.c3 { + display: flex; + width: 100%; + color: rgba(0, 0, 0, 0.87); + font-size: 12px; + font-weight: 500; +} + +.c4 { + display: flex; + align-items: stretch; + width: 100%; + background-color: #FFFFFF; + min-height: 52px; + border-bottom-width: 1px; + border-bottom-color: rgba(0,0,0,.12); + border-bottom-style: solid; +} + +.c5 { + position: relative; + display: flex; + align-items: center; + box-sizing: border-box; + line-height: normal; + padding-left: 16px; + padding-right: 16px; + word-break: break-word; +} + +.c6 { + position: relative; + display: flex; + align-items: center; + box-sizing: border-box; + line-height: normal; + padding-left: 16px; + padding-right: 16px; +} + +.c12 { + position: relative; + display: flex; + align-items: center; + box-sizing: border-box; + line-height: normal; + padding-left: 16px; + padding-right: 16px; + word-break: break-word; + padding: 0; +} + +.c7 { + flex-grow: 1; + flex-shrink: 0; + flex-basis: 0; + max-width: 100%; + min-width: 100px; +} + +.c14 div:first-child { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.c13 { + flex: 0 0 48px; + min-width: 48px; + justify-content: center; + align-items: center; + user-select: none; + white-space: nowrap; +} + +.c11 { + display: flex; + align-items: stretch; + align-content: stretch; + width: 100%; + box-sizing: border-box; + font-size: 13px; + font-weight: 400; + color: rgba(0, 0, 0, 0.87); + background-color: #FFFFFF; + min-height: 48px; +} + +.c11:not(:last-of-type) { + border-bottom-style: solid; + border-bottom-width: 1px; + border-bottom-color: rgba(0,0,0,.12); +} + +.c8 { + display: inline-flex; + align-items: center; + justify-content: inherit; + height: 100%; + width: 100%; + outline: none; + user-select: none; + overflow: hidden; +} + +.c9 { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.c10 { + display: flex; + flex-direction: column; +} + +.c0 { + position: relative; + width: 100%; + border-radius: inherit; + overflow-x: auto; + overflow-y: hidden; + min-height: 0; +} + +.c1 { + position: relative; + width: 100%; + display: table; +} + +
+
+
+
+
+
+
+
+
+
+ Test +
+
+
+
+
+
+
+
+
+ +
+
-
- Test -
+ Apple
-
-
- Loading... +
+ +
+
+
+ Zuchinni +
+
@@ -15469,7 +16556,7 @@ exports[`DataTable::progress/nodata when persistTableHead should only Loading an
`; -exports[`DataTable::responsive should render correctly responsive by default 1`] = ` +exports[`DataTable::selectableRows should render correctly when selectableRows is true 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -15509,9 +16596,20 @@ exports[`DataTable::responsive should render correctly responsive by default 1`] line-height: normal; padding-left: 16px; padding-right: 16px; + padding: 0; } -.c11 { +.c7 { + position: relative; + display: flex; + align-items: center; + box-sizing: border-box; + line-height: normal; + padding-left: 16px; + padding-right: 16px; +} + +.c13 { position: relative; display: flex; align-items: center; @@ -15520,9 +16618,21 @@ exports[`DataTable::responsive should render correctly responsive by default 1`] padding-left: 16px; padding-right: 16px; word-break: break-word; + padding: 0; } -.c6 { +.c15 { + position: relative; + display: flex; + align-items: center; + box-sizing: border-box; + line-height: normal; + padding-left: 16px; + padding-right: 16px; + word-break: break-word; +} + +.c8 { flex-grow: 1; flex-shrink: 0; flex-basis: 0; @@ -15530,13 +16640,22 @@ exports[`DataTable::responsive should render correctly responsive by default 1`] min-width: 100px; } -.c12 div:first-child { +.c16 div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } -.c10 { +.c14 { + flex: 0 0 48px; + min-width: 48px; + justify-content: center; + align-items: center; + user-select: none; + white-space: nowrap; +} + +.c12 { display: flex; align-items: stretch; align-content: stretch; @@ -15549,13 +16668,13 @@ exports[`DataTable::responsive should render correctly responsive by default 1`] min-height: 48px; } -.c10:not(:last-of-type) { +.c12:not(:last-of-type) { border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgba(0,0,0,.12); } -.c7 { +.c9 { display: inline-flex; align-items: center; justify-content: inherit; @@ -15566,13 +16685,22 @@ exports[`DataTable::responsive should render correctly responsive by default 1`] overflow: hidden; } -.c8 { +.c10 { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } -.c9 { +.c6 { + flex: 0 0 48px; + justify-content: center; + align-items: center; + user-select: none; + white-space: nowrap; + font-size: unset; +} + +.c11 { display: flex; flex-direction: column; } @@ -15612,37 +16740,59 @@ exports[`DataTable::responsive should render correctly responsive by default 1`] >
+ +
+
-
+
- Test +
+ Test +
+ +
+
+ +
+
`; -exports[`DataTable::responsive should render correctly when responsive=false 1`] = ` +exports[`DataTable::selectableRows should render correctly when selectableRowsHighlight is true and a row is selected 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -15720,9 +16880,20 @@ exports[`DataTable::responsive should render correctly when responsive=false 1`] line-height: normal; padding-left: 16px; padding-right: 16px; + padding: 0; } -.c11 { +.c7 { + position: relative; + display: flex; + align-items: center; + box-sizing: border-box; + line-height: normal; + padding-left: 16px; + padding-right: 16px; +} + +.c13 { position: relative; display: flex; align-items: center; @@ -15731,9 +16902,21 @@ exports[`DataTable::responsive should render correctly when responsive=false 1`] padding-left: 16px; padding-right: 16px; word-break: break-word; + padding: 0; } -.c6 { +.c15 { + position: relative; + display: flex; + align-items: center; + box-sizing: border-box; + line-height: normal; + padding-left: 16px; + padding-right: 16px; + word-break: break-word; +} + +.c8 { flex-grow: 1; flex-shrink: 0; flex-basis: 0; @@ -15741,13 +16924,22 @@ exports[`DataTable::responsive should render correctly when responsive=false 1`] min-width: 100px; } -.c12 div:first-child { +.c16 div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } -.c10 { +.c14 { + flex: 0 0 48px; + min-width: 48px; + justify-content: center; + align-items: center; + user-select: none; + white-space: nowrap; +} + +.c17 { display: flex; align-items: stretch; align-content: stretch; @@ -15760,13 +16952,38 @@ exports[`DataTable::responsive should render correctly when responsive=false 1`] min-height: 48px; } -.c10:not(:last-of-type) { +.c17:not(:last-of-type) { border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgba(0,0,0,.12); } -.c7 { +.c12 { + display: flex; + align-items: stretch; + align-content: stretch; + width: 100%; + box-sizing: border-box; + font-size: 13px; + font-weight: 400; + color: rgba(0, 0, 0, 0.87); + background-color: #FFFFFF; + min-height: 48px; +} + +.c12:not(:last-of-type) { + border-bottom-style: solid; + border-bottom-width: 1px; + border-bottom-color: rgba(0,0,0,.12); +} + +.c12:nth-of-type(n) { + color: rgba(0, 0, 0, 0.87); + background-color: #e3f2fd; + border-bottom-color: #FFFFFF; +} + +.c9 { display: inline-flex; align-items: center; justify-content: inherit; @@ -15777,13 +16994,22 @@ exports[`DataTable::responsive should render correctly when responsive=false 1`] overflow: hidden; } -.c8 { +.c10 { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } -.c9 { +.c6 { + flex: 0 0 48px; + justify-content: center; + align-items: center; + user-select: none; + white-space: nowrap; + font-size: unset; +} + +.c11 { display: flex; flex-direction: column; } @@ -15792,6 +17018,9 @@ exports[`DataTable::responsive should render correctly when responsive=false 1`] position: relative; width: 100%; border-radius: inherit; + overflow-x: auto; + overflow-y: hidden; + min-height: 0; } .c1 { @@ -15819,38 +17048,60 @@ exports[`DataTable::responsive should render correctly when responsive=false 1`] role="row" >
+ +
+
-
+
- Test +
+ Test +
+ +
+
+ +
+
`; -exports[`DataTable::selectableRows should not render a select all checkbox when selectableRowsNoSelectAll is true 1`] = ` +exports[`DataTable::sorting a custom column sorting function is used 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -15928,17 +17189,6 @@ exports[`DataTable::selectableRows should not render a select all checkbox when line-height: normal; padding-left: 16px; padding-right: 16px; - word-break: break-word; -} - -.c6 { - position: relative; - display: flex; - align-items: center; - box-sizing: border-box; - line-height: normal; - padding-left: 16px; - padding-right: 16px; } .c12 { @@ -15950,10 +17200,9 @@ exports[`DataTable::selectableRows should not render a select all checkbox when padding-left: 16px; padding-right: 16px; word-break: break-word; - padding: 0; } -.c7 { +.c6 { flex-grow: 1; flex-shrink: 0; flex-basis: 0; @@ -15961,21 +17210,12 @@ exports[`DataTable::selectableRows should not render a select all checkbox when min-width: 100px; } -.c14 div:first-child { +.c13 div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } -.c13 { - flex: 0 0 48px; - min-width: 48px; - justify-content: center; - align-items: center; - user-select: none; - white-space: nowrap; -} - .c11 { display: flex; align-items: stretch; @@ -15995,7 +17235,15 @@ exports[`DataTable::selectableRows should not render a select all checkbox when border-bottom-color: rgba(0,0,0,.12); } -.c8 { +.c9 { + padding: 2px; + color: inherit; + flex-grow: 0; + flex-shrink: 0; + opacity: 1; +} + +.c7 { display: inline-flex; align-items: center; justify-content: inherit; @@ -16004,9 +17252,29 @@ exports[`DataTable::selectableRows should not render a select all checkbox when outline: none; user-select: none; overflow: hidden; + cursor: pointer; } -.c9 { +.c7 span.__rdt_custom_sort_icon__ i, +.c7 span.__rdt_custom_sort_icon__ svg { + transform: 'translate3d(0, 0, 0)'; + opacity: 1; + color: inherit; + font-size: 18px; + height: 18px; + width: 18px; + backface-visibility: hidden; + transform-style: preserve-3d; + transition-duration: 95ms; + transition-property: transform; +} + +.c7 span.__rdt_custom_sort_icon__.asc i, +.c7 span.__rdt_custom_sort_icon__.asc svg { + transform: rotate(180deg); +} + +.c8 { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; @@ -16051,26 +17319,28 @@ exports[`DataTable::selectableRows should not render a select all checkbox when role="row" >
-
-
+
- Test +
+ Test +
+ + ▲ +
@@ -16086,17 +17356,7 @@ exports[`DataTable::selectableRows should not render a select all checkbox when role="row" >
- -
-
- -
-
`; -exports[`DataTable::selectableRows should render correctly when selectableRows is true 1`] = ` +exports[`DataTable::sorting should render correctly and bypass internal sort when sortServer = true and asc sort 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -16184,32 +17434,9 @@ exports[`DataTable::selectableRows should render correctly when selectableRows i line-height: normal; padding-left: 16px; padding-right: 16px; - padding: 0; -} - -.c7 { - position: relative; - display: flex; - align-items: center; - box-sizing: border-box; - line-height: normal; - padding-left: 16px; - padding-right: 16px; -} - -.c13 { - position: relative; - display: flex; - align-items: center; - box-sizing: border-box; - line-height: normal; - padding-left: 16px; - padding-right: 16px; - word-break: break-word; - padding: 0; } -.c15 { +.c12 { position: relative; display: flex; align-items: center; @@ -16220,7 +17447,7 @@ exports[`DataTable::selectableRows should render correctly when selectableRows i word-break: break-word; } -.c8 { +.c6 { flex-grow: 1; flex-shrink: 0; flex-basis: 0; @@ -16228,22 +17455,13 @@ exports[`DataTable::selectableRows should render correctly when selectableRows i min-width: 100px; } -.c16 div:first-child { +.c13 div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } -.c14 { - flex: 0 0 48px; - min-width: 48px; - justify-content: center; - align-items: center; - user-select: none; - white-space: nowrap; -} - -.c12 { +.c11 { display: flex; align-items: stretch; align-content: stretch; @@ -16256,13 +17474,21 @@ exports[`DataTable::selectableRows should render correctly when selectableRows i min-height: 48px; } -.c12:not(:last-of-type) { +.c11:not(:last-of-type) { border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgba(0,0,0,.12); } .c9 { + padding: 2px; + color: inherit; + flex-grow: 0; + flex-shrink: 0; + opacity: 1; +} + +.c7 { display: inline-flex; align-items: center; justify-content: inherit; @@ -16271,24 +17497,35 @@ exports[`DataTable::selectableRows should render correctly when selectableRows i outline: none; user-select: none; overflow: hidden; + cursor: pointer; } -.c10 { - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; +.c7 span.__rdt_custom_sort_icon__ i, +.c7 span.__rdt_custom_sort_icon__ svg { + transform: 'translate3d(0, 0, 0)'; + opacity: 1; + color: inherit; + font-size: 18px; + height: 18px; + width: 18px; + backface-visibility: hidden; + transform-style: preserve-3d; + transition-duration: 95ms; + transition-property: transform; } -.c6 { - flex: 0 0 48px; - justify-content: center; - align-items: center; - user-select: none; +.c7 span.__rdt_custom_sort_icon__.asc i, +.c7 span.__rdt_custom_sort_icon__.asc svg { + transform: rotate(180deg); +} + +.c8 { + overflow: hidden; white-space: nowrap; - font-size: unset; + text-overflow: ellipsis; } -.c11 { +.c10 { display: flex; flex-direction: column; } @@ -16328,57 +17565,43 @@ exports[`DataTable::selectableRows should render correctly when selectableRows i >
- -
-
-
+
- Test +
+ Test +
+ + ▲ +
- -
-
- -
-
`; -exports[`DataTable::selectableRows should render correctly when selectableRowsHighlight is true and a row is selected 1`] = ` +exports[`DataTable::sorting should render correctly and bypass internal sort when sortServer = true and desc sort 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -16466,32 +17679,9 @@ exports[`DataTable::selectableRows should render correctly when selectableRowsHi line-height: normal; padding-left: 16px; padding-right: 16px; - padding: 0; -} - -.c7 { - position: relative; - display: flex; - align-items: center; - box-sizing: border-box; - line-height: normal; - padding-left: 16px; - padding-right: 16px; -} - -.c13 { - position: relative; - display: flex; - align-items: center; - box-sizing: border-box; - line-height: normal; - padding-left: 16px; - padding-right: 16px; - word-break: break-word; - padding: 0; } -.c15 { +.c12 { position: relative; display: flex; align-items: center; @@ -16502,7 +17692,7 @@ exports[`DataTable::selectableRows should render correctly when selectableRowsHi word-break: break-word; } -.c8 { +.c6 { flex-grow: 1; flex-shrink: 0; flex-basis: 0; @@ -16510,41 +17700,13 @@ exports[`DataTable::selectableRows should render correctly when selectableRowsHi min-width: 100px; } -.c16 div:first-child { +.c13 div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } -.c14 { - flex: 0 0 48px; - min-width: 48px; - justify-content: center; - align-items: center; - user-select: none; - white-space: nowrap; -} - -.c17 { - display: flex; - align-items: stretch; - align-content: stretch; - width: 100%; - box-sizing: border-box; - font-size: 13px; - font-weight: 400; - color: rgba(0, 0, 0, 0.87); - background-color: #FFFFFF; - min-height: 48px; -} - -.c17:not(:last-of-type) { - border-bottom-style: solid; - border-bottom-width: 1px; - border-bottom-color: rgba(0,0,0,.12); -} - -.c12 { +.c11 { display: flex; align-items: stretch; align-content: stretch; @@ -16557,19 +17719,21 @@ exports[`DataTable::selectableRows should render correctly when selectableRowsHi min-height: 48px; } -.c12:not(:last-of-type) { +.c11:not(:last-of-type) { border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgba(0,0,0,.12); } -.c12:nth-of-type(n) { - color: rgba(0, 0, 0, 0.87); - background-color: #e3f2fd; - border-bottom-color: #FFFFFF; +.c9 { + padding: 2px; + color: inherit; + flex-grow: 0; + flex-shrink: 0; + opacity: 1; } -.c9 { +.c7 { display: inline-flex; align-items: center; justify-content: inherit; @@ -16578,24 +17742,35 @@ exports[`DataTable::selectableRows should render correctly when selectableRowsHi outline: none; user-select: none; overflow: hidden; + cursor: pointer; } -.c10 { - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; +.c7 span.__rdt_custom_sort_icon__ i, +.c7 span.__rdt_custom_sort_icon__ svg { + transform: 'translate3d(0, 0, 0)'; + opacity: 1; + color: inherit; + font-size: 18px; + height: 18px; + width: 18px; + backface-visibility: hidden; + transform-style: preserve-3d; + transition-duration: 95ms; + transition-property: transform; } -.c6 { - flex: 0 0 48px; - justify-content: center; - align-items: center; - user-select: none; +.c7 span.__rdt_custom_sort_icon__.asc i, +.c7 span.__rdt_custom_sort_icon__.asc svg { + transform: rotate(180deg); +} + +.c8 { + overflow: hidden; white-space: nowrap; - font-size: unset; + text-overflow: ellipsis; } -.c11 { +.c10 { display: flex; flex-direction: column; } @@ -16635,57 +17810,43 @@ exports[`DataTable::selectableRows should render correctly when selectableRowsHi >
- -
-
-
+
- Test +
+ Test +
+ + ▲ +
- -
-
- -
-
`; -exports[`DataTable::sorting a custom column sorting function is used 1`] = ` +exports[`DataTable::sorting should render correctly and not be sorted when a column.sort === false 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -16775,7 +17926,7 @@ exports[`DataTable::sorting a custom column sorting function is used 1`] = ` padding-right: 16px; } -.c12 { +.c11 { position: relative; display: flex; align-items: center; @@ -16794,13 +17945,13 @@ exports[`DataTable::sorting a custom column sorting function is used 1`] = ` min-width: 100px; } -.c13 div:first-child { +.c12 div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } -.c11 { +.c10 { display: flex; align-items: stretch; align-content: stretch; @@ -16813,20 +17964,12 @@ exports[`DataTable::sorting a custom column sorting function is used 1`] = ` min-height: 48px; } -.c11:not(:last-of-type) { +.c10:not(:last-of-type) { border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgba(0,0,0,.12); } -.c9 { - padding: 2px; - color: inherit; - flex-grow: 0; - flex-shrink: 0; - opacity: 1; -} - .c7 { display: inline-flex; align-items: center; @@ -16836,26 +17979,6 @@ exports[`DataTable::sorting a custom column sorting function is used 1`] = ` outline: none; user-select: none; overflow: hidden; - cursor: pointer; -} - -.c7 span.__rdt_custom_sort_icon__ i, -.c7 span.__rdt_custom_sort_icon__ svg { - transform: 'translate3d(0, 0, 0)'; - opacity: 1; - color: inherit; - font-size: 18px; - height: 18px; - width: 18px; - backface-visibility: hidden; - transform-style: preserve-3d; - transition-duration: 95ms; - transition-property: transform; -} - -.c7 span.__rdt_custom_sort_icon__.asc i, -.c7 span.__rdt_custom_sort_icon__.asc svg { - transform: rotate(180deg); } .c8 { @@ -16864,7 +17987,7 @@ exports[`DataTable::sorting a custom column sorting function is used 1`] = ` text-overflow: ellipsis; } -.c10 { +.c9 { display: flex; flex-direction: column; } @@ -16906,39 +18029,37 @@ exports[`DataTable::sorting a custom column sorting function is used 1`] = ` class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
- - ▲ -
`; -exports[`DataTable::sorting should render correctly and bypass internal sort when sortServer = true and asc sort 1`] = ` +exports[`DataTable::sorting should render correctly when a column is sorted from asc to desc 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -17149,24 +18270,26 @@ exports[`DataTable::sorting should render correctly and bypass internal sort whe class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
+ + ▲ +
- - ▲ -
@@ -17219,7 +18342,7 @@ exports[`DataTable::sorting should render correctly and bypass internal sort whe
`; -exports[`DataTable::sorting should render correctly and bypass internal sort when sortServer = true and desc sort 1`] = ` +exports[`DataTable::sorting should render correctly when a column is sorted in default asc 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -17392,24 +18515,26 @@ exports[`DataTable::sorting should render correctly and bypass internal sort whe class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
+ + ▲ +
- - ▲ -
@@ -17462,7 +18587,7 @@ exports[`DataTable::sorting should render correctly and bypass internal sort whe
`; -exports[`DataTable::sorting should render correctly and not be sorted when a column.sort === false 1`] = ` +exports[`DataTable::sorting should render correctly with a custom sortIcon 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -17557,6 +18682,38 @@ exports[`DataTable::sorting should render correctly and not be sorted when a col outline: none; user-select: none; overflow: hidden; + cursor: pointer; +} + +.c7 span.__rdt_custom_sort_icon__ i, +.c7 span.__rdt_custom_sort_icon__ svg { + transform: 'translate3d(0, 0, 0)'; + opacity: 0; + color: inherit; + font-size: 18px; + height: 18px; + width: 18px; + backface-visibility: hidden; + transform-style: preserve-3d; + transition-duration: 95ms; + transition-property: transform; +} + +.c7 span.__rdt_custom_sort_icon__.asc i, +.c7 span.__rdt_custom_sort_icon__.asc svg { + transform: rotate(180deg); +} + +.c7:hover, +.c7:focus { + opacity: 0.7; +} + +.c7:hover span, +.c7:focus span, +.c7:hover span.__rdt_custom_sort_icon__ *, +.c7:focus span.__rdt_custom_sort_icon__ * { + opacity: 0.7; } .c8 { @@ -17607,19 +18764,27 @@ exports[`DataTable::sorting should render correctly and not be sorted when a col class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
+ +
+ ASC +
+
@@ -17673,7 +18838,7 @@ exports[`DataTable::sorting should render correctly and not be sorted when a col
`; -exports[`DataTable::sorting should render correctly when a column is sorted from asc to desc 1`] = ` +exports[`DataTable::sorting should render correctly with a custom sortIcon and column.right = true 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -17715,7 +18880,7 @@ exports[`DataTable::sorting should render correctly when a column is sorted from padding-right: 16px; } -.c12 { +.c11 { position: relative; display: flex; align-items: center; @@ -17732,15 +18897,16 @@ exports[`DataTable::sorting should render correctly when a column is sorted from flex-basis: 0; max-width: 100%; min-width: 100px; + justify-content: flex-end; } -.c13 div:first-child { +.c12 div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } -.c11 { +.c10 { display: flex; align-items: stretch; align-content: stretch; @@ -17753,20 +18919,12 @@ exports[`DataTable::sorting should render correctly when a column is sorted from min-height: 48px; } -.c11:not(:last-of-type) { +.c10:not(:last-of-type) { border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgba(0,0,0,.12); } -.c9 { - padding: 2px; - color: inherit; - flex-grow: 0; - flex-shrink: 0; - opacity: 1; -} - .c7 { display: inline-flex; align-items: center; @@ -17782,7 +18940,7 @@ exports[`DataTable::sorting should render correctly when a column is sorted from .c7 span.__rdt_custom_sort_icon__ i, .c7 span.__rdt_custom_sort_icon__ svg { transform: 'translate3d(0, 0, 0)'; - opacity: 1; + opacity: 0; color: inherit; font-size: 18px; height: 18px; @@ -17798,13 +18956,25 @@ exports[`DataTable::sorting should render correctly when a column is sorted from transform: rotate(180deg); } +.c7:hover, +.c7:focus { + opacity: 0.7; +} + +.c7:hover span, +.c7:focus span, +.c7:hover span.__rdt_custom_sort_icon__ *, +.c7:focus span.__rdt_custom_sort_icon__ * { + opacity: 0.7; +} + .c8 { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } -.c10 { +.c9 { display: flex; flex-direction: column; } @@ -17846,39 +19016,43 @@ exports[`DataTable::sorting should render correctly when a column is sorted from class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test + +
+ ASC +
+
+
+ Test +
- - ▲ -
`; -exports[`DataTable::sorting should render correctly when a column is sorted in default asc 1`] = ` +exports[`DataTable::sorting should render correctly with a default sort field and the icon to the right when column.right = true and the native sort icon 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -17975,6 +19149,7 @@ exports[`DataTable::sorting should render correctly when a column is sorted in d flex-basis: 0; max-width: 100%; min-width: 100px; + justify-content: flex-end; } .c13 div:first-child { @@ -18002,12 +19177,12 @@ exports[`DataTable::sorting should render correctly when a column is sorted in d border-bottom-color: rgba(0,0,0,.12); } -.c9 { +.c8 { padding: 2px; color: inherit; flex-grow: 0; flex-shrink: 0; - opacity: 1; + opacity: 0; } .c7 { @@ -18025,7 +19200,7 @@ exports[`DataTable::sorting should render correctly when a column is sorted in d .c7 span.__rdt_custom_sort_icon__ i, .c7 span.__rdt_custom_sort_icon__ svg { transform: 'translate3d(0, 0, 0)'; - opacity: 1; + opacity: 0; color: inherit; font-size: 18px; height: 18px; @@ -18041,7 +19216,19 @@ exports[`DataTable::sorting should render correctly when a column is sorted in d transform: rotate(180deg); } -.c8 { +.c7:hover, +.c7:focus { + opacity: 0.7; +} + +.c7:hover span, +.c7:focus span, +.c7:hover span.__rdt_custom_sort_icon__ *, +.c7:focus span.__rdt_custom_sort_icon__ * { + opacity: 0.7; +} + +.c9 { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; @@ -18089,24 +19276,26 @@ exports[`DataTable::sorting should render correctly when a column is sorted in d class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test + + ▲ + +
+ Test +
- - ▲ -
@@ -18159,7 +19348,7 @@ exports[`DataTable::sorting should render correctly when a column is sorted in d
`; -exports[`DataTable::sorting should render correctly with a custom sortIcon 1`] = ` +exports[`DataTable::sorting should render correctly with a default sort field and the native sort icon 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -18201,7 +19390,7 @@ exports[`DataTable::sorting should render correctly with a custom sortIcon 1`] = padding-right: 16px; } -.c11 { +.c12 { position: relative; display: flex; align-items: center; @@ -18220,13 +19409,13 @@ exports[`DataTable::sorting should render correctly with a custom sortIcon 1`] = min-width: 100px; } -.c12 div:first-child { +.c13 div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } -.c10 { +.c11 { display: flex; align-items: stretch; align-content: stretch; @@ -18239,12 +19428,20 @@ exports[`DataTable::sorting should render correctly with a custom sortIcon 1`] = min-height: 48px; } -.c10:not(:last-of-type) { +.c11:not(:last-of-type) { border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgba(0,0,0,.12); } +.c9 { + padding: 2px; + color: inherit; + flex-grow: 0; + flex-shrink: 0; + opacity: 0; +} + .c7 { display: inline-flex; align-items: center; @@ -18294,7 +19491,7 @@ exports[`DataTable::sorting should render correctly with a custom sortIcon 1`] = text-overflow: ellipsis; } -.c9 { +.c10 { display: flex; flex-direction: column; } @@ -18336,41 +19533,41 @@ exports[`DataTable::sorting should render correctly with a custom sortIcon 1`] = class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test -
- -
- ASC +
+ Test
- + + ▲ + +
`; -exports[`DataTable::sorting should render correctly with a custom sortIcon and column.right = true 1`] = ` +exports[`DataTable::sorting should render correctly with a defaultSortAsc = false 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -18450,7 +19647,7 @@ exports[`DataTable::sorting should render correctly with a custom sortIcon and c padding-right: 16px; } -.c11 { +.c12 { position: relative; display: flex; align-items: center; @@ -18467,16 +19664,15 @@ exports[`DataTable::sorting should render correctly with a custom sortIcon and c flex-basis: 0; max-width: 100%; min-width: 100px; - justify-content: flex-end; } -.c12 div:first-child { +.c13 div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } -.c10 { +.c11 { display: flex; align-items: stretch; align-content: stretch; @@ -18489,12 +19685,21 @@ exports[`DataTable::sorting should render correctly with a custom sortIcon and c min-height: 48px; } -.c10:not(:last-of-type) { +.c11:not(:last-of-type) { border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgba(0,0,0,.12); } +.c9 { + padding: 2px; + color: inherit; + flex-grow: 0; + flex-shrink: 0; + opacity: 0; + transform: rotate(180deg); +} + .c7 { display: inline-flex; align-items: center; @@ -18544,7 +19749,7 @@ exports[`DataTable::sorting should render correctly with a custom sortIcon and c text-overflow: ellipsis; } -.c9 { +.c10 { display: flex; flex-direction: column; } @@ -18586,41 +19791,41 @@ exports[`DataTable::sorting should render correctly with a custom sortIcon and c class="c5 c6 rdt_TableCol" data-column-id="1" > -
- -
- ASC -
-
+
- Test +
+ Test +
+ + ▲ +
`; -exports[`DataTable::sorting should render correctly with a default sort field and the icon to the right when column.right = true and the native sort icon 1`] = ` +exports[`DataTable::sorting should sort if the column is selected and the Enter key is pressed 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -18717,7 +19922,6 @@ exports[`DataTable::sorting should render correctly with a default sort field an flex-basis: 0; max-width: 100%; min-width: 100px; - justify-content: flex-end; } .c13 div:first-child { @@ -18745,12 +19949,13 @@ exports[`DataTable::sorting should render correctly with a default sort field an border-bottom-color: rgba(0,0,0,.12); } -.c8 { +.c9 { padding: 2px; color: inherit; flex-grow: 0; flex-shrink: 0; - opacity: 0; + opacity: 1; + transform: rotate(180deg); } .c7 { @@ -18768,7 +19973,7 @@ exports[`DataTable::sorting should render correctly with a default sort field an .c7 span.__rdt_custom_sort_icon__ i, .c7 span.__rdt_custom_sort_icon__ svg { transform: 'translate3d(0, 0, 0)'; - opacity: 0; + opacity: 1; color: inherit; font-size: 18px; height: 18px; @@ -18784,19 +19989,7 @@ exports[`DataTable::sorting should render correctly with a default sort field an transform: rotate(180deg); } -.c7:hover, -.c7:focus { - opacity: 0.7; -} - -.c7:hover span, -.c7:focus span, -.c7:hover span.__rdt_custom_sort_icon__ *, -.c7:focus span.__rdt_custom_sort_icon__ * { - opacity: 0.7; -} - -.c9 { +.c8 { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; @@ -18844,23 +20037,25 @@ exports[`DataTable::sorting should render correctly with a default sort field an class="c5 c6 rdt_TableCol" data-column-id="1" > -
- - ▲ - +
- Test +
+ Test +
+ + ▲ +
@@ -18872,39 +20067,39 @@ exports[`DataTable::sorting should render correctly with a default sort field an >
- Apple + Zuchinni
- Zuchinni + Apple
@@ -18914,7 +20109,7 @@ exports[`DataTable::sorting should render correctly with a default sort field an
`; -exports[`DataTable::sorting should render correctly with a default sort field and the native sort icon 1`] = ` +exports[`DataTable::striped should render correctly when striped 1`] = ` .c2 { position: relative; box-sizing: border-box; @@ -18956,7 +20151,7 @@ exports[`DataTable::sorting should render correctly with a default sort field an padding-right: 16px; } -.c12 { +.c11 { position: relative; display: flex; align-items: center; @@ -18975,13 +20170,13 @@ exports[`DataTable::sorting should render correctly with a default sort field an min-width: 100px; } -.c13 div:first-child { +.c12 div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } -.c11 { +.c10 { display: flex; align-items: stretch; align-content: stretch; @@ -18992,20 +20187,33 @@ exports[`DataTable::sorting should render correctly with a default sort field an color: rgba(0, 0, 0, 0.87); background-color: #FFFFFF; min-height: 48px; + color: rgba(0, 0, 0, 0.87); + background-color: #FAFAFA; } -.c11:not(:last-of-type) { +.c10:not(:last-of-type) { border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgba(0,0,0,.12); } -.c9 { - padding: 2px; - color: inherit; - flex-grow: 0; - flex-shrink: 0; - opacity: 0; +.c13 { + display: flex; + align-items: stretch; + align-content: stretch; + width: 100%; + box-sizing: border-box; + font-size: 13px; + font-weight: 400; + color: rgba(0, 0, 0, 0.87); + background-color: #FFFFFF; + min-height: 48px; +} + +.c13:not(:last-of-type) { + border-bottom-style: solid; + border-bottom-width: 1px; + border-bottom-color: rgba(0,0,0,.12); } .c7 { @@ -19017,38 +20225,6 @@ exports[`DataTable::sorting should render correctly with a default sort field an outline: none; user-select: none; overflow: hidden; - cursor: pointer; -} - -.c7 span.__rdt_custom_sort_icon__ i, -.c7 span.__rdt_custom_sort_icon__ svg { - transform: 'translate3d(0, 0, 0)'; - opacity: 0; - color: inherit; - font-size: 18px; - height: 18px; - width: 18px; - backface-visibility: hidden; - transform-style: preserve-3d; - transition-duration: 95ms; - transition-property: transform; -} - -.c7 span.__rdt_custom_sort_icon__.asc i, -.c7 span.__rdt_custom_sort_icon__.asc svg { - transform: rotate(180deg); -} - -.c7:hover, -.c7:focus { - opacity: 0.7; -} - -.c7:hover span, -.c7:focus span, -.c7:hover span.__rdt_custom_sort_icon__ *, -.c7:focus span.__rdt_custom_sort_icon__ * { - opacity: 0.7; } .c8 { @@ -19057,7 +20233,7 @@ exports[`DataTable::sorting should render correctly with a default sort field an text-overflow: ellipsis; } -.c10 { +.c9 { display: flex; flex-direction: column; } @@ -19099,39 +20275,37 @@ exports[`DataTable::sorting should render correctly with a default sort field an class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
- - ▲ -
`; -exports[`DataTable::sorting should render correctly with a defaultSortAsc = false 1`] = ` +exports[`DataTable::subHeader should render correctly when a subheader is enabled 1`] = ` +.c0 { + position: relative; + display: flex; + flex: 1 1 auto; + box-sizing: border-box; + align-items: center; + padding: 4px 16px 4px 24px; + width: 100%; + justify-content: flex-end; + flex-wrap: wrap; + background-color: #FFFFFF; + min-height: 52px; +} + +
+
+
+`; + +exports[`DataTable::subHeader should render correctly with center align 1`] = ` +.c0 { + position: relative; + display: flex; + flex: 1 1 auto; + box-sizing: border-box; + align-items: center; + padding: 4px 16px 4px 24px; + width: 100%; + justify-content: center; + flex-wrap: wrap; + background-color: #FFFFFF; + min-height: 52px; +} + +
+
+
+`; + +exports[`DataTable::subHeader should render correctly with left align 1`] = ` +.c0 { + position: relative; + display: flex; + flex: 1 1 auto; + box-sizing: border-box; + align-items: center; + padding: 4px 16px 4px 24px; + width: 100%; + justify-content: flex-start; + flex-wrap: wrap; + background-color: #FFFFFF; + min-height: 52px; +} + +
+
+
+`; + +exports[`DataTable::subHeader should render correctly with right align 1`] = ` +.c0 { + position: relative; + display: flex; + flex: 1 1 auto; + box-sizing: border-box; + align-items: center; + padding: 4px 16px 4px 24px; + width: 100%; + justify-content: flex-end; + flex-wrap: wrap; + background-color: #FFFFFF; + min-height: 52px; +} + +
+
+
+`; + +exports[`DataTable::subHeader should render when subHeaderWrap is false 1`] = ` +.c0 { + position: relative; + display: flex; + flex: 1 1 auto; + box-sizing: border-box; + align-items: center; + padding: 4px 16px 4px 24px; + width: 100%; + justify-content: flex-end; + flex-wrap: nowrap; + background-color: #FFFFFF; + min-height: 52px; +} + +
+
+
+`; + +exports[`DataTable:filter it should filter if filterable is set true 1`] = ` .c2 { position: relative; box-sizing: border-box; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; flex-direction: column; width: 100%; height: 100%; max-width: 100%; - color: rgba(0, 0, 0, 0.87); + color: rgba(0,0,0,0.87); background-color: #FFFFFF; } .c3 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; display: flex; width: 100%; - color: rgba(0, 0, 0, 0.87); + color: rgba(0,0,0,0.87); font-size: 12px; font-weight: 500; } .c4 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; display: flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; align-items: stretch; width: 100%; background-color: #FFFFFF; @@ -19203,7 +20506,13 @@ exports[`DataTable::sorting should render correctly with a defaultSortAsc = fals .c5 { position: relative; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; display: flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; align-items: center; box-sizing: border-box; line-height: normal; @@ -19211,9 +20520,15 @@ exports[`DataTable::sorting should render correctly with a defaultSortAsc = fals padding-right: 16px; } -.c12 { +.c11 { position: relative; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; display: flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; align-items: center; box-sizing: border-box; line-height: normal; @@ -19223,88 +20538,74 @@ exports[`DataTable::sorting should render correctly with a defaultSortAsc = fals } .c6 { + -webkit-box-flex: 1; + -webkit-flex-grow: 1; + -ms-flex-positive: 1; flex-grow: 1; + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; flex-shrink: 0; + -webkit-flex-basis: 0; + -ms-flex-preferred-size: 0; flex-basis: 0; max-width: 100%; min-width: 100px; } -.c13 div:first-child { +.c12 div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } -.c11 { +.c10 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; display: flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; align-items: stretch; + -webkit-align-content: stretch; + -ms-flex-line-pack: stretch; align-content: stretch; width: 100%; box-sizing: border-box; font-size: 13px; font-weight: 400; - color: rgba(0, 0, 0, 0.87); + color: rgba(0,0,0,0.87); background-color: #FFFFFF; min-height: 48px; } -.c11:not(:last-of-type) { +.c10:not(:last-of-type) { border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgba(0,0,0,.12); } -.c9 { - padding: 2px; - color: inherit; - flex-grow: 0; - flex-shrink: 0; - opacity: 0; - transform: rotate(180deg); -} - .c7 { + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; display: inline-flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; align-items: center; + -webkit-box-pack: inherit; + -webkit-justify-content: inherit; + -ms-flex-pack: inherit; justify-content: inherit; height: 100%; width: 100%; outline: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; user-select: none; overflow: hidden; - cursor: pointer; -} - -.c7 span.__rdt_custom_sort_icon__ i, -.c7 span.__rdt_custom_sort_icon__ svg { - transform: 'translate3d(0, 0, 0)'; - opacity: 0; - color: inherit; - font-size: 18px; - height: 18px; - width: 18px; - backface-visibility: hidden; - transform-style: preserve-3d; - transition-duration: 95ms; - transition-property: transform; -} - -.c7 span.__rdt_custom_sort_icon__.asc i, -.c7 span.__rdt_custom_sort_icon__.asc svg { - transform: rotate(180deg); -} - -.c7:hover, -.c7:focus { - opacity: 0.7; -} - -.c7:hover span, -.c7:focus span, -.c7:hover span.__rdt_custom_sort_icon__ *, -.c7:focus span.__rdt_custom_sort_icon__ * { - opacity: 0.7; } .c8 { @@ -19313,8 +20614,13 @@ exports[`DataTable::sorting should render correctly with a defaultSortAsc = fals text-overflow: ellipsis; } -.c10 { +.c9 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; flex-direction: column; } @@ -19355,39 +20661,46 @@ exports[`DataTable::sorting should render correctly with a defaultSortAsc = fals class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
- - ▲ - + +
-
-
-
- Zuchinni -
-
-
`; -exports[`DataTable::sorting should sort if the column is selected and the Enter key is pressed 1`] = ` +exports[`DataTable:filter it should not filter if filterServer is set true 1`] = ` .c2 { position: relative; box-sizing: border-box; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; flex-direction: column; width: 100%; height: 100%; max-width: 100%; - color: rgba(0, 0, 0, 0.87); + color: rgba(0,0,0,0.87); background-color: #FFFFFF; } .c3 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; display: flex; width: 100%; - color: rgba(0, 0, 0, 0.87); + color: rgba(0,0,0,0.87); font-size: 12px; font-weight: 500; } .c4 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; display: flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; align-items: stretch; width: 100%; background-color: #FFFFFF; @@ -19459,7 +20767,13 @@ exports[`DataTable::sorting should sort if the column is selected and the Enter .c5 { position: relative; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; display: flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; align-items: center; box-sizing: border-box; line-height: normal; @@ -19467,9 +20781,15 @@ exports[`DataTable::sorting should sort if the column is selected and the Enter padding-right: 16px; } -.c12 { +.c11 { position: relative; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; display: flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; align-items: center; box-sizing: border-box; line-height: normal; @@ -19479,76 +20799,74 @@ exports[`DataTable::sorting should sort if the column is selected and the Enter } .c6 { + -webkit-box-flex: 1; + -webkit-flex-grow: 1; + -ms-flex-positive: 1; flex-grow: 1; + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; flex-shrink: 0; + -webkit-flex-basis: 0; + -ms-flex-preferred-size: 0; flex-basis: 0; max-width: 100%; min-width: 100px; } -.c13 div:first-child { +.c12 div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } -.c11 { +.c10 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; display: flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; align-items: stretch; + -webkit-align-content: stretch; + -ms-flex-line-pack: stretch; align-content: stretch; width: 100%; box-sizing: border-box; font-size: 13px; font-weight: 400; - color: rgba(0, 0, 0, 0.87); + color: rgba(0,0,0,0.87); background-color: #FFFFFF; min-height: 48px; } -.c11:not(:last-of-type) { +.c10:not(:last-of-type) { border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgba(0,0,0,.12); } -.c9 { - padding: 2px; - color: inherit; - flex-grow: 0; - flex-shrink: 0; - opacity: 1; - transform: rotate(180deg); -} - .c7 { + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; display: inline-flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; align-items: center; + -webkit-box-pack: inherit; + -webkit-justify-content: inherit; + -ms-flex-pack: inherit; justify-content: inherit; height: 100%; width: 100%; outline: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; user-select: none; overflow: hidden; - cursor: pointer; -} - -.c7 span.__rdt_custom_sort_icon__ i, -.c7 span.__rdt_custom_sort_icon__ svg { - transform: 'translate3d(0, 0, 0)'; - opacity: 1; - color: inherit; - font-size: 18px; - height: 18px; - width: 18px; - backface-visibility: hidden; - transform-style: preserve-3d; - transition-duration: 95ms; - transition-property: transform; -} - -.c7 span.__rdt_custom_sort_icon__.asc i, -.c7 span.__rdt_custom_sort_icon__.asc svg { - transform: rotate(180deg); } .c8 { @@ -19557,8 +20875,13 @@ exports[`DataTable::sorting should sort if the column is selected and the Enter text-overflow: ellipsis; } -.c10 { +.c9 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; flex-direction: column; } @@ -19599,67 +20922,74 @@ exports[`DataTable::sorting should sort if the column is selected and the Enter class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
- - ▲ - + +
- Zuchinni + Apple
- Apple + Zuchinni
@@ -19669,29 +20999,43 @@ exports[`DataTable::sorting should sort if the column is selected and the Enter
`; -exports[`DataTable::striped should render correctly when striped 1`] = ` +exports[`DataTable:filter should not be rendered if column.name is missing 1`] = ` .c2 { position: relative; box-sizing: border-box; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; flex-direction: column; width: 100%; height: 100%; max-width: 100%; - color: rgba(0, 0, 0, 0.87); + color: rgba(0,0,0,0.87); background-color: #FFFFFF; } .c3 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; display: flex; width: 100%; - color: rgba(0, 0, 0, 0.87); + color: rgba(0,0,0,0.87); font-size: 12px; font-weight: 500; } .c4 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; display: flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; align-items: stretch; width: 100%; background-color: #FFFFFF; @@ -19703,7 +21047,13 @@ exports[`DataTable::striped should render correctly when striped 1`] = ` .c5 { position: relative; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; display: flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; align-items: center; box-sizing: border-box; line-height: normal; @@ -19711,9 +21061,15 @@ exports[`DataTable::striped should render correctly when striped 1`] = ` padding-right: 16px; } -.c11 { +.c9 { position: relative; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; display: flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; align-items: center; box-sizing: border-box; line-height: normal; @@ -19723,78 +21079,60 @@ exports[`DataTable::striped should render correctly when striped 1`] = ` } .c6 { + -webkit-box-flex: 1; + -webkit-flex-grow: 1; + -ms-flex-positive: 1; flex-grow: 1; + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; flex-shrink: 0; + -webkit-flex-basis: 0; + -ms-flex-preferred-size: 0; flex-basis: 0; max-width: 100%; min-width: 100px; } -.c12 div:first-child { +.c10 div:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } -.c10 { - display: flex; - align-items: stretch; - align-content: stretch; - width: 100%; - box-sizing: border-box; - font-size: 13px; - font-weight: 400; - color: rgba(0, 0, 0, 0.87); - background-color: #FFFFFF; - min-height: 48px; - color: rgba(0, 0, 0, 0.87); - background-color: #FAFAFA; -} - -.c10:not(:last-of-type) { - border-bottom-style: solid; - border-bottom-width: 1px; - border-bottom-color: rgba(0,0,0,.12); -} - -.c13 { +.c8 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; display: flex; + -webkit-align-items: stretch; + -webkit-box-align: stretch; + -ms-flex-align: stretch; align-items: stretch; + -webkit-align-content: stretch; + -ms-flex-line-pack: stretch; align-content: stretch; width: 100%; box-sizing: border-box; font-size: 13px; font-weight: 400; - color: rgba(0, 0, 0, 0.87); + color: rgba(0,0,0,0.87); background-color: #FFFFFF; min-height: 48px; } -.c13:not(:last-of-type) { +.c8:not(:last-of-type) { border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: rgba(0,0,0,.12); } .c7 { - display: inline-flex; - align-items: center; - justify-content: inherit; - height: 100%; - width: 100%; - outline: none; - user-select: none; - overflow: hidden; -} - -.c8 { - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; -} - -.c9 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; flex-direction: column; } @@ -19834,36 +21172,20 @@ exports[`DataTable::striped should render correctly when striped 1`] = `
-
-
- Test -
-
-
+ />
`; -exports[`DataTable::subHeader should render correctly when a subheader is enabled 1`] = ` -.c0 { - position: relative; - display: flex; - flex: 1 1 auto; - box-sizing: border-box; - align-items: center; - padding: 4px 16px 4px 24px; - width: 100%; - justify-content: flex-end; - flex-wrap: wrap; - background-color: #FFFFFF; - min-height: 52px; -} - -
-
-
-`; - -exports[`DataTable::subHeader should render correctly with center align 1`] = ` -.c0 { - position: relative; - display: flex; - flex: 1 1 auto; - box-sizing: border-box; - align-items: center; - padding: 4px 16px 4px 24px; - width: 100%; - justify-content: center; - flex-wrap: wrap; - background-color: #FFFFFF; - min-height: 52px; -} - -
-
-
-`; - -exports[`DataTable::subHeader should render correctly with left align 1`] = ` -.c0 { - position: relative; - display: flex; - flex: 1 1 auto; - box-sizing: border-box; - align-items: center; - padding: 4px 16px 4px 24px; - width: 100%; - justify-content: flex-start; - flex-wrap: wrap; - background-color: #FFFFFF; - min-height: 52px; -} - -
-
-
-`; - -exports[`DataTable::subHeader should render correctly with right align 1`] = ` -.c0 { - position: relative; - display: flex; - flex: 1 1 auto; - box-sizing: border-box; - align-items: center; - padding: 4px 16px 4px 24px; - width: 100%; - justify-content: flex-end; - flex-wrap: wrap; - background-color: #FFFFFF; - min-height: 52px; -} - -
-
-
-`; - -exports[`DataTable::subHeader should render when subHeaderWrap is false 1`] = ` -.c0 { - position: relative; - display: flex; - flex: 1 1 auto; - box-sizing: border-box; - align-items: center; - padding: 4px 16px 4px 24px; - width: 100%; - justify-content: flex-end; - flex-wrap: nowrap; - background-color: #FFFFFF; - min-height: 52px; -} - -
-
-
-`; - exports[`data prop changes should update state if the data prop changes 1`] = ` .c2 { position: relative; @@ -20161,19 +21368,21 @@ exports[`data prop changes should update state if the data prop changes 1`] = ` class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -20654,19 +21863,21 @@ exports[`should render correctly when conditionalRowStyles is used with an expan class="c7 c8 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -21004,19 +22215,21 @@ exports[`should render correctly when conditionalRowStyles is used with an expan class="c7 c8 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -21282,19 +22495,21 @@ exports[`should render correctly when conditionalRowStyles with classNames is us class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -21496,19 +22711,21 @@ exports[`should render correctly when disabled 1`] = ` class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Test +
+ Test +
@@ -21707,19 +22924,21 @@ exports[`should render the correctly when using selector function 1`] = ` class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Name +
+ Name +
@@ -21899,19 +23118,21 @@ exports[`should render the correctly when using selector function and a format f class="c5 c6 rdt_TableCol" data-column-id="1" > -
+
- Name +
+ Name +
diff --git a/src/DataTable/defaultProps.tsx b/src/DataTable/defaultProps.tsx index 3908f027..1ba2cd5c 100644 --- a/src/DataTable/defaultProps.tsx +++ b/src/DataTable/defaultProps.tsx @@ -68,6 +68,7 @@ export const defaultProps = { subHeaderAlign: Alignment.RIGHT, subHeaderWrap: true, subHeaderComponent: null, + filterServer: false, fixedHeader: false, fixedHeaderScrollHeight: '100vh', pagination: false, @@ -94,6 +95,7 @@ export const defaultProps = { direction: Direction.AUTO, onChangePage: noop, onChangeRowsPerPage: noop, + onFilter: noop, onRowClicked: noop, onRowDoubleClicked: noop, onRowMouseEnter: noop, diff --git a/src/DataTable/tableReducer.ts b/src/DataTable/tableReducer.ts index a9c9beaf..8bd9ea4e 100644 --- a/src/DataTable/tableReducer.ts +++ b/src/DataTable/tableReducer.ts @@ -134,6 +134,22 @@ export function tableReducer(state: TableState, action: Action): TableS }; } + case 'FILTER_CHANGE': { + const { filterText, selectedColumn } = action; + const keyName = selectedColumn.name?.toString() || selectedColumn.id?.toString() || 'noname'; + let filters = { ...state.filters }; + if (!filterText && keyName in filters) { + delete filters[keyName]; + } else { + filters = { ...filters, [keyName]: { column: selectedColumn, value: filterText } }; + } + return { + ...state, + filters, + filterActive: Object.keys(filters).length > 0, + }; + } + case 'CHANGE_PAGE': { const { page, paginationServer, visibleOnly, persistSelectedOnPageChange } = action; const mergeSelections = paginationServer && persistSelectedOnPageChange; diff --git a/src/DataTable/types.ts b/src/DataTable/types.ts index 66a7ecb9..8de9625d 100644 --- a/src/DataTable/types.ts +++ b/src/DataTable/types.ts @@ -28,6 +28,11 @@ export type PaginationComponentProps = { }; export type PaginationComponent = React.ComponentType; +export type FilterComponentProps = { + name: string; + onChange: (e: React.ChangeEvent) => void; +} + export type TableProps = { actions?: React.ReactNode | React.ReactNode[]; className?: string; @@ -54,6 +59,7 @@ export type TableProps = { expandableRowsHideExpander?: boolean; expandOnRowClicked?: boolean; expandOnRowDoubleClicked?: boolean; + filterServer?: boolean; fixedHeader?: boolean; fixedHeaderScrollHeight?: string; highlightOnHover?: boolean; @@ -64,6 +70,7 @@ export type TableProps = { noTableHead?: boolean; onChangePage?: PaginationChangePage; onChangeRowsPerPage?: PaginationChangeRowsPerPage; + onFilter?: (filters: { [k: string]: { column: TableColumn; value: string } }) => void; onRowClicked?: (row: T, e: React.MouseEvent) => void; onRowDoubleClicked?: (row: T, e: React.MouseEvent) => void; onRowMouseEnter?: (row: T, e: React.MouseEvent) => void; @@ -132,8 +139,11 @@ export type TableColumnBase = { omit?: boolean; right?: boolean; sortable?: boolean; + filterable?: boolean; + filterValues?: Primitive[] | {value: Primitive, label: string}[]; style?: CSSObject; width?: string; + filterValue?: string wrap?: boolean; }; @@ -245,6 +255,9 @@ export type TableState = { contextMessage: ContextMessage; selectedCount: number; selectedRows: T[]; + filteredData: T[]; + filterActive: boolean; + filters: { [k: string]: { column: TableColumn; value: string } }; selectedColumn: TableColumn; sortDirection: SortOrder; currentPage: number; @@ -345,6 +358,18 @@ export interface SortAction { clearSelectedOnSort: boolean; } +export interface FilterAction { + type: 'FILTER_CHANGE'; + filterServer: boolean; + filterText: string; + selectedColumn: TableColumn; + clearSelectedOnSort: boolean; + //pagination: boolean; + //paginationServer: boolean; + //visibleOnly: boolean; + //persistSelectedOnSort: boolean; +} + export interface PaginationPageAction { type: 'CHANGE_PAGE'; page: number; @@ -374,6 +399,8 @@ export type Action = | SingleRowAction | MultiRowAction | SortAction + | FilterAction | PaginationPageAction | PaginationRowsPerPageAction + | FilterAction | ClearSelectedRowsAction; diff --git a/stories/DataTable/KitchenSink.stories.js b/stories/DataTable/KitchenSink.stories.js index f1f25780..aa761b16 100644 --- a/stories/DataTable/KitchenSink.stories.js +++ b/stories/DataTable/KitchenSink.stories.js @@ -20,12 +20,14 @@ const columns = [ name: 'Title', selector: row => row.title, sortable: true, + filterable: true, reorder: true, }, { name: 'Director', selector: row => row.director, sortable: true, + filterable: true, reorder: true, }, { @@ -33,6 +35,8 @@ const columns = [ selector: row => row.year, sortable: true, reorder: true, + filterable: true, + filterValues: [1998, 1999, {value: '2000', label: 'Millenium'}, 2001], }, ]; @@ -74,6 +78,8 @@ const KitchenSinkStory = ({ ); return ( + <> +

JavaScript

+ /> + ); }; diff --git a/stories/DataTable/sorting/remote.mdx b/stories/DataTable/sorting/remote.mdx index 46b883af..7dd44886 100644 --- a/stories/DataTable/sorting/remote.mdx +++ b/stories/DataTable/sorting/remote.mdx @@ -15,12 +15,14 @@ const columns = [ selector: row => row.title, sortable: true, sortField: 'title', + filterable: true, }, { name: 'Director', selector: row => row.director, sortable: true, sortField: 'director', + filterable: true, }, { name: 'Year', diff --git a/stories/DataTable/sorting/remote.stories.js b/stories/DataTable/sorting/remote.stories.js index a3282a97..8e0e479c 100644 --- a/stories/DataTable/sorting/remote.stories.js +++ b/stories/DataTable/sorting/remote.stories.js @@ -3,6 +3,7 @@ import doc from './remote.mdx'; import { orderBy } from 'lodash'; import initData from '../../constants/sampleMovieData'; import DataTable from '../../../src/index'; +import { getProperty } from '../../../src/DataTable/util'; const columns = [ { @@ -10,12 +11,15 @@ const columns = [ selector: row => row.title, sortable: true, sortField: 'title', + filterable: true, + filterValue: 'god', }, { name: 'Director', selector: row => row.director, sortable: true, sortField: 'director', + filterable: true, }, { name: 'Year', @@ -41,11 +45,32 @@ export const RemoteSort = () => { }, 100); }; + const handleFilter = filters => { + // simulate server sort + + setLoading(true); + + // instead of setTimeout this is where you would handle your API call. + setTimeout(() => { + const filteredRows = initData.filter((row, idx) => + Object.entries(filters) // + .reduce((acc, [_, { column, value }]) => { + return new RegExp(`.*${value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}.*`, 'i').test(getProperty(row, column.selector, null, idx)?.toString() ?? '') + ? acc + : false; + }, true), + ); + setData(filteredRows); + setLoading(false); + }, 100); + }; + return ( row.title, sortable: true, + filterable: true, }, { name: 'Director', selector: row => row.director, sortable: true, + filterable: true, }, { name: 'Year', diff --git a/stories/columns.stories.mdx b/stories/columns.stories.mdx index 5c20d6e1..f184babf 100644 --- a/stories/columns.stories.mdx +++ b/stories/columns.stories.mdx @@ -18,15 +18,17 @@ import { Meta } from '@storybook/addon-docs'; | right | boolean | no | Right aligns the content in the cell. useful for numbers | | center | boolean | no | Center aligns the content in the cell | | compact | boolean | no | Sets cell padding to 0 | -| ignoreRowClick | boolean | no | Prevents the `onRowClicked` and `onRowDoubleClicked` event from being passed on the specific TableCell column. This is useful for a menu or button where you do not want the `onRowClicked` triggered, such as when using `onRowClicked` for navigation or routing | +| ignoreRowClick | boolean | no | Prevents the `onRowClicked` and `onRowDoubleClicked` event from being passed on the specific TableCell column. This is useful for a menu or button where you do not want the `onRowClicked` triggered, such as when using `onRowClicked` for navigation or routing | | button | boolean | no | This is like `ignoreRowClick` except it will apply additional styling for button placement. you do not need to set `ignoreRowClick` when using `button` | | wrap | boolean | no | Whether the cell content should be allowed to wrap.

**Note:** `cell` negates `wrap` | | allowOverflow | boolean | no | Allows content in the cell to overflow. useful for menus/layovers that do not rely on "smart" positioning | | hide | integer or `sm`, `md`, `lg` | no | Specify a screen size (breakpoint) as an integer (in pixels) that hides the column when resizing the browser window. You can also use the preset values of: `sm` (small), `md`(medium), and `lg`(large). The default breakpoints are defined [here](#built-in-breakpoints) | | omit | boolean | no | Omits the column from the table. useful if you need to hide access to data. | +| filterable | boolean | no | If the column is filterable.

**Note:** `selector` and `name` is required for the column to filter | +| filterValues | Primitive[] or `or {value: Primitive, label: string}[]`| no | If this list is defined a select box with its values is rendered as filter cell instead of an input element | | sortable | boolean | no | If the column is sortable.

**Note:** `selector` is required for the column to sort | | sortField | string | no | This field is typically used with [onSort](/docs/api-props--page#sorting) and when you want to give a specific column a string based name. Another example is remote sorting and when using [sortSever](/docs/api-props--page#sorting) together with `onSort` to call an API for sorting. `sortField` will gives the field you can use to build your sort query url. In this case you would provide the `sortField` to build a URL: `https://api.github.com/search/repositories?q=blog&sort=${column.sortField}&order=${sortDirection}` | -| sortFunction | `(a, b) => {}` | no | By default RDT uses `Array.sort`, however, you can override the default behavior by passing in a custom sort function. [defining a custom sort function](/docs/api-custom-sorting--page#custom-sorting---sortfunction) | +| sortFunction | `(a, b) => {}` | no | By default RDT uses `Array.sort`, however, you can override the default behavior by passing in a custom sort function. [defining a custom sort function](/docs/api-custom-sorting--page#custom-sorting---sortfunction) | | reorder | boolean | no | Allows a column to be dragged and reordered | | style | object | no | Allows you to customize the css of the cell using css-in-js [style objects](https://www.styled-components.com/docs/advanced#style-objects) | | conditionalCellStyles | array | no | Allows an array of [conditional style objects](/docs/api-custom-conditional-formatting--page#conditional-style-object) to conditionally apply css styles to a cell | diff --git a/stories/development.stories.mdx b/stories/development.stories.mdx index 37f2fa2b..cea505cf 100644 --- a/stories/development.stories.mdx +++ b/stories/development.stories.mdx @@ -1,4 +1,4 @@ -import { Meta } from '@storybook/addon-docs'; +# import { Meta } from '@storybook/addon-docs'; diff --git a/stories/intro.stories.mdx b/stories/intro.stories.mdx index 215511a6..cfc2a94f 100644 --- a/stories/intro.stories.mdx +++ b/stories/intro.stories.mdx @@ -17,6 +17,7 @@ If you want to achieve balance with the force and want a simple but flexible tab - Declarative configuration - Built-in and configurable: - Sorting + - Column Filtering - Selectable Rows - Expandable Rows - Pagination diff --git a/stories/props.stories.mdx b/stories/props.stories.mdx index 5ac4860b..8e459c78 100644 --- a/stories/props.stories.mdx +++ b/stories/props.stories.mdx @@ -42,6 +42,13 @@ import { Meta } from '@storybook/addon-docs'; | sortFunction | _See description_ | no | null | Pass in your own custom sort function. **Your function must return an new array reference**, otherwise RDT will not re-render. For example, `Array.sort` sorts the array in place but because of JavaScript object equality it will be the same reference and will not re-render. A common pattern is to return `yourArray.slice(0)` which creates a new array.

**Type:** `(rows, selector, direction) => {}` | | onSort | _See description_ | no | | Callback to access the sort state when a column is clicked. Returns `(column, sortDirection, event)`. See [Columns](/docs/api-columns--page) for Column Definitions API.

**Type:** `(selectedColumn, sortDirection, sortedRows) => {}` | +# Filtering + +| Property | Type | Required | Default | Description | +| ------------------ | --------------------------------------- | -------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| filterServer | boolean | no | null | Disables internal filtering for use with server-side/remote filtering or when you want to manually control the filter behavior. place your filtering logic and/or api calls in an `onFilter` handler. | +| onFilter | `(filters: { [k: string]: { column: TableColumn; value: string } }) => void` | no | | callback to filter data whenever a filter expression is entered. Filter is an object that has one key for each column with a filter expression entered. Each key is equal to the columns `name`, `column` hold the column definition and `value` is the current filter expression for this column. | + # Row Selection | Property | Type | Required | Default | Description | diff --git a/stories/simpleExamples.stories.mdx b/stories/simpleExamples.stories.mdx index 5a6f59c7..6c8e6240 100644 --- a/stories/simpleExamples.stories.mdx +++ b/stories/simpleExamples.stories.mdx @@ -86,6 +86,49 @@ function MyComponent() { }; ``` +## Basic Filtering + +Adding sorting a table has never been easier: + +```js +import DataTable from 'react-data-table-component'; + +const columns = [ + { + name: 'Title', + selector: row => row.title, + filterable: true, + }, + { + name: 'Year', + selector: row => row.year, + filterable: true, + }, +]; + +const data = [ + { + id: 1, + title: 'Beetlejuice', + year: '1988', + }, + { + id: 2, + title: 'Ghostbusters', + year: '1984', + }, +] + +function MyComponent() { + return ( + + ); +}; +``` + ## Selectable Rows Adding selectable rows is usually quite a bit of code. Let's simplify: diff --git a/yarn.lock b/yarn.lock index c1bcd6d8..9ce62473 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12977,9 +12977,9 @@ __metadata: languageName: node linkType: hard -"react-data-table-component@workspace:.": +"react-data-table-component-with-filter@workspace:.": version: 0.0.0-use.local - resolution: "react-data-table-component@workspace:." + resolution: "react-data-table-component-with-filter@workspace:." dependencies: "@babel/core": "npm:^7.23.7" "@babel/eslint-parser": "npm:^7.23.3"