Socket
Socket
Sign inDemoInstall

@oerlikon/topology-select

Package Overview
Dependencies
385
Maintainers
7
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @oerlikon/topology-select

Provides a simple react components for selecting topology nodes


Version published
Maintainers
7
Created

Readme

Source

@oerlikon/topology-select

Provides a simple react components for selecting topology nodes

props

minSearchCharacters: Minimum search term length to initialize a search request. Defaults to 3.

zone: Topology zone. Used in all api requests (e.g. in topo://ZONE/node/...). Defaults to local.

Inherits the following properties from material-ui TextField:

  • name
  • onBlur
  • error
  • helperText
  • className
  • label

usage

Single mode

import React, { useState } from 'react';
import { TopologySelect } from '@oerlikon/topology-select';

const BASE_URL = 'http://API_BASE_URL';
const ACCESS_TOKEN = 'my-access-token';

export const MyForm = () => {
  const [value, setValue] = useState<string>();

  const handleChange = (event: ChangeEvent<{ value: string }>) => {
    setValue(event.target.value);
  };

  return (
    <TopologySelect
      multiple={false}
      value={value}
      onChange={handleChange}
      label="Select a node"
      baseUrl={BASE_URL}
      accessToken={ACCESS_TOKEN}
    />
  );
};

Multiple mode

import React, { useState } from 'react';
import { TopologySelect } from '@oerlikon/topology-select';

const BASE_URL = 'http://API_BASE_URL';
const ACCESS_TOKEN = 'my-access-token';

export const MyForm = () => {
  const [values, setValues] = useState<string[]>([]);

  const handleChange = (event: ChangeEvent<{ value: string[] }>) => {
    setValues(event.target.value);
  };

  return (
    <TopologySelect
      multiple
      value={values}
      onChange={handleChange}
      label="Select multiple nodes"
      baseUrl={BASE_URL}
      accessToken={ACCESS_TOKEN}
    />
  );
};

FAQs

Last updated on 19 Mar 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc