From 206a3be46039ccb0fef113563a7a74a0a60b0aea Mon Sep 17 00:00:00 2001 From: Igor Yegorov Date: Mon, 8 Oct 2018 01:21:26 +0300 Subject: [PATCH] Bump version to 2.0.0-alpha-013 --- RELEASE_NOTES.md | 3 +++ src/Fable.Helpers.ReactNative.fs | 40 +++++++++++++++++--------------- src/Fable.React.Native.fsproj | 2 +- 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 260cdae..5faa16a 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,6 @@ +### 2.0.0-alpha-013 +- added generic values support for `Picker` & `PickerItem`. + ### 2.0.0-alpha-012 - fixed `TransformsStyle.Transform`; - added `deg` & `rad` functions to create values of `IAngle` type. diff --git a/src/Fable.Helpers.ReactNative.fs b/src/Fable.Helpers.ReactNative.fs index 5c49cf4..8eceee4 100644 --- a/src/Fable.Helpers.ReactNative.fs +++ b/src/Fable.Helpers.ReactNative.fs @@ -315,6 +315,9 @@ module Props = type IAngle = interface end + type IPickerItem<'a> = + inherit React.ReactElement + type IStyle = interface end @@ -363,7 +366,7 @@ module Props = type IDrawerLayoutAndroidProperties = interface end - type IPickerProperties = + type IPickerProperties<'a> = interface end type IProgressBarAndroidProperties = @@ -473,7 +476,6 @@ module Props = inherit IActivityIndicatorIOSProperties inherit IDatePickerIOSProperties inherit IDrawerLayoutAndroidProperties - inherit IPickerProperties inherit IProgressBarAndroidProperties inherit IProgressViewIOSProperties inherit IRefreshControlProperties @@ -974,34 +976,34 @@ module Props = | Value of U2 | Label of string - type PickerItemProperties = + type PickerItemProperties<'a> = | Label of string // REQUIRED! - | Value of string + | Value of 'a | Color of string | TestID of string - type PickerPropertiesIOS = + type PickerPropertiesIOS<'a> = | ItemStyle of IStyle list - interface IPickerProperties + interface IPickerProperties<'a> - type PickerPropertiesAndroid = + type PickerPropertiesAndroid<'a> = | Enabled of bool | Mode of Mode | Prompt of string - interface IPickerProperties + interface IPickerProperties<'a> - type PickerProperties = - | OnValueChange of (string -> int -> unit) - | SelectedValue of string + type PickerProperties<'a> = + | OnValueChange of ('a -> int -> unit) + | SelectedValue of 'a | Style of IStyle list | TestId of string | Ref of Ref - interface IPickerProperties + interface IPickerProperties<'a> - type PickerIOSProperties = + type PickerIOSProperties<'a> = | ItemStyle of ViewStyle list | Ref of Ref - interface IPickerProperties + interface IPickerProperties<'a> module ProgressBar = type ProgressBarAndroidProperties = @@ -1565,7 +1567,7 @@ module Props = interface IWebViewPropertiesIOS interface IDatePickerIOSProperties interface IDrawerLayoutAndroidProperties - interface IPickerProperties + interface IPickerProperties<'a> interface IProgressBarAndroidProperties interface IProgressViewIOSProperties interface IRefreshControlProperties @@ -1722,18 +1724,18 @@ let inline pickerIOSItem (props:Picker.PickerIOSItemProperties list) : React.Rea RN.PickerIOS.Item, props, []) -let inline pickerItem (props:Picker.PickerItemProperties list) : React.ReactElement = +let inline pickerItem<'a> (props:Picker.PickerItemProperties<'a> list) : IPickerItem<'a> = createElement( RN.Picker.Item, props, []) -let inline picker (props:IPickerProperties list) (children:React.ReactElement list): React.ReactElement = +let inline picker (props:IPickerProperties<'a> list) (children:IPickerItem<'a> list): React.ReactElement = createElement( RN.Picker, props, - children) + unbox children) -let inline pickerIOS (props:Picker.PickerIOSProperties list) (children:React.ReactElement list): React.ReactElement = +let inline pickerIOS (props:Picker.PickerIOSProperties<'a> list) (children:React.ReactElement list): React.ReactElement = createElement( RN.PickerIOS, props, diff --git a/src/Fable.React.Native.fsproj b/src/Fable.React.Native.fsproj index 49b9579..6a6bdc0 100644 --- a/src/Fable.React.Native.fsproj +++ b/src/Fable.React.Native.fsproj @@ -1,7 +1,7 @@ 2.0.0 - 2.0.0-alpha-012 + 2.0.0-alpha-013 netstandard1.6 true