|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
import { Button, IconName, Intent, MaybeElement, Popover, Position } from '@blueprintjs/core';
|
|
|
|
|
import * as React from 'react';
|
|
|
|
|
import { Popover, Position, Button, Intent, Classes, Card, IconName, MaybeElement } from '@blueprintjs/core';
|
|
|
|
|
import { KeyBoard } from '../../../Common/KeyEnum';
|
|
|
|
|
|
|
|
|
|
interface IPopOverContentProps
|
|
|
|
@ -12,6 +12,8 @@ interface IPopOverContentProps
|
|
|
|
|
style?: React.CSSProperties;
|
|
|
|
|
className?: string;
|
|
|
|
|
intent?: Intent;
|
|
|
|
|
onClosing?: () => void;
|
|
|
|
|
onOpening?: () => void;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export class PopoverContent extends React.Component<IPopOverContentProps> {
|
|
|
|
@ -28,12 +30,16 @@ export class PopoverContent extends React.Component<IPopOverContentProps> {
|
|
|
|
|
disabled={this.props.disabled}
|
|
|
|
|
onOpening={e =>
|
|
|
|
|
{
|
|
|
|
|
if (this.props.onOpening)
|
|
|
|
|
this.props.onOpening();
|
|
|
|
|
e.tabIndex = -1;
|
|
|
|
|
e.focus();
|
|
|
|
|
e.addEventListener("keydown", this.handleKeyDown);
|
|
|
|
|
}}
|
|
|
|
|
onClosing={e =>
|
|
|
|
|
{
|
|
|
|
|
if (this.props.onClosing)
|
|
|
|
|
this.props.onClosing();
|
|
|
|
|
e.removeEventListener('keydown', this.handleKeyDown);
|
|
|
|
|
if (this.props.closeFocusElement)
|
|
|
|
|
this.props.closeFocusElement.focus();
|
|
|
|
@ -60,6 +66,7 @@ export class PopoverContent extends React.Component<IPopOverContentProps> {
|
|
|
|
|
{
|
|
|
|
|
if (this.cancelBtn)
|
|
|
|
|
this.cancelBtn.click();
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
}
|
|
|
|
|
else if (e.keyCode === KeyBoard.Escape)
|
|
|
|
|
{
|
|
|
|
|