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 - npm Package Compare versions

Comparing version

to
0.2.7

3

d.ts/EditableSelect.d.ts

@@ -11,5 +11,6 @@ // Import React

onUpdate: Function;
defaultOptionText?: string;
}
export interface EditableSelect extends React.ReactElement<EditableSelectProps> { }
export interface EditableSelectClass extends React.ComponentClass<EditableSelectProps> { }
export interface EditableSelectClass extends React.ComponentClass<EditableSelectProps> { }
export const EditableSelect: EditableSelectClass;

@@ -13,3 +13,3 @@ // Import React

export interface EditableTextArea extends React.ReactElement<EditableTextAreaProps> { }
export interface EditableTextAreaClass extends React.ComponentClass<EditableTextAreaProps> { }
export interface EditableTextAreaClass extends React.ComponentClass<EditableTextAreaProps> { }
export const EditableTextField: EditableTextAreaClass;

@@ -13,3 +13,3 @@ // Import React

export interface EditableTextField extends React.ReactElement<EditableTextFieldProps> { }
export interface EditableTextFieldClass extends React.ComponentClass<EditableTextFieldProps> { }
export interface EditableTextFieldClass extends React.ComponentClass<EditableTextFieldProps> { }
export const EditableTextField: EditableTextFieldClass;
{
"name": "react-bootstrap-xeditable",
"version": "0.2.6",
"version": "0.2.7",
"description": "",

@@ -10,6 +10,6 @@ "main": "lib/index.js",

"scripts": {
"start": "webpack-dev-server --inline --progress --port 8080",
"build:commonjs": "rimraf lib && cross-env BABEL_ENV=commonjs babel src --out-dir lib",
"build:es": "rimraf es && cross-env BABEL_ENV=es babel src --out-dir es",
"build:umd": "rimraf dist && cross-env BABEL_ENV=commonjs webpack --config config/webpack.prod.js --progress --profile --bail",
"start": "./node_modules/.bin/webpack-dev-server --inline --progress --port 8080",
"build:commonjs": "./node_modules/.bin/rimraf lib && ./node_modules/.bin/cross-env BABEL_ENV=commonjs ./node_modules/.bin/babel src --out-dir lib",
"build:es": "./node_modules/.bin/rimraf es && ./node_modules/.bin/cross-env BABEL_ENV=es ./node_modules/.bin/babel src --out-dir es",
"build:umd": "./node_modules/.bin/rimraf dist && ./node_modules/.bin/cross-env BABEL_ENV=commonjs ./node_modules/.bin/webpack --config config/webpack.prod.js --progress --profile --bail",
"build": "npm run build:commonjs && npm run build:es && npm run build:umd "

@@ -35,2 +35,3 @@ },

"devDependencies": {
"babel-cli": "^6.23.0",
"babel-core": "^6.20.0",

@@ -49,2 +50,3 @@ "babel-eslint": "^7.1.1",

"babel-preset-stage-1": "^6.16.0",
"cross-env": "^3.2.3",
"css-loader": "^0.26.1",

@@ -51,0 +53,0 @@ "eslint": "^3.12.2",

@@ -6,3 +6,3 @@ import React from 'react';

static defaultProps = {
name: null,
name: null
}

@@ -13,3 +13,3 @@ static propTypes = {

options: React.PropTypes.array.isRequired,
defaultOptionText: React.PropTypes.string,
defaultOptionText: React.PropTypes.string
}

@@ -22,3 +22,3 @@ constructor(props) {

if (this.props.defaultOptionText) {
options.unshift({ text: this.props.defaultOptionText, value: null});
options.unshift({text: this.props.defaultOptionText, value: null});
}

@@ -42,3 +42,3 @@ const selected = options.find((opt) => {

text: text,
value: this.props.value,
value: this.props.value
};

@@ -54,3 +54,3 @@

text: this.refs.el.options[this.refs.el.selectedIndex].text,
value: this.refs.el.value,
value: this.refs.el.value
});

@@ -65,8 +65,6 @@ }

convertOptions= (options) => {
convertOptions = (options) => {
return options.map((opt) => {
if (typeof opt === 'string'
|| typeof opt === 'number'
|| typeof opt === 'boolean') {
return { text: opt, value: opt};
if (typeof opt === 'string' || typeof opt === 'number' || typeof opt === 'boolean') {
return {text: opt, value: opt};
}

@@ -83,3 +81,3 @@ return {text: opt.text, value: opt.value};

<XEditable isLoading={false} save={this.save} cancel={this.cancel}>
<select ref='el' className='form-control input-sm' name={this.props.name} defaultValue={this.state.value} >
<select ref='el' className='form-control input-sm' name={this.props.name} defaultValue={this.state.value}>
{options}

@@ -90,5 +88,5 @@ </select>

} else {
return <a href='javascript:;' className='editable editable-click' onClick={this.handleLinkClick} >{this.state.text}</a>;
return <a href='javascript:;' className='editable editable-click' onClick={this.handleLinkClick}>{this.state.text}</a>;
}
}
}

@@ -19,3 +19,3 @@ import React from 'react';

this.state = {
isEditing: false,
isEditing: false
};

@@ -42,9 +42,11 @@ this.setState = this.setState.bind(this);

<XEditable isLoading={false} save={this.save} cancel={this.cancel}>
<textarea ref='el' className='form-control' rows='3' name={this.props.name} defaultValue={this.props.value} placeholder={this.props.placeholder}/>
<textarea ref='el' className='form-control' rows='3' name={this.props.name} defaultValue={this.props.value} placeholder={this.props.placeholder}/>
</XEditable>
);
} else {
return <a href='javascript:;' className='editable editable-click' onClick={this.handleLinkClick} ><pre>{this.props.value}</pre></a>;
return <a href='javascript:;' className='editable editable-click' onClick={this.handleLinkClick}>
<pre>{this.props.value}</pre>
</a>;
}
}
}

@@ -19,3 +19,3 @@ import React from 'react';

this.state = {
isEditing: false,
isEditing: false
};

@@ -42,10 +42,10 @@ this.setState = this.setState.bind(this);

<XEditable isLoading={false} save={this.save} cancel={this.cancel}>
<input ref='el' type='text' className='form-control input-sm' name={this.props.name} defaultValue={this.props.value} placeholder={this.props.placeholder} autoFocus/>
<span className='editable-clear-x' onClick={this.clear} ></span>
<input ref='el' type='text' className='form-control input-sm' name={this.props.name} defaultValue={this.props.value} placeholder={this.props.placeholder} autoFocus/>
<span className='editable-clear-x' onClick={this.clear}></span>
</XEditable>
);
} else {
return <a href='javascript:;' className='editable editable-click' onClick={this.handleLinkClick} >{this.props.value}</a>;
return <a href='javascript:;' className='editable editable-click' onClick={this.handleLinkClick}>{this.props.value}</a>;
}
}
}

@@ -18,26 +18,28 @@ import React from 'react';

<div>
{this.props.isLoading ? (
<div className='editableform-loading'></div>
) : (
<form className='form-inline editableform' onSubmit={this.props.save}>
<div className='control-group form-group'>
<div>
<div className='editable-input' style={{
position: 'relative'
}}>
{this.props.children}
{this.props.isLoading
? (
<div className='editableform-loading'></div>
)
: (
<form className='form-inline editableform' onSubmit={this.props.save}>
<div className='control-group form-group'>
<div>
<div className='editable-input' style={{
position: 'relative'
}}>
{this.props.children}
</div>
<div className='editable-buttons'>
<button type='submit' className='btn btn-primary btn-sm editable-submit' onClick={this.props.save}>
<i className='glyphicon glyphicon-ok'></i>
</button>
<button type='button' className='btn btn-default btn-sm editable-cancel' onClick={this.props.cancel}>
<i className='glyphicon glyphicon-remove'></i>
</button>
</div>
</div>
<div className='editable-buttons'>
<button type='submit' className='btn btn-primary btn-sm editable-submit' onClick={this.props.save}>
<i className='glyphicon glyphicon-ok'></i>
</button>
<button type='button' className='btn btn-default btn-sm editable-cancel' onClick={this.props.cancel}>
<i className='glyphicon glyphicon-remove'></i>
</button>
</div>
<div className='editable-error-block help-block'></div>
</div>
<div className='editable-error-block help-block'></div>
</div>
</form>
)}
</form>
)}
</div>

@@ -44,0 +46,0 @@ </span>

Sorry, the diff of this file is not supported yet