git.iko.soy/typeable/elm-ui
on 18fb463 help sign in
README.md−4
since splitsnapshots
unifiedsplit
@@ -66,10 +66,6 @@ The work is based off of a rewrite of the [Style Elements](https://github.com/md
66
66
67The community around `elm-ui` is maintaining a collection of examples called the [elm-ui-cookbook](https://github.com/rofrol/elm-ui-cookbook). If you are just starting out with `elm-ui`, or get stuck on specific things, this can be a great resource.
67The community around `elm-ui` is maintaining a collection of examples called the [elm-ui-cookbook](https://github.com/rofrol/elm-ui-cookbook). If you are just starting out with `elm-ui`, or get stuck on specific things, this can be a great resource.
68
68
69−## Notes
70−
71−Make sure to have `<!DOCTYPE html>` on top of your application; otherwise, things might get messed up in some browsers.
72−
73## Contributing
69## Contributing
74
70
75Want to help out fixing bugs or reporting issues?
71Want to help out fixing bugs or reporting issues?
elm.json+1−1
@@ -3,7 +3,7 @@
3 "name": "mdgriffith/elm-ui",
3 "name": "mdgriffith/elm-ui",
4 "summary": "Layout and style that's easy to refactor, all without thinking about CSS.",
4 "summary": "Layout and style that's easy to refactor, all without thinking about CSS.",
5 "license": "BSD-3-Clause",
5 "license": "BSD-3-Clause",
6− "version": "1.1.8",
6+ "version": "1.1.7",
7 "exposed-modules": [
7 "exposed-modules": [
8 "Element",
8 "Element",
9 "Element.Input",
9 "Element.Input",
src/Element/Input.elm+13−29
@@ -369,17 +369,7 @@ button attrs { onPress, label } =
369
369
370 Just msg ->
370 Just msg ->
371 Events.onClick msg
371 Events.onClick msg
372− :: onKeyLookup
372+ :: onEnter msg
373− (\code ->
374− if code == enter then
375− Just msg
376−
377− else if code == space then
378− Just msg
379−
380− else
381− Nothing
382− )
383 :: attrs
373 :: attrs
384 )
374 )
385 )
375 )
@@ -713,7 +703,7 @@ slider attributes input =
713 ("input[type=\"range\"]." ++ className ++ "::-ms-thumb")
703 ("input[type=\"range\"]." ++ className ++ "::-ms-thumb")
714 thumbShadowStyle
704 thumbShadowStyle
715 )
705 )
716− , Internal.Attr (Html.Attributes.class (className ++ " ui-slide-bar focusable-parent"))
706+ , Internal.Attr (Html.Attributes.class (className ++ " focusable-parent"))
717 , Internal.Attr
707 , Internal.Attr
718 (Html.Events.onInput
708 (Html.Events.onInput
719 (\str ->
709 (\str ->
@@ -779,10 +769,10 @@ slider attributes input =
779 -- This is after `attributes` because the thumb should be in front of everything.
769 -- This is after `attributes` because the thumb should be in front of everything.
780 ++ [ Element.behindContent <|
770 ++ [ Element.behindContent <|
781 if vertical then
771 if vertical then
782− viewVerticalThumb factor (Internal.htmlClass "focusable-thumb" :: thumbAttributes) trackWidth
772+ viewVerticalThumb factor thumbAttributes trackWidth
783
773
784 else
774 else
785− viewHorizontalThumb factor (Internal.htmlClass "focusable-thumb" :: thumbAttributes) trackHeight
775+ viewHorizontalThumb factor thumbAttributes trackHeight
786 ]
776 ]
787 )
777 )
788 Element.none
778 Element.none
@@ -1565,8 +1555,6 @@ email =
1565
1555
1566By default it will have a minimum height of one line and resize based on it's contents.
1556By default it will have a minimum height of one line and resize based on it's contents.
1567
1557
1568−Use `Element.spacing` to change its line-height.
1569−
1570-}
1558-}
1571multiline :
1559multiline :
1572 List (Attribute msg)
1560 List (Attribute msg)
@@ -2105,11 +2093,7 @@ onKeyLookup lookup =
2105 Json.field "key" Json.string
2093 Json.field "key" Json.string
2106 |> Json.andThen decode
2094 |> Json.andThen decode
2107 in
2095 in
2108− -- We generally want these attached to the keydown event becaues it allows us to prevent default on things like spacebar scrolling the page.
2109− -- https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/button_role
2110− Internal.Attr <|
2096+ Internal.Attr <| Html.Events.on "keyup" isKey
2111− Html.Events.preventDefaultOn "keydown"
2112− (Json.map (\fired -> ( fired, True )) isKey)
2113
2097
2114
2098
2115{-| -}
2099{-| -}
@@ -2205,8 +2189,7 @@ defaultCheckbox : Bool -> Element msg
2205defaultCheckbox checked =
2189defaultCheckbox checked =
2206 Element.el
2190 Element.el
2207 [ Internal.htmlClass "focusable"
2191 [ Internal.htmlClass "focusable"
2208− , Element.width
2192+ , Element.width (Element.px 14)
2209− (Element.px 14)
2210 , Element.height (Element.px 14)
2193 , Element.height (Element.px 14)
2211 , Font.color white
2194 , Font.color white
2212 , Element.centerY
2195 , Element.centerY
@@ -2242,8 +2225,9 @@ defaultCheckbox checked =
2242
2225
2243 else
2226 else
2244 1
2227 1
2245− , Element.inFront
2228+ ]
2229+ (if checked then
2246− (Element.el
2230+ Element.el
2247 [ Border.color white
2231 [ Border.color white
2248 , Element.height (Element.px 6)
2232 , Element.height (Element.px 6)
2249 , Element.width (Element.px 9)
2233 , Element.width (Element.px 9)
@@ -2251,7 +2235,6 @@ defaultCheckbox checked =
2251 , Element.centerX
2235 , Element.centerX
2252 , Element.centerY
2236 , Element.centerY
2253 , Element.moveUp 1
2237 , Element.moveUp 1
2254− , Element.transparent (not checked)
2255 , Border.widthEach
2238 , Border.widthEach
2256 { top = 0
2239 { top = 0
2257 , left = 2
2240 , left = 2
@@ -2260,6 +2243,7 @@ defaultCheckbox checked =
2260 }
2243 }
2261 ]
2244 ]
2262 Element.none
2245 Element.none
2263− )
2246+
2264− ]
2247+ else
2265− Element.none
2248+ Element.none
2249+ )
src/Internal/Model.elm+2−6
@@ -2244,11 +2244,7 @@ renderFocusStyle focus =
2244 , Just <| Property "outline" "none"
2244 , Just <| Property "outline" "none"
2245 ]
2245 ]
2246 )
2246 )
2247− , Style
2248− ((Internal.Style.dot classes.any ++ ":focus .focusable, ")
2247+ , Style (Internal.Style.dot classes.any ++ ":focus .focusable, " ++ Internal.Style.dot classes.any ++ ".focusable:focus")
2249− ++ (Internal.Style.dot classes.any ++ ".focusable:focus, ")
2250− ++ (".ui-slide-bar:focus + " ++ Internal.Style.dot classes.any ++ " .focusable-thumb")
2251− )
2252 (List.filterMap identity
2248 (List.filterMap identity
2253 [ Maybe.map (\color -> Property "border-color" (formatColor color)) focus.borderColor
2249 [ Maybe.map (\color -> Property "border-color" (formatColor color)) focus.borderColor
2254 , Maybe.map (\color -> Property "background-color" (formatColor color)) focus.backgroundColor
2250 , Maybe.map (\color -> Property "background-color" (formatColor color)) focus.backgroundColor
@@ -2656,7 +2652,7 @@ renderStyle options maybePseudo selector props =
2656 , (selector ++ "-fs:focus-within {")
2652 , (selector ++ "-fs:focus-within {")
2657 ++ renderedProps
2653 ++ renderedProps
2658 ++ "\n}"
2654 ++ "\n}"
2659− , (".ui-slide-bar:focus + " ++ Internal.Style.dot classes.any ++ " .focusable-thumb" ++ selector ++ "-fs {")
2655+ , (".focusable-parent:focus ~ " ++ "." ++ classes.any ++ " " ++ selector ++ "-fs {")
2660 ++ renderedProps
2656 ++ renderedProps
2661 ++ "\n}"
2657 ++ "\n}"
2662 ]
2658 ]