Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
F
fether
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
20
Issues
20
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
parity
fether
Commits
43008ef4
Commit
43008ef4
authored
Jul 04, 2018
by
Amaury Martiny
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use a custom Form Field component
parent
35939359
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
85 additions
and
3 deletions
+85
-3
packages/fether-ui/package.json
packages/fether-ui/package.json
+3
-1
packages/fether-ui/src/Form/Field/Field.js
packages/fether-ui/src/Form/Field/Field.js
+32
-0
packages/fether-ui/src/Form/Field/index.js
packages/fether-ui/src/Form/Field/index.js
+1
-1
packages/fether-ui/src/Form/Form.js
packages/fether-ui/src/Form/Form.js
+12
-0
packages/fether-ui/src/Form/Slider/Slider.js
packages/fether-ui/src/Form/Slider/Slider.js
+24
-0
packages/fether-ui/src/Form/Slider/index.js
packages/fether-ui/src/Form/Slider/index.js
+6
-0
packages/fether-ui/src/Form/index.js
packages/fether-ui/src/Form/index.js
+6
-0
packages/fether-ui/src/index.js
packages/fether-ui/src/index.js
+1
-1
No files found.
packages/fether-ui/package.json
View file @
43008ef4
...
...
@@ -33,7 +33,9 @@
"dependencies"
:
{
"react-blockies"
:
"^1.3.0"
,
"react-content-loader"
:
"^3.1.2"
,
"react-tooltip"
:
"^3.6.1"
"react-tooltip"
:
"^3.6.1"
,
"semantic-ui-css"
:
"^2.3.2"
,
"semantic-ui-react"
:
"^0.81.3"
},
"devDependencies"
:
{
"@babel/cli"
:
"^7.0.0-beta.49"
,
...
...
packages/fether-ui/src/Form
Field/Form
Field.js
→
packages/fether-ui/src/Form
/Field/
Field.js
View file @
43008ef4
...
...
@@ -4,22 +4,29 @@
// SPDX-License-Identifier: BSD-3-Clause
import
React
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
{
Popup
}
from
'
semantic-ui-react
'
;
import
'
semantic-ui-css/components/popup.min.css
'
;
export
const
FormField
=
({
className
,
input
:
inputComponent
,
export
const
Field
=
({
as
:
T
=
'
input
'
,
children
,
input
,
label
,
meta
,
...
otherProps
})
=>
(
<
div
className
=
{[
'
form_field
'
,
className
].
join
(
'
'
)}
>
<
div
className
=
'
form_field
'
>
<
label
>
{
label
}
<
/label
>
{
inputComponent
||
<
input
{...
otherProps
}
/>
}
<
Popup
content
=
{
meta
.
error
}
inverted
on
=
'
click
'
open
=
{
!
meta
.
pristine
&&
!
meta
.
valid
&&
meta
.
touched
}
position
=
'
top center
'
size
=
'
mini
'
trigger
=
{
<
T
{...
input
}
{...
otherProps
}
/>
}
/>
{
children
}
<
/div
>
);
FormField
.
propTypes
=
{
className
:
PropTypes
.
string
,
input
:
PropTypes
.
node
,
label
:
PropTypes
.
string
};
packages/fether-ui/src/FormField/index.js
→
packages/fether-ui/src/Form
/
Field/index.js
View file @
43008ef4
...
...
@@ -3,4 +3,4 @@
//
// SPDX-License-Identifier: BSD-3-Clause
export
*
from
'
./F
ormF
ield
'
;
export
*
from
'
./Field
'
;
packages/fether-ui/src/Form/Form.js
0 → 100644
View file @
43008ef4
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
// This file is part of Parity.
//
// SPDX-License-Identifier: BSD-3-Clause
import
{
Field
}
from
'
./Field
'
;
import
{
Slider
}
from
'
./Slider
'
;
export
const
Form
=
{
Field
,
Slider
};
packages/fether-ui/src/Form/Slider/Slider.js
0 → 100644
View file @
43008ef4
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
// This file is part of Parity.
//
// SPDX-License-Identifier: BSD-3-Clause
import
React
from
'
react
'
;
import
{
Field
}
from
'
../Field
'
;
export
const
Slider
=
({
centerText
,
input
,
leftText
,
rightText
,
...
otherProps
})
=>
(
<
Field
input
=
{
input
}
{...
otherProps
}
>
<
nav
className
=
'
range-nav
'
>
<
span
className
=
'
range-nav_label
'
>
{
leftText
}
<
/span
>
<
span
className
=
'
range-nav_value
'
>
{
centerText
}
<
/span
>
<
span
className
=
'
range-nav_label
'
>
{
rightText
}
<
/span
>
<
/nav
>
<
/Field
>
);
packages/fether-ui/src/Form/Slider/index.js
0 → 100644
View file @
43008ef4
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
// This file is part of Parity.
//
// SPDX-License-Identifier: BSD-3-Clause
export
*
from
'
./Slider
'
;
packages/fether-ui/src/Form/index.js
0 → 100644
View file @
43008ef4
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
// This file is part of Parity.
//
// SPDX-License-Identifier: BSD-3-Clause
export
*
from
'
./Form
'
;
packages/fether-ui/src/index.js
View file @
43008ef4
...
...
@@ -7,7 +7,7 @@ export * from './AccountCard';
export
*
from
'
./AccountHeader
'
;
export
*
from
'
./AddressShort
'
;
export
*
from
'
./Card
'
;
export
*
from
'
./Form
Field
'
;
export
*
from
'
./Form
'
;
export
*
from
'
./Header
'
;
export
*
from
'
./Placeholder
'
;
export
*
from
'
./TokenCard
'
;
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