Commit b93fcabe authored by arturo's avatar arturo

>>> BEGIN

parent 83b4876a
Pipeline #3013 canceled with stage
...@@ -8955,7 +8955,7 @@ select.form-control { ...@@ -8955,7 +8955,7 @@ select.form-control {
margin-right: 8px; margin-right: 8px;
} }
.search-button-prepend .input-group-text { .ngrams-table-search-button .input-group-text {
width: 41px; width: 41px;
z-index: initial; z-index: initial;
} }
......
...@@ -8908,7 +8908,7 @@ select.form-control { ...@@ -8908,7 +8908,7 @@ select.form-control {
margin-right: 8px; margin-right: 8px;
} }
.search-button-prepend .input-group-text { .ngrams-table-search-button .input-group-text {
width: 41px; width: 41px;
z-index: initial; z-index: initial;
} }
......
...@@ -8664,7 +8664,7 @@ select.form-control { ...@@ -8664,7 +8664,7 @@ select.form-control {
margin-right: 8px; margin-right: 8px;
} }
.search-button-prepend .input-group-text { .ngrams-table-search-button .input-group-text {
width: 41px; width: 41px;
z-index: initial; z-index: initial;
} }
......
...@@ -8912,7 +8912,7 @@ select.form-control { ...@@ -8912,7 +8912,7 @@ select.form-control {
margin-right: 8px; margin-right: 8px;
} }
.search-button-prepend .input-group-text { .ngrams-table-search-button .input-group-text {
width: 41px; width: 41px;
z-index: initial; z-index: initial;
} }
......
...@@ -8913,7 +8913,7 @@ select.form-control { ...@@ -8913,7 +8913,7 @@ select.form-control {
margin-right: 8px; margin-right: 8px;
} }
.search-button-prepend .input-group-text { .ngrams-table-search-button .input-group-text {
width: 41px; width: 41px;
z-index: initial; z-index: initial;
} }
......
...@@ -45,42 +45,73 @@ type SearchButtonProps = ...@@ -45,42 +45,73 @@ type SearchButtonProps =
searchButton :: R2.Component SearchButtonProps searchButton :: R2.Component SearchButtonProps
searchButton = R.createElement searchButtonCpt searchButton = R.createElement searchButtonCpt
searchButtonCpt :: R.Component SearchButtonProps searchButtonCpt :: R.Component SearchButtonProps
searchButtonCpt = here.component "searchButton" cpt where searchButtonCpt = here.component "searchButton" cpt where
cpt { inputRef, searchQuery } _ = do cpt { inputRef, searchQuery } _ = do
-- | States
-- |
searchQuery' <- T.useLive T.unequal searchQuery searchQuery' <- T.useLive T.unequal searchQuery
-- | Behaviors
-- |
let
onReset _ = do
R2.setInputValue inputRef ""
T.write_ "" searchQuery
onSubmit _ = do
T.write_ (R2.getInputValue inputRef) searchQuery
-- | Render
-- |
pure $ pure $
H.div H.div
{ className: "search-button-append input-group-append" } { className: intercalate " "
[ "ngrams-table-search-button"
, "input-group-append"
]
}
[ [
if searchQuery' /= "" if searchQuery' /= ""
then then
R.fragment R.fragment
[ B.button [
B.button
{ variant: ButtonVariant Light { variant: ButtonVariant Light
, callback: \_ -> do , callback: onReset
R2.setInputValue inputRef "" , className: "input-group-text"
T.write_ "" searchQuery }
, className: "input-group-text" } [
[ B.icon B.icon
{ name: "times" { name: "times"
, className: "text-danger" , className: "text-danger"
} }
] ]
, B.button { callback: \_ -> T.write_ (R2.getInputValue inputRef) searchQuery ,
, className: "input-group-text" } B.button
[ B.icon { name: "search" } { variant: ButtonVariant Light
, callback: onSubmit
, className: "input-group-text"
}
[ B.icon
{ name: "search"
, className: "text-secondary"
}
] ]
] ]
else else
B.button { callback: \_ -> T.write_ (R2.getInputValue inputRef) searchQuery B.button
, className: "input-group-text" } { variant: ButtonVariant Light
[ B.icon , callback: onSubmit
{ name: "search" } , className: "input-group-text"
] }
[ B.icon
{ name: "search"
, className: "text-secondary"
}
]
] ]
type SearchFieldInputProps = type SearchFieldInputProps =
...@@ -109,4 +140,3 @@ searchFieldInputCpt = here.component "searchFieldInput" cpt where ...@@ -109,4 +140,3 @@ searchFieldInputCpt = here.component "searchFieldInput" cpt where
T.write_ (R2.getInputValue inputRef) searchQuery T.write_ (R2.getInputValue inputRef) searchQuery
else else
pure unit pure unit
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
///////////////////////////////////////////////////: ///////////////////////////////////////////////////:
.search-button-prepend .ngrams-table-search-button
.input-group-text .input-group-text
// @XXX Glyphicon icons lack of homogeneous width // @XXX Glyphicon icons lack of homogeneous width
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment