Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EuiTableRowCellCheckbox to TS #1964

Merged
merged 3 commits into from
May 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## [`master`](https://github.com/elastic/eui/tree/master)

- Converted `EuiTableRowCellCheckbox` to TS ([#1964](https://github.com/elastic/eui/pull/1964))
- Update `caniuse-lite` version resolution ([#1970](https://github.com/elastic/eui/pull/1970))
- Add a webpack directive for naming icon chunks ([#1944])(https://github.com/elastic/eui/pull/1944))

Expand Down
15 changes: 6 additions & 9 deletions src/components/table/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { CommonProps, NoArgCallback } from '../common';
import { IconType } from '../icon';
import { HorizontalAlignment } from '../../services/alignment';
import { EuiTableRowCellCheckbox as TableRowCellCheckbox } from './table_row_cell_checkbox';

import {
FunctionComponent,
Expand Down Expand Up @@ -165,20 +166,16 @@ declare module '@elastic/eui' {
}

export const EuiTableRowCell: FunctionComponent<
CommonProps & TdHTMLAttributes<HTMLTableCellElement> & EuiTableRowCellSharedPropsShape & EuiTableRowCellProps
CommonProps &
TdHTMLAttributes<HTMLTableCellElement> &
EuiTableRowCellSharedPropsShape &
EuiTableRowCellProps
>;

/**
* table row cell checkbox type defs
*
* @see './table_row_cell_checkbox.js'
*/

export interface EuiTableRowCellCheckboxProps {}

export const EuiTableRowCellCheckbox: FunctionComponent<
CommonProps &
TdHTMLAttributes<HTMLTableCellElement> &
EuiTableRowCellCheckboxProps
>;
export const EuiTableRowCellCheckbox: typeof TableRowCellCheckbox;
}
18 changes: 0 additions & 18 deletions src/components/table/table_row_cell_checkbox.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { render } from 'enzyme';
import { requiredProps } from '../../test/required_props';
import { requiredProps } from '../../test';

import { EuiTableRowCellCheckbox } from './table_row_cell_checkbox';

Expand Down
15 changes: 15 additions & 0 deletions src/components/table/table_row_cell_checkbox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React, { FunctionComponent, TdHTMLAttributes } from 'react';
import classNames from 'classnames';
import { CommonProps } from '../common';

export const EuiTableRowCellCheckbox: FunctionComponent<
CommonProps & TdHTMLAttributes<HTMLTableCellElement>
> = ({ children, className, ...rest }) => {
const classes = classNames('euiTableRowCellCheckbox', className);

return (
<td className={classes} {...rest}>
<div className="euiTableCellContent">{children}</div>
</td>
);
};