@@ -9,12 +9,11 @@ import Data.Either (Either(..))
99import Data.Enum (class BoundedEnum , fromEnum , toEnum , upFromIncluding )
1010import Data.Foldable (for_ )
1111import Data.Generic.Rep (class Generic )
12- import Data.Generic.Rep.Show (genericShow )
1312import Data.Maybe (Maybe (..), maybe )
1413import Data.Newtype (unwrap )
1514import Data.Profunctor.Join (Join (..))
1615import Data.Profunctor.Star (Star (..))
17- import Data.Symbol ( SProxy (..) )
16+ import Data.Show.Generic ( genericShow )
1817import Data.Traversable (for )
1918import Effect.Exception as Ex
2019import Halogen as H
@@ -28,6 +27,7 @@ import Halogen.Datepicker.Internal.Num as Num
2827import Halogen.Datepicker.Internal.Range (Range , bottomTop )
2928import Halogen.Datepicker.Internal.Utils (componentProps , foldSteps , handlePickerQuery , mustBeMounted , pickerProps , transitionState' )
3029import Halogen.HTML as HH
30+ import Type.Proxy (Proxy (..))
3131
3232type State = PickerValue DateError Date
3333
@@ -47,8 +47,8 @@ type Slots =
4747 , choice ∷ Choice.Slot (Maybe Int ) F.Command
4848 )
4949
50- _num = SProxy ∷ SProxy " num"
51- _choice = SProxy ∷ SProxy " choice"
50+ _num = Proxy ∷ Proxy " num"
51+ _choice = Proxy ∷ Proxy " choice"
5252
5353type Slot = H.Slot Query Message
5454
@@ -58,15 +58,15 @@ type DSL = H.HalogenM State Action Slots Message
5858picker
5959 ∷ ∀ m
6060 . MonadError Ex.Error m
61- ⇒ F.Format → H.Component HH.HTML Query Unit Message m
61+ ⇒ F.Format → H.Component Query Unit Message m
6262picker = pickerWithConfig defaultConfig
6363
6464pickerWithConfig
6565 ∷ ∀ m
6666 . MonadError Ex.Error m
6767 ⇒ Config
6868 → F.Format
69- → H.Component HH.HTML Query Unit Message m
69+ → H.Component Query Unit Message m
7070pickerWithConfig config format =
7171 H .mkComponent
7272 { initialState: const Nothing
@@ -126,12 +126,12 @@ buildDate format = do
126126 where
127127 mkBuildStep ∷ F.Command → DSL m BuildStep
128128 mkBuildStep = commandCata
129- { text: \cmd → pure $ Just mempty
129+ { text: \_ → pure $ Just mempty
130130 , enum: \cmd → do
131- num ← queryNum cmd $ H .request GetValue
131+ num ← queryNum cmd $ H .mkRequest GetValue
132132 pure $ num <#> \n → Join $ Star $ \t → F .toSetter cmd n t
133133 , choice: \cmd → do
134- num ← queryChoice cmd $ H .request GetValue
134+ num ← queryChoice cmd $ H .mkRequest GetValue
135135 pure $ num <#> \n → Join $ Star $ \t → F .toSetter cmd n t
136136 }
137137 runStep ∷ BuildStep → Maybe (Maybe Date )
@@ -145,34 +145,34 @@ propagateChange
145145 → State
146146 → DSL m Unit
147147propagateChange format date = for_ (unwrap format) $ commandCata
148- { text: \cmd → pure unit
148+ { text: \_ → pure unit
149149 , enum: \cmd → do
150150 let val = value date >>= F .toGetter cmd
151- queryNum cmd $ H .request (SetValue val)
151+ queryNum cmd $ H .mkRequest (SetValue val)
152152 , choice: \cmd → do
153153 let val = value date >>= F .toGetter cmd
154- res ← queryChoice cmd $ H .request (SetValue val)
154+ res ← queryChoice cmd $ H .mkRequest (SetValue val)
155155 Choice .valueMustBeInValues res
156156 }
157157
158158commandCata
159159 ∷ ∀ a
160- . { text ∷ F.Command → a
161- , enum ∷ F.Command → a
160+ . { text ∷ F.Command → a
161+ , enum ∷ F.Command → a
162162 , choice ∷ F.Command → a
163163 }
164164 → F.Command
165165 → a
166166commandCata p cmd = case cmd of
167- F.Placeholder str → p.text cmd
168- F.YearFull → p.enum cmd
169- F.YearTwoDigits → p.enum cmd
170- F.YearAbsolute → p.enum cmd
171- F.MonthFull → p.choice cmd
172- F.MonthShort → p.choice cmd
173- F.MonthTwoDigits → p.enum cmd
167+ F.Placeholder _ → p.text cmd
168+ F.YearFull → p.enum cmd
169+ F.YearTwoDigits → p.enum cmd
170+ F.YearAbsolute → p.enum cmd
171+ F.MonthFull → p.choice cmd
172+ F.MonthShort → p.choice cmd
173+ F.MonthTwoDigits → p.enum cmd
174174 F.DayOfMonthTwoDigits → p.enum cmd
175- F.DayOfMonth → p.enum cmd
175+ F.DayOfMonth → p.enum cmd
176176
177177queryChoice
178178 ∷ ∀ m
0 commit comments