Skip to content

Commit

Permalink
Add charset attribute
Browse files Browse the repository at this point in the history
- Fix event types
- Update Feliz.Bulma deps
  • Loading branch information
dbrattli committed Apr 28, 2020
1 parent a36cca9 commit 6607fde
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 16 deletions.
4 changes: 2 additions & 2 deletions Feliz.Bulma.ViewEngine/paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ STORAGE: NONE
RESTRICTION: == netstandard2.0
NUGET
remote: https://www.nuget.org/api/v2
Feliz.ViewEngine (0.16)
FSharp.Core (>= 4.7 < 5.0)
Feliz.ViewEngine (0.17)
FSharp.Core (>= 4.7)
FSharp.Core (4.7)
18 changes: 18 additions & 0 deletions src/Interop.fs
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,21 @@ type FunctionComponent<'Props> = 'Props -> ReactElement
type React =
static member functionComponent(name: string, render: 'props -> ReactElement) : FunctionComponent<'props> =
render

type Event () = class end
with
member x.preventDefault () = ()
member x.type' = "Event"

type AnimationEvent () = inherit Event ()
type ClipboardEvent () = inherit Event ()
type CompositionEvent () = inherit Event ()
type DragEvent () = inherit Event ()
type IKeyboardKey = interface end
type KeyboardEvent () = inherit Event ()
type FocusEvent () = inherit Event ()
type MouseEvent () = inherit Event ()
type TouchEvent () = inherit Event ()
type TransitionEvent () = inherit Event ()
type WheelEvent () = inherit Event ()
type File = class end
44 changes: 30 additions & 14 deletions src/Properties.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,6 @@ namespace Feliz.ViewEngine

open Feliz.ViewEngine.Styles

type AnimationEvent = class end
type ClipboardEvent = class end
type CompositionEvent = class end
type DragEvent = class end
type Event = class end
type IKeyboardKey = interface end
type KeyboardEvent = class end
type FocusEvent = class end
type MouseEvent = class end
type TouchEvent = class end
type TransitionEvent = class end
type WheelEvent = class end
type File = class end

[<RequireQualifiedAccess>]
type AriaDropEffect =
/// A duplicate of the source object will be dropped into the target.
Expand Down Expand Up @@ -314,6 +300,9 @@ type prop =

static member inline capture (value: bool) = Interop.mkAttr "capture" value

/// This attribute declares the document's character encoding. Must be used in the meta tag.
static member inline charset (value: string) = Interop.mkAttr "charset" value

/// Children of this React element.
static member inline children (value: ReactElement) = Children [ value ]
static member inline children (elems: #seq<ReactElement>) = List.ofSeq elems |> Children
Expand Down Expand Up @@ -1426,6 +1415,10 @@ module prop =
/// The first letter of each word defaults to a capital letter; all other letters default to lowercase
static member inline words = Interop.mkAttr "autocapitalize" "words"

[<Erase>]
type charset =
static member inline utf8 = Interop.mkAttr "charset" "utf-8"

/// A set of values specifying the coordinates of the hot-spot region.
///
/// The number and meaning of the values depend upon the value specified for the shape attribute
Expand Down Expand Up @@ -1540,6 +1533,29 @@ module prop =
/// This value uses the top of the em box as the baseline.
static member inline textTop = Interop.mkAttr "dominantBaseline" "text-top"

/// Defines a pragma directive.
[<Erase>]
type httpEquiv =
/// Allows page authors to define a content policy for the current page.
///
/// Content policies mostly specify allowed server origins and script endpoints which help guard against cross-site
/// scripting attacks.
static member inline contentSecurityPolicy = Interop.mkAttr "http-equiv" "content-security-policy"
/// If specified, the content attribute must have the value "text/html; charset=utf-8".
///
/// Note: Can only be used in documents served with a text/html MIME type — not in documents served with an XML MIME type.
static member inline contentType = Interop.mkAttr "http-equiv" "content-type"
/// Sets the name of the default CSS style sheet set.
static member inline defaultStyle = Interop.mkAttr "http-equiv" "default-style"
/// This instruction specifies:
///
/// The number of seconds until the page should be reloaded - only if the content attribute contains a positive integer.
///
/// The number of seconds until the page should redirect to another - only if the content attribute contains a positive integer followed by the string ';url=', and a valid URL.
static member inline refresh = Interop.mkAttr "http-equiv" "refresh"
/// If specified, the content attribute must have the value "IE=edge". User agents are required to ignore this pragma.
static member inline xUaCompatible = Interop.mkAttr "http-equiv" "x-ua-compatible"

/// Provides a hint to browsers as to the type of virtual keyboard configuration to use when editing this element or its contents.
[<Erase>]
type inputMode =
Expand Down

0 comments on commit 6607fde

Please sign in to comment.