Skip to content

Commit d5cc117

Browse files
committed
Bump 0.6.2
1 parent 04da280 commit d5cc117

8 files changed

+57
-52
lines changed

lib/actions.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ var place = exports.place = (0, _reduxActions.createAction)(PLACE);
2929
var DELAY = exports.DELAY = prefix('delay');
3030
var DURATION = 1500;
3131
function delay(action) {
32-
var _ref = arguments.length <= 1 || arguments[1] === undefined ? { duration: DURATION } : arguments[1];
33-
34-
var duration = _ref.duration;
35-
var callback = _ref.callback;
32+
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { duration: DURATION },
33+
duration = _ref.duration,
34+
callback = _ref.callback;
3635

3736
if (!action.meta) {
3837
action.meta = {};

lib/middleware.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ function middleware(store) {
3737
}
3838

3939
// Setup timeout
40-
var _action$meta$DELAY = action.meta[_actions.DELAY];
41-
var duration = _action$meta$DELAY.duration;
42-
var callback = _action$meta$DELAY.callback;
40+
var _action$meta$DELAY = action.meta[_actions.DELAY],
41+
duration = _action$meta$DELAY.duration,
42+
callback = _action$meta$DELAY.callback;
4343

4444
names.forEach(function (name) {
4545
var newToken = setTimeout(function () {

lib/origin.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ var Origin = function (_Component) {
4646
}, {
4747
key: 'createWithDelay',
4848
value: function createWithDelay(creator) {
49-
var extras = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
50-
var _props = this.props;
51-
var duration = _props.delay;
52-
var callback = _props.onTimeout;
49+
var extras = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
50+
var _props = this.props,
51+
duration = _props.delay,
52+
callback = _props.onTimeout;
5353

5454
var action = creator(_extends({}, this.props, extras));
5555
if (duration || callback) {

lib/reducer.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ var handlers = (_handlers = {}, _defineProperty(_handlers, _actions.SHOW, functi
5555
}), _handlers);
5656

5757
function tooltip() {
58-
var state = arguments.length <= 0 || arguments[0] === undefined ? initial : arguments[0];
58+
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initial;
5959
var action = arguments[1];
6060

6161
// Check usage of deprecated props
@@ -66,7 +66,7 @@ function tooltip() {
6666
}
6767

6868
function reducer() {
69-
var state = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
69+
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7070
var action = arguments[1];
7171

7272
var newState = _extends({}, state);

lib/styles.js

+19-13
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,18 @@
33
Object.defineProperty(exports, "__esModule", {
44
value: true
55
});
6+
exports.border = exports.arrow = exports.content = exports.base = undefined;
67

78
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
89

10+
var _themes = require('./themes');
11+
12+
var themes = _interopRequireWildcard(_themes);
13+
14+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
15+
16+
var theme = themes.simple;
17+
918
var base = exports.base = {
1019
padding: 0,
1120
fontSize: 0,
@@ -49,30 +58,27 @@ var border = exports.border = {
4958
display: 'block',
5059
width: 0,
5160
height: 0,
52-
position: 'absolute'
61+
position: 'absolute',
62+
borderStyle: 'solid'
5363
},
5464
top: _extends({
55-
borderLeft: '9px solid transparent !important',
56-
borderRight: '9px solid transparent !important',
57-
borderTop: '9px solid',
65+
borderColor: theme.border.borderColor + ' transparent transparent transparent',
66+
borderWidth: '9px 9px 0px 9px',
5867
bottom: '-7px'
5968
}, vertical),
6069
right: _extends({
61-
borderTop: '9px solid transparent !important',
62-
borderBottom: '9px solid transparent !important',
63-
borderRight: '9px solid',
70+
borderColor: 'transparent ' + theme.border.borderColor + ' transparent transparent',
71+
borderWidth: '9px 9px 9px 0px',
6472
left: '-7px'
6573
}, horizontal),
6674
bottom: _extends({
67-
borderLeft: '9px solid transparent !important',
68-
borderRight: '9px solid transparent !important',
69-
borderBottom: '9px solid',
75+
borderColor: 'transparent transparent ' + theme.border.borderColor + ' transparent',
76+
borderWidth: '0px 9px 9px 9px',
7077
top: '-7px'
7178
}, vertical),
7279
left: _extends({
73-
borderTop: '9px solid transparent !important',
74-
borderBottom: '9px solid transparent !important',
75-
borderLeft: '9px solid',
80+
borderColor: 'transparent transparent transparent ' + theme.border.borderColor,
81+
borderWidth: '9px 0px 9px 9px',
7682
right: '-7px'
7783
}, horizontal)
7884
};

lib/tooltip.js

+12-12
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@ var Tooltip = function (_Component) {
9090
_createClass(Tooltip, [{
9191
key: 'componentWillReceiveProps',
9292
value: function componentWillReceiveProps(nextProps) {
93-
var place = nextProps.place;
94-
var content = nextProps.content;
95-
var children = nextProps.children;
93+
var place = nextProps.place,
94+
content = nextProps.content,
95+
children = nextProps.children;
9696

9797
var origin = (0, _utils.originOrEl)(nextProps);
9898
if (origin && ((0, _utils.originOrEl)(this.props) != origin || this.props.place !== place || this.props.content !== content || this.props.children !== children)) {
@@ -118,7 +118,7 @@ var Tooltip = function (_Component) {
118118
}, {
119119
key: 'children',
120120
value: function children() {
121-
var props = arguments.length <= 0 || arguments[0] === undefined ? this.props : arguments[0];
121+
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props;
122122
var content = props.content;
123123

124124
if (typeof content === 'string') {
@@ -129,23 +129,23 @@ var Tooltip = function (_Component) {
129129
}, {
130130
key: 'render',
131131
value: function render() {
132-
var _props = this.props;
133-
var show = _props.show;
134-
var onHover = _props.onHover;
135-
var onLeave = _props.onLeave;
132+
var _props = this.props,
133+
show = _props.show,
134+
onHover = _props.onHover,
135+
onLeave = _props.onLeave;
136136

137137
var origin = (0, _utils.originOrEl)(this.props);
138-
var _state = this.state;
139-
var place = _state.place;
140-
var offset = _state.offset;
138+
var _state = this.state,
139+
place = _state.place,
140+
offset = _state.offset;
141141

142142
var content = this.children();
143143
var visibility = origin && show ? 'visible' : 'hidden';
144144
var style = {
145145
base: _extends({}, styles.base, themes.simple.base, { visibility: visibility }, offset),
146146
content: _extends({}, styles.content, themes.simple.content),
147147
arrow: _extends({}, styles.arrow),
148-
border: _extends({}, styles.border.base, styles.border[place], themes.simple.border)
148+
border: _extends({}, themes.simple.border, styles.border.base, styles.border[place])
149149
};
150150
style.shadow = _extends({}, style.content, { visibility: 'hidden', position: 'absolute' });
151151

lib/utils.js

+13-13
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
44
value: true
55
});
66

7-
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
7+
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
88

99
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
1010

@@ -47,14 +47,14 @@ function dimension(el) {
4747
*/
4848
function position(el) {
4949
var pos = el.getBoundingClientRect();
50-
var _window = window;
51-
var pageYOffset = _window.pageYOffset;
52-
var pageXOffset = _window.pageXOffset;
53-
var _document$documentEle = document.documentElement;
54-
var scrollTop = _document$documentEle.scrollTop;
55-
var clientTop = _document$documentEle.clientTop;
56-
var scrollLeft = _document$documentEle.scrollLeft;
57-
var clientLeft = _document$documentEle.clientLeft;
50+
var _window = window,
51+
pageYOffset = _window.pageYOffset,
52+
pageXOffset = _window.pageXOffset;
53+
var _document$documentEle = document.documentElement,
54+
scrollTop = _document$documentEle.scrollTop,
55+
clientTop = _document$documentEle.clientTop,
56+
scrollLeft = _document$documentEle.scrollLeft,
57+
clientLeft = _document$documentEle.clientLeft;
5858

5959
var winTop = (pageYOffset || scrollTop) - clientTop;
6060
var winLeft = (pageXOffset || scrollLeft) - clientLeft;
@@ -235,8 +235,8 @@ function overDirs(tip, el) {
235235
* @return {Object} 'offset': style data to locate, 'place': final direction of the tooltip
236236
*/
237237
function adjust(content, props) {
238-
var auto = props.auto;
239-
var within = props.within;
238+
var auto = props.auto,
239+
within = props.within;
240240

241241
var origin = originOrEl(props);
242242
var place = props.place;
@@ -298,8 +298,8 @@ var actionTypes = Object.keys(actions).map(function (k) {
298298
return typeof e === 'string';
299299
});
300300
function deprecatedWarning(action) {
301-
var type = action.type;
302-
var payload = action.payload;
301+
var type = action.type,
302+
payload = action.payload;
303303

304304
if (actionTypes.indexOf(action.type) === -1) {
305305
return; // Ignore non-related actions

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "redux-tooltip",
3-
"version": "0.6.1",
3+
"version": "0.6.2",
44
"description": "A tooltip React component for Redux",
55
"main": "./lib/index.js",
66
"repository": {

0 commit comments

Comments
 (0)