How to use the @blueprintjs/select.Suggest.ofType function in @blueprintjs/select

To help you get started, we’ve selected a few @blueprintjs/select examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nowyasimi / no8am / no8am / static / js / search / SearchBoxWithPopover.tsx View on Github external
interface ISearchBoxWithPopoverDispatchProps {
    onLoadMetadata: () => void;
    onSearchItem: (item: IMetadata) => void;
}

interface IMetadataByType {
    [x: string]: SearchBoxWithPopoverItem[];
}

interface ISearchHeader {
    text: string;
}

type SearchBoxWithPopoverItem = ISearchHeader | IMetadata;

const SuggestWrapper = Suggest.ofType();

@HotkeysTarget
class SearchBoxWithPopover
    extends React.Component {

    private noResults = (
        // TODO
        // } else if (this.props.searchHistory.length > 0) {
        //     return ([{text: "Recent Searches (No results)"}] as SearchBoxWithPopoverItem[])
        //         .concat(this.props.searchHistory);
        <menuitem for="" disabled="{true}">
    );
</menuitem>
github spotify / proto-registry / src / components / TypeSearch.tsx View on Github external
/* tslint:disable */
// Sadly this library is not ES6 module compatible
const Fuse = require('fuse.js')

/* tslint:enable */

interface IProps {
  // The nodes to search
  nodes: ReflectionObject[]
  // Recently searched/selected nodes, to be shown as suggestions before the user starts searching
  recent: ReadonlyArray
  // Called when the user requests a type to be selected
  onSelected: (fullName: string) =&gt; void
}

const NodeSuggest = Suggest.ofType()

// A component that provides a search field for types.
class TypeSearch extends React.PureComponent {
  public render () {
    return (
      
    )
  }
github palantir / blueprint / packages / docs-app / src / examples / select-examples / suggestExample.tsx View on Github external
import { H5, MenuItem, Switch } from "@blueprintjs/core";
import { Example, IExampleProps } from "@blueprintjs/docs-theme";
import { Suggest } from "@blueprintjs/select";
import {
    areFilmsEqual,
    createFilm,
    filmSelectProps,
    IFilm,
    maybeAddCreatedFilmToArrays,
    maybeDeleteCreatedFilmFromArrays,
    renderCreateFilmOption,
    TOP_100_FILMS,
} from "./films";

const FilmSuggest = Suggest.ofType();

export interface ISuggestExampleState {
    allowCreate: boolean;
    closeOnSelect: boolean;
    createdItems: IFilm[];
    fill: boolean;
    film: IFilm;
    items: IFilm[];
    minimal: boolean;
    openOnKeyDown: boolean;
    resetOnClose: boolean;
    resetOnQuery: boolean;
    resetOnSelect: boolean;
}

export class SuggestExample extends React.PureComponent {
github HiDeoo / YaTA / src / components / BroadcasterInformations.tsx View on Github external
import * as _ from 'lodash'
import pluralize from 'pluralize'
import * as React from 'react'

import BroadcasterSection from 'components/BroadcasterSection'
import ExternalLink from 'components/ExternalLink'
import NonIdealState from 'components/NonIdealState'
import Spinner from 'components/Spinner'
import { BroadcasterSectionProps } from 'containers/BroadcasterOverlay'
import Twitch, { RawGame, RawNotification } from 'libs/Twitch'
import styled, { theme } from 'styled'

/**
 * Game suggest component.
 */
const GameSuggest = Suggest.ofType()

/**
 * InfoInput component.
 */
const InfoInput = styled(InputGroup)`
  .${Classes.DARK} &amp; &gt; .${Classes.INPUT}.${Classes.DISABLED}, .${Classes.DARK} &amp; &gt; .${Classes.INPUT}:disabled {
    ${theme('broadcaster.input.disabled')};
  }
`

/**
 * GameFormGroup component.
 */
const GameFormGroup = styled(FormGroup)`
  width: 100%;
`