@jetbrains/ring-ui 5.0.153 → 5.0.154
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/components/select/select.d.ts +2 -0
- package/components/select/select.js +3 -1
- package/components/select/select__popup.d.ts +1 -0
- package/components/select/select__popup.js +4 -2
- package/dist/select/select.d.ts +2 -0
- package/dist/select/select.js +3 -0
- package/dist/select/select__popup.d.ts +1 -0
- package/dist/select/select__popup.js +4 -0
- package/package.json +1 -1
|
@@ -79,6 +79,7 @@ export interface BaseSelectProps<T = unknown> {
|
|
|
79
79
|
onKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
80
80
|
onSelect: (selected: SelectItem<T> | null, event?: Event | SyntheticEvent) => void;
|
|
81
81
|
onDeselect: (selected: SelectItem<T> | null) => void;
|
|
82
|
+
onOutsideClick: (e: PointerEvent) => void;
|
|
82
83
|
onAdd: (value: string) => void;
|
|
83
84
|
onDone: () => void;
|
|
84
85
|
onReset: () => void;
|
|
@@ -183,6 +184,7 @@ export default class Select<T = unknown> extends Component<SelectProps<T>, Selec
|
|
|
183
184
|
onKeyDown: typeof noop;
|
|
184
185
|
onSelect: typeof noop;
|
|
185
186
|
onDeselect: typeof noop;
|
|
187
|
+
onOutsideClick: typeof noop;
|
|
186
188
|
onChange: typeof noop;
|
|
187
189
|
onAdd: typeof noop;
|
|
188
190
|
onDone: typeof noop;
|
|
@@ -214,6 +214,7 @@ export default class Select extends Component {
|
|
|
214
214
|
onKeyDown: noop,
|
|
215
215
|
onSelect: noop,
|
|
216
216
|
onDeselect: noop,
|
|
217
|
+
onOutsideClick: noop,
|
|
217
218
|
onChange: noop,
|
|
218
219
|
onAdd: noop,
|
|
219
220
|
onDone: noop,
|
|
@@ -433,7 +434,7 @@ export default class Select extends Component {
|
|
|
433
434
|
message = this.props.notFoundMessage ?? translate('noOptionsFound');
|
|
434
435
|
}
|
|
435
436
|
return (<SelectPopup data={_shownData} message={message} toolbar={showPopup && this.getToolbar()} loading={this.props.loading} activeIndex={this.state.selectedIndex} hidden={!showPopup} ref={this.popupRef} maxHeight={this.props.maxHeight} minWidth={this.props.minWidth} directions={this.props.directions} className={this.props.popupClassName} style={this.props.popupStyle} top={this.props.top} left={this.props.left} filter={this.isInputMode() ? false : this.props.filter} // disable popup filter in INPUT mode
|
|
436
|
-
multiple={this.props.multiple} filterValue={this.state.filterValue} anchorElement={anchorElement} onCloseAttempt={this._onCloseAttempt} onSelect={this._listSelectHandler} onSelectAll={this._listSelectAllHandler} onFilter={this._filterChangeHandler} onClear={this.clearFilter} onLoadMore={this.props.onLoadMore} isInputMode={this.isInputMode()} selected={this.state.selected} tags={this.props.tags} compact={this.props.compact} renderOptimization={this.props.renderOptimization} ringPopupTarget={this.props.ringPopupTarget} disableMoveOverflow={this.props.disableMoveOverflow} disableScrollToActive={this.props.disableScrollToActive} dir={this.props.dir} onEmptyPopupEnter={this.onEmptyPopupEnter} listId={this.listId}/>);
|
|
437
|
+
multiple={this.props.multiple} filterValue={this.state.filterValue} anchorElement={anchorElement} onCloseAttempt={this._onCloseAttempt} onOutsideClick={this.props.onOutsideClick} onSelect={this._listSelectHandler} onSelectAll={this._listSelectAllHandler} onFilter={this._filterChangeHandler} onClear={this.clearFilter} onLoadMore={this.props.onLoadMore} isInputMode={this.isInputMode()} selected={this.state.selected} tags={this.props.tags} compact={this.props.compact} renderOptimization={this.props.renderOptimization} ringPopupTarget={this.props.ringPopupTarget} disableMoveOverflow={this.props.disableMoveOverflow} disableScrollToActive={this.props.disableScrollToActive} dir={this.props.dir} onEmptyPopupEnter={this.onEmptyPopupEnter} listId={this.listId}/>);
|
|
437
438
|
}}
|
|
438
439
|
</I18nContext.Consumer>);
|
|
439
440
|
}
|
|
@@ -893,6 +894,7 @@ Select.propTypes = {
|
|
|
893
894
|
onBeforeOpen: PropTypes.func,
|
|
894
895
|
onSelect: PropTypes.func,
|
|
895
896
|
onDeselect: PropTypes.func,
|
|
897
|
+
onOutsideClick: PropTypes.func,
|
|
896
898
|
onFocus: PropTypes.func,
|
|
897
899
|
onBlur: PropTypes.func,
|
|
898
900
|
onKeyDown: PropTypes.func,
|
|
@@ -46,6 +46,7 @@ export interface SelectPopupProps<T = unknown> {
|
|
|
46
46
|
loading: boolean;
|
|
47
47
|
onSelect: (item: ListDataItem<T>, event: Event, params?: SelectHandlerParams) => void;
|
|
48
48
|
onCloseAttempt: (e?: Event | SyntheticEvent, isEsc?: boolean | undefined) => void;
|
|
49
|
+
onOutsideClick: (e: PointerEvent) => void;
|
|
49
50
|
onFilter: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
50
51
|
onClear: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
51
52
|
onLoadMore: () => void;
|
|
@@ -43,6 +43,7 @@ export default class SelectPopup extends PureComponent {
|
|
|
43
43
|
loading: false,
|
|
44
44
|
onSelect: noop,
|
|
45
45
|
onCloseAttempt: noop,
|
|
46
|
+
onOutsideClick: noop,
|
|
46
47
|
onFilter: noop,
|
|
47
48
|
onClear: noop,
|
|
48
49
|
onLoadMore: noop,
|
|
@@ -313,7 +314,7 @@ export default class SelectPopup extends PureComponent {
|
|
|
313
314
|
right: event => this.handleNavigation(event)
|
|
314
315
|
};
|
|
315
316
|
render() {
|
|
316
|
-
const { toolbar, className, multiple, hidden, isInputMode, anchorElement, minWidth, onCloseAttempt, directions, top, left, style, dir, filter } = this.props;
|
|
317
|
+
const { toolbar, className, multiple, hidden, isInputMode, anchorElement, minWidth, onCloseAttempt, onOutsideClick, directions, top, left, style, dir, filter } = this.props;
|
|
317
318
|
const classes = classNames(styles.popup, className);
|
|
318
319
|
return (<PopupTargetContext.Consumer>
|
|
319
320
|
{ringPopupTarget => {
|
|
@@ -323,7 +324,7 @@ export default class SelectPopup extends PureComponent {
|
|
|
323
324
|
const list = this.getList(this.props.ringPopupTarget || ringPopupTarget);
|
|
324
325
|
const bottomLine = this.getBottomLine();
|
|
325
326
|
const hasContent = filterWithTags || selectAll || list || bottomLine || toolbar;
|
|
326
|
-
return (<Popup trapFocus={false} ref={this.popupRef} hidden={hidden || !hasContent} attached={isInputMode} className={classes} dontCloseOnAnchorClick anchorElement={anchorElement} minWidth={minWidth} onCloseAttempt={onCloseAttempt} directions={directions} top={top} left={left} onMouseDown={this.mouseDownHandler} target={this.props.ringPopupTarget} autoCorrectTopOverflow={false} style={style}>
|
|
327
|
+
return (<Popup trapFocus={false} ref={this.popupRef} hidden={hidden || !hasContent} attached={isInputMode} className={classes} dontCloseOnAnchorClick anchorElement={anchorElement} minWidth={minWidth} onCloseAttempt={onCloseAttempt} onOutsideClick={onOutsideClick} directions={directions} top={top} left={left} onMouseDown={this.mouseDownHandler} target={this.props.ringPopupTarget} autoCorrectTopOverflow={false} style={style}>
|
|
327
328
|
<div dir={dir}>
|
|
328
329
|
{!hidden && filter &&
|
|
329
330
|
(<Shortcuts map={this.shortcutsMap} scope={this.shortcutsScope}/>)}
|
|
@@ -370,6 +371,7 @@ SelectPopup.propTypes = {
|
|
|
370
371
|
loading: PropTypes.bool,
|
|
371
372
|
onClear: PropTypes.func,
|
|
372
373
|
onCloseAttempt: PropTypes.func,
|
|
374
|
+
onOutsideClick: PropTypes.func,
|
|
373
375
|
onEmptyPopupEnter: PropTypes.func,
|
|
374
376
|
onFilter: PropTypes.func,
|
|
375
377
|
onLoadMore: PropTypes.func,
|
package/dist/select/select.d.ts
CHANGED
|
@@ -79,6 +79,7 @@ export interface BaseSelectProps<T = unknown> {
|
|
|
79
79
|
onKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
80
80
|
onSelect: (selected: SelectItem<T> | null, event?: Event | SyntheticEvent) => void;
|
|
81
81
|
onDeselect: (selected: SelectItem<T> | null) => void;
|
|
82
|
+
onOutsideClick: (e: PointerEvent) => void;
|
|
82
83
|
onAdd: (value: string) => void;
|
|
83
84
|
onDone: () => void;
|
|
84
85
|
onReset: () => void;
|
|
@@ -183,6 +184,7 @@ export default class Select<T = unknown> extends Component<SelectProps<T>, Selec
|
|
|
183
184
|
onKeyDown: typeof noop;
|
|
184
185
|
onSelect: typeof noop;
|
|
185
186
|
onDeselect: typeof noop;
|
|
187
|
+
onOutsideClick: typeof noop;
|
|
186
188
|
onChange: typeof noop;
|
|
187
189
|
onAdd: typeof noop;
|
|
188
190
|
onDone: typeof noop;
|
package/dist/select/select.js
CHANGED
|
@@ -266,6 +266,7 @@ class Select extends Component {
|
|
|
266
266
|
onKeyDown: noop,
|
|
267
267
|
onSelect: noop,
|
|
268
268
|
onDeselect: noop,
|
|
269
|
+
onOutsideClick: noop,
|
|
269
270
|
onChange: noop,
|
|
270
271
|
onAdd: noop,
|
|
271
272
|
onDone: noop,
|
|
@@ -546,6 +547,7 @@ class Select extends Component {
|
|
|
546
547
|
filterValue: this.state.filterValue,
|
|
547
548
|
anchorElement: anchorElement,
|
|
548
549
|
onCloseAttempt: this._onCloseAttempt,
|
|
550
|
+
onOutsideClick: this.props.onOutsideClick,
|
|
549
551
|
onSelect: this._listSelectHandler,
|
|
550
552
|
onSelectAll: this._listSelectAllHandler,
|
|
551
553
|
onFilter: this._filterChangeHandler,
|
|
@@ -1122,6 +1124,7 @@ Select.propTypes = {
|
|
|
1122
1124
|
onBeforeOpen: PropTypes.func,
|
|
1123
1125
|
onSelect: PropTypes.func,
|
|
1124
1126
|
onDeselect: PropTypes.func,
|
|
1127
|
+
onOutsideClick: PropTypes.func,
|
|
1125
1128
|
onFocus: PropTypes.func,
|
|
1126
1129
|
onBlur: PropTypes.func,
|
|
1127
1130
|
onKeyDown: PropTypes.func,
|
|
@@ -46,6 +46,7 @@ export interface SelectPopupProps<T = unknown> {
|
|
|
46
46
|
loading: boolean;
|
|
47
47
|
onSelect: (item: ListDataItem<T>, event: Event, params?: SelectHandlerParams) => void;
|
|
48
48
|
onCloseAttempt: (e?: Event | SyntheticEvent, isEsc?: boolean | undefined) => void;
|
|
49
|
+
onOutsideClick: (e: PointerEvent) => void;
|
|
49
50
|
onFilter: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
50
51
|
onClear: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
51
52
|
onLoadMore: () => void;
|
|
@@ -90,6 +90,7 @@ class SelectPopup extends PureComponent {
|
|
|
90
90
|
loading: false,
|
|
91
91
|
onSelect: noop,
|
|
92
92
|
onCloseAttempt: noop,
|
|
93
|
+
onOutsideClick: noop,
|
|
93
94
|
onFilter: noop,
|
|
94
95
|
onClear: noop,
|
|
95
96
|
onLoadMore: noop,
|
|
@@ -409,6 +410,7 @@ class SelectPopup extends PureComponent {
|
|
|
409
410
|
anchorElement,
|
|
410
411
|
minWidth,
|
|
411
412
|
onCloseAttempt,
|
|
413
|
+
onOutsideClick,
|
|
412
414
|
directions,
|
|
413
415
|
top,
|
|
414
416
|
left,
|
|
@@ -433,6 +435,7 @@ class SelectPopup extends PureComponent {
|
|
|
433
435
|
anchorElement: anchorElement,
|
|
434
436
|
minWidth: minWidth,
|
|
435
437
|
onCloseAttempt: onCloseAttempt,
|
|
438
|
+
onOutsideClick: onOutsideClick,
|
|
436
439
|
directions: directions,
|
|
437
440
|
top: top,
|
|
438
441
|
left: left,
|
|
@@ -480,6 +483,7 @@ SelectPopup.propTypes = {
|
|
|
480
483
|
loading: PropTypes.bool,
|
|
481
484
|
onClear: PropTypes.func,
|
|
482
485
|
onCloseAttempt: PropTypes.func,
|
|
486
|
+
onOutsideClick: PropTypes.func,
|
|
483
487
|
onEmptyPopupEnter: PropTypes.func,
|
|
484
488
|
onFilter: PropTypes.func,
|
|
485
489
|
onLoadMore: PropTypes.func,
|