This repository has been archived by the owner on Oct 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added functional start input fields set and end input fields set.
- Loading branch information
1 parent
a429b8d
commit 22e87c4
Showing
7 changed files
with
342 additions
and
9 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import React from 'react' | ||
import styled from 'styled-components' | ||
|
||
import BgIconDateSVG from '../../assets/images/icon-date.svg' | ||
|
||
export default function InputFieldDate({ val, onChangeVal, name, id }) { | ||
return ( | ||
<> | ||
<Label htmlFor={id}> | ||
<BgDateSpan> </BgDateSpan>Date | ||
</Label> | ||
{/* <Input defaultValue={defaultVal} type="date" /> */} | ||
<Input | ||
name={name} | ||
id={id} | ||
value={val} | ||
onChange={(e) => onChangeVal(e)} | ||
placeholder="01/01/2024" | ||
/> | ||
</> | ||
) | ||
} | ||
|
||
const Label = styled.label` | ||
display: flex; | ||
width: calc(100% - 15px); | ||
height: 26px; | ||
line-height: 26px; | ||
margin-left: 15px; | ||
color: #7b9390; | ||
font: 500 14px/26px Roboto; | ||
` | ||
|
||
const BgDateSpan = styled.span` | ||
width: 26px; | ||
height: 26px; | ||
background: transparent url(${BgIconDateSVG}) no-repeat; | ||
` | ||
|
||
const Input = styled.input.attrs({ type: 'date' })` | ||
display: flex; | ||
width: calc(100% - 15px); | ||
height: 26px; | ||
font: 500 18px/26px Roboto; | ||
color: #aebcbb; | ||
margin-left: 15px; | ||
background: transparent; | ||
outline: 0; | ||
border: none; | ||
position: relative; | ||
&::-webkit-calendar-picker-indicator { | ||
position: absolute; | ||
top: unset; | ||
left: unset; | ||
width: 100%; | ||
height: 100%; | ||
background: transparent; | ||
color: transparent; | ||
} | ||
&::-webkit-inner-spin-button { | ||
z-index: 1; | ||
} | ||
&::-webkit-clear-button { | ||
z-index: 1; | ||
} | ||
&::-webkit-input-placeholder { | ||
color: #aebcbb; | ||
} | ||
&::placeholder { | ||
color: #aebcbb; | ||
} | ||
&:active { | ||
color: #000000; | ||
} | ||
&:hover { | ||
color: #000000; | ||
} | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import React from 'react' | ||
import styled from 'styled-components' | ||
|
||
export default function InputFieldEnergy({ val, onChangeVal, name, id }) { | ||
return ( | ||
<> | ||
<Label htmlFor={id}>Energy use</Label> | ||
{/* <Input defaultValue="0.0 kWh" type="text" /> */} | ||
|
||
<Input | ||
name={name} | ||
id={id} | ||
value={val} | ||
onChange={(e) => onChangeVal(e)} | ||
placeholder="0.0 kWh" | ||
list={`${id}-list`} | ||
/> | ||
<datalist id={`${id}-list`}> | ||
{Array.from(Array(2 * 20).keys()).map((e) => { | ||
const r = (e + 1) / 2 | ||
return <option key={e} value={`${r.toFixed(1)} MWh`} /> | ||
})} | ||
</datalist> | ||
{/* Styling: https://www.npmjs.com/package/datalist-css */} | ||
</> | ||
) | ||
} | ||
|
||
const Label = styled.label` | ||
display: flex; | ||
width: calc(100% - 15px); | ||
height: 26px; | ||
line-height: 26px; | ||
margin-left: 15px; | ||
color: #7b9390; | ||
font: 500 14px/26px Roboto; | ||
` | ||
|
||
const Input = styled.input` | ||
display: flex; | ||
width: calc(100% - 15px); | ||
height: 26px; | ||
font: 500 18px/26px Roboto; | ||
color: #aebcbb; | ||
margin-left: 15px; | ||
background: transparent; | ||
outline: 0; | ||
border: none; | ||
position: relative; | ||
&::-webkit-input-placeholder { | ||
color: #aebcbb; | ||
} | ||
&::placeholder { | ||
color: #aebcbb; | ||
} | ||
&:active { | ||
color: #000000; | ||
} | ||
&:hover { | ||
color: #000000; | ||
} | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import React from 'react' | ||
import styled from 'styled-components' | ||
|
||
export default function InputFieldEnergy({ val, onChangeVal, name, id }) { | ||
return ( | ||
<> | ||
<Label htmlFor={id}>H2 batch</Label> | ||
{/* <Input defaultValue="0.0 kWh" type="text" /> */} | ||
|
||
<Input | ||
name={name} | ||
id={id} | ||
value={val} | ||
onChange={(e) => onChangeVal(e)} | ||
placeholder="0.0 kWh" | ||
list={`${id}-list`} | ||
/> | ||
<datalist id={`${id}-list`}> | ||
{Array.from(Array(2 * 20).keys()).map((e) => { | ||
const r = (e + 1) / 2 | ||
return <option key={e} value={`${r.toFixed(1)} MWh`} /> | ||
})} | ||
</datalist> | ||
{/* Styling: https://www.npmjs.com/package/datalist-css */} | ||
</> | ||
) | ||
} | ||
|
||
const Label = styled.label` | ||
display: flex; | ||
width: calc(100% - 15px); | ||
height: 26px; | ||
line-height: 26px; | ||
margin-left: 15px; | ||
color: #7b9390; | ||
font: 500 14px/26px Roboto; | ||
` | ||
|
||
const Input = styled.input` | ||
display: flex; | ||
width: calc(100% - 15px); | ||
height: 26px; | ||
font: 500 18px/26px Roboto; | ||
color: #aebcbb; | ||
margin-left: 15px; | ||
background: transparent; | ||
outline: 0; | ||
border: none; | ||
position: relative; | ||
&::-webkit-input-placeholder { | ||
color: #aebcbb; | ||
} | ||
&::placeholder { | ||
color: #aebcbb; | ||
} | ||
&:active { | ||
color: #000000; | ||
} | ||
&:hover { | ||
color: #000000; | ||
} | ||
` |
Oops, something went wrong.