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
84df0e2d
Commit
84df0e2d
authored
Dec 14, 2018
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added custom scrollbar to select component
parent
9e4547f7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
2 deletions
+14
-2
public/app/core/components/CustomScrollbar/CustomScrollbar.tsx
+2
-2
public/app/core/components/Select/Select.tsx
+11
-0
public/sass/components/_form_select_box.scss
+1
-0
No files found.
public/app/core/components/CustomScrollbar/CustomScrollbar.tsx
View file @
84df0e2d
...
@@ -28,8 +28,8 @@ class CustomScrollbar extends PureComponent<Props> {
...
@@ -28,8 +28,8 @@ class CustomScrollbar extends PureComponent<Props> {
<
Scrollbars
<
Scrollbars
className=
{
customClassName
}
className=
{
customClassName
}
autoHeight=
{
true
}
autoHeight=
{
true
}
autoHeightMin=
{
'
100%
'
}
autoHeightMin=
{
'
inherit
'
}
autoHeightMax=
{
'
100%
'
}
autoHeightMax=
{
'
inherit
'
}
renderTrackHorizontal=
{
props
=>
<
div
{
...
props
}
className=
"track-horizontal"
/>
}
renderTrackHorizontal=
{
props
=>
<
div
{
...
props
}
className=
"track-horizontal"
/>
}
renderTrackVertical=
{
props
=>
<
div
{
...
props
}
className=
"track-vertical"
/>
}
renderTrackVertical=
{
props
=>
<
div
{
...
props
}
className=
"track-vertical"
/>
}
renderThumbHorizontal=
{
props
=>
<
div
{
...
props
}
className=
"thumb-horizontal"
/>
}
renderThumbHorizontal=
{
props
=>
<
div
{
...
props
}
className=
"thumb-horizontal"
/>
}
...
...
public/app/core/components/Select/Select.tsx
View file @
84df0e2d
...
@@ -3,12 +3,14 @@ import classNames from 'classnames';
...
@@ -3,12 +3,14 @@ import classNames from 'classnames';
import
React
,
{
PureComponent
}
from
'react'
;
import
React
,
{
PureComponent
}
from
'react'
;
import
{
default
as
ReactSelect
}
from
'react-select'
;
import
{
default
as
ReactSelect
}
from
'react-select'
;
import
{
default
as
ReactAsyncSelect
}
from
'react-select/lib/Async'
;
import
{
default
as
ReactAsyncSelect
}
from
'react-select/lib/Async'
;
import
{
components
}
from
'react-select'
;
// Components
// Components
import
{
Option
,
SingleValue
}
from
'./PickerOption'
;
import
{
Option
,
SingleValue
}
from
'./PickerOption'
;
import
IndicatorsContainer
from
'./IndicatorsContainer'
;
import
IndicatorsContainer
from
'./IndicatorsContainer'
;
import
NoOptionsMessage
from
'./NoOptionsMessage'
;
import
NoOptionsMessage
from
'./NoOptionsMessage'
;
import
ResetStyles
from
'./ResetStyles'
;
import
ResetStyles
from
'./ResetStyles'
;
import
CustomScrollbar
from
'../CustomScrollbar/CustomScrollbar'
;
export
interface
SelectOptionItem
{
export
interface
SelectOptionItem
{
label
?:
string
;
label
?:
string
;
...
@@ -51,6 +53,14 @@ interface AsyncProps {
...
@@ -51,6 +53,14 @@ interface AsyncProps {
loadingMessage
?:
()
=>
string
;
loadingMessage
?:
()
=>
string
;
}
}
export
const
MenuList
=
props
=>
{
return
(
<
components
.
MenuList
{
...
props
}
>
<
CustomScrollbar
autoHide=
{
false
}
>
{
props
.
children
}
</
CustomScrollbar
>
</
components
.
MenuList
>
);
};
export
class
Select
extends
PureComponent
<
CommonProps
&
SelectProps
>
{
export
class
Select
extends
PureComponent
<
CommonProps
&
SelectProps
>
{
static
defaultProps
=
{
static
defaultProps
=
{
width
:
null
,
width
:
null
,
...
@@ -106,6 +116,7 @@ export class Select extends PureComponent<CommonProps & SelectProps> {
...
@@ -106,6 +116,7 @@ export class Select extends PureComponent<CommonProps & SelectProps> {
Option
,
Option
,
SingleValue
,
SingleValue
,
IndicatorsContainer
,
IndicatorsContainer
,
MenuList
,
}
}
}
}
defaultValue=
{
defaultValue
}
defaultValue=
{
defaultValue
}
value=
{
value
}
value=
{
value
}
...
...
public/sass/components/_form_select_box.scss
View file @
84df0e2d
...
@@ -79,6 +79,7 @@ $select-input-bg-disabled: $input-bg-disabled;
...
@@ -79,6 +79,7 @@ $select-input-bg-disabled: $input-bg-disabled;
.gf-form-select-box__option
{
.gf-form-select-box__option
{
border-left
:
2px
solid
transparent
;
border-left
:
2px
solid
transparent
;
white-space
:
nowrap
;
white-space
:
nowrap
;
background-color
:
$input-bg
;
&
.gf-form-select-box__option--is-focused
{
&
.gf-form-select-box__option--is-focused
{
color
:
$dropdownLinkColorHover
;
color
:
$dropdownLinkColorHover
;
...
...
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