New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-bootstrap-xeditable

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-bootstrap-xeditable

X-Editable for React with Bootstrap. [Demo](https://yankun.org/react-bootstrap-xeditable/)

1.0.0
latest
Source
npm
Version published
Maintainers
2
Created
Source

react-bootstrap-xeditable

X-Editable for React with Bootstrap. Demo

Build Status npm version devDependencies Status

Install

# npm
npm install react-bootstrap-xeditable

# yarn
yarn add react-bootstrap-xeditable

import bootstrap css and xeditable css


<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

<link rel="stylesheet" href="https://vitalets.github.io/x-editable/assets/x-editable/bootstrap3-editable/css/bootstrap-editable.css">

Usage:

TextField

import {EditableTextField} from 'react-bootstrap-xeditable';

<EditableTextField name='username' value={this.state.value} onSave={this.onSave} placeholder='Please input your username'/>
Options
OptionTypeRequiredDescription
isEditingbooleanoptionalSet editing status
isEditablebooleanoptionalYou can make it readonly
linkClassNamestringoptionalDefined the css class for the link text
nonValueTextstringoptionalthe default text if no value
valuestringrequiredThe value of input text
onSavefunctionrequiredthe callback when click save button
onCancelfunctionoptionalthe callback when click cancel button
placeholderstringoptional

Select

const options = [
  {
    text: 'China',
    value: 'CN'
  }, {
    text: 'India',
    value: 'IN'
  }, {
    text: 'United Kingdom (UK)',
    value: 'UK'
  }, {
    text: 'United States of America (USA)',
    value: 'USA'
  }
];
import {EditableSelect} from 'react-bootstrap-xeditable';

<EditableSelect name='country' onSave={this.onSave} value={this.state.value} options={options}/>
Options
OptionTypeRequiredDescription
isEditingbooleanoptionalSet editing status
isEditablebooleanoptionalYou can make it readonly
linkClassNamestringoptionalDefined the css class for the link text
nonValueTextstringoptionalthe default text if no value
valuestringstring[]required
multiplebooleanoptionalIf the select support multiple
optionsIOption[]string[]required
onSavefunctionrequiredthe callback when click save button
onCancelfunctionoptionalthe callback when click cancel button

TextArea

import {EditableTextArea} from 'react-bootstrap-xeditable';

<EditableTextArea name='username' value={this.state.value} onSave={this.onSave} placeholder='Please input your username'/>
Options
OptionTypeRequiredDescription
isEditingbooleanoptionalSet editing status
isEditablebooleanoptionalYou can make it readonly
linkClassNamestringoptionalDefined the css class for the link text
nonValueTextstringoptionalthe default text if no value
valuestringrequiredThe value of input text
onSavefunctionrequiredthe callback when click save button
onCancelfunctionoptionalthe callback when click cancel button

Progress:

  • :white_check_mark: : Supported
  • :runner: : In Progress
  • :thought_balloon: : Planning
ElementSupportReactXElement
textfield:white_check_mark:EditableTextField
select:white_check_mark:EditableSelect
textarea:white_check_mark:EditableTextArea
date:thought_balloon: 
datetime:thought_balloon: 
select2:thought_balloon: 

TypeScript:

d.ts already intergrated. just import it.

Known Issues:

  • Only support inline mode
  • onBlur not support yet

License

Licensed under the MIT license. Copyright (C) 2018 Kun Yan

FAQs

Package last updated on 26 Oct 2018

Did you know?

Socket

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