From d3e44b98d15c7aadee0b3b08bec772b57c2b9970 Mon Sep 17 00:00:00 2001 From: maryia-lapata Date: Thu, 8 Aug 2019 13:15:21 +0300 Subject: [PATCH 1/5] Add TS for onChange in EUIRange --- src/components/form/range/index.d.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/form/range/index.d.ts b/src/components/form/range/index.d.ts index 90a35463fe0..86ea5ffd576 100644 --- a/src/components/form/range/index.d.ts +++ b/src/components/form/range/index.d.ts @@ -51,6 +51,11 @@ declare module '@elastic/eui' { tickInterval?: number; valueAppend?: ReactNode; valuePrepend?: ReactNode; + + onChange?: ( + event: React.ChangeEvent, + isValid: boolean + ) => void; } export const EuiRange: FunctionComponent< @@ -70,7 +75,7 @@ declare module '@elastic/eui' { export const EuiDualRange: FunctionComponent< CommonProps & - Omit, 'value'> & + Omit, 'value' | 'onChange'> & EuiRangeProps & EuiDualRangeProps >; From 36897e9bc340213e9fd5afebe3f1fda942b1ee6e Mon Sep 17 00:00:00 2001 From: maryia-lapata Date: Thu, 8 Aug 2019 13:21:46 +0300 Subject: [PATCH 2/5] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b352718ccdb..d71b4a4bf68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## [`master`](https://github.com/elastic/eui/tree/master) -No public interface changes since `13.3.0`. +Added missing `onChange` TS defs for EuiRange ([#2211](https://github.com/elastic/eui/pull/2211)) ## [`13.3.0`](https://github.com/elastic/eui/tree/v13.3.0) From acb97a6373e3a5664c7b40e29bc9d28b9d5f03db Mon Sep 17 00:00:00 2001 From: maryia-lapata Date: Thu, 8 Aug 2019 13:23:43 +0300 Subject: [PATCH 3/5] Update index.d.ts --- src/components/form/range/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/form/range/index.d.ts b/src/components/form/range/index.d.ts index 86ea5ffd576..14b2870c339 100644 --- a/src/components/form/range/index.d.ts +++ b/src/components/form/range/index.d.ts @@ -75,7 +75,7 @@ declare module '@elastic/eui' { export const EuiDualRange: FunctionComponent< CommonProps & - Omit, 'value' | 'onChange'> & + Omit, 'value'> & EuiRangeProps & EuiDualRangeProps >; From 1c28ee5e889435daa43cde426566d0549e42da63 Mon Sep 17 00:00:00 2001 From: maryia-lapata Date: Mon, 12 Aug 2019 09:54:31 +0300 Subject: [PATCH 4/5] Apply code review comments --- CHANGELOG.md | 4 ++++ src/components/form/range/index.d.ts | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d71b4a4bf68..6b7bd7f380a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## [`master`](https://github.com/elastic/eui/tree/master) +No public interface changes since `13.3.0`. + +**Bug fixes** + Added missing `onChange` TS defs for EuiRange ([#2211](https://github.com/elastic/eui/pull/2211)) ## [`13.3.0`](https://github.com/elastic/eui/tree/v13.3.0) diff --git a/src/components/form/range/index.d.ts b/src/components/form/range/index.d.ts index 14b2870c339..14cacd52569 100644 --- a/src/components/form/range/index.d.ts +++ b/src/components/form/range/index.d.ts @@ -53,7 +53,9 @@ declare module '@elastic/eui' { valuePrepend?: ReactNode; onChange?: ( - event: React.ChangeEvent, + event: + | React.ChangeEvent + | React.MouseEvent, isValid: boolean ) => void; } From de4268b6a7c00721f6db22c07af79c083f4b4674 Mon Sep 17 00:00:00 2001 From: maryia-lapata Date: Thu, 15 Aug 2019 11:06:10 +0300 Subject: [PATCH 5/5] Update CHANGELOG.md --- CHANGELOG.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 364a2f5f408..ababa991a93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,10 +6,7 @@ - Fixed `EuiSwitch` semantics to align with aria roles ([#2193](https://github.com/elastic/eui/pull/2193)) - Removed Firefox's focus ring to match other browsers ([#2193](https://github.com/elastic/eui/pull/2193)) - -**Bug fixes** - -Added missing `onChange` TS defs for EuiRange ([#2211](https://github.com/elastic/eui/pull/2211)) +- Added missing `onChange` TS defs for EuiRange ([#2211](https://github.com/elastic/eui/pull/2211)) ## [`13.3.0`](https://github.com/elastic/eui/tree/v13.3.0)