From 7bb34d271b5909d40b9e8c74f1ad75f0618adac4 Mon Sep 17 00:00:00 2001 From: Matt Kime Date: Thu, 6 Feb 2020 10:24:53 -0600 Subject: [PATCH 1/7] export option type --- src/components/form/index.js | 2 +- src/components/form/select/index.ts | 2 +- src/components/form/select/select.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/form/index.js b/src/components/form/index.js index b07c9f0c34f..c5470385aae 100644 --- a/src/components/form/index.js +++ b/src/components/form/index.js @@ -17,7 +17,7 @@ export { EuiFormLabel } from './form_label'; export { EuiFormRow } from './form_row'; export { EuiRadio, EuiRadioGroup } from './radio'; export { EuiDualRange, EuiRange } from './range'; -export { EuiSelect } from './select'; +export { EuiSelect, Option } from './select'; export { EuiSuperSelect, EuiSuperSelectControl } from './super_select'; export { EuiSwitch } from './switch'; export { EuiTextArea } from './text_area'; diff --git a/src/components/form/select/index.ts b/src/components/form/select/index.ts index 911289c29b4..4e1e16aa2df 100644 --- a/src/components/form/select/index.ts +++ b/src/components/form/select/index.ts @@ -1 +1 @@ -export { EuiSelect, EuiSelectProps } from './select'; +export { EuiSelect, EuiSelectProps, Option } from './select'; diff --git a/src/components/form/select/select.tsx b/src/components/form/select/select.tsx index 1f8478a1904..5b3de3be2c0 100644 --- a/src/components/form/select/select.tsx +++ b/src/components/form/select/select.tsx @@ -13,7 +13,7 @@ import { import { EuiValidatableControl } from '../validatable_control'; import { EuiFormControlLayoutIconsProps } from '../form_control_layout/form_control_layout_icons'; -interface Option extends OptionHTMLAttributes { +export interface Option extends OptionHTMLAttributes { text: React.ReactNode; } From 1dd1da6a259840997d1d54625108b9c425e64e82 Mon Sep 17 00:00:00 2001 From: Matt Kime Date: Thu, 6 Feb 2020 21:27:37 -0600 Subject: [PATCH 2/7] rename option --- src/components/form/index.js | 2 +- src/components/form/select/select.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/form/index.js b/src/components/form/index.js index c5470385aae..79bb02d298a 100644 --- a/src/components/form/index.js +++ b/src/components/form/index.js @@ -17,7 +17,7 @@ export { EuiFormLabel } from './form_label'; export { EuiFormRow } from './form_row'; export { EuiRadio, EuiRadioGroup } from './radio'; export { EuiDualRange, EuiRange } from './range'; -export { EuiSelect, Option } from './select'; +export { EuiSelect, EuiSelectOptionProps } from './select'; export { EuiSuperSelect, EuiSuperSelectControl } from './super_select'; export { EuiSwitch } from './switch'; export { EuiTextArea } from './text_area'; diff --git a/src/components/form/select/select.tsx b/src/components/form/select/select.tsx index 5b3de3be2c0..445cc288632 100644 --- a/src/components/form/select/select.tsx +++ b/src/components/form/select/select.tsx @@ -13,13 +13,13 @@ import { import { EuiValidatableControl } from '../validatable_control'; import { EuiFormControlLayoutIconsProps } from '../form_control_layout/form_control_layout_icons'; -export interface Option extends OptionHTMLAttributes { +export interface EuiSelectOptionProps extends OptionHTMLAttributes { text: React.ReactNode; } export type EuiSelectProps = SelectHTMLAttributes & CommonProps & { - options?: Option[]; + options?: EuiSelectOptionProps[]; isInvalid?: boolean; fullWidth?: boolean; isLoading?: boolean; From 43876205d3d00eff3e7f5fdbf33eaa4cc655af02 Mon Sep 17 00:00:00 2001 From: Matthew Kime Date: Fri, 7 Feb 2020 13:53:50 -0600 Subject: [PATCH 3/7] Update index.ts --- src/components/form/select/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/form/select/index.ts b/src/components/form/select/index.ts index 4e1e16aa2df..e66523868f6 100644 --- a/src/components/form/select/index.ts +++ b/src/components/form/select/index.ts @@ -1 +1 @@ -export { EuiSelect, EuiSelectProps, Option } from './select'; +export { EuiSelect, EuiSelectProps, EuiSelectOptionProps } from './select'; From 29a27463fdf879b0d9e19a9b6f17cf64c636cd8e Mon Sep 17 00:00:00 2001 From: Matt Kime Date: Fri, 7 Feb 2020 15:56:51 -0600 Subject: [PATCH 4/7] minor fixes --- src/components/form/select/index.ts | 2 +- src/components/form/select/select.tsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/form/select/index.ts b/src/components/form/select/index.ts index 4e1e16aa2df..e66523868f6 100644 --- a/src/components/form/select/index.ts +++ b/src/components/form/select/index.ts @@ -1 +1 @@ -export { EuiSelect, EuiSelectProps, Option } from './select'; +export { EuiSelect, EuiSelectProps, EuiSelectOptionProps } from './select'; diff --git a/src/components/form/select/select.tsx b/src/components/form/select/select.tsx index 445cc288632..8b6606c3496 100644 --- a/src/components/form/select/select.tsx +++ b/src/components/form/select/select.tsx @@ -13,7 +13,8 @@ import { import { EuiValidatableControl } from '../validatable_control'; import { EuiFormControlLayoutIconsProps } from '../form_control_layout/form_control_layout_icons'; -export interface EuiSelectOptionProps extends OptionHTMLAttributes { +export interface EuiSelectOptionProps + extends OptionHTMLAttributes { text: React.ReactNode; } From dc74fdf64fe6c40fe1ae5e6fd8ee2e98107993e5 Mon Sep 17 00:00:00 2001 From: Matt Kime Date: Mon, 10 Feb 2020 09:01:23 -0600 Subject: [PATCH 5/7] don't export type via js, add to changelog --- CHANGELOG.md | 1 + src/components/form/index.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22d931a246c..2fda697918a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - Added optional `key` attribute to `EuiContextMenu` items and relaxed `name` attribute to allow any React node ([#2817](https://github.com/elastic/eui/pull/2817)) - Converted `EuiColorPicker` color conversion functions to `chroma-js` methods ([#2805](https://github.com/elastic/eui/pull/2805)) - Added `direction` parameter to `euiPaletteColorBlind()` for specifiying lighter or darker (or both) alternates ([#2822](https://github.com/elastic/eui/pull/2822)) +- Export EuiSelectOptionProps type ([#2830](https://github.com/elastic/eui/pull/2830)) **Bug fixes** diff --git a/src/components/form/index.js b/src/components/form/index.js index 79bb02d298a..b07c9f0c34f 100644 --- a/src/components/form/index.js +++ b/src/components/form/index.js @@ -17,7 +17,7 @@ export { EuiFormLabel } from './form_label'; export { EuiFormRow } from './form_row'; export { EuiRadio, EuiRadioGroup } from './radio'; export { EuiDualRange, EuiRange } from './range'; -export { EuiSelect, EuiSelectOptionProps } from './select'; +export { EuiSelect } from './select'; export { EuiSuperSelect, EuiSuperSelectControl } from './super_select'; export { EuiSwitch } from './switch'; export { EuiTextArea } from './text_area'; From 5269751a22ef77293228edfc0f8471d3ac0c9f58 Mon Sep 17 00:00:00 2001 From: Chandler Prall Date: Mon, 10 Feb 2020 08:29:13 -0700 Subject: [PATCH 6/7] Update CHANGELOG.md update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d87b2fd9821..d59dd7e9395 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## [`master`](https://github.com/elastic/eui/tree/master) - Converted `EuiFilePicker` to TypeScript ([#2832](https://github.com/elastic/eui/issues/2832)) +- Export EuiSelectOptionProps type ([#2830](https://github.com/elastic/eui/pull/2830)) ## [`19.0.0`](https://github.com/elastic/eui/tree/v19.0.0) @@ -18,7 +19,6 @@ - Converted `EuiSideNav` to TypeScript ([#2818](https://github.com/elastic/eui/issues/2818)) - Added babel-transformed and partially mocked commonjs build (`test-env/`) to target Kibana's Jest environment ([#2698](https://github.com/elastic/eui/pull/2698)) - Altered styles of `EuiToken` and add added more token types to match ES field types of `tokenAlias`, `tokenDate`, `tokenGeo`, `tokenIP`, `tokenNested`, `tokenRange`, `tokenShape` ([#2758](https://github.com/elastic/eui/pull/2758)) -- Export EuiSelectOptionProps type ([#2830](https://github.com/elastic/eui/pull/2830)) **Bug fixes** From 36be35e839ea71d4e4c59bf0d1f76578326ea0cf Mon Sep 17 00:00:00 2001 From: Chandler Prall Date: Mon, 10 Feb 2020 08:29:45 -0700 Subject: [PATCH 7/7] Update CHANGELOG.md changelog entry style --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d59dd7e9395..baf6c159505 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ ## [`master`](https://github.com/elastic/eui/tree/master) - Converted `EuiFilePicker` to TypeScript ([#2832](https://github.com/elastic/eui/issues/2832)) -- Export EuiSelectOptionProps type ([#2830](https://github.com/elastic/eui/pull/2830)) +- Exported `EuiSelectOptionProps` type ([#2830](https://github.com/elastic/eui/pull/2830)) ## [`19.0.0`](https://github.com/elastic/eui/tree/v19.0.0)