Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Molstar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michal Malý
Molstar
Commits
1c5287e1
Commit
1c5287e1
authored
6 years ago
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
text param component
parent
caf9557a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/mol-app/component/parameter/text.tsx
+40
-0
40 additions, 0 deletions
src/mol-app/component/parameter/text.tsx
src/mol-app/component/parameters.tsx
+3
-0
3 additions, 0 deletions
src/mol-app/component/parameters.tsx
with
43 additions
and
0 deletions
src/mol-app/component/parameter/text.tsx
0 → 100644
+
40
−
0
View file @
1c5287e1
/**
* Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import
*
as
React
from
'
react
'
import
{
TextParam
}
from
'
mol-view/parameter
'
;
export
interface
TextParamComponentProps
{
param
:
TextParam
value
:
string
onChange
(
v
:
string
):
void
}
export
interface
TextParamComponentState
{
value
:
string
}
export
class
TextParamComponent
extends
React
.
Component
<
TextParamComponentProps
,
TextParamComponentState
>
{
state
=
{
value
:
this
.
props
.
value
}
onChange
(
value
:
string
)
{
this
.
setState
({
value
})
this
.
props
.
onChange
(
value
)
}
render
()
{
return
<
div
>
<
span
>
{
this
.
props
.
param
.
label
}
</
span
>
<
input
type
=
'text'
value
=
{
this
.
state
.
value
}
onChange
=
{
e
=>
this
.
onChange
(
e
.
currentTarget
.
value
)
}
>
</
input
>
</
div
>;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/mol-app/component/parameters.tsx
+
3
−
0
View file @
1c5287e1
...
...
@@ -11,6 +11,7 @@ import { NumberParamComponent } from './parameter/number';
import
{
RangeParamComponent
}
from
'
./parameter/range
'
;
import
{
SelectParamComponent
}
from
'
./parameter/select
'
;
import
{
MultiSelectParamComponent
}
from
'
./parameter/multi-select
'
;
import
{
TextParamComponent
}
from
'
./parameter/text
'
;
interface
ParametersProps
<
P
extends
Params
>
{
params
:
P
...
...
@@ -32,6 +33,8 @@ function getParamComponent<P extends Param>(p: Param, value: P['defaultValue'],
return
<
SelectParamComponent
param
=
{
p
}
value
=
{
value
}
onChange
=
{
onChange
}
/>
case
'
multi-select
'
:
return
<
MultiSelectParamComponent
param
=
{
p
}
value
=
{
value
}
onChange
=
{
onChange
}
/>
case
'
text
'
:
return
<
TextParamComponent
param
=
{
p
}
value
=
{
value
}
onChange
=
{
onChange
}
/>
}
return
''
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment