@jetbrains/ring-ui-built 6.0.49 → 6.0.50
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,14 +510,11 @@ 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);
|
514
513
|
} else {
|
515
514
|
nextSelection = currentSelection.filter(function (item) {
|
516
515
|
return item.key !== selected.key;
|
517
516
|
});
|
518
|
-
_this.props.onDeselect && _this.props.onDeselect(selected);
|
519
517
|
}
|
520
|
-
_this.props.onChange(nextSelection, event);
|
521
518
|
var nextState = {
|
522
519
|
filterValue: '',
|
523
520
|
selected: nextSelection,
|
@@ -545,6 +542,14 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
545
542
|
}
|
546
543
|
return _objectSpread2(_objectSpread2({}, prevState), nextState);
|
547
544
|
}, 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);
|
548
553
|
if (tryKeepOpen) {
|
549
554
|
_this._redrawPopup();
|
550
555
|
}
|
@@ -643,11 +648,11 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
643
648
|
var _this$state = this.state,
|
644
649
|
showPopup = _this$state.showPopup,
|
645
650
|
selected = _this$state.selected;
|
646
|
-
var _this$
|
647
|
-
onClose = _this$
|
648
|
-
onOpen = _this$
|
649
|
-
onChange = _this$
|
650
|
-
multiple = _this$
|
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;
|
651
656
|
if (prevState.showPopup && !showPopup) {
|
652
657
|
onClose(selected);
|
653
658
|
} else if (!prevState.showPopup && showPopup) {
|
@@ -789,9 +794,9 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
789
794
|
}, {
|
790
795
|
key: "getToolbar",
|
791
796
|
value: function getToolbar() {
|
792
|
-
var _this$
|
793
|
-
hint = _this$
|
794
|
-
renderBottomToolbar = _this$
|
797
|
+
var _this$props4 = this.props,
|
798
|
+
hint = _this$props4.hint,
|
799
|
+
renderBottomToolbar = _this$props4.renderBottomToolbar;
|
795
800
|
var _ref3 = this.state.addButton || {},
|
796
801
|
prefix = _ref3.prefix,
|
797
802
|
label = _ref3.label,
|
@@ -821,8 +826,8 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
821
826
|
}, {
|
822
827
|
key: "getTopbar",
|
823
828
|
value: function getTopbar() {
|
824
|
-
var _this$props$renderTop, _this$
|
825
|
-
return (_this$props$renderTop = (_this$
|
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);
|
826
831
|
}
|
827
832
|
}, {
|
828
833
|
key: "getFilterFn",
|
@@ -903,10 +908,10 @@ var Select = /*#__PURE__*/function (_Component) {
|
|
903
908
|
key: "_getIcons",
|
904
909
|
value: function _getIcons() {
|
905
910
|
var selected = this.state.selected;
|
906
|
-
var _this$
|
907
|
-
disabled = _this$
|
908
|
-
clear = _this$
|
909
|
-
hideArrow = _this$
|
911
|
+
var _this$props6 = this.props,
|
912
|
+
disabled = _this$props6.disabled,
|
913
|
+
clear = _this$props6.clear,
|
914
|
+
hideArrow = _this$props6.hideArrow;
|
910
915
|
var icons = [];
|
911
916
|
var height = this.props.height || this.context;
|
912
917
|
if (!Array.isArray(selected) && selected !== null && selected !== void 0 && selected.icon) {
|
@@ -45,6 +45,7 @@ declare class SimpleTable<T extends SelectionItem> extends PureComponent<SimpleT
|
|
45
45
|
loaderClassName?: import("react").Validator<string | null | undefined> | undefined;
|
46
46
|
stickyHeaderOffset?: import("react").Validator<string | null | undefined> | undefined;
|
47
47
|
renderEmpty?: import("react").Validator<(() => import("react").ReactNode) | null | undefined> | undefined;
|
48
|
+
RowComponent?: import("react").Validator<typeof import("./row-with-focus-sensor").default | null | undefined> | undefined;
|
48
49
|
shortcuts?: import("react").Validator<import("../shortcuts/core").ShortcutsMap | null | undefined> | undefined;
|
49
50
|
};
|
50
51
|
static defaultProps: {
|
@@ -49,6 +49,7 @@ declare class SmartTable<T extends SelectionItem> extends PureComponent<SmartTab
|
|
49
49
|
loaderClassName?: import("react").Validator<string | null | undefined> | undefined;
|
50
50
|
stickyHeaderOffset?: import("react").Validator<string | null | undefined> | undefined;
|
51
51
|
renderEmpty?: import("react").Validator<(() => import("react").ReactNode) | null | undefined> | undefined;
|
52
|
+
RowComponent?: import("react").Validator<typeof import("./row-with-focus-sensor").default | null | undefined> | undefined;
|
52
53
|
selectable?: import("react").Validator<boolean | null | undefined> | undefined;
|
53
54
|
shortcuts?: import("react").Validator<import("../shortcuts/core").ShortcutsMap | null | undefined> | undefined;
|
54
55
|
onSelectionChange: PropTypes.Requireable<(...args: any[]) => any>;
|
@@ -8,6 +8,7 @@ import { FocusSensorAddProps, FocusSensorProps } from '../global/focus-sensor-ho
|
|
8
8
|
import { SelectionItem } from './selection';
|
9
9
|
import { SelectionShortcutsAddProps, SelectionShortcutsProps } from './selection-shortcuts-hoc';
|
10
10
|
import { DisableHoverAddProps, DisableHoverProps } from './disable-hover-hoc';
|
11
|
+
import Row from './row-with-focus-sensor';
|
11
12
|
import { Column, SortParams } from './header-cell';
|
12
13
|
export interface ReorderParams<T> {
|
13
14
|
data: T[];
|
@@ -49,6 +50,7 @@ export interface TableProps<T extends SelectionItem> extends FocusSensorAddProps
|
|
49
50
|
caption?: string | null | undefined;
|
50
51
|
stickyHeaderOffset?: string | undefined;
|
51
52
|
renderEmpty?: (() => ReactNode) | null | undefined;
|
53
|
+
RowComponent: typeof Row;
|
52
54
|
}
|
53
55
|
/**
|
54
56
|
* Interactive table with selection and keyboard navigation support.
|
@@ -79,6 +81,7 @@ export declare class Table<T extends SelectionItem> extends PureComponent<TableP
|
|
79
81
|
remoteSelection: boolean;
|
80
82
|
isDisabledSelectionVisible: () => boolean;
|
81
83
|
getCheckboxTooltip: () => undefined;
|
84
|
+
RowComponent: typeof Row;
|
82
85
|
wideFirstColumn: boolean;
|
83
86
|
};
|
84
87
|
state: {
|
@@ -220,7 +220,8 @@ var Table = /*#__PURE__*/function (_PureComponent) {
|
|
220
220
|
onItemDoubleClick = _this$props4.onItemDoubleClick,
|
221
221
|
onItemClick = _this$props4.onItemClick,
|
222
222
|
renderEmpty = _this$props4.renderEmpty,
|
223
|
-
maxColSpan = _this$props4.maxColSpan
|
223
|
+
maxColSpan = _this$props4.maxColSpan,
|
224
|
+
RowComponent = _this$props4.RowComponent;
|
224
225
|
// NOTE: Do not construct new object per render because it causes all rows rerendering
|
225
226
|
var headerProps = {
|
226
227
|
caption,
|
@@ -281,7 +282,7 @@ var Table = /*#__PURE__*/function (_PureComponent) {
|
|
281
282
|
}
|
282
283
|
var ref = props.ref,
|
283
284
|
restProps = _objectWithoutProperties(props, _excluded);
|
284
|
-
var row = /*#__PURE__*/createElement(
|
285
|
+
var row = /*#__PURE__*/createElement(RowComponent, _objectSpread2(_objectSpread2({
|
285
286
|
innerRef: ref,
|
286
287
|
level: getItemLevel(value),
|
287
288
|
item: value,
|
@@ -402,6 +403,7 @@ _defineProperty(Table, "defaultProps", {
|
|
402
403
|
getCheckboxTooltip: function getCheckboxTooltip() {
|
403
404
|
return undefined;
|
404
405
|
},
|
406
|
+
RowComponent: RowWithFocusSensorCallbacks,
|
405
407
|
//TODO: change to false in 7.0
|
406
408
|
wideFirstColumn: true
|
407
409
|
});
|