react-tooltip 3.11.2 → 3.11.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -1
- package/{standalone/react-tooltip.js → dist/index.es.js} +1080 -1363
- package/dist/index.es.js.map +1 -0
- package/dist/index.js +2042 -285
- package/dist/index.js.map +1 -0
- package/package.json +52 -20
- package/Makefile +0 -62
- package/bower.json +0 -33
- package/contributing.md +0 -28
- package/dist/constant.js +0 -13
- package/dist/decorators/bodyMode.js +0 -124
- package/dist/decorators/customEvent.js +0 -110
- package/dist/decorators/getEffect.js +0 -12
- package/dist/decorators/isCapture.js +0 -11
- package/dist/decorators/staticMethods.js +0 -78
- package/dist/decorators/trackRemoval.js +0 -52
- package/dist/decorators/windowListener.js +0 -48
- package/dist/style.js +0 -6
- package/dist/utils/aria.js +0 -24
- package/dist/utils/getPosition.js +0 -274
- package/dist/utils/getTipContent.js +0 -32
- package/dist/utils/nodeListToArray.js +0 -15
- package/standalone/react-tooltip.min.js +0 -3
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
exports.default = function (target) {
|
|
8
|
-
target.prototype.isBodyMode = function () {
|
|
9
|
-
return !!this.props.bodyMode;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
target.prototype.bindBodyListener = function (targetArray) {
|
|
13
|
-
var _this = this;
|
|
14
|
-
|
|
15
|
-
var _state = this.state,
|
|
16
|
-
event = _state.event,
|
|
17
|
-
eventOff = _state.eventOff,
|
|
18
|
-
possibleCustomEvents = _state.possibleCustomEvents,
|
|
19
|
-
possibleCustomEventsOff = _state.possibleCustomEventsOff;
|
|
20
|
-
|
|
21
|
-
var body = getBody();
|
|
22
|
-
|
|
23
|
-
var customEvents = findCustomEvents(targetArray, 'data-event');
|
|
24
|
-
var customEventsOff = findCustomEvents(targetArray, 'data-event-off');
|
|
25
|
-
|
|
26
|
-
if (event != null) customEvents[event] = true;
|
|
27
|
-
if (eventOff != null) customEventsOff[eventOff] = true;
|
|
28
|
-
possibleCustomEvents.split(' ').forEach(function (event) {
|
|
29
|
-
return customEvents[event] = true;
|
|
30
|
-
});
|
|
31
|
-
possibleCustomEventsOff.split(' ').forEach(function (event) {
|
|
32
|
-
return customEventsOff[event] = true;
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
this.unbindBodyListener(body);
|
|
36
|
-
|
|
37
|
-
var listeners = this.bodyModeListeners = {};
|
|
38
|
-
if (event == null) {
|
|
39
|
-
listeners.mouseover = bodyListener.bind(this, this.showTooltip, {});
|
|
40
|
-
listeners.mousemove = bodyListener.bind(this, this.updateTooltip, { respectEffect: true });
|
|
41
|
-
listeners.mouseout = bodyListener.bind(this, this.hideTooltip, {});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
for (var _event in customEvents) {
|
|
45
|
-
listeners[_event] = bodyListener.bind(this, function (e) {
|
|
46
|
-
var targetEventOff = e.currentTarget.getAttribute('data-event-off') || eventOff;
|
|
47
|
-
_customEvent.checkStatus.call(_this, targetEventOff, e);
|
|
48
|
-
}, { customEvent: true });
|
|
49
|
-
}
|
|
50
|
-
for (var _event2 in customEventsOff) {
|
|
51
|
-
listeners[_event2] = bodyListener.bind(this, this.hideTooltip, { customEvent: true });
|
|
52
|
-
}
|
|
53
|
-
for (var _event3 in listeners) {
|
|
54
|
-
body.addEventListener(_event3, listeners[_event3]);
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
target.prototype.unbindBodyListener = function (body) {
|
|
59
|
-
body = body || getBody();
|
|
60
|
-
|
|
61
|
-
var listeners = this.bodyModeListeners;
|
|
62
|
-
for (var event in listeners) {
|
|
63
|
-
body.removeEventListener(event, listeners[event]);
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
var _customEvent = require('./customEvent');
|
|
69
|
-
|
|
70
|
-
var makeProxy = function makeProxy(e) {
|
|
71
|
-
var proxy = {};
|
|
72
|
-
for (var key in e) {
|
|
73
|
-
if (typeof e[key] === 'function') {
|
|
74
|
-
proxy[key] = e[key].bind(e);
|
|
75
|
-
} else {
|
|
76
|
-
proxy[key] = e[key];
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
return proxy;
|
|
80
|
-
}; /**
|
|
81
|
-
* Util method to get effect
|
|
82
|
-
*/
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
var bodyListener = function bodyListener(callback, options, e) {
|
|
86
|
-
var _options$respectEffec = options.respectEffect,
|
|
87
|
-
respectEffect = _options$respectEffec === undefined ? false : _options$respectEffec,
|
|
88
|
-
_options$customEvent = options.customEvent,
|
|
89
|
-
customEvent = _options$customEvent === undefined ? false : _options$customEvent;
|
|
90
|
-
var id = this.props.id;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
var tip = e.target.getAttribute('data-tip') || null;
|
|
94
|
-
var forId = e.target.getAttribute('data-for') || null;
|
|
95
|
-
|
|
96
|
-
var target = e.target;
|
|
97
|
-
if (this.isCustomEvent(target) && !customEvent) {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
var isTargetBelongsToTooltip = id == null && forId == null || forId === id;
|
|
102
|
-
|
|
103
|
-
if (tip != null && (!respectEffect || this.getEffect(target) === 'float') && isTargetBelongsToTooltip) {
|
|
104
|
-
var proxy = makeProxy(e);
|
|
105
|
-
proxy.currentTarget = target;
|
|
106
|
-
callback(proxy);
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
var findCustomEvents = function findCustomEvents(targetArray, dataAttribute) {
|
|
111
|
-
var events = {};
|
|
112
|
-
targetArray.forEach(function (target) {
|
|
113
|
-
var event = target.getAttribute(dataAttribute);
|
|
114
|
-
if (event) event.split(' ').forEach(function (event) {
|
|
115
|
-
return events[event] = true;
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
return events;
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
var getBody = function getBody() {
|
|
123
|
-
return document.getElementsByTagName('body')[0];
|
|
124
|
-
};
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
exports.default = function (target) {
|
|
8
|
-
target.prototype.isCustomEvent = function (ele) {
|
|
9
|
-
var event = this.state.event;
|
|
10
|
-
|
|
11
|
-
return event || !!ele.getAttribute('data-event');
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
/* Bind listener for custom event */
|
|
15
|
-
target.prototype.customBindListener = function (ele) {
|
|
16
|
-
var _this = this;
|
|
17
|
-
|
|
18
|
-
var _state = this.state,
|
|
19
|
-
event = _state.event,
|
|
20
|
-
eventOff = _state.eventOff;
|
|
21
|
-
|
|
22
|
-
var dataEvent = ele.getAttribute('data-event') || event;
|
|
23
|
-
var dataEventOff = ele.getAttribute('data-event-off') || eventOff;
|
|
24
|
-
|
|
25
|
-
dataEvent.split(' ').forEach(function (event) {
|
|
26
|
-
ele.removeEventListener(event, customListeners.get(ele, event));
|
|
27
|
-
var customListener = checkStatus.bind(_this, dataEventOff);
|
|
28
|
-
customListeners.set(ele, event, customListener);
|
|
29
|
-
ele.addEventListener(event, customListener, false);
|
|
30
|
-
});
|
|
31
|
-
if (dataEventOff) {
|
|
32
|
-
dataEventOff.split(' ').forEach(function (event) {
|
|
33
|
-
ele.removeEventListener(event, _this.hideTooltip);
|
|
34
|
-
ele.addEventListener(event, _this.hideTooltip, false);
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
/* Unbind listener for custom event */
|
|
40
|
-
target.prototype.customUnbindListener = function (ele) {
|
|
41
|
-
var _state2 = this.state,
|
|
42
|
-
event = _state2.event,
|
|
43
|
-
eventOff = _state2.eventOff;
|
|
44
|
-
|
|
45
|
-
var dataEvent = event || ele.getAttribute('data-event');
|
|
46
|
-
var dataEventOff = eventOff || ele.getAttribute('data-event-off');
|
|
47
|
-
|
|
48
|
-
ele.removeEventListener(dataEvent, customListeners.get(ele, event));
|
|
49
|
-
if (dataEventOff) ele.removeEventListener(dataEventOff, this.hideTooltip);
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Custom events to control showing and hiding of tooltip
|
|
57
|
-
*
|
|
58
|
-
* @attributes
|
|
59
|
-
* - `event` {String}
|
|
60
|
-
* - `eventOff` {String}
|
|
61
|
-
*/
|
|
62
|
-
|
|
63
|
-
var checkStatus = exports.checkStatus = function checkStatus(dataEventOff, e) {
|
|
64
|
-
var show = this.state.show;
|
|
65
|
-
var id = this.props.id;
|
|
66
|
-
|
|
67
|
-
var isCapture = this.isCapture(e.currentTarget);
|
|
68
|
-
var currentItem = e.currentTarget.getAttribute('currentItem');
|
|
69
|
-
|
|
70
|
-
if (!isCapture) e.stopPropagation();
|
|
71
|
-
if (show && currentItem === 'true') {
|
|
72
|
-
if (!dataEventOff) this.hideTooltip(e);
|
|
73
|
-
} else {
|
|
74
|
-
e.currentTarget.setAttribute('currentItem', 'true');
|
|
75
|
-
setUntargetItems(e.currentTarget, this.getTargetArray(id));
|
|
76
|
-
this.showTooltip(e);
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
var setUntargetItems = function setUntargetItems(currentTarget, targetArray) {
|
|
81
|
-
for (var i = 0; i < targetArray.length; i++) {
|
|
82
|
-
if (currentTarget !== targetArray[i]) {
|
|
83
|
-
targetArray[i].setAttribute('currentItem', 'false');
|
|
84
|
-
} else {
|
|
85
|
-
targetArray[i].setAttribute('currentItem', 'true');
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
var customListeners = {
|
|
91
|
-
id: '9b69f92e-d3fe-498b-b1b4-c5e63a51b0cf',
|
|
92
|
-
set: function set(target, event, listener) {
|
|
93
|
-
if (this.id in target) {
|
|
94
|
-
var map = target[this.id];
|
|
95
|
-
map[event] = listener;
|
|
96
|
-
} else {
|
|
97
|
-
// this is workaround for WeakMap, which is not supported in older browsers, such as IE
|
|
98
|
-
Object.defineProperty(target, this.id, {
|
|
99
|
-
configurable: true,
|
|
100
|
-
value: _defineProperty({}, event, listener)
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
get: function get(target, event) {
|
|
105
|
-
var map = target[this.id];
|
|
106
|
-
if (map !== undefined) {
|
|
107
|
-
return map[event];
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
exports.default = function (target) {
|
|
8
|
-
target.prototype.getEffect = function (currentTarget) {
|
|
9
|
-
var dataEffect = currentTarget.getAttribute('data-effect');
|
|
10
|
-
return dataEffect || this.props.effect || 'float';
|
|
11
|
-
};
|
|
12
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
exports.default = function (target) {
|
|
8
|
-
target.prototype.isCapture = function (currentTarget) {
|
|
9
|
-
return currentTarget && currentTarget.getAttribute('data-iscapture') === 'true' || this.props.isCapture || false;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
exports.default = function (target) {
|
|
8
|
-
/**
|
|
9
|
-
* Hide all tooltip
|
|
10
|
-
* @trigger ReactTooltip.hide()
|
|
11
|
-
*/
|
|
12
|
-
target.hide = function (target) {
|
|
13
|
-
dispatchGlobalEvent(_constant2.default.GLOBAL.HIDE, { target: target });
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Rebuild all tooltip
|
|
18
|
-
* @trigger ReactTooltip.rebuild()
|
|
19
|
-
*/
|
|
20
|
-
target.rebuild = function () {
|
|
21
|
-
dispatchGlobalEvent(_constant2.default.GLOBAL.REBUILD);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Show specific tooltip
|
|
26
|
-
* @trigger ReactTooltip.show()
|
|
27
|
-
*/
|
|
28
|
-
target.show = function (target) {
|
|
29
|
-
dispatchGlobalEvent(_constant2.default.GLOBAL.SHOW, { target: target });
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
target.prototype.globalRebuild = function () {
|
|
33
|
-
if (this.mount) {
|
|
34
|
-
this.unbindListener();
|
|
35
|
-
this.bindListener();
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
target.prototype.globalShow = function (event) {
|
|
40
|
-
if (this.mount) {
|
|
41
|
-
// Create a fake event, specific show will limit the type to `solid`
|
|
42
|
-
// only `float` type cares e.clientX e.clientY
|
|
43
|
-
var e = { currentTarget: event.detail.target };
|
|
44
|
-
this.showTooltip(e, true);
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
target.prototype.globalHide = function (event) {
|
|
49
|
-
if (this.mount) {
|
|
50
|
-
var hasTarget = event && event.detail && event.detail.target && true || false;
|
|
51
|
-
this.hideTooltip({ currentTarget: hasTarget && event.detail.target }, hasTarget);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
var _constant = require('../constant');
|
|
57
|
-
|
|
58
|
-
var _constant2 = _interopRequireDefault(_constant);
|
|
59
|
-
|
|
60
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
61
|
-
|
|
62
|
-
var dispatchGlobalEvent = function dispatchGlobalEvent(eventName, opts) {
|
|
63
|
-
// Compatible with IE
|
|
64
|
-
// @see http://stackoverflow.com/questions/26596123/internet-explorer-9-10-11-event-constructor-doesnt-work
|
|
65
|
-
var event = void 0;
|
|
66
|
-
|
|
67
|
-
if (typeof window.CustomEvent === 'function') {
|
|
68
|
-
event = new window.CustomEvent(eventName, { detail: opts });
|
|
69
|
-
} else {
|
|
70
|
-
event = document.createEvent('Event');
|
|
71
|
-
event.initEvent(eventName, false, true);
|
|
72
|
-
event.detail = opts;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
window.dispatchEvent(event);
|
|
76
|
-
}; /**
|
|
77
|
-
* Static methods for react-tooltip
|
|
78
|
-
*/
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
exports.default = function (target) {
|
|
8
|
-
target.prototype.bindRemovalTracker = function () {
|
|
9
|
-
var _this = this;
|
|
10
|
-
|
|
11
|
-
var MutationObserver = getMutationObserverClass();
|
|
12
|
-
if (MutationObserver == null) return;
|
|
13
|
-
|
|
14
|
-
var observer = new MutationObserver(function (mutations) {
|
|
15
|
-
for (var m1 = 0; m1 < mutations.length; m1++) {
|
|
16
|
-
var mutation = mutations[m1];
|
|
17
|
-
for (var m2 = 0; m2 < mutation.removedNodes.length; m2++) {
|
|
18
|
-
var element = mutation.removedNodes[m2];
|
|
19
|
-
if (element === _this.state.currentTarget) {
|
|
20
|
-
_this.hideTooltip();
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
observer.observe(window.document, { childList: true, subtree: true });
|
|
28
|
-
|
|
29
|
-
this.removalTracker = observer;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
target.prototype.unbindRemovalTracker = function () {
|
|
33
|
-
if (this.removalTracker) {
|
|
34
|
-
this.removalTracker.disconnect();
|
|
35
|
-
this.removalTracker = null;
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Tracking target removing from DOM.
|
|
42
|
-
* It's necessary to hide tooltip when it's target disappears.
|
|
43
|
-
* Otherwise, the tooltip would be shown forever until another target
|
|
44
|
-
* is triggered.
|
|
45
|
-
*
|
|
46
|
-
* If MutationObserver is not available, this feature just doesn't work.
|
|
47
|
-
*/
|
|
48
|
-
|
|
49
|
-
// https://hacks.mozilla.org/2012/05/dom-mutationobserver-reacting-to-dom-changes-without-killing-browser-performance/
|
|
50
|
-
var getMutationObserverClass = function getMutationObserverClass() {
|
|
51
|
-
return window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
|
|
52
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
exports.default = function (target) {
|
|
8
|
-
target.prototype.bindWindowEvents = function (resizeHide) {
|
|
9
|
-
// ReactTooltip.hide
|
|
10
|
-
window.removeEventListener(_constant2.default.GLOBAL.HIDE, this.globalHide);
|
|
11
|
-
window.addEventListener(_constant2.default.GLOBAL.HIDE, this.globalHide, false);
|
|
12
|
-
|
|
13
|
-
// ReactTooltip.rebuild
|
|
14
|
-
window.removeEventListener(_constant2.default.GLOBAL.REBUILD, this.globalRebuild);
|
|
15
|
-
window.addEventListener(_constant2.default.GLOBAL.REBUILD, this.globalRebuild, false);
|
|
16
|
-
|
|
17
|
-
// ReactTooltip.show
|
|
18
|
-
window.removeEventListener(_constant2.default.GLOBAL.SHOW, this.globalShow);
|
|
19
|
-
window.addEventListener(_constant2.default.GLOBAL.SHOW, this.globalShow, false);
|
|
20
|
-
|
|
21
|
-
// Resize
|
|
22
|
-
if (resizeHide) {
|
|
23
|
-
window.removeEventListener('resize', this.onWindowResize);
|
|
24
|
-
window.addEventListener('resize', this.onWindowResize, false);
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
target.prototype.unbindWindowEvents = function () {
|
|
29
|
-
window.removeEventListener(_constant2.default.GLOBAL.HIDE, this.globalHide);
|
|
30
|
-
window.removeEventListener(_constant2.default.GLOBAL.REBUILD, this.globalRebuild);
|
|
31
|
-
window.removeEventListener(_constant2.default.GLOBAL.SHOW, this.globalShow);
|
|
32
|
-
window.removeEventListener('resize', this.onWindowResize);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* invoked by resize event of window
|
|
37
|
-
*/
|
|
38
|
-
target.prototype.onWindowResize = function () {
|
|
39
|
-
if (!this.mount) return;
|
|
40
|
-
this.hideTooltip();
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
var _constant = require('../constant');
|
|
45
|
-
|
|
46
|
-
var _constant2 = _interopRequireDefault(_constant);
|
|
47
|
-
|
|
48
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
package/dist/style.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = '.__react_component_tooltip{border-radius:3px;display:inline-block;font-size:13px;left:-999em;opacity:0;padding:8px 21px;position:fixed;pointer-events:none;transition:opacity 0.3s ease-out;top:-999em;visibility:hidden;z-index:999}.__react_component_tooltip.allow_hover,.__react_component_tooltip.allow_click{pointer-events:auto}.__react_component_tooltip:before,.__react_component_tooltip:after{content:"";width:0;height:0;position:absolute}.__react_component_tooltip.show{opacity:0.9;margin-top:0px;margin-left:0px;visibility:visible}.__react_component_tooltip.type-dark{color:#fff;background-color:#222}.__react_component_tooltip.type-dark.place-top:after{border-top-color:#222;border-top-style:solid;border-top-width:6px}.__react_component_tooltip.type-dark.place-bottom:after{border-bottom-color:#222;border-bottom-style:solid;border-bottom-width:6px}.__react_component_tooltip.type-dark.place-left:after{border-left-color:#222;border-left-style:solid;border-left-width:6px}.__react_component_tooltip.type-dark.place-right:after{border-right-color:#222;border-right-style:solid;border-right-width:6px}.__react_component_tooltip.type-dark.border{border:1px solid #fff}.__react_component_tooltip.type-dark.border.place-top:before{border-top:8px solid #fff}.__react_component_tooltip.type-dark.border.place-bottom:before{border-bottom:8px solid #fff}.__react_component_tooltip.type-dark.border.place-left:before{border-left:8px solid #fff}.__react_component_tooltip.type-dark.border.place-right:before{border-right:8px solid #fff}.__react_component_tooltip.type-success{color:#fff;background-color:#8DC572}.__react_component_tooltip.type-success.place-top:after{border-top-color:#8DC572;border-top-style:solid;border-top-width:6px}.__react_component_tooltip.type-success.place-bottom:after{border-bottom-color:#8DC572;border-bottom-style:solid;border-bottom-width:6px}.__react_component_tooltip.type-success.place-left:after{border-left-color:#8DC572;border-left-style:solid;border-left-width:6px}.__react_component_tooltip.type-success.place-right:after{border-right-color:#8DC572;border-right-style:solid;border-right-width:6px}.__react_component_tooltip.type-success.border{border:1px solid #fff}.__react_component_tooltip.type-success.border.place-top:before{border-top:8px solid #fff}.__react_component_tooltip.type-success.border.place-bottom:before{border-bottom:8px solid #fff}.__react_component_tooltip.type-success.border.place-left:before{border-left:8px solid #fff}.__react_component_tooltip.type-success.border.place-right:before{border-right:8px solid #fff}.__react_component_tooltip.type-warning{color:#fff;background-color:#F0AD4E}.__react_component_tooltip.type-warning.place-top:after{border-top-color:#F0AD4E;border-top-style:solid;border-top-width:6px}.__react_component_tooltip.type-warning.place-bottom:after{border-bottom-color:#F0AD4E;border-bottom-style:solid;border-bottom-width:6px}.__react_component_tooltip.type-warning.place-left:after{border-left-color:#F0AD4E;border-left-style:solid;border-left-width:6px}.__react_component_tooltip.type-warning.place-right:after{border-right-color:#F0AD4E;border-right-style:solid;border-right-width:6px}.__react_component_tooltip.type-warning.border{border:1px solid #fff}.__react_component_tooltip.type-warning.border.place-top:before{border-top:8px solid #fff}.__react_component_tooltip.type-warning.border.place-bottom:before{border-bottom:8px solid #fff}.__react_component_tooltip.type-warning.border.place-left:before{border-left:8px solid #fff}.__react_component_tooltip.type-warning.border.place-right:before{border-right:8px solid #fff}.__react_component_tooltip.type-error{color:#fff;background-color:#BE6464}.__react_component_tooltip.type-error.place-top:after{border-top-color:#BE6464;border-top-style:solid;border-top-width:6px}.__react_component_tooltip.type-error.place-bottom:after{border-bottom-color:#BE6464;border-bottom-style:solid;border-bottom-width:6px}.__react_component_tooltip.type-error.place-left:after{border-left-color:#BE6464;border-left-style:solid;border-left-width:6px}.__react_component_tooltip.type-error.place-right:after{border-right-color:#BE6464;border-right-style:solid;border-right-width:6px}.__react_component_tooltip.type-error.border{border:1px solid #fff}.__react_component_tooltip.type-error.border.place-top:before{border-top:8px solid #fff}.__react_component_tooltip.type-error.border.place-bottom:before{border-bottom:8px solid #fff}.__react_component_tooltip.type-error.border.place-left:before{border-left:8px solid #fff}.__react_component_tooltip.type-error.border.place-right:before{border-right:8px solid #fff}.__react_component_tooltip.type-info{color:#fff;background-color:#337AB7}.__react_component_tooltip.type-info.place-top:after{border-top-color:#337AB7;border-top-style:solid;border-top-width:6px}.__react_component_tooltip.type-info.place-bottom:after{border-bottom-color:#337AB7;border-bottom-style:solid;border-bottom-width:6px}.__react_component_tooltip.type-info.place-left:after{border-left-color:#337AB7;border-left-style:solid;border-left-width:6px}.__react_component_tooltip.type-info.place-right:after{border-right-color:#337AB7;border-right-style:solid;border-right-width:6px}.__react_component_tooltip.type-info.border{border:1px solid #fff}.__react_component_tooltip.type-info.border.place-top:before{border-top:8px solid #fff}.__react_component_tooltip.type-info.border.place-bottom:before{border-bottom:8px solid #fff}.__react_component_tooltip.type-info.border.place-left:before{border-left:8px solid #fff}.__react_component_tooltip.type-info.border.place-right:before{border-right:8px solid #fff}.__react_component_tooltip.type-light{color:#222;background-color:#fff}.__react_component_tooltip.type-light.place-top:after{border-top-color:#fff;border-top-style:solid;border-top-width:6px}.__react_component_tooltip.type-light.place-bottom:after{border-bottom-color:#fff;border-bottom-style:solid;border-bottom-width:6px}.__react_component_tooltip.type-light.place-left:after{border-left-color:#fff;border-left-style:solid;border-left-width:6px}.__react_component_tooltip.type-light.place-right:after{border-right-color:#fff;border-right-style:solid;border-right-width:6px}.__react_component_tooltip.type-light.border{border:1px solid #222}.__react_component_tooltip.type-light.border.place-top:before{border-top:8px solid #222}.__react_component_tooltip.type-light.border.place-bottom:before{border-bottom:8px solid #222}.__react_component_tooltip.type-light.border.place-left:before{border-left:8px solid #222}.__react_component_tooltip.type-light.border.place-right:before{border-right:8px solid #222}.__react_component_tooltip.place-top{margin-top:-10px}.__react_component_tooltip.place-top:before{border-left:10px solid transparent;border-right:10px solid transparent;bottom:-8px;left:50%;margin-left:-10px}.__react_component_tooltip.place-top:after{border-left:8px solid transparent;border-right:8px solid transparent;bottom:-6px;left:50%;margin-left:-8px}.__react_component_tooltip.place-bottom{margin-top:10px}.__react_component_tooltip.place-bottom:before{border-left:10px solid transparent;border-right:10px solid transparent;top:-8px;left:50%;margin-left:-10px}.__react_component_tooltip.place-bottom:after{border-left:8px solid transparent;border-right:8px solid transparent;top:-6px;left:50%;margin-left:-8px}.__react_component_tooltip.place-left{margin-left:-10px}.__react_component_tooltip.place-left:before{border-top:6px solid transparent;border-bottom:6px solid transparent;right:-8px;top:50%;margin-top:-5px}.__react_component_tooltip.place-left:after{border-top:5px solid transparent;border-bottom:5px solid transparent;right:-6px;top:50%;margin-top:-4px}.__react_component_tooltip.place-right{margin-left:10px}.__react_component_tooltip.place-right:before{border-top:6px solid transparent;border-bottom:6px solid transparent;left:-8px;top:50%;margin-top:-5px}.__react_component_tooltip.place-right:after{border-top:5px solid transparent;border-bottom:5px solid transparent;left:-6px;top:50%;margin-top:-4px}.__react_component_tooltip .multi-line{display:block;padding:2px 0px;text-align:center}';
|
package/dist/utils/aria.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.parseAria = parseAria;
|
|
7
|
-
/**
|
|
8
|
-
* Support aria- and role in ReactTooltip
|
|
9
|
-
*
|
|
10
|
-
* @params props {Object}
|
|
11
|
-
* @return {Object}
|
|
12
|
-
*/
|
|
13
|
-
function parseAria(props) {
|
|
14
|
-
var ariaObj = {};
|
|
15
|
-
Object.keys(props).filter(function (prop) {
|
|
16
|
-
// aria-xxx and role is acceptable
|
|
17
|
-
return (/(^aria-\w+$|^role$)/.test(prop)
|
|
18
|
-
);
|
|
19
|
-
}).forEach(function (prop) {
|
|
20
|
-
ariaObj[prop] = props[prop];
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
return ariaObj;
|
|
24
|
-
}
|