Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
renderLinkEditor(show: boolean, buttonRef: string, onConfirmUrl: Function) {
return Overlay(
{
show: show,
placement: 'bottom',
container: document.body,
target: () => this.refs[buttonRef],
},
Popover({id: 'popover'},
D.div({className: 'input-group'},
D.input({
ref: 'url-input',
className: 'form-control input-sm',
type: 'text',
value: this.state.urlValue,
onChange: (e) => {
const value = (e.target as any).value;
this.setState({urlValue: value});
},
onKeyDown: (e: KeyboardEvent) => {
if (e.which === 13 && this.state.urlValue !== '') { // enter
onConfirmUrl();
} else if (e.which === 27) { // esc
this.hideLinkEditor();
}
},
}),
private renderReactElement() {
return D.div(
{className: 'annotation-body-editor'},
D.input({
className: 'annotation-body-editor__title-field',
placeholder: 'Title',
defaultValue: this.originalRegionTitle,
onChange: event => {
this.changedRegionTitle = (event.target as HTMLInputElement).value;
},
}));
}
private dialogBody() {
return ModalBody(
{},
this.showMessage(),
D.form(
{
className: 'new-profile-modal__form',
},
D.input(
{
className: this.inputClassName(
'new-profile-modal__form__profile-name',
this.state.inputValidationState.name
),
placeholder: 'Profile Name',
type: 'text',
required: true,
ref: CreateProfileDialogClass.nameInputRef,
}
),
D.textarea(
{
className: this.inputClassName(
'new-profile-modal__form__profile-description',
this.state.inputValidationState.description
render() {
return (
DOM.input(
{
type: 'hidden',
name: 'csrfmiddlewaretoken',
value: this.state.csrfToken
}
)
);
}
}
renderFilter() {
const { selectedPane } = this.state;
const { tabs, filterString = "" } = this.props;
const { clientType, paramName } = sidePanelItems[selectedPane];
const targets = getTabsByClientType(tabs, clientType);
return dom.header(
{},
dom.input({
ref: node => {
this.filterInput = node;
},
placeholder: "Filter tabs",
value: filterString,
autoFocus: true,
type: "search",
onChange: e => this.onFilterChange(e.target.value),
onKeyDown: e => {
if (targets.size === 1 && e.keyCode === 13) {
this.onTabClick(targets.first(), paramName);
}
}
})
);
}