react-draggable-tab
Advanced tools
Comparing version 0.9.0 to 0.10.0
## Change Log | ||
### PR | ||
### Ver 0.10.0 | ||
* #99 [Fix this.unbindShortcuts is not a function](https://github.com/georgeOsdDev/react-draggable-tab/issues/99) | ||
* Fix falling unit tests | ||
### Ver 0.9.0 | ||
This version contains a breaking change. The name of the Tab 'disableClose' property, | ||
which shadowed a standard property name and resulted in a React warning, has been changed | ||
to 'unclosable'. | ||
**TESTS ARE BROKEN**. `react-addons-test-utils` has a hard dependency on React 15. For | ||
@@ -53,3 +58,3 @@ React 16, Facebook has moved the utilities into `react-dom/test-utils` and | ||
`onTabDoubleClick`, `onTabMouseEnter` and `onTabMouseEnter` are removed from `Tabs`. | ||
All `onXXX` handler except `onClick` are now used on `Tab`. | ||
All `onXXX` handler except `onClick` are now used on `Tab`. | ||
* Update dependencies libraries version [cf65dbc](https://github.com/georgeOsdDev/react-draggable-tab/commit/cf65dbc8f756561536f53f5e3960bf86afebdc73) | ||
@@ -56,0 +61,0 @@ |
@@ -223,3 +223,3 @@ 'use strict'; | ||
value: function componentWillUnmount() { | ||
this.unbindShortcuts(); | ||
this.constructor.unbindShortcuts(); | ||
} | ||
@@ -226,0 +226,0 @@ }, { |
{ | ||
"name": "react-draggable-tab", | ||
"version": "0.9.0", | ||
"version": "0.10.0", | ||
"description": "Draggable chrome like tab react component ", | ||
@@ -11,8 +11,8 @@ "main": "./lib/index.js", | ||
"start:example:base": "npm run clean && npm run build && ", | ||
"start:example": "NODE_ENV=development npm run start:example:base", | ||
"start:example:prod": "NODE_ENV=production npm run start:example:base", | ||
"start:example": "cross-env NODE_ENV=development npm run start:example:base", | ||
"start:example:prod": "cross-env NODE_ENV=production npm run start:example:base", | ||
"test:local": "karma start", | ||
"test": "./node_modules/.bin/karma start --browsers Firefox --single-run", | ||
"clean": "rimraf lib", | ||
"build": "NODE_ENV=production babel src --out-dir lib" | ||
"build": "cross-env NODE_ENV=production babel src --out-dir lib" | ||
}, | ||
@@ -49,2 +49,3 @@ "repository": { | ||
"chai": "^4.1.2", | ||
"cross-env": "^5.1.4", | ||
"eslint": "^4.16.0", | ||
@@ -68,2 +69,3 @@ "eslint-config-airbnb": "^16.1.0", | ||
"react-tap-event-plugin": "^3.0.2", | ||
"react-test-renderer": "^16.3.2", | ||
"watchify": "^3.9.0" | ||
@@ -70,0 +72,0 @@ }, |
@@ -104,2 +104,5 @@ # React-draggable-tab [![Build Status](https://travis-ci.org/georgeOsdDev/react-draggable-tab.svg?branch=develop)](https://travis-ci.org/georgeOsdDev/react-draggable-tab) [![npm version](https://badge.fury.io/js/react-draggable-tab.svg)](http://badge.fury.io/js/react-draggable-tab) | ||
* `unclosable`: Disable tab to close. | ||
`PropTypes.bool` default `false`. | ||
* `shouldTabClose(e, key)`: will be called before tab close event, return false if you want to stop tab close process, default `true`; | ||
@@ -181,3 +184,3 @@ | ||
tabs:[ | ||
(<Tab key={'tab0'} title={'unclosable tab'} disableClose={true} > | ||
(<Tab key={'tab0'} title={'unclosable tab'} unclosable={true} > | ||
<div> | ||
@@ -277,6 +280,5 @@ <h1>This tab cannot close</h1> | ||
## [Contributors](https://github.com/georgeOsdDev/react-draggable-tab/graphs/contributors) | ||
## Contributors | ||
* @linhlc888 | ||
* @uriklar | ||
See [list](https://github.com/georgeOsdDev/react-draggable-tab/graphs/contributors) | ||
@@ -283,0 +285,0 @@ ## Known Issue |
@@ -142,3 +142,3 @@ import React from 'react'; | ||
componentWillUnmount() { | ||
this.unbindShortcuts(); | ||
this.constructor.unbindShortcuts(); | ||
} | ||
@@ -145,0 +145,0 @@ |
'use strict'; | ||
import React from 'react'; | ||
import ReactDom from 'react-dom'; | ||
import ReactTestUtils from 'react-addons-test-utils'; | ||
import ReactTestUtils from 'react-dom/test-utils'; | ||
import ShallowRenderer from 'react-test-renderer/shallow'; | ||
import chai from 'chai'; | ||
@@ -28,3 +29,3 @@ let expect = chai.expect; | ||
component = <CloseIcon style={style} className={className}>×</CloseIcon>; | ||
let renderer = ReactTestUtils.createRenderer(); | ||
let renderer = new ShallowRenderer(); | ||
renderer.render(component); | ||
@@ -31,0 +32,0 @@ let output = renderer.getRenderOutput(); |
'use strict'; | ||
import React from 'react'; | ||
import ReactDom from 'react-dom'; | ||
import ReactTestUtils from 'react-addons-test-utils'; | ||
import ReactTestUtils from 'react-dom/test-utils'; | ||
import chai from 'chai'; | ||
@@ -18,3 +18,3 @@ let expect = chai.expect; | ||
expect(component.props.title).to.be.equal('untitled'); | ||
expect(component.props.disableClose).to.be.equal(false); | ||
expect(component.props.uncloseable).to.be.equal(false); | ||
@@ -21,0 +21,0 @@ expect(component.props.tabClassNames).to.be.an('object'); |
'use strict'; | ||
import React from 'react'; | ||
import ReactDom from 'react-dom'; | ||
import ReactTestUtils from 'react-addons-test-utils'; | ||
import ReactTestUtils from 'react-dom/test-utils'; | ||
import chai from 'chai'; | ||
@@ -6,0 +6,0 @@ let expect = chai.expect; |
import React from 'react'; | ||
import ReactDom from 'react-dom'; | ||
import ReactTestUtils from 'react-addons-test-utils'; | ||
import ReactTestUtils from 'react-dom/test-utils'; | ||
import chai from 'chai'; | ||
@@ -66,19 +66,15 @@ import Mousetrap from 'mousetrap'; | ||
beforeEach(() => { | ||
let Wrapper = React.createClass({ | ||
getInitialState: function() { | ||
return {foo: 1}; | ||
}, | ||
update: function() { | ||
this.setState({foo: 2}); | ||
}, | ||
render: function() { | ||
return <div><Tabs | ||
selectedTab="tab1" | ||
tabs={tabs} /></div>; | ||
}, | ||
}); | ||
class Wrapper extends React.Component { | ||
getInitialState() { | ||
return {foo: 1}; | ||
} | ||
update() { | ||
this.setState({foo: 2}); | ||
} | ||
render() { | ||
return <div><Tabs | ||
selectedTab="tab1" | ||
tabs={tabs} /></div>; | ||
} | ||
} | ||
component = ReactTestUtils.renderIntoDocument(<Wrapper />); | ||
@@ -85,0 +81,0 @@ }); |
Sorry, the diff of this file is not supported yet
4286
300
392396
34