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

Mark properties on EUIFlyout as optional in typings #1003

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
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
## [`master`](https://github.com/elastic/eui/tree/master)

- Gave `EuiFlyout` close button a data-test-subj ([#1000](https://github.com/elastic/eui/pull/1000/files))
- Make some proprties of `EuiFlyout` optional ([#1003](https://github.com/elastic/eui/pull/1003))
- Add typings for `EuiFlyout`, `EuiFlyoutBody`, `EuiFlyoutHeader`, and `EuiFlyoutFooter` ([#1001](https://github.com/elastic/eui/pull/1001))
- Gave `EuiFlyout` close button a data-test-subj ([#1000](https://github.com/elastic/eui/pull/1000))

## [`1.2.1`](https://github.com/elastic/eui/tree/v1.2.1)

Expand Down
8 changes: 4 additions & 4 deletions src/components/flyout/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
declare module '@elastic/eui' {
export interface EuiFlyoutProps {
onClose: () => void;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add children?: ReactNode; to props of components that can have children. The official defs that come with react do that (eg. DOMAttributes). For most of the existing EUI defs we inherit that from DOMAttributes and HTMLAttributes). While I think it's not a must or critical (that is, things will work without it), I believe that it also serves an accurate documentation for the use and capabilities of the components.

size: 's' | 'm' | 'l';
size?: 's' | 'm' | 'l';
/**
* Hides the default close button. You must provide another close button somewhere within the flyout.
*/
hideCloseButton: boolean;
hideCloseButton?: boolean;
/**
* Locks the mouse / keyboard focus to within the flyout
*/
ownFocus: boolean;
ownFocus?: boolean;
}

export const EuiFlyout: React.SFC<
Expand All @@ -20,7 +20,7 @@ declare module '@elastic/eui' {
export const EuiFlyoutBody: React.SFC<CommonProps>;

export interface EuiFlyoutHeaderProps {
hasBorder: boolean;
hasBorder?: boolean;
}
export const EuiFlyoutHeader: React.SFC<CommonProps & EuiFlyoutHeaderProps>;

Expand Down