Commit b93fcabe authored by arturo's avatar arturo

>>> BEGIN

parent 83b4876a
Pipeline #3013 canceled with stage
......@@ -8955,7 +8955,7 @@ select.form-control {
margin-right: 8px;
}
.search-button-prepend .input-group-text {
.ngrams-table-search-button .input-group-text {
width: 41px;
z-index: initial;
}
......
......@@ -8908,7 +8908,7 @@ select.form-control {
margin-right: 8px;
}
.search-button-prepend .input-group-text {
.ngrams-table-search-button .input-group-text {
width: 41px;
z-index: initial;
}
......
......@@ -8664,7 +8664,7 @@ select.form-control {
margin-right: 8px;
}
.search-button-prepend .input-group-text {
.ngrams-table-search-button .input-group-text {
width: 41px;
z-index: initial;
}
......
......@@ -8912,7 +8912,7 @@ select.form-control {
margin-right: 8px;
}
.search-button-prepend .input-group-text {
.ngrams-table-search-button .input-group-text {
width: 41px;
z-index: initial;
}
......
......@@ -8913,7 +8913,7 @@ select.form-control {
margin-right: 8px;
}
.search-button-prepend .input-group-text {
.ngrams-table-search-button .input-group-text {
width: 41px;
z-index: initial;
}
......
......@@ -45,42 +45,73 @@ type SearchButtonProps =
searchButton :: R2.Component SearchButtonProps
searchButton = R.createElement searchButtonCpt
searchButtonCpt :: R.Component SearchButtonProps
searchButtonCpt = here.component "searchButton" cpt where
cpt { inputRef, searchQuery } _ = do
-- | States
-- |
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 $
H.div
{ className: "search-button-append input-group-append" }
{ className: intercalate " "
[ "ngrams-table-search-button"
, "input-group-append"
]
}
[
if searchQuery' /= ""
then
R.fragment
[ B.button
[
B.button
{ variant: ButtonVariant Light
, callback: \_ -> do
R2.setInputValue inputRef ""
T.write_ "" searchQuery
, className: "input-group-text" }
[ B.icon
, callback: onReset
, className: "input-group-text"
}
[
B.icon
{ name: "times"
, className: "text-danger"
}
]
, B.button { callback: \_ -> T.write_ (R2.getInputValue inputRef) searchQuery
, className: "input-group-text" }
[ B.icon { name: "search" }
,
B.button
{ variant: ButtonVariant Light
, callback: onSubmit
, className: "input-group-text"
}
[ B.icon
{ name: "search"
, className: "text-secondary"
}
]
]
else
B.button { callback: \_ -> T.write_ (R2.getInputValue inputRef) searchQuery
, className: "input-group-text" }
[ B.icon
{ name: "search" }
]
B.button
{ variant: ButtonVariant Light
, callback: onSubmit
, className: "input-group-text"
}
[ B.icon
{ name: "search"
, className: "text-secondary"
}
]
]
type SearchFieldInputProps =
......@@ -109,4 +140,3 @@ searchFieldInputCpt = here.component "searchFieldInput" cpt where
T.write_ (R2.getInputValue inputRef) searchQuery
else
pure unit
......@@ -52,7 +52,7 @@
///////////////////////////////////////////////////:
.search-button-prepend
.ngrams-table-search-button
.input-group-text
// @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