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
6d1e323b
Unverified
Commit
6d1e323b
authored
Apr 10, 2020
by
Alex Khomenko
Committed by
GitHub
Apr 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Grafana UI: make menuPlacement customizable (#23499)
parent
1ff69db5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
25 deletions
+27
-25
packages/grafana-ui/src/components/Select/SelectBase.tsx
+2
-1
packages/grafana-ui/src/components/Select/types.ts
+25
-24
No files found.
packages/grafana-ui/src/components/Select/SelectBase.tsx
View file @
6d1e323b
...
@@ -86,6 +86,7 @@ export function SelectBase<T>({
...
@@ -86,6 +86,7 @@ export function SelectBase<T>({
loadingMessage
=
'Loading options...'
,
loadingMessage
=
'Loading options...'
,
maxMenuHeight
=
300
,
maxMenuHeight
=
300
,
menuPosition
,
menuPosition
,
menuPlacement
=
'auto'
,
noOptionsMessage
=
'No options found'
,
noOptionsMessage
=
'No options found'
,
onBlur
,
onBlur
,
onChange
,
onChange
,
...
@@ -158,7 +159,7 @@ export function SelectBase<T>({
...
@@ -158,7 +159,7 @@ export function SelectBase<T>({
isSearchable
,
isSearchable
,
maxMenuHeight
,
maxMenuHeight
,
menuIsOpen
:
isOpen
,
menuIsOpen
:
isOpen
,
menuPlacement
:
'auto'
,
menuPlacement
,
menuPosition
,
menuPosition
,
menuShouldScrollIntoView
:
false
,
menuShouldScrollIntoView
:
false
,
onBlur
,
onBlur
,
...
...
packages/grafana-ui/src/components/Select/types.ts
View file @
6d1e323b
...
@@ -5,43 +5,44 @@ import { FormInputSize } from '../Forms/types';
...
@@ -5,43 +5,44 @@ import { FormInputSize } from '../Forms/types';
export
type
SelectValue
<
T
>
=
T
|
SelectableValue
<
T
>
|
T
[]
|
Array
<
SelectableValue
<
T
>>
;
export
type
SelectValue
<
T
>
=
T
|
SelectableValue
<
T
>
|
T
[]
|
Array
<
SelectableValue
<
T
>>
;
export
interface
SelectCommonProps
<
T
>
{
export
interface
SelectCommonProps
<
T
>
{
allowCustomValue
?:
boolean
;
autoFocus
?:
boolean
;
backspaceRemovesValue
?:
boolean
;
className
?:
string
;
className
?:
string
;
options
?:
Array
<
SelectableValue
<
T
>>
;
components
?:
any
;
defaultValue
?:
any
;
defaultValue
?:
any
;
inputValue
?:
string
;
disabled
?:
boolean
;
value
?:
SelectValue
<
T
>
;
formatCreateLabel
?:
(
input
:
string
)
=>
string
;
getOptionLabel
?:
(
item
:
SelectableValue
<
T
>
)
=>
string
;
getOptionLabel
?:
(
item
:
SelectableValue
<
T
>
)
=>
string
;
getOptionValue
?:
(
item
:
SelectableValue
<
T
>
)
=>
string
;
getOptionValue
?:
(
item
:
SelectableValue
<
T
>
)
=>
string
;
onCreateOption
?:
(
value
:
string
)
=>
void
;
inputValue
?:
string
;
onChange
:
(
value
:
SelectableValue
<
T
>
)
=>
{}
|
void
;
onInputChange
?:
(
label
:
string
)
=>
void
;
onKeyDown
?:
(
event
:
React
.
KeyboardEvent
)
=>
void
;
placeholder
?:
string
;
disabled
?:
boolean
;
isSearchable
?:
boolean
;
isClearable
?:
boolean
;
isClearable
?:
boolean
;
autoFocus
?:
boolean
;
openMenuOnFocus
?:
boolean
;
onBlur
?:
()
=>
void
;
maxMenuHeight
?:
number
;
isLoading
?:
boolean
;
isLoading
?:
boolean
;
noOptionsMessage
?:
string
;
isMulti
?:
boolean
;
isMulti
?:
boolean
;
backspaceRemovesValue
?:
boolean
;
isOpen
?:
boolean
;
isOpen
?:
boolean
;
components
?:
any
;
isSearchable
?:
boolean
;
onOpenMenu
?:
()
=>
void
;
maxMenuHeight
?:
number
;
menuPlacement
?:
'auto'
|
'bottom'
|
'top'
;
menuPosition
?:
'fixed'
|
'absolute'
;
noOptionsMessage
?:
string
;
onBlur
?:
()
=>
void
;
onChange
:
(
value
:
SelectableValue
<
T
>
)
=>
{}
|
void
;
onCloseMenu
?:
()
=>
void
;
onCloseMenu
?:
()
=>
void
;
tabSelectsValue
?:
boolean
;
onCreateOption
?:
(
value
:
string
)
=>
void
;
formatCreateLabel
?:
(
input
:
string
)
=>
string
;
onInputChange
?:
(
label
:
string
)
=>
void
;
allowCustomValue
?:
boolean
;
onKeyDown
?:
(
event
:
React
.
KeyboardEvent
)
=>
void
;
width
?:
number
;
onOpenMenu
?:
()
=>
void
;
size
?:
FormInputSize
;
openMenuOnFocus
?:
boolean
;
options
?:
Array
<
SelectableValue
<
T
>>
;
placeholder
?:
string
;
/** item to be rendered in front of the input */
/** item to be rendered in front of the input */
prefix
?:
JSX
.
Element
|
string
|
null
;
prefix
?:
JSX
.
Element
|
string
|
null
;
/** Use a custom element to control Select. A proper ref to the renderControl is needed if 'portal' isn't set to null*/
/** Use a custom element to control Select. A proper ref to the renderControl is needed if 'portal' isn't set to null*/
renderControl
?:
ControlComponent
<
T
>
;
renderControl
?:
ControlComponent
<
T
>
;
menuPosition
?:
'fixed'
|
'absolute'
;
size
?:
FormInputSize
;
tabSelectsValue
?:
boolean
;
value
?:
SelectValue
<
T
>
;
width
?:
number
;
}
}
export
interface
SelectAsyncProps
<
T
>
{
export
interface
SelectAsyncProps
<
T
>
{
...
...
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