stylable-components
Advanced tools
Comparing version 0.5.7 to 0.5.8
@@ -15,2 +15,3 @@ /// <reference types="react" /> | ||
onTop?: boolean; | ||
enableUpdateOnScroll?: boolean; | ||
disableGlobalEvents?: boolean; | ||
@@ -35,2 +36,3 @@ disableAutoPosition?: boolean; | ||
disableGlobalEvents: boolean; | ||
enableUpdateOnScroll: boolean; | ||
}; | ||
@@ -48,2 +50,4 @@ private target; | ||
componentWillReceiveProps(props: TooltipProps): void; | ||
show: () => void; | ||
hide: () => void; | ||
private setTarget(); | ||
@@ -54,4 +58,3 @@ private bindEvents(); | ||
private toggle; | ||
private hide; | ||
private stopEvent; | ||
} |
@@ -60,2 +60,9 @@ "use strict"; | ||
}, 200); | ||
_this.show = function () { return _this.setState({ open: true }, _this.setStylesDebounce); }; | ||
_this.hide = function () { | ||
if (!_this.preventHide) { | ||
_this.setState({ open: false }); | ||
} | ||
_this.preventHide = false; | ||
}; | ||
_this.toggle = function (e) { | ||
@@ -80,8 +87,2 @@ var open = _this.state.open; | ||
}; | ||
_this.hide = function () { | ||
if (!_this.preventHide) { | ||
_this.setState({ open: false }); | ||
} | ||
_this.preventHide = false; | ||
}; | ||
_this.stopEvent = function (e) { | ||
@@ -101,11 +102,11 @@ if (!_this.props.disableGlobalEvents) { | ||
var _this = this; | ||
var _a = this.props, children = _a.children, disableGlobalEvents = _a.disableGlobalEvents, onTop = _a.onTop, className = _a.className; | ||
var _a = this.props, children = _a.children, disableGlobalEvents = _a.disableGlobalEvents, enableUpdateOnScroll = _a.enableUpdateOnScroll, onTop = _a.onTop, className = _a.className; | ||
var _b = this.state, style = _b.style, open = _b.open, position = _b.position; | ||
var globalEvents = { | ||
resize: this.setStylesDebounce, | ||
scroll: this.setStylesDebounce | ||
}; | ||
var globalEvents = {}; | ||
if (!disableGlobalEvents) { | ||
globalEvents.mousedown = globalEvents.touchstart = this.hide; | ||
} | ||
if (enableUpdateOnScroll) { | ||
globalEvents.resize = globalEvents.scroll = this.setStylesDebounce; | ||
} | ||
if (open) { | ||
@@ -241,3 +242,4 @@ return (React.createElement(portal_1.Portal, null, | ||
disableAutoPosition: false, | ||
disableGlobalEvents: false | ||
disableGlobalEvents: false, | ||
enableUpdateOnScroll: false | ||
}; | ||
@@ -244,0 +246,0 @@ Tooltip = __decorate([ |
{ | ||
"name": "stylable-components", | ||
"version": "0.5.7", | ||
"version": "0.5.8", | ||
"description": "Fully-tested & strictly-typed component library based on React, using optional Wix styling.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/src/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1126641
14174