Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
2b8eab8c
Commit
2b8eab8c
authored
Nov 16, 2018
by
Peter Holmberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
maxHeight and style overrides
parent
61a704a6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
7 deletions
+32
-7
public/app/core/components/Picker/Unit/UnitGroup.tsx
+2
-4
public/app/core/components/Picker/Unit/UnitPicker.tsx
+30
-3
No files found.
public/app/core/components/Picker/Unit/UnitGroup.tsx
View file @
2b8eab8c
...
...
@@ -9,7 +9,7 @@ interface State {
expanded
:
boolean
;
}
export
class
UnitGroup
extends
PureComponent
<
ExtendedGroupProps
,
State
>
{
export
default
class
UnitGroup
extends
PureComponent
<
ExtendedGroupProps
,
State
>
{
state
=
{
expanded
:
false
,
};
...
...
@@ -24,10 +24,8 @@ export class UnitGroup extends PureComponent<ExtendedGroupProps, State> {
const
{
children
,
label
}
=
this
.
props
;
const
{
expanded
}
=
this
.
state
;
console
.
log
(
children
);
return
(
<
div
className=
"width-
18
unit-picker-group"
style=
{
{
marginBottom
:
'5px'
}
}
>
<
div
className=
"width-
21
unit-picker-group"
style=
{
{
marginBottom
:
'5px'
}
}
>
<
div
className=
"unit-picker-group-item"
onClick=
{
this
.
onToggleChildren
}
>
<
span
style=
{
{
textTransform
:
'capitalize'
}
}
>
{
label
}
</
span
>
<
i
className=
{
`fa ${expanded ? 'fa-minus' : 'fa-plus'}`
}
/>
{
' '
}
...
...
public/app/core/components/Picker/Unit/UnitPicker.tsx
View file @
2b8eab8c
import
React
,
{
PureComponent
}
from
'react'
;
import
Select
from
'react-select'
;
import
{
UnitGroup
}
from
'./UnitGroup'
;
import
UnitGroup
from
'./UnitGroup'
;
import
UnitOption
from
'./UnitOption'
;
import
UnitMenu
from
'./UnitMenu'
;
import
ResetStyles
from
'../ResetStyles'
;
...
...
@@ -12,7 +12,34 @@ interface Props {
export
default
class
UnitPicker
extends
PureComponent
<
Props
>
{
render
()
{
const
options
=
kbn
.
getUnitFormats
();
const
unitGroups
=
kbn
.
getUnitFormats
();
const
options
=
unitGroups
.
map
(
group
=>
{
const
options
=
group
.
submenu
.
map
(
unit
=>
{
return
{
label
:
unit
.
text
,
value
:
unit
.
value
,
};
});
return
{
label
:
group
.
text
,
options
,
};
});
const
styles
=
{
...
ResetStyles
,
menu
:
()
=>
({
maxHeight
:
'500px'
,
overflow
:
'scroll'
,
}),
menuList
:
()
=>
({
WebkitOverflowScrolling
:
'touch'
,
overflowY
:
'auto'
,
position
:
'relative'
,
}
as
React
.
CSSProperties
),
};
return
(
<
Select
...
...
@@ -26,7 +53,7 @@ export default class UnitPicker extends PureComponent<Props> {
Option
:
UnitOption
,
Menu
:
UnitMenu
,
}
}
styles=
{
ResetS
tyles
}
styles=
{
s
tyles
}
/>
);
}
...
...
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