rsuite 5.37.4 → 5.39.0
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/CHANGELOG.md +25 -0
- package/Dropdown/styles/mixin.less +0 -1
- package/Nav/styles/index.less +10 -11
- package/SelectPicker/styles/index.less +8 -4
- package/cjs/Calendar/Calendar.d.ts +6 -1
- package/cjs/Calendar/Calendar.js +12 -13
- package/cjs/Calendar/CalendarContainer.d.ts +2 -0
- package/cjs/Calendar/CalendarContainer.js +4 -2
- package/cjs/Calendar/TableRow.js +6 -3
- package/cjs/Calendar/types.d.ts +1 -0
- package/cjs/SelectPicker/Listbox.d.ts +34 -0
- package/cjs/SelectPicker/Listbox.js +263 -0
- package/cjs/SelectPicker/ListboxOption.d.ts +11 -0
- package/cjs/SelectPicker/ListboxOption.js +50 -0
- package/cjs/SelectPicker/ListboxOptionGroup.d.ts +9 -0
- package/cjs/SelectPicker/ListboxOptionGroup.js +69 -0
- package/cjs/SelectPicker/SelectPicker.js +33 -36
- package/cjs/Windowing/List.d.ts +2 -2
- package/cjs/locales/index.d.ts +1 -0
- package/cjs/locales/index.js +6 -2
- package/cjs/locales/ne_NP.d.ts +117 -0
- package/cjs/locales/ne_NP.js +89 -0
- package/cjs/utils/getDataGroupBy.d.ts +23 -0
- package/cjs/utils/getDataGroupBy.js +33 -0
- package/dist/rsuite-no-reset-rtl.css +22 -15
- package/dist/rsuite-no-reset-rtl.min.css +1 -1
- package/dist/rsuite-no-reset-rtl.min.css.map +1 -1
- package/dist/rsuite-no-reset.css +22 -15
- package/dist/rsuite-no-reset.min.css +1 -1
- package/dist/rsuite-no-reset.min.css.map +1 -1
- package/dist/rsuite-rtl.css +22 -15
- package/dist/rsuite-rtl.min.css +1 -1
- package/dist/rsuite-rtl.min.css.map +1 -1
- package/dist/rsuite.css +22 -15
- package/dist/rsuite.js +39 -6
- package/dist/rsuite.js.map +1 -1
- package/dist/rsuite.min.css +1 -1
- package/dist/rsuite.min.css.map +1 -1
- package/dist/rsuite.min.js +1 -1
- package/dist/rsuite.min.js.map +1 -1
- package/esm/Calendar/Calendar.d.ts +6 -1
- package/esm/Calendar/Calendar.js +12 -13
- package/esm/Calendar/CalendarContainer.d.ts +2 -0
- package/esm/Calendar/CalendarContainer.js +4 -2
- package/esm/Calendar/TableRow.js +6 -3
- package/esm/Calendar/types.d.ts +1 -0
- package/esm/SelectPicker/Listbox.d.ts +34 -0
- package/esm/SelectPicker/Listbox.js +240 -0
- package/esm/SelectPicker/ListboxOption.d.ts +11 -0
- package/esm/SelectPicker/ListboxOption.js +37 -0
- package/esm/SelectPicker/ListboxOptionGroup.d.ts +9 -0
- package/esm/SelectPicker/ListboxOptionGroup.js +53 -0
- package/esm/SelectPicker/SelectPicker.js +33 -36
- package/esm/Windowing/List.d.ts +2 -2
- package/esm/locales/index.d.ts +1 -0
- package/esm/locales/index.js +2 -1
- package/esm/locales/ne_NP.d.ts +117 -0
- package/esm/locales/ne_NP.js +79 -0
- package/esm/utils/getDataGroupBy.d.ts +23 -0
- package/esm/utils/getDataGroupBy.js +32 -0
- package/locales/ne_NP/package.json +7 -0
- package/package.json +1 -1
- package/styles/mixins/listbox.less +2 -0
|
@@ -17,12 +17,17 @@ export interface CalendarProps extends WithAsProps {
|
|
|
17
17
|
locale?: CalendarLocale;
|
|
18
18
|
/** Callback fired before the value changed */
|
|
19
19
|
onChange?: (date: Date) => void;
|
|
20
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* Callback fired before the month changed
|
|
22
|
+
* @todo-Doma Change signature to `onMonthChange(year: number, month: number, reason: string)`?
|
|
23
|
+
*/
|
|
21
24
|
onMonthChange?: (date: Date) => void;
|
|
22
25
|
/** Callback fired before the date selected */
|
|
23
26
|
onSelect?: (date: Date) => void;
|
|
24
27
|
/** Custom render calendar cells */
|
|
25
28
|
renderCell?: (date: Date) => React.ReactNode;
|
|
29
|
+
/** Custom cell classes base on it's date */
|
|
30
|
+
cellClassName?: (date: Date) => string | undefined;
|
|
26
31
|
}
|
|
27
32
|
declare const Calendar: RsRefForwardingComponent<typeof CalendarContainer, CalendarProps>;
|
|
28
33
|
export default Calendar;
|
package/esm/Calendar/Calendar.js
CHANGED
|
@@ -25,7 +25,8 @@ var Calendar = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
25
25
|
onSelect = props.onSelect,
|
|
26
26
|
renderCell = props.renderCell,
|
|
27
27
|
value = props.value,
|
|
28
|
-
|
|
28
|
+
cellClassName = props.cellClassName,
|
|
29
|
+
rest = _objectWithoutPropertiesLoose(props, ["as", "bordered", "className", "classPrefix", "compact", "defaultValue", "isoWeek", "locale", "onChange", "onMonthChange", "onSelect", "renderCell", "value", "cellClassName"]);
|
|
29
30
|
|
|
30
31
|
var _useCalendarDate = useCalendarDate(value, defaultValue),
|
|
31
32
|
calendarDate = _useCalendarDate.calendarDate,
|
|
@@ -37,21 +38,18 @@ var Calendar = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
37
38
|
var handleChange = useCallback(function (nextValue) {
|
|
38
39
|
setCalendarDate(nextValue);
|
|
39
40
|
onChange === null || onChange === void 0 ? void 0 : onChange(nextValue);
|
|
40
|
-
|
|
41
|
+
|
|
42
|
+
if (!isSameMonth(nextValue, calendarDate)) {
|
|
43
|
+
onMonthChange === null || onMonthChange === void 0 ? void 0 : onMonthChange(nextValue);
|
|
44
|
+
}
|
|
45
|
+
}, [setCalendarDate, onChange, calendarDate, onMonthChange]);
|
|
41
46
|
var handleClickToday = useCallback(function () {
|
|
42
47
|
handleChange(new Date());
|
|
43
48
|
}, [handleChange]);
|
|
44
49
|
var handleSelect = useCallback(function (nextValue) {
|
|
45
50
|
onSelect === null || onSelect === void 0 ? void 0 : onSelect(nextValue);
|
|
46
51
|
handleChange(nextValue);
|
|
47
|
-
}, [handleChange, onSelect]);
|
|
48
|
-
|
|
49
|
-
var handleMonthChange = useCallback(function (nextValue) {
|
|
50
|
-
if (!isSameMonth(nextValue, calendarDate)) {
|
|
51
|
-
handleChange(nextValue);
|
|
52
|
-
onMonthChange === null || onMonthChange === void 0 ? void 0 : onMonthChange(nextValue);
|
|
53
|
-
}
|
|
54
|
-
}, [calendarDate, handleChange, onMonthChange]);
|
|
52
|
+
}, [handleChange, onSelect]);
|
|
55
53
|
|
|
56
54
|
var _useClassNames = useClassNames(classPrefix),
|
|
57
55
|
prefix = _useClassNames.prefix,
|
|
@@ -89,9 +87,10 @@ var Calendar = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
89
87
|
},
|
|
90
88
|
renderToolbar: renderToolbar,
|
|
91
89
|
renderCell: customRenderCell,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
90
|
+
cellClassName: cellClassName,
|
|
91
|
+
onMoveForward: handleChange,
|
|
92
|
+
onMoveBackward: handleChange,
|
|
93
|
+
onChangeMonth: handleChange,
|
|
95
94
|
onSelect: handleSelect
|
|
96
95
|
}));
|
|
97
96
|
});
|
|
@@ -52,6 +52,8 @@ export interface CalendarProps extends WithAsProps, Omit<HTMLAttributes<HTMLDivE
|
|
|
52
52
|
onSelect?: (date: Date, event: React.MouseEvent) => void;
|
|
53
53
|
/** Custom rendering cell*/
|
|
54
54
|
renderCell?: (date: Date) => React.ReactNode;
|
|
55
|
+
/** Custom cell classes base on it's date */
|
|
56
|
+
cellClassName?: (date: Date) => string | undefined;
|
|
55
57
|
/** Called when opening the month view */
|
|
56
58
|
onToggleMonthDropdown?: (toggle: boolean) => void;
|
|
57
59
|
/** Called when opening the time view */
|
|
@@ -40,13 +40,14 @@ var CalendarContainer = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
40
40
|
onToggleMonthDropdown = props.onToggleMonthDropdown,
|
|
41
41
|
onToggleTimeDropdown = props.onToggleTimeDropdown,
|
|
42
42
|
calendarDate = props.calendarDate,
|
|
43
|
+
cellClassName = props.cellClassName,
|
|
43
44
|
renderCell = props.renderCell,
|
|
44
45
|
renderTitle = props.renderTitle,
|
|
45
46
|
renderToolbar = props.renderToolbar,
|
|
46
47
|
showMeridian = props.showMeridian,
|
|
47
48
|
showWeekNumbers = props.showWeekNumbers,
|
|
48
49
|
inline = props.inline,
|
|
49
|
-
rest = _objectWithoutPropertiesLoose(props, ["as", "className", "classPrefix", "dateRange", "disabledBackward", "defaultState", "disabledDate", "disabledForward", "format", "hoverRangeValue", "isoWeek", "limitEndYear", "limitStartYear", "locale", "onChangeMonth", "onChangeTime", "onMouseMove", "onMoveBackward", "onMoveForward", "onSelect", "onToggleMeridian", "onToggleMonthDropdown", "onToggleTimeDropdown", "calendarDate", "renderCell", "renderTitle", "renderToolbar", "showMeridian", "showWeekNumbers", "inline"]);
|
|
50
|
+
rest = _objectWithoutPropertiesLoose(props, ["as", "className", "classPrefix", "dateRange", "disabledBackward", "defaultState", "disabledDate", "disabledForward", "format", "hoverRangeValue", "isoWeek", "limitEndYear", "limitStartYear", "locale", "onChangeMonth", "onChangeTime", "onMouseMove", "onMoveBackward", "onMoveForward", "onSelect", "onToggleMeridian", "onToggleMonthDropdown", "onToggleTimeDropdown", "calendarDate", "cellClassName", "renderCell", "renderTitle", "renderToolbar", "showMeridian", "showWeekNumbers", "inline"]);
|
|
50
51
|
|
|
51
52
|
var _useClassNames = useClassNames(classPrefix),
|
|
52
53
|
withClassPrefix = _useClassNames.withClassPrefix,
|
|
@@ -132,11 +133,12 @@ var CalendarContainer = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
132
133
|
onChangeTime: onChangeTime,
|
|
133
134
|
onMouseMove: onMouseMove,
|
|
134
135
|
onSelect: onSelect,
|
|
136
|
+
cellClassName: cellClassName,
|
|
135
137
|
renderCell: renderCell,
|
|
136
138
|
showWeekNumbers: showWeekNumbers,
|
|
137
139
|
inline: inline
|
|
138
140
|
};
|
|
139
|
-
}, [calendarDate, dateRange, format, handleChangeMonth, hoverRangeValue, inSameThisMonthDate, inline, isDisabledDate, isoWeek, locale, onChangeTime, onMouseMove, onSelect, renderCell, showWeekNumbers]);
|
|
141
|
+
}, [calendarDate, dateRange, format, handleChangeMonth, hoverRangeValue, inSameThisMonthDate, inline, isDisabledDate, isoWeek, locale, onChangeTime, onMouseMove, onSelect, cellClassName, renderCell, showWeekNumbers]);
|
|
140
142
|
return /*#__PURE__*/React.createElement(CalendarProvider, {
|
|
141
143
|
value: contextValue
|
|
142
144
|
}, /*#__PURE__*/React.createElement(Component, _extends({}, omitHideDisabledProps(rest), {
|
package/esm/Calendar/TableRow.js
CHANGED
|
@@ -25,6 +25,7 @@ var TableRow = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
25
25
|
isoWeek = _useCalendarContext.isoWeek,
|
|
26
26
|
onMouseMove = _useCalendarContext.onMouseMove,
|
|
27
27
|
onSelect = _useCalendarContext.onSelect,
|
|
28
|
+
cellClassName = _useCalendarContext.cellClassName,
|
|
28
29
|
renderCell = _useCalendarContext.renderCell,
|
|
29
30
|
overrideLocale = _useCalendarContext.locale,
|
|
30
31
|
showWeekNumbers = _useCalendarContext.showWeekNumbers;
|
|
@@ -67,7 +68,9 @@ var TableRow = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
67
68
|
var unSameMonth = !(inSameMonth !== null && inSameMonth !== void 0 && inSameMonth(thisDate));
|
|
68
69
|
var isStartSelected = !unSameMonth && selectedStartDate && DateUtils.isSameDay(thisDate, selectedStartDate);
|
|
69
70
|
var isEndSelected = !unSameMonth && selectedEndDate && DateUtils.isSameDay(thisDate, selectedEndDate);
|
|
70
|
-
var isSelected = isRangeSelectionMode ? isStartSelected || isEndSelected : DateUtils.isSameDay(thisDate, selected);
|
|
71
|
+
var isSelected = isRangeSelectionMode ? isStartSelected || isEndSelected : DateUtils.isSameDay(thisDate, selected); // TODO-Doma Move those logic that's for DatePicker/DateRangePicker to a separate component
|
|
72
|
+
// Calendar is not supposed to be reused this way
|
|
73
|
+
|
|
71
74
|
var inRange = false; // for Selected
|
|
72
75
|
|
|
73
76
|
if (selectedStartDate && selectedEndDate) {
|
|
@@ -91,7 +94,7 @@ var TableRow = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
91
94
|
}
|
|
92
95
|
}
|
|
93
96
|
|
|
94
|
-
var _classes = prefix('cell', {
|
|
97
|
+
var _classes = merge(prefix('cell', {
|
|
95
98
|
'cell-un-same-month': unSameMonth,
|
|
96
99
|
'cell-is-today': isToday,
|
|
97
100
|
'cell-selected': isSelected,
|
|
@@ -99,7 +102,7 @@ var TableRow = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
99
102
|
'cell-selected-end': isEndSelected,
|
|
100
103
|
'cell-in-range': !unSameMonth && inRange,
|
|
101
104
|
'cell-disabled': disabled
|
|
102
|
-
});
|
|
105
|
+
}), cellClassName === null || cellClassName === void 0 ? void 0 : cellClassName(thisDate));
|
|
103
106
|
|
|
104
107
|
var title = formatDate ? formatDate(thisDate, formatStr) : DateUtils.format(thisDate, formatStr);
|
|
105
108
|
days.push( /*#__PURE__*/React.createElement("div", {
|
package/esm/Calendar/types.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export interface CalendarInnerContextValue {
|
|
|
13
13
|
onMouseMove?: (date: Date) => void;
|
|
14
14
|
onSelect?: (date: Date, event: React.MouseEvent) => void;
|
|
15
15
|
renderCell?: (date: Date) => React.ReactNode;
|
|
16
|
+
cellClassName?: (date: Date) => string | undefined;
|
|
16
17
|
showWeekNumbers?: boolean;
|
|
17
18
|
inline?: boolean;
|
|
18
19
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ListProps, ListHandle } from '../Windowing';
|
|
3
|
+
import { CompareFn, Group } from '../utils/getDataGroupBy';
|
|
4
|
+
import { StandardProps } from '../@types/common';
|
|
5
|
+
interface ListboxProps<T, K> extends StandardProps, Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
6
|
+
classPrefix: string;
|
|
7
|
+
options: readonly T[];
|
|
8
|
+
getOptionKey?: (option: T) => K;
|
|
9
|
+
sort?: <B extends boolean>(isGroup: B) => B extends true ? CompareFn<Group<T>> : CompareFn<T>;
|
|
10
|
+
groupBy?: string;
|
|
11
|
+
disabledOptionKeys?: readonly K[];
|
|
12
|
+
selectedOptionKey?: K;
|
|
13
|
+
activeOptionKey?: K;
|
|
14
|
+
maxHeight?: number;
|
|
15
|
+
labelKey?: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
style?: React.CSSProperties;
|
|
18
|
+
optionClassPrefix?: string;
|
|
19
|
+
rowHeight?: number;
|
|
20
|
+
rowGroupHeight?: number;
|
|
21
|
+
virtualized?: boolean;
|
|
22
|
+
listProps?: Partial<ListProps>;
|
|
23
|
+
listRef?: React.Ref<ListHandle>;
|
|
24
|
+
/** Custom selected option */
|
|
25
|
+
renderMenuItem?: (itemLabel: React.ReactNode, item: any) => React.ReactNode;
|
|
26
|
+
renderMenuGroup?: (title: React.ReactNode, item: any) => React.ReactNode;
|
|
27
|
+
onSelect?: (value: K, item: T, event: React.MouseEvent) => void;
|
|
28
|
+
onGroupTitleClick?: (event: React.MouseEvent) => void;
|
|
29
|
+
}
|
|
30
|
+
declare type ListboxComponent = <T, K>(p: ListboxProps<T, K> & {
|
|
31
|
+
ref?: React.ForwardedRef<HTMLDivElement>;
|
|
32
|
+
}) => JSX.Element;
|
|
33
|
+
declare const Listbox: ListboxComponent;
|
|
34
|
+
export default Listbox;
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
import React, { useRef, useState, useEffect, useCallback } from 'react';
|
|
4
|
+
import isUndefined from 'lodash/isUndefined';
|
|
5
|
+
import getPosition from 'dom-lib/getPosition';
|
|
6
|
+
import scrollTop from 'dom-lib/scrollTop';
|
|
7
|
+
import getHeight from 'dom-lib/getHeight';
|
|
8
|
+
import { List, AutoSizer } from '../Windowing';
|
|
9
|
+
import shallowEqual from '../utils/shallowEqual';
|
|
10
|
+
import { mergeRefs, useClassNames, useMount } from '../utils';
|
|
11
|
+
import ListboxOptionGroup from './ListboxOptionGroup';
|
|
12
|
+
import { groupOptions } from '../utils/getDataGroupBy';
|
|
13
|
+
import ListboxOption from './ListboxOption';
|
|
14
|
+
var Listbox = /*#__PURE__*/React.forwardRef(function Listbox(props, ref) {
|
|
15
|
+
var _props$options = props.options,
|
|
16
|
+
options = _props$options === void 0 ? [] : _props$options,
|
|
17
|
+
getOptionKey = props.getOptionKey,
|
|
18
|
+
groupBy = props.groupBy,
|
|
19
|
+
sort = props.sort,
|
|
20
|
+
_props$maxHeight = props.maxHeight,
|
|
21
|
+
maxHeight = _props$maxHeight === void 0 ? 320 : _props$maxHeight,
|
|
22
|
+
selectedOptionKey = props.selectedOptionKey,
|
|
23
|
+
_props$disabledOption = props.disabledOptionKeys,
|
|
24
|
+
disabledOptionKeys = _props$disabledOption === void 0 ? [] : _props$disabledOption,
|
|
25
|
+
_props$classPrefix = props.classPrefix,
|
|
26
|
+
classPrefix = _props$classPrefix === void 0 ? 'dropdown-menu' : _props$classPrefix,
|
|
27
|
+
_props$labelKey = props.labelKey,
|
|
28
|
+
labelKey = _props$labelKey === void 0 ? 'label' : _props$labelKey,
|
|
29
|
+
virtualized = props.virtualized,
|
|
30
|
+
listProps = props.listProps,
|
|
31
|
+
virtualizedListRef = props.listRef,
|
|
32
|
+
className = props.className,
|
|
33
|
+
style = props.style,
|
|
34
|
+
activeOptionKey = props.activeOptionKey,
|
|
35
|
+
optionClassPrefix = props.optionClassPrefix,
|
|
36
|
+
_props$rowHeight = props.rowHeight,
|
|
37
|
+
rowHeight = _props$rowHeight === void 0 ? 36 : _props$rowHeight,
|
|
38
|
+
_props$rowGroupHeight = props.rowGroupHeight,
|
|
39
|
+
rowGroupHeight = _props$rowGroupHeight === void 0 ? 48 : _props$rowGroupHeight,
|
|
40
|
+
renderMenuGroup = props.renderMenuGroup,
|
|
41
|
+
renderMenuItem = props.renderMenuItem,
|
|
42
|
+
onGroupTitleClick = props.onGroupTitleClick,
|
|
43
|
+
onSelect = props.onSelect,
|
|
44
|
+
rest = _objectWithoutPropertiesLoose(props, ["options", "getOptionKey", "groupBy", "sort", "maxHeight", "selectedOptionKey", "disabledOptionKeys", "classPrefix", "labelKey", "virtualized", "listProps", "listRef", "className", "style", "activeOptionKey", "optionClassPrefix", "rowHeight", "rowGroupHeight", "renderMenuGroup", "renderMenuItem", "onGroupTitleClick", "onSelect"]);
|
|
45
|
+
|
|
46
|
+
var group = typeof groupBy !== 'undefined';
|
|
47
|
+
|
|
48
|
+
var _useClassNames = useClassNames(classPrefix),
|
|
49
|
+
withClassPrefix = _useClassNames.withClassPrefix,
|
|
50
|
+
prefix = _useClassNames.prefix,
|
|
51
|
+
merge = _useClassNames.merge;
|
|
52
|
+
|
|
53
|
+
var classes = merge(className, withClassPrefix('items', {
|
|
54
|
+
grouped: group
|
|
55
|
+
}));
|
|
56
|
+
var menuBodyContainerRef = useRef(null);
|
|
57
|
+
var listRef = useRef(null);
|
|
58
|
+
|
|
59
|
+
var _useState = useState([]),
|
|
60
|
+
foldedGroupKeys = _useState[0],
|
|
61
|
+
setFoldedGroupKeys = _useState[1];
|
|
62
|
+
|
|
63
|
+
var handleGroupTitleClick = useCallback(function (key, event) {
|
|
64
|
+
var _listRef$current;
|
|
65
|
+
|
|
66
|
+
var nextGroupKeys = foldedGroupKeys.filter(function (item) {
|
|
67
|
+
return item !== key;
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
if (nextGroupKeys.length === foldedGroupKeys.length) {
|
|
71
|
+
nextGroupKeys.push(key);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
setFoldedGroupKeys(nextGroupKeys);
|
|
75
|
+
onGroupTitleClick === null || onGroupTitleClick === void 0 ? void 0 : onGroupTitleClick(event); // See example https://codesandbox.io/s/grouped-list-with-sticky-headers-shgok?fontsize=14&file=/index.js:1314-1381
|
|
76
|
+
|
|
77
|
+
(_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : _listRef$current.resetAfterIndex(0); // use group index to reduce calculation
|
|
78
|
+
}, [onGroupTitleClick, foldedGroupKeys]);
|
|
79
|
+
useEffect(function () {
|
|
80
|
+
var container = menuBodyContainerRef.current;
|
|
81
|
+
|
|
82
|
+
if (!container) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
var activeItem = container.querySelector("." + prefix('item-focus'));
|
|
87
|
+
|
|
88
|
+
if (!activeItem) {
|
|
89
|
+
activeItem = container.querySelector("." + prefix('item-active'));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (!activeItem) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
var position = getPosition(activeItem, container);
|
|
97
|
+
var sTop = scrollTop(container);
|
|
98
|
+
var sHeight = getHeight(container);
|
|
99
|
+
|
|
100
|
+
if (sTop > position.top) {
|
|
101
|
+
scrollTop(container, Math.max(0, position.top - 20));
|
|
102
|
+
} else if (position.top > sTop + sHeight) {
|
|
103
|
+
scrollTop(container, Math.max(0, position.top - sHeight + 32));
|
|
104
|
+
}
|
|
105
|
+
}, [activeOptionKey, menuBodyContainerRef, prefix]);
|
|
106
|
+
useMount(function scrollToSelectedOption() {
|
|
107
|
+
if (virtualized && selectedOptionKey) {
|
|
108
|
+
if (typeof groupBy === 'undefined') {
|
|
109
|
+
var _listRef$current2;
|
|
110
|
+
|
|
111
|
+
var selectedOptionIndex = options.findIndex(function (option) {
|
|
112
|
+
return (getOptionKey === null || getOptionKey === void 0 ? void 0 : getOptionKey(option)) === selectedOptionKey;
|
|
113
|
+
});
|
|
114
|
+
(_listRef$current2 = listRef.current) === null || _listRef$current2 === void 0 ? void 0 : _listRef$current2.scrollToItem(selectedOptionIndex);
|
|
115
|
+
} else {
|
|
116
|
+
var _listRef$current3;
|
|
117
|
+
|
|
118
|
+
var groups = groupOptions(options, groupBy, sort === null || sort === void 0 ? void 0 : sort(false), sort === null || sort === void 0 ? void 0 : sort(true));
|
|
119
|
+
var selectedGroupIndex = groups.findIndex(function (group) {
|
|
120
|
+
return group.key === selectedOptionKey;
|
|
121
|
+
}); // TODO-Doma
|
|
122
|
+
// This only scrolls the list to the group, not to the selected item within the group
|
|
123
|
+
// .scrollToItem does not support specifying an px offset
|
|
124
|
+
// Find a way to scroll to the selected item within the group
|
|
125
|
+
|
|
126
|
+
(_listRef$current3 = listRef.current) === null || _listRef$current3 === void 0 ? void 0 : _listRef$current3.scrollToItem(selectedGroupIndex);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
var renderOption = useCallback(function (option) {
|
|
131
|
+
var _getOptionKey;
|
|
132
|
+
|
|
133
|
+
var optionKey = (_getOptionKey = getOptionKey === null || getOptionKey === void 0 ? void 0 : getOptionKey(option)) !== null && _getOptionKey !== void 0 ? _getOptionKey : JSON.stringify(option);
|
|
134
|
+
var label = option[labelKey];
|
|
135
|
+
var disabled = disabledOptionKeys === null || disabledOptionKeys === void 0 ? void 0 : disabledOptionKeys.some(function (disabledValue) {
|
|
136
|
+
return shallowEqual(disabledValue, optionKey);
|
|
137
|
+
});
|
|
138
|
+
var selected = shallowEqual(selectedOptionKey, optionKey);
|
|
139
|
+
var focus = !isUndefined(activeOptionKey) && shallowEqual(activeOptionKey, optionKey);
|
|
140
|
+
return /*#__PURE__*/React.createElement(ListboxOption, {
|
|
141
|
+
key: optionKey,
|
|
142
|
+
disabled: disabled,
|
|
143
|
+
selected: selected,
|
|
144
|
+
active: focus,
|
|
145
|
+
"data-key": optionKey,
|
|
146
|
+
classPrefix: optionClassPrefix,
|
|
147
|
+
onClick: function onClick(event) {
|
|
148
|
+
if (!disabled) {
|
|
149
|
+
onSelect === null || onSelect === void 0 ? void 0 : onSelect(optionKey, option, event);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}, renderMenuItem ? renderMenuItem(label, option) : label);
|
|
153
|
+
}, [getOptionKey, labelKey, disabledOptionKeys, selectedOptionKey, activeOptionKey, optionClassPrefix, renderMenuItem, onSelect]);
|
|
154
|
+
var renderOptions = useCallback(function (options) {
|
|
155
|
+
return options.map(function (option) {
|
|
156
|
+
return renderOption(option);
|
|
157
|
+
});
|
|
158
|
+
}, [renderOption]);
|
|
159
|
+
var renderOptionGroup = useCallback(function (group) {
|
|
160
|
+
var groupKey = group.key;
|
|
161
|
+
var expanded = !foldedGroupKeys.includes(groupKey);
|
|
162
|
+
return /*#__PURE__*/React.createElement(ListboxOptionGroup, {
|
|
163
|
+
key: groupKey,
|
|
164
|
+
title: renderMenuGroup ? renderMenuGroup(groupKey, group) : groupKey,
|
|
165
|
+
classPrefix: 'picker-menu-group',
|
|
166
|
+
expanded: expanded,
|
|
167
|
+
onClickTitle: function onClickTitle(e) {
|
|
168
|
+
return handleGroupTitleClick(group.key, e);
|
|
169
|
+
}
|
|
170
|
+
}, renderOptions(group.options));
|
|
171
|
+
}, [foldedGroupKeys, handleGroupTitleClick, renderMenuGroup, renderOptions]);
|
|
172
|
+
var renderOptionGroups = useCallback(function (groupKey) {
|
|
173
|
+
var groups = groupOptions(options, groupKey, sort === null || sort === void 0 ? void 0 : sort(false), sort === null || sort === void 0 ? void 0 : sort(true));
|
|
174
|
+
return groups.map(function (group) {
|
|
175
|
+
return renderOptionGroup(group);
|
|
176
|
+
});
|
|
177
|
+
}, [options, renderOptionGroup, sort]);
|
|
178
|
+
var renderVirtualizedOptions = useCallback(function () {
|
|
179
|
+
return /*#__PURE__*/React.createElement(AutoSizer, {
|
|
180
|
+
defaultHeight: maxHeight,
|
|
181
|
+
style: {
|
|
182
|
+
width: 'auto',
|
|
183
|
+
height: 'auto'
|
|
184
|
+
}
|
|
185
|
+
}, function (_ref) {
|
|
186
|
+
var height = _ref.height;
|
|
187
|
+
return /*#__PURE__*/React.createElement(List, _extends({
|
|
188
|
+
ref: mergeRefs(listRef, virtualizedListRef),
|
|
189
|
+
height: height || maxHeight,
|
|
190
|
+
itemCount: options.length,
|
|
191
|
+
itemSize: rowHeight
|
|
192
|
+
}, listProps), function (_ref2) {
|
|
193
|
+
var index = _ref2.index;
|
|
194
|
+
return renderOption(options[index]);
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
}, [listProps, maxHeight, options, renderOption, rowHeight, virtualizedListRef]); // Example of rendering option groups in VariableSizeList
|
|
198
|
+
// https://github.com/bvaughn/react-window/issues/358
|
|
199
|
+
|
|
200
|
+
var renderVirtualizedOptionGroups = useCallback(function (groupKey) {
|
|
201
|
+
var groups = groupOptions(options, groupKey, sort === null || sort === void 0 ? void 0 : sort(false), sort === null || sort === void 0 ? void 0 : sort(true));
|
|
202
|
+
return /*#__PURE__*/React.createElement(AutoSizer, {
|
|
203
|
+
defaultHeight: maxHeight,
|
|
204
|
+
style: {
|
|
205
|
+
width: 'auto',
|
|
206
|
+
height: 'auto'
|
|
207
|
+
}
|
|
208
|
+
}, function (_ref3) {
|
|
209
|
+
var height = _ref3.height;
|
|
210
|
+
return /*#__PURE__*/React.createElement(List, _extends({
|
|
211
|
+
ref: mergeRefs(listRef, virtualizedListRef),
|
|
212
|
+
height: height || maxHeight,
|
|
213
|
+
itemCount: groups.length,
|
|
214
|
+
itemSize: function itemSize(index) {
|
|
215
|
+
var item = groups[index];
|
|
216
|
+
var expanded = !foldedGroupKeys.includes(item.key);
|
|
217
|
+
|
|
218
|
+
if (expanded) {
|
|
219
|
+
return item.options.length * rowHeight + rowGroupHeight;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
return rowGroupHeight;
|
|
223
|
+
}
|
|
224
|
+
}, listProps), function (_ref4) {
|
|
225
|
+
var index = _ref4.index;
|
|
226
|
+
return renderOptionGroup(groups[index]);
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
}, [foldedGroupKeys, listProps, maxHeight, options, renderOptionGroup, rowGroupHeight, rowHeight, sort, virtualizedListRef]);
|
|
230
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
231
|
+
role: "listbox"
|
|
232
|
+
}, rest, {
|
|
233
|
+
className: classes,
|
|
234
|
+
ref: mergeRefs(menuBodyContainerRef, ref),
|
|
235
|
+
style: _extends({}, style, {
|
|
236
|
+
maxHeight: maxHeight
|
|
237
|
+
})
|
|
238
|
+
}), typeof groupBy === 'undefined' ? virtualized ? renderVirtualizedOptions() : renderOptions(options) : virtualized ? renderVirtualizedOptionGroups(groupBy) : renderOptionGroups(groupBy));
|
|
239
|
+
});
|
|
240
|
+
export default Listbox;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StandardProps } from '../@types/common';
|
|
3
|
+
interface ListboxOptionProps extends StandardProps, React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
selected?: boolean;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
active?: boolean;
|
|
7
|
+
title?: string;
|
|
8
|
+
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
9
|
+
}
|
|
10
|
+
declare const ListboxOption: React.ForwardRefExoticComponent<ListboxOptionProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export default ListboxOption;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { useClassNames } from '../utils';
|
|
5
|
+
var ListboxOption = /*#__PURE__*/React.forwardRef(function ListboxOption(props, ref) {
|
|
6
|
+
var selected = props.selected,
|
|
7
|
+
_props$classPrefix = props.classPrefix,
|
|
8
|
+
classPrefix = _props$classPrefix === void 0 ? 'dropdown-menu-item' : _props$classPrefix,
|
|
9
|
+
children = props.children,
|
|
10
|
+
className = props.className,
|
|
11
|
+
disabled = props.disabled,
|
|
12
|
+
active = props.active,
|
|
13
|
+
onKeyDown = props.onKeyDown,
|
|
14
|
+
rest = _objectWithoutPropertiesLoose(props, ["selected", "classPrefix", "children", "className", "disabled", "active", "onKeyDown"]);
|
|
15
|
+
|
|
16
|
+
var _useClassNames = useClassNames(classPrefix),
|
|
17
|
+
withClassPrefix = _useClassNames.withClassPrefix;
|
|
18
|
+
|
|
19
|
+
var classes = withClassPrefix({
|
|
20
|
+
active: selected,
|
|
21
|
+
focus: active,
|
|
22
|
+
disabled: disabled
|
|
23
|
+
});
|
|
24
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
25
|
+
ref: ref,
|
|
26
|
+
role: "option",
|
|
27
|
+
"aria-selected": selected || undefined,
|
|
28
|
+
"aria-disabled": disabled
|
|
29
|
+
}, rest, {
|
|
30
|
+
className: className,
|
|
31
|
+
onKeyDown: disabled ? undefined : onKeyDown
|
|
32
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
33
|
+
className: classes
|
|
34
|
+
}, children));
|
|
35
|
+
});
|
|
36
|
+
ListboxOption.displayName = 'Listbox.Option';
|
|
37
|
+
export default ListboxOption;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StandardProps } from '../@types/common';
|
|
3
|
+
interface ListboxOptionGroupProps extends StandardProps, Omit<React.HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
4
|
+
title?: React.ReactNode;
|
|
5
|
+
expanded?: boolean;
|
|
6
|
+
onClickTitle?: React.MouseEventHandler;
|
|
7
|
+
}
|
|
8
|
+
declare const ListboxOptionGroup: React.ForwardRefExoticComponent<ListboxOptionGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export default ListboxOptionGroup;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _taggedTemplateLiteralLoose from "@babel/runtime/helpers/esm/taggedTemplateLiteralLoose";
|
|
3
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
|
+
|
|
5
|
+
var _templateObject, _templateObject2;
|
|
6
|
+
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import classNames from 'classnames';
|
|
9
|
+
import { useClassNames } from '../utils';
|
|
10
|
+
import ArrowDown from '@rsuite/icons/legacy/ArrowDown';
|
|
11
|
+
import useUniqueId from '../utils/useUniqueId';
|
|
12
|
+
var ListboxOptionGroup = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
13
|
+
var _props$classPrefix = props.classPrefix,
|
|
14
|
+
classPrefix = _props$classPrefix === void 0 ? 'dropdown-menu-group' : _props$classPrefix,
|
|
15
|
+
title = props.title,
|
|
16
|
+
children = props.children,
|
|
17
|
+
className = props.className,
|
|
18
|
+
_props$expanded = props.expanded,
|
|
19
|
+
expanded = _props$expanded === void 0 ? true : _props$expanded,
|
|
20
|
+
onClickTitle = props.onClickTitle,
|
|
21
|
+
rest = _objectWithoutPropertiesLoose(props, ["classPrefix", "title", "children", "className", "expanded", "onClickTitle"]);
|
|
22
|
+
|
|
23
|
+
var _useClassNames = useClassNames(classPrefix),
|
|
24
|
+
withClassPrefix = _useClassNames.withClassPrefix,
|
|
25
|
+
prefix = _useClassNames.prefix,
|
|
26
|
+
merge = _useClassNames.merge;
|
|
27
|
+
|
|
28
|
+
var classes = merge(className, withClassPrefix());
|
|
29
|
+
var groupId = useUniqueId('listbox-group-');
|
|
30
|
+
var labelId = groupId + '-label';
|
|
31
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
32
|
+
role: "group",
|
|
33
|
+
id: groupId,
|
|
34
|
+
"aria-expanded": expanded,
|
|
35
|
+
"aria-labelledby": labelId
|
|
36
|
+
}, rest, {
|
|
37
|
+
ref: ref,
|
|
38
|
+
className: classNames(classes, {
|
|
39
|
+
folded: !expanded
|
|
40
|
+
})
|
|
41
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
className: prefix(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["title"]))),
|
|
43
|
+
tabIndex: -1,
|
|
44
|
+
onClick: onClickTitle
|
|
45
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
46
|
+
id: labelId
|
|
47
|
+
}, title), /*#__PURE__*/React.createElement(ArrowDown, {
|
|
48
|
+
"aria-hidden": true,
|
|
49
|
+
className: prefix(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["caret"])))
|
|
50
|
+
})), children);
|
|
51
|
+
});
|
|
52
|
+
ListboxOptionGroup.displayName = 'Listbox.OptionGroup';
|
|
53
|
+
export default ListboxOptionGroup;
|
|
@@ -7,13 +7,12 @@ var _templateObject;
|
|
|
7
7
|
import React, { useRef, useState, useCallback } from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import pick from 'lodash/pick';
|
|
10
|
-
import isUndefined from 'lodash/isUndefined';
|
|
11
10
|
import isNil from 'lodash/isNil';
|
|
12
11
|
import isFunction from 'lodash/isFunction';
|
|
13
12
|
import omit from 'lodash/omit';
|
|
14
13
|
import { createChainedFunction, useCustom, useClassNames, useControlled, mergeRefs, shallowEqual } from '../utils';
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
14
|
+
import { PickerToggle, PickerToggleTrigger, PickerOverlay, SearchBar, useFocusItemValue, usePickerClassName, useSearch, usePublicMethods, useToggleKeyDownEvent, pickTriggerPropKeys, omitTriggerPropKeys, listPickerPropTypes } from '../Picker';
|
|
15
|
+
import Listbox from './Listbox';
|
|
17
16
|
var emptyArray = [];
|
|
18
17
|
var SelectPicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
19
18
|
var _props$as = props.as,
|
|
@@ -233,40 +232,38 @@ var SelectPicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
233
232
|
top: top
|
|
234
233
|
});
|
|
235
234
|
|
|
236
|
-
var
|
|
235
|
+
var menu = function () {
|
|
236
|
+
if (!filteredData.length) {
|
|
237
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
238
|
+
className: prefix(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["none"])))
|
|
239
|
+
}, locale === null || locale === void 0 ? void 0 : locale.noResultsText);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
return /*#__PURE__*/React.createElement(Listbox, {
|
|
243
|
+
options: filteredData,
|
|
244
|
+
getOptionKey: function getOptionKey(option) {
|
|
245
|
+
return option[valueKey];
|
|
246
|
+
},
|
|
247
|
+
id: id ? id + "-listbox" : undefined,
|
|
248
|
+
listProps: listProps,
|
|
249
|
+
listRef: listRef,
|
|
250
|
+
disabledOptionKeys: disabledItemValues,
|
|
251
|
+
labelKey: labelKey,
|
|
252
|
+
renderMenuGroup: renderMenuGroup,
|
|
253
|
+
renderMenuItem: renderMenuItem,
|
|
254
|
+
maxHeight: menuMaxHeight,
|
|
255
|
+
classPrefix: 'picker-select-menu',
|
|
256
|
+
optionClassPrefix: 'picker-select-menu-item',
|
|
257
|
+
selectedOptionKey: value,
|
|
258
|
+
activeOptionKey: focusItemValue,
|
|
259
|
+
groupBy: groupBy,
|
|
260
|
+
sort: sort,
|
|
261
|
+
onSelect: handleItemSelect,
|
|
262
|
+
onGroupTitleClick: onGroupTitleClick,
|
|
263
|
+
virtualized: virtualized
|
|
264
|
+
});
|
|
265
|
+
}();
|
|
237
266
|
|
|
238
|
-
if (groupBy) {
|
|
239
|
-
items = getDataGroupBy(items, groupBy, sort);
|
|
240
|
-
} else if (typeof sort === 'function') {
|
|
241
|
-
items = items.sort(sort(false));
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
var menu = items.length ? /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
245
|
-
id: id ? id + "-listbox" : undefined,
|
|
246
|
-
listProps: listProps,
|
|
247
|
-
listRef: listRef,
|
|
248
|
-
disabledItemValues: disabledItemValues,
|
|
249
|
-
valueKey: valueKey,
|
|
250
|
-
labelKey: labelKey,
|
|
251
|
-
renderMenuGroup: renderMenuGroup,
|
|
252
|
-
renderMenuItem: renderMenuItem,
|
|
253
|
-
maxHeight: menuMaxHeight,
|
|
254
|
-
classPrefix: 'picker-select-menu',
|
|
255
|
-
dropdownMenuItemClassPrefix: 'picker-select-menu-item',
|
|
256
|
-
dropdownMenuItemAs: DropdownMenuItem,
|
|
257
|
-
activeItemValues: [value],
|
|
258
|
-
focusItemValue: focusItemValue,
|
|
259
|
-
data: items // FIXME-Doma
|
|
260
|
-
// `group` is redundant so long as `groupBy` exists
|
|
261
|
-
,
|
|
262
|
-
group: !isUndefined(groupBy),
|
|
263
|
-
groupBy: groupBy,
|
|
264
|
-
onSelect: handleItemSelect,
|
|
265
|
-
onGroupTitleClick: onGroupTitleClick,
|
|
266
|
-
virtualized: virtualized
|
|
267
|
-
}) : /*#__PURE__*/React.createElement("div", {
|
|
268
|
-
className: prefix(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["none"])))
|
|
269
|
-
}, locale === null || locale === void 0 ? void 0 : locale.noResultsText);
|
|
270
267
|
return /*#__PURE__*/React.createElement(PickerOverlay, {
|
|
271
268
|
ref: mergeRefs(overlayRef, speakerRef),
|
|
272
269
|
autoWidth: menuAutoWidth,
|
package/esm/Windowing/List.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { VariableSizeList, ListItemKeySelector, ListOnScrollProps, ListOnItemsRe
|
|
|
2
2
|
import { WithAsProps, RsRefForwardingComponent } from '../@types/common';
|
|
3
3
|
export interface ListProps<T = any> extends WithAsProps {
|
|
4
4
|
/**
|
|
5
|
-
* @deprecated use itemSize instead
|
|
5
|
+
* @deprecated use {@link itemSize} instead
|
|
6
6
|
* Either a fixed row height (number) or a function that returns the height of a row given its index: ({ index: number }): number
|
|
7
7
|
*/
|
|
8
8
|
rowHeight?: number | (({ index: number }: {
|
|
@@ -34,7 +34,7 @@ export interface ListProps<T = any> extends WithAsProps {
|
|
|
34
34
|
*/
|
|
35
35
|
onScroll?: (props: ListOnScrollProps) => void;
|
|
36
36
|
}
|
|
37
|
-
export interface ListHandle extends
|
|
37
|
+
export interface ListHandle extends Pick<VariableSizeList, 'resetAfterIndex' | 'scrollTo' | 'scrollToItem'> {
|
|
38
38
|
/**
|
|
39
39
|
* @deprecated use scrollToItem instead
|
|
40
40
|
* Ensure row is visible. This method can be used to safely scroll back to a cell that a user has scrolled away from even if it was previously scrolled to.
|