Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
purescript-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Grégoire Locqueville
purescript-gargantext
Commits
d3d99c14
Commit
d3d99c14
authored
Feb 03, 2021
by
Przemyslaw Kaminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[inputWithText] add onBlur
parent
11855438
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
6 deletions
+19
-6
Add.purs
src/Gargantext/Components/Forest/Tree/Node/Action/Add.purs
+3
-1
SearchField.purs
...omponents/Forest/Tree/Node/Action/Search/SearchField.purs
+5
-1
Tools.purs
src/Gargantext/Components/Forest/Tree/Node/Tools.purs
+2
-1
InputWithEnter.purs
src/Gargantext/Components/InputWithEnter.purs
+6
-3
User.purs
src/Gargantext/Components/Nodes/Annuaire/User.purs
+1
-0
Contact.purs
src/Gargantext/Components/Nodes/Annuaire/User/Contact.purs
+1
-0
Corpus.purs
src/Gargantext/Components/Nodes/Corpus.purs
+1
-0
No files found.
src/Gargantext/Components/Forest/Tree/Node/Action/Add.purs
View file @
d3d99c14
...
...
@@ -20,6 +20,7 @@ import Gargantext.Types as GT
import Gargantext.Types (NodeType(..))
import Gargantext.Utils.Reactix as R2
thisModule :: String
thisModule = "Gargantext.Components.Forest.Tree.Node.Action.Add"
----------------------------------------------------------------------
...
...
@@ -83,7 +84,8 @@ addNodeView p@{ dispatch, nodeType, nodeTypes } = R.createElement el p []
defaultNt = (fromMaybe Error $ head nodeTypes)
maybeEdit = [ if edit
then inputWithEnter {
onEnter: \_ -> launchAff_ $ dispatch (AddNode name' nt')
onBlur: \val -> setNodeName $ const val
, onEnter: \_ -> launchAff_ $ dispatch (AddNode name' nt')
, onValueChanged: \val -> setNodeName $ const val
, autoFocus: true
, className: "form-control"
...
...
src/Gargantext/Components/Forest/Tree/Node/Action/Search/SearchField.purs
View file @
d3d99c14
...
...
@@ -346,7 +346,8 @@ searchInputCpt = R.hooksComponentWithModule thisModule "searchInput" cpt
valueRef <- R.useRef term
pure $ H.div { className: "" } [
inputWithEnter { onEnter: onEnter valueRef setSearch
inputWithEnter { onBlur: onBlur valueRef setSearch
, onEnter: onEnter valueRef setSearch
, onValueChanged: onValueChanged valueRef
, autoFocus: false
, className: "form-control"
...
...
@@ -364,6 +365,9 @@ searchInputCpt = R.hooksComponentWithModule thisModule "searchInput" cpt
-- , type: "text"
-- }
-- ]
onBlur valueRef setSearch value = do
R.setRef valueRef value
setSearch $ _ { term = value }
onEnter valueRef setSearch _ = do
setSearch $ _ { term = R.readRef valueRef }
...
...
src/Gargantext/Components/Forest/Tree/Node/Tools.purs
View file @
d3d99c14
...
...
@@ -82,7 +82,8 @@ textInputBoxCpt = R.hooksComponentWithModule thisModule "textInputBox" cpt
textInput renameNodeNameRef =
H.div { className: "col-8" }
[ inputWithEnter {
onEnter: submit renameNodeNameRef
onBlur: R.setRef renameNodeNameRef
, onEnter: submit renameNodeNameRef
, onValueChanged: R.setRef renameNodeNameRef
, autoFocus: true
, className: "form-control"
...
...
src/Gargantext/Components/InputWithEnter.purs
View file @
d3d99c14
...
...
@@ -11,7 +11,8 @@ thisModule :: String
thisModule = "Gargantext.Components.InputWithEnter"
type Props a = (
onEnter :: Unit -> Effect Unit
onBlur :: String -> Effect Unit
, onEnter :: Unit -> Effect Unit
, onValueChanged :: String -> Effect Unit
, autoFocus :: Boolean
...
...
@@ -27,9 +28,10 @@ inputWithEnter props = R.createElement inputWithEnterCpt props []
inputWithEnterCpt :: forall a. R.Component (Props a)
inputWithEnterCpt = R.hooksComponentWithModule thisModule "inputWithEnter" cpt
where
cpt props@{ onEnter, onValueChanged
cpt props@{ on
Blur, on
Enter, onValueChanged
, autoFocus, className, defaultValue, placeholder } _ = do
pure $ H.input { on: { input: onInput
pure $ H.input { on: { blur: onBlur'
, input: onInput
, keyPress: onKeyPress }
, autoFocus
, className
...
...
@@ -38,6 +40,7 @@ inputWithEnterCpt = R.hooksComponentWithModule thisModule "inputWithEnter" cpt
, type: props.type }
where
onBlur' e = onBlur $ R.unsafeEventValue e
onInput e = onValueChanged $ R.unsafeEventValue e
onKeyPress e = do
...
...
src/Gargantext/Components/Nodes/Annuaire/User.purs
View file @
d3d99c14
...
...
@@ -130,6 +130,7 @@ contactInfoItemCpt = R.hooksComponentWithModule thisModule "contactInfoItem" cpt
autoFocus: true
, className: "form-control"
, defaultValue: R.readRef valueRef
, onBlur: R.setRef valueRef
, onEnter: onClick
, onValueChanged: R.setRef valueRef
, placeholder
...
...
src/Gargantext/Components/Nodes/Annuaire/User/Contact.purs
View file @
d3d99c14
...
...
@@ -130,6 +130,7 @@ contactInfoItemCpt = R.hooksComponentWithModule thisModule "contactInfoItem" cpt
autoFocus: true
, className: "form-control"
, defaultValue: R.readRef valueRef
, onBlur: R.setRef valueRef
, onEnter: onClick
, onValueChanged: R.setRef valueRef
, placeholder
...
...
src/Gargantext/Components/Nodes/Corpus.purs
View file @
d3d99c14
...
...
@@ -309,6 +309,7 @@ renameableTextCpt = R.hooksComponentWithModule thisModule "renameableTextCpt" cp
autoFocus: false
, className: "form-control text"
, defaultValue: text
, onBlur: setText <<< const
, onEnter: submit
, onValueChanged: setText <<< const
, placeholder: ""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment