ui-kit-ck-consultant 0.5.301 → 0.5.302
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +20 -0
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -709,19 +709,39 @@ var FormSelectMultiples = /*#__PURE__*/function (_React$Component) {
|
|
709
709
|
}
|
710
710
|
};
|
711
711
|
|
712
|
+
_this.detectClickOutside = function () {
|
713
|
+
window.addEventListener('mousedown', function (event) {
|
714
|
+
if (!_this.containerRef.current.contains(event.target)) {
|
715
|
+
_this.setState({
|
716
|
+
isDisplay: false
|
717
|
+
});
|
718
|
+
}
|
719
|
+
});
|
720
|
+
};
|
721
|
+
|
712
722
|
_this.state = {
|
713
723
|
isDisplay: false
|
714
724
|
};
|
725
|
+
_this.containerRef = React__default.createRef();
|
715
726
|
_this.inputRef = React__default.createRef();
|
716
727
|
return _this;
|
717
728
|
}
|
718
729
|
|
719
730
|
var _proto = FormSelectMultiples.prototype;
|
720
731
|
|
732
|
+
_proto.componentDidMount = function componentDidMount() {
|
733
|
+
document.addEventListener('mousedown', this.detectClickOutside);
|
734
|
+
};
|
735
|
+
|
736
|
+
_proto.componentWillUnmount = function componentWillUnmount() {
|
737
|
+
window.removeEventListener('mousedown', this.detectClickOutside);
|
738
|
+
};
|
739
|
+
|
721
740
|
_proto.render = function render() {
|
722
741
|
var _this2 = this;
|
723
742
|
|
724
743
|
return /*#__PURE__*/React__default.createElement("div", {
|
744
|
+
ref: this.containerRef,
|
725
745
|
className: classNames$1(style$6.form_select_multiples_container, this.props.className)
|
726
746
|
}, this.props.title ? /*#__PURE__*/React__default.createElement("span", {
|
727
747
|
className: this.props.classNameTitle
|