diff --git a/nativescript-bind-elm/src/Native.elm b/nativescript-bind-elm/src/Native.elm index 7880711..35b9301 100644 --- a/nativescript-bind-elm/src/Native.elm +++ b/nativescript-bind-elm/src/Native.elm @@ -1,4 +1,4 @@ -module Native exposing (activityIndicator, button, formattedString, label, span, datePicker) +module Native exposing (activityIndicator, button, datePicker, formattedString, htmlView, label, span) import Html exposing (Attribute, Html) @@ -32,6 +32,12 @@ span : List (Attribute msg) -> List (Html msg) -> Html msg span = buildElement "ns-span" + datePicker : List (Attribute msg) -> List (Html msg) -> Html msg datePicker = buildElement "ns-datepicker" + + +htmlView : List (Attribute msg) -> List (Html msg) -> Html msg +htmlView = + buildElement "ns-html-view" diff --git a/nativescript-bind-elm/src/Native/Attributes.elm b/nativescript-bind-elm/src/Native/Attributes.elm index 3d8cd91..6c37ab6 100644 --- a/nativescript-bind-elm/src/Native/Attributes.elm +++ b/nativescript-bind-elm/src/Native/Attributes.elm @@ -802,3 +802,8 @@ month = year : String -> Attribute msg year = attribute "year" + + +html : String -> Attribute msg +html = + attribute "html" diff --git a/nativescript-bind-res/Native/Constants.res b/nativescript-bind-res/Native/Constants.res index 6033da7..cabcc2d 100644 --- a/nativescript-bind-res/Native/Constants.res +++ b/nativescript-bind-res/Native/Constants.res @@ -214,7 +214,21 @@ let formattedString = let span = [formattedString, ["text"]->Belt.Array.map(dashed)]->Belt.Array.concatMany -let datePicker = [view, ["date", "day", "iosPreferredDatePickerStyle", "maxDate", "minDate", "month", "year"]->Belt.Array.map(dashed)]->Belt.Array.concatMany +let datePicker = + [ + view, + [ + "date", + "day", + "iosPreferredDatePickerStyle", + "maxDate", + "minDate", + "month", + "year", + ]->Belt.Array.map(dashed), + ]->Belt.Array.concatMany + +let htmlView = [view, ["html"]->Belt.Array.map(dashed)]->Belt.Array.concatMany // Js.log("****************************") // ["date", "day", "iosPreferredDatePickerStyle", "maxDate", "minDate", "month", "year"] diff --git a/nativescript-bind-res/Native/Elements.res b/nativescript-bind-res/Native/Elements.res index 4bf9287..84b0054 100644 --- a/nativescript-bind-res/Native/Elements.res +++ b/nativescript-bind-res/Native/Elements.res @@ -74,6 +74,15 @@ module DatePicker = { let handler: Types.handler = buildHandler(new, Constants.datePicker, Helper.addView) } +module HtmlView = { + %%private( + @module("@nativescript/core") @new + external new: unit => Types.nativeObject = "HtmlView" + ) + let tagName = "ns-html-view" + + let handler: Types.handler = buildHandler(new, Constants.htmlView, Helper.addView) +} let all: array = [ { @@ -100,4 +109,8 @@ let all: array = [ tagName: DatePicker.tagName, handler: DatePicker.handler, }, + { + tagName: HtmlView.tagName, + handler: HtmlView.handler, + }, ] diff --git a/src/Main.elm b/src/Main.elm index 40e8573..318e66f 100644 --- a/src/Main.elm +++ b/src/Main.elm @@ -148,6 +148,19 @@ detailsPage model = , NA.minDate "1980-02-01" ] [] + , Native.htmlView + [ NA.html """ + + + + + + Hello World + + + """ + ] + [] ] ] )