@jetbrains/ring-ui-built 6.0.50 → 7.0.0-beta.1

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.
@@ -510,11 +510,14 @@ var Select = /*#__PURE__*/function (_Component) {
510
510
  var nextSelection;
511
511
  if (!prevState.multipleMap[selected.key]) {
512
512
  nextSelection = currentSelection.concat(selected);
513
+ _this.props.onSelect && _this.props.onSelect(selected, event);
513
514
  } else {
514
515
  nextSelection = currentSelection.filter(function (item) {
515
516
  return item.key !== selected.key;
516
517
  });
518
+ _this.props.onDeselect && _this.props.onDeselect(selected);
517
519
  }
520
+ _this.props.onChange(nextSelection, event);
518
521
  var nextState = {
519
522
  filterValue: '',
520
523
  selected: nextSelection,
@@ -542,14 +545,6 @@ var Select = /*#__PURE__*/function (_Component) {
542
545
  }
543
546
  return _objectSpread2(_objectSpread2({}, prevState), nextState);
544
547
  }, function () {
545
- if (_this.state.multipleMap[selected.key]) {
546
- var _this$props$onSelect, _this$props;
547
- (_this$props$onSelect = (_this$props = _this.props).onSelect) === null || _this$props$onSelect === void 0 || _this$props$onSelect.call(_this$props, selected, event);
548
- } else {
549
- var _this$props$onDeselec, _this$props2;
550
- (_this$props$onDeselec = (_this$props2 = _this.props).onDeselect) === null || _this$props$onDeselec === void 0 || _this$props$onDeselec.call(_this$props2, selected);
551
- }
552
- _this.props.onChange(_this.state.selected, event);
553
548
  if (tryKeepOpen) {
554
549
  _this._redrawPopup();
555
550
  }
@@ -648,11 +643,11 @@ var Select = /*#__PURE__*/function (_Component) {
648
643
  var _this$state = this.state,
649
644
  showPopup = _this$state.showPopup,
650
645
  selected = _this$state.selected;
651
- var _this$props3 = this.props,
652
- onClose = _this$props3.onClose,
653
- onOpen = _this$props3.onOpen,
654
- onChange = _this$props3.onChange,
655
- multiple = _this$props3.multiple;
646
+ var _this$props = this.props,
647
+ onClose = _this$props.onClose,
648
+ onOpen = _this$props.onOpen,
649
+ onChange = _this$props.onChange,
650
+ multiple = _this$props.multiple;
656
651
  if (prevState.showPopup && !showPopup) {
657
652
  onClose(selected);
658
653
  } else if (!prevState.showPopup && showPopup) {
@@ -794,9 +789,9 @@ var Select = /*#__PURE__*/function (_Component) {
794
789
  }, {
795
790
  key: "getToolbar",
796
791
  value: function getToolbar() {
797
- var _this$props4 = this.props,
798
- hint = _this$props4.hint,
799
- renderBottomToolbar = _this$props4.renderBottomToolbar;
792
+ var _this$props2 = this.props,
793
+ hint = _this$props2.hint,
794
+ renderBottomToolbar = _this$props2.renderBottomToolbar;
800
795
  var _ref3 = this.state.addButton || {},
801
796
  prefix = _ref3.prefix,
802
797
  label = _ref3.label,
@@ -826,8 +821,8 @@ var Select = /*#__PURE__*/function (_Component) {
826
821
  }, {
827
822
  key: "getTopbar",
828
823
  value: function getTopbar() {
829
- var _this$props$renderTop, _this$props5;
830
- return (_this$props$renderTop = (_this$props5 = this.props).renderTopToolbar) === null || _this$props$renderTop === void 0 ? void 0 : _this$props$renderTop.call(_this$props5);
824
+ var _this$props$renderTop, _this$props3;
825
+ return (_this$props$renderTop = (_this$props3 = this.props).renderTopToolbar) === null || _this$props$renderTop === void 0 ? void 0 : _this$props$renderTop.call(_this$props3);
831
826
  }
832
827
  }, {
833
828
  key: "getFilterFn",
@@ -908,10 +903,10 @@ var Select = /*#__PURE__*/function (_Component) {
908
903
  key: "_getIcons",
909
904
  value: function _getIcons() {
910
905
  var selected = this.state.selected;
911
- var _this$props6 = this.props,
912
- disabled = _this$props6.disabled,
913
- clear = _this$props6.clear,
914
- hideArrow = _this$props6.hideArrow;
906
+ var _this$props4 = this.props,
907
+ disabled = _this$props4.disabled,
908
+ clear = _this$props4.clear,
909
+ hideArrow = _this$props4.hideArrow;
915
910
  var icons = [];
916
911
  var height = this.props.height || this.context;
917
912
  if (!Array.isArray(selected) && selected !== null && selected !== void 0 && selected.icon) {