-----------------------------------------------------------------------------
{-# LANGUAGE OverloadedStrings #-}
-----------------------------------------------------------------------------
-- |
-- Module      :  Miso.Native.X.Element.ScrollCoordinator.Property
-- Copyright   :  (C) 2016-2026 David M. Johnson
-- License     :  BSD3-style (see the file LICENSE)
-- Maintainer  :  David M. Johnson <code@dmj.io>
-- Stability   :  experimental
-- Portability :  non-portable
----------------------------------------------------------------------------
module Miso.Native.X.Element.ScrollCoordinator.Property
  ( -- *** Property
    androidNestedScrollAsChild_
  , bounces_
  , enableScroll_
  , enableScrollBar_
  , granularity_
  , headerOverSlot_
  , iosForceScrollDetach_
  , iosScrollsToTop_
  , refreshMode_
    -- *** Types
  , RefreshMode (..)
  ) where
-----------------------------------------------------------------------------
import           Miso.JSON (ToJSON(..))
import           Miso.Types (Attribute)
import           Miso.Property
-----------------------------------------------------------------------------
-- | The pull-to-refresh mode of the foldview (iOS), used by 'refreshMode_'.
data RefreshMode
  = RefreshNone
  | RefreshPage
  | RefreshFold
  deriving (Int -> RefreshMode -> ShowS
[RefreshMode] -> ShowS
RefreshMode -> String
(Int -> RefreshMode -> ShowS)
-> (RefreshMode -> String)
-> ([RefreshMode] -> ShowS)
-> Show RefreshMode
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RefreshMode -> ShowS
showsPrec :: Int -> RefreshMode -> ShowS
$cshow :: RefreshMode -> String
show :: RefreshMode -> String
$cshowList :: [RefreshMode] -> ShowS
showList :: [RefreshMode] -> ShowS
Show, RefreshMode -> RefreshMode -> Bool
(RefreshMode -> RefreshMode -> Bool)
-> (RefreshMode -> RefreshMode -> Bool) -> Eq RefreshMode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RefreshMode -> RefreshMode -> Bool
== :: RefreshMode -> RefreshMode -> Bool
$c/= :: RefreshMode -> RefreshMode -> Bool
/= :: RefreshMode -> RefreshMode -> Bool
Eq)
-----------------------------------------------------------------------------
instance ToJSON RefreshMode where
  toJSON :: RefreshMode -> Value
toJSON RefreshMode
RefreshNone = Value
"none"
  toJSON RefreshMode
RefreshPage = Value
"page"
  toJSON RefreshMode
RefreshFold = Value
"fold"
-----------------------------------------------------------------------------
-- | https://lynxjs.org/api/elements/built-in/scroll-coordinator.html#android-nested-scroll-as-child
--
-- *Android* only. Enables nested scroll behavior as a child element in other
-- scrolling widgets.
--
-- Default Value: 'False'
--
androidNestedScrollAsChild_ :: Bool -> Attribute model action
androidNestedScrollAsChild_ :: forall model action. Bool -> Attribute model action
androidNestedScrollAsChild_ = MisoString -> Bool -> Attribute model action
forall model action. MisoString -> Bool -> Attribute model action
boolProp MisoString
"android-nested-scroll-as-child"
-----------------------------------------------------------------------------
-- | https://lynxjs.org/api/elements/built-in/scroll-coordinator.html#bounces
--
-- *iOS \/ Harmony* only. Enables the bounce effect when scrolling past the
-- boundary.
--
-- Default Value: 'True'
--
bounces_ :: Bool -> Attribute model action
bounces_ :: forall model action. Bool -> Attribute model action
bounces_ = MisoString -> Bool -> Attribute model action
forall model action. MisoString -> Bool -> Attribute model action
boolProp MisoString
"bounces"
-----------------------------------------------------------------------------
-- | https://lynxjs.org/api/elements/built-in/scroll-coordinator.html#enable-scroll
--
-- Controls whether vertical scrolling is permitted.
--
-- Default Value: 'True'
--
enableScroll_ :: Bool -> Attribute model action
enableScroll_ :: forall model action. Bool -> Attribute model action
enableScroll_ = MisoString -> Bool -> Attribute model action
forall model action. MisoString -> Bool -> Attribute model action
boolProp MisoString
"enable-scroll"
-----------------------------------------------------------------------------
-- | https://lynxjs.org/api/elements/built-in/scroll-coordinator.html#enable-scroll-bar
--
-- *iOS \/ Harmony* only. Determines scrollbar visibility during coordinator
-- scrolling.
--
-- Default Value: 'False'
--
enableScrollBar_ :: Bool -> Attribute model action
enableScrollBar_ :: forall model action. Bool -> Attribute model action
enableScrollBar_ = MisoString -> Bool -> Attribute model action
forall model action. MisoString -> Bool -> Attribute model action
boolProp MisoString
"enable-scroll-bar"
-----------------------------------------------------------------------------
-- | https://lynxjs.org/api/elements/built-in/scroll-coordinator.html#granularity
--
-- The event response granularity of @bindoffset@.
--
-- Default Value: 0.01
--
granularity_ :: Double -> Attribute model action
granularity_ :: forall model action. Double -> Attribute model action
granularity_ = MisoString -> Double -> Attribute model action
forall model action. MisoString -> Double -> Attribute model action
doubleProp MisoString
"granularity"
-----------------------------------------------------------------------------
-- | https://lynxjs.org/api/elements/built-in/scroll-coordinator.html#header-over-slot
--
-- Controls header layering hierarchy relative to slot content.
--
-- Default Value: 'False'
--
headerOverSlot_ :: Bool -> Attribute model action
headerOverSlot_ :: forall model action. Bool -> Attribute model action
headerOverSlot_ = MisoString -> Bool -> Attribute model action
forall model action. MisoString -> Bool -> Attribute model action
boolProp MisoString
"header-over-slot"
-----------------------------------------------------------------------------
-- | https://lynxjs.org/api/elements/built-in/scroll-coordinator.html#ios-force-scroll-detach
--
-- *iOS* only. Forces @nested-vertical-scroll-behavior@ invalidation.
--
-- Default Value: 'False'
--
iosForceScrollDetach_ :: Bool -> Attribute model action
iosForceScrollDetach_ :: forall model action. Bool -> Attribute model action
iosForceScrollDetach_ = MisoString -> Bool -> Attribute model action
forall model action. MisoString -> Bool -> Attribute model action
boolProp MisoString
"ios-force-scroll-detach"
-----------------------------------------------------------------------------
-- | https://lynxjs.org/api/elements/built-in/scroll-coordinator.html#ios-scrolls-to-top
--
-- *iOS* only. Enables status-bar tap-to-scroll-top functionality.
--
-- Default Value: 'False'
--
iosScrollsToTop_ :: Bool -> Attribute model action
iosScrollsToTop_ :: forall model action. Bool -> Attribute model action
iosScrollsToTop_ = MisoString -> Bool -> Attribute model action
forall model action. MisoString -> Bool -> Attribute model action
boolProp MisoString
"ios-scrolls-to-top"
-----------------------------------------------------------------------------
-- | https://lynxjs.org/api/elements/built-in/scroll-coordinator.html#refresh-mode
--
-- *iOS* only. The pull-to-refresh mode of the foldview.
--
-- > refreshMode_ RefreshFold
--
-- Default Value: 'RefreshNone'
--
refreshMode_ :: RefreshMode -> Attribute model action
refreshMode_ :: forall model action. RefreshMode -> Attribute model action
refreshMode_ = MisoString -> RefreshMode -> Attribute model action
forall a model action.
ToJSON a =>
MisoString -> a -> Attribute model action
prop MisoString
"refresh-mode"
-----------------------------------------------------------------------------