rsuite 5.68.1 → 5.70.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 +30 -0
- package/Calendar/styles/index.css +1 -1
- package/Calendar/styles/index.less +1 -1
- package/DatePicker/styles/index.css +1 -1
- package/DateRangePicker/styles/index.css +1 -1
- package/README.md +2 -2
- package/Table/styles/index.css +1 -1
- package/Table/styles/index.less +1 -1
- package/cjs/Calendar/Calendar.d.ts +7 -2
- package/cjs/Calendar/Calendar.js +1 -1
- package/cjs/Calendar/CalendarContainer.d.ts +5 -0
- package/cjs/Calendar/CalendarContainer.js +15 -44
- package/cjs/Calendar/CalendarContext.d.ts +126 -2
- package/cjs/Calendar/CalendarContext.js +11 -3
- package/cjs/Calendar/CalendarHeader.js +3 -20
- package/cjs/Calendar/MonthDropdown.js +39 -29
- package/cjs/Calendar/TimeDropdown.js +0 -14
- package/cjs/Calendar/index.d.ts +1 -2
- package/cjs/CascadeTree/CascadeTree.js +3 -1
- package/cjs/CascadeTree/SearchView.d.ts +1 -0
- package/cjs/CascadeTree/SearchView.js +3 -2
- package/cjs/CascadeTree/types.d.ts +5 -1
- package/cjs/Cascader/Cascader.d.ts +1 -1
- package/cjs/Cascader/Cascader.js +1 -0
- package/cjs/CustomProvider/CustomProvider.d.ts +13 -16
- package/cjs/DateInput/hooks/useDateInputState.d.ts +0 -2
- package/cjs/DateInput/hooks/useDateInputState.js +4 -1
- package/cjs/DatePicker/DatePicker.d.ts +6 -1
- package/cjs/DatePicker/DatePicker.js +10 -8
- package/cjs/DateRangePicker/Calendar.d.ts +3 -3
- package/cjs/DateRangePicker/Calendar.js +1 -1
- package/cjs/DateRangePicker/DateRangePicker.d.ts +15 -3
- package/cjs/DateRangePicker/DateRangePicker.js +30 -25
- package/cjs/InputNumber/InputNumber.d.ts +9 -0
- package/cjs/InputNumber/InputNumber.js +28 -8
- package/cjs/MultiCascadeTree/MultiCascadeTree.d.ts +1 -1
- package/cjs/MultiCascadeTree/MultiCascadeTree.js +4 -1
- package/cjs/MultiCascadeTree/SearchView.d.ts +1 -0
- package/cjs/MultiCascadeTree/SearchView.js +3 -2
- package/cjs/MultiCascadeTree/types.d.ts +5 -1
- package/cjs/MultiCascader/MultiCascader.d.ts +1 -1
- package/cjs/MultiCascader/MultiCascader.js +3 -0
- package/cjs/TreePicker/TreePicker.js +1 -0
- package/cjs/internals/Windowing/List.d.ts +13 -3
- package/cjs/internals/Windowing/index.d.ts +1 -1
- package/cjs/internals/hooks/useCustom.js +25 -12
- package/cjs/internals/hooks/useEventCallback.js +8 -1
- package/cjs/useMediaQuery/useMediaQuery.js +12 -6
- package/dist/rsuite-no-reset-rtl.css +2 -2
- 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 +2 -2
- package/dist/rsuite-no-reset.min.css +1 -1
- package/dist/rsuite-no-reset.min.css.map +1 -1
- package/dist/rsuite-rtl.css +2 -2
- package/dist/rsuite-rtl.min.css +1 -1
- package/dist/rsuite-rtl.min.css.map +1 -1
- package/dist/rsuite.css +2 -2
- package/dist/rsuite.js +84 -73
- 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 +7 -2
- package/esm/Calendar/Calendar.js +1 -1
- package/esm/Calendar/CalendarContainer.d.ts +5 -0
- package/esm/Calendar/CalendarContainer.js +15 -44
- package/esm/Calendar/CalendarContext.d.ts +126 -2
- package/esm/Calendar/CalendarContext.js +12 -3
- package/esm/Calendar/CalendarHeader.js +3 -20
- package/esm/Calendar/MonthDropdown.js +39 -29
- package/esm/Calendar/TimeDropdown.js +0 -14
- package/esm/Calendar/index.d.ts +1 -2
- package/esm/CascadeTree/CascadeTree.js +3 -1
- package/esm/CascadeTree/SearchView.d.ts +1 -0
- package/esm/CascadeTree/SearchView.js +3 -2
- package/esm/CascadeTree/types.d.ts +5 -1
- package/esm/Cascader/Cascader.d.ts +1 -1
- package/esm/Cascader/Cascader.js +1 -0
- package/esm/CustomProvider/CustomProvider.d.ts +13 -16
- package/esm/DateInput/hooks/useDateInputState.d.ts +0 -2
- package/esm/DateInput/hooks/useDateInputState.js +5 -2
- package/esm/DatePicker/DatePicker.d.ts +6 -1
- package/esm/DatePicker/DatePicker.js +10 -8
- package/esm/DateRangePicker/Calendar.d.ts +3 -3
- package/esm/DateRangePicker/Calendar.js +1 -1
- package/esm/DateRangePicker/DateRangePicker.d.ts +15 -3
- package/esm/DateRangePicker/DateRangePicker.js +19 -14
- package/esm/InputNumber/InputNumber.d.ts +9 -0
- package/esm/InputNumber/InputNumber.js +29 -9
- package/esm/MultiCascadeTree/MultiCascadeTree.d.ts +1 -1
- package/esm/MultiCascadeTree/MultiCascadeTree.js +4 -1
- package/esm/MultiCascadeTree/SearchView.d.ts +1 -0
- package/esm/MultiCascadeTree/SearchView.js +3 -2
- package/esm/MultiCascadeTree/types.d.ts +5 -1
- package/esm/MultiCascader/MultiCascader.d.ts +1 -1
- package/esm/MultiCascader/MultiCascader.js +3 -0
- package/esm/TreePicker/TreePicker.js +1 -0
- package/esm/internals/Windowing/List.d.ts +13 -3
- package/esm/internals/Windowing/index.d.ts +1 -1
- package/esm/internals/hooks/useCustom.js +25 -12
- package/esm/internals/hooks/useEventCallback.js +8 -2
- package/esm/useMediaQuery/useMediaQuery.js +13 -7
- package/package.json +2 -2
- package/cjs/Calendar/types.d.ts +0 -28
- package/cjs/Calendar/types.js +0 -4
- package/esm/Calendar/types.d.ts +0 -28
- package/esm/Calendar/types.js +0 -2
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import type { Locale as DateFnsLocale } from 'date-fns';
|
|
2
3
|
import { Locale } from '../locales';
|
|
3
4
|
import { ToastContainerInstance } from '../toaster/ToastContainer';
|
|
5
|
+
export interface FormatDateOptions {
|
|
6
|
+
locale?: DateFnsLocale;
|
|
7
|
+
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
8
|
+
firstWeekContainsDate?: number;
|
|
9
|
+
useAdditionalWeekYearTokens?: boolean;
|
|
10
|
+
useAdditionalDayOfYearTokens?: boolean;
|
|
11
|
+
}
|
|
4
12
|
export interface CustomValue<T = Locale> {
|
|
5
13
|
/** Language configuration */
|
|
6
14
|
locale: T;
|
|
@@ -19,7 +27,7 @@ export interface CustomValue<T = Locale> {
|
|
|
19
27
|
* }
|
|
20
28
|
*
|
|
21
29
|
* */
|
|
22
|
-
formatDate: (date: Date | number, format: string) => string;
|
|
30
|
+
formatDate: (date: Date | number, format: string, options?: FormatDateOptions) => string;
|
|
23
31
|
/**
|
|
24
32
|
* Return the date parsed from string using the given format string.
|
|
25
33
|
*
|
|
@@ -33,7 +41,7 @@ export interface CustomValue<T = Locale> {
|
|
|
33
41
|
* }
|
|
34
42
|
*
|
|
35
43
|
* */
|
|
36
|
-
parseDate: (dateString: string, formatString: string) => Date;
|
|
44
|
+
parseDate: (dateString: string, formatString: string, referenceDate?: Date | number, options?: FormatDateOptions) => Date;
|
|
37
45
|
/**
|
|
38
46
|
* A Map of toast containers
|
|
39
47
|
*/
|
|
@@ -60,6 +68,7 @@ declare const CustomContext: React.Context<CustomProviderProps<{
|
|
|
60
68
|
} | undefined;
|
|
61
69
|
Plaintext?: {
|
|
62
70
|
unfilled: string;
|
|
71
|
+
/** Support right-to-left */
|
|
63
72
|
notSelected: string;
|
|
64
73
|
notUploaded: string;
|
|
65
74
|
} | undefined;
|
|
@@ -67,19 +76,7 @@ declare const CustomContext: React.Context<CustomProviderProps<{
|
|
|
67
76
|
more: string;
|
|
68
77
|
prev: string;
|
|
69
78
|
next: string;
|
|
70
|
-
first: string;
|
|
71
|
-
* Return the date parsed from string using the given format string.
|
|
72
|
-
*
|
|
73
|
-
* Example:
|
|
74
|
-
*
|
|
75
|
-
* import parse from 'date-fns/parse';
|
|
76
|
-
* import eo from 'date-fns/locale/eo'
|
|
77
|
-
*
|
|
78
|
-
* function parseDate(date, formatStr) {
|
|
79
|
-
* return parse(date, formatStr, new Date(), { locale: eo });
|
|
80
|
-
* }
|
|
81
|
-
*
|
|
82
|
-
* */
|
|
79
|
+
first: string;
|
|
83
80
|
last: string;
|
|
84
81
|
limit: string;
|
|
85
82
|
total: string;
|
|
@@ -152,7 +149,7 @@ declare const CustomContext: React.Context<CustomProviderProps<{
|
|
|
152
149
|
} | undefined;
|
|
153
150
|
Uploader?: {
|
|
154
151
|
inited: string;
|
|
155
|
-
progress: string;
|
|
152
|
+
progress: string;
|
|
156
153
|
error: string;
|
|
157
154
|
complete: string;
|
|
158
155
|
emptyFile: string;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useCallback, useEffect } from 'react';
|
|
3
3
|
import startCase from 'lodash/startCase';
|
|
4
|
-
import { addDays, addMonths, addYears, addHours, addMinutes, addSeconds,
|
|
4
|
+
import { addDays, addMonths, addYears, addHours, addMinutes, addSeconds, isLastDayOfMonth, lastDayOfMonth, isValid } from "../../internals/utils/date/index.js";
|
|
5
|
+
import { useCustom } from "../../internals/hooks/index.js";
|
|
5
6
|
import { useDateField, patternMap } from "../DateField.js";
|
|
6
7
|
export function useDateInputState(_ref) {
|
|
7
8
|
var formatStr = _ref.formatStr,
|
|
8
9
|
locale = _ref.locale,
|
|
9
10
|
date = _ref.date,
|
|
10
11
|
isControlledDate = _ref.isControlledDate;
|
|
12
|
+
var _useCustom = useCustom(),
|
|
13
|
+
formatDate = _useCustom.formatDate;
|
|
11
14
|
var _useDateField = useDateField(formatStr, locale.localize, date),
|
|
12
15
|
dateField = _useDateField.dateField,
|
|
13
16
|
dispatch = _useDateField.dispatch,
|
|
@@ -88,7 +91,7 @@ export function useDateInputState(_ref) {
|
|
|
88
91
|
};
|
|
89
92
|
var toControlledDateString = function toControlledDateString() {
|
|
90
93
|
if (date && isValid(date)) {
|
|
91
|
-
return
|
|
94
|
+
return formatDate(date, formatStr, {
|
|
92
95
|
locale: locale
|
|
93
96
|
});
|
|
94
97
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { RangeType } from './Toolbar';
|
|
3
|
-
import { DatePickerLocale } from '../locales';
|
|
4
3
|
import type { FormControlBaseProps, PickerBaseProps, RsRefForwardingComponent } from '../internals/types';
|
|
4
|
+
import type { DatePickerLocale } from '../locales';
|
|
5
5
|
import type { DeprecatedProps } from './types';
|
|
6
|
+
import type { MonthDropdownProps } from '../Calendar/CalendarContext';
|
|
6
7
|
export interface DatePickerProps extends PickerBaseProps<DatePickerLocale>, FormControlBaseProps<Date | null>, DeprecatedProps {
|
|
7
8
|
/**
|
|
8
9
|
* Custom caret component
|
|
@@ -77,6 +78,10 @@ export interface DatePickerProps extends PickerBaseProps<DatePickerLocale>, Form
|
|
|
77
78
|
* Meridian format for 12-hour time
|
|
78
79
|
*/
|
|
79
80
|
showMeridian?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* The props for the Month Dropdown component.
|
|
83
|
+
*/
|
|
84
|
+
monthDropdownProps?: MonthDropdownProps;
|
|
80
85
|
/**
|
|
81
86
|
* Whether a date on the calendar view should be disabled
|
|
82
87
|
*
|
|
@@ -3,7 +3,7 @@ import _taggedTemplateLiteralLoose from "@babel/runtime/helpers/esm/taggedTempla
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
5
|
var _templateObject, _templateObject2;
|
|
6
|
-
var _excluded = ["as", "className", "classPrefix", "calendarDefaultDate", "cleanable", "editable", "defaultValue", "disabled", "readOnly", "plaintext", "format", "id", "isoWeek", "weekStart", "limitEndYear", "limitStartYear", "locale", "loading", "label", "menuClassName", "menuStyle", "appearance", "placement", "oneTap", "placeholder", "ranges", "value", "showMeridian", "showWeekNumbers", "style", "size", "
|
|
6
|
+
var _excluded = ["as", "className", "classPrefix", "calendarDefaultDate", "cleanable", "caretAs", "editable", "defaultValue", "disabled", "readOnly", "plaintext", "format", "id", "isoWeek", "weekStart", "limitEndYear", "limitStartYear", "locale", "loading", "label", "menuClassName", "menuStyle", "appearance", "placement", "oneTap", "placeholder", "ranges", "value", "showMeridian", "showWeekNumbers", "style", "size", "monthDropdownProps", "shouldDisableDate", "shouldDisableHour", "shouldDisableMinute", "shouldDisableSecond", "onChange", "onChangeCalendarDate", "onClean", "onEnter", "onExit", "onNextMonth", "onOk", "onPrevMonth", "onSelect", "onToggleMonthDropdown", "onToggleTimeDropdown", "onShortcutClick", "renderCell", "renderValue", "disabledDate", "disabledHours", "disabledMinutes", "disabledSeconds"];
|
|
7
7
|
import React, { useMemo } from 'react';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import mapValues from 'lodash/mapValues';
|
|
@@ -12,21 +12,21 @@ import IconCalendar from '@rsuite/icons/legacy/Calendar';
|
|
|
12
12
|
import IconClockO from '@rsuite/icons/legacy/ClockO';
|
|
13
13
|
import CalendarContainer from "../Calendar/CalendarContainer.js";
|
|
14
14
|
import useCalendarDate from "../Calendar/useCalendarDate.js";
|
|
15
|
-
import { isEveryDateInMonth } from "../Calendar/MonthDropdown.js";
|
|
16
15
|
import Toolbar from "./Toolbar.js";
|
|
17
16
|
import Stack from "../Stack/index.js";
|
|
18
17
|
import PredefinedRanges from "./PredefinedRanges.js";
|
|
18
|
+
import DateInput from "../DateInput/index.js";
|
|
19
|
+
import InputGroup from "../InputGroup/index.js";
|
|
20
|
+
import useMonthView from "./hooks/useMonthView.js";
|
|
21
|
+
import useFocus from "./hooks/useFocus.js";
|
|
22
|
+
import useCustomizedInput from "./hooks/useCustomizedInput.js";
|
|
23
|
+
import { isEveryDateInMonth } from "../Calendar/MonthDropdown.js";
|
|
19
24
|
import { mergeRefs, partitionHTMLProps, createChainedFunction } from "../internals/utils/index.js";
|
|
20
25
|
import { useClassNames, useControlled, useCustom, useUniqueId, useEventCallback } from "../internals/hooks/index.js";
|
|
21
26
|
import { shouldRenderMonth, shouldRenderDate, shouldRenderTime, shouldOnlyRenderTime, setHours, getHours, isValid, copyTime, disableTime, calendarOnlyProps } from "../internals/utils/date/index.js";
|
|
22
27
|
import { PickerPopup, PickerLabel, PickerIndicator, PickerToggleTrigger, pickerPropTypes, pickTriggerPropKeys, usePickerClassName, usePickerRef, onMenuKeyDown } from "../internals/Picker/index.js";
|
|
23
28
|
import { OverlayCloseCause } from "../internals/Overlay/OverlayTrigger.js";
|
|
24
|
-
import DateInput from "../DateInput/index.js";
|
|
25
|
-
import InputGroup from "../InputGroup/index.js";
|
|
26
29
|
import { splitRanges, deprecatedPropTypes, getRestProps } from "./utils.js";
|
|
27
|
-
import useMonthView from "./hooks/useMonthView.js";
|
|
28
|
-
import useFocus from "./hooks/useFocus.js";
|
|
29
|
-
import useCustomizedInput from "./hooks/useCustomizedInput.js";
|
|
30
30
|
/**
|
|
31
31
|
* A date picker allows users to select a date from a calendar.
|
|
32
32
|
*
|
|
@@ -42,6 +42,7 @@ var DatePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
42
42
|
calendarDefaultDate = props.calendarDefaultDate,
|
|
43
43
|
_props$cleanable = props.cleanable,
|
|
44
44
|
cleanable = _props$cleanable === void 0 ? true : _props$cleanable,
|
|
45
|
+
caretAsProp = props.caretAs,
|
|
45
46
|
_props$editable = props.editable,
|
|
46
47
|
editable = _props$editable === void 0 ? true : _props$editable,
|
|
47
48
|
defaultValue = props.defaultValue,
|
|
@@ -75,7 +76,7 @@ var DatePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
75
76
|
showWeekNumbers = props.showWeekNumbers,
|
|
76
77
|
style = props.style,
|
|
77
78
|
size = props.size,
|
|
78
|
-
|
|
79
|
+
monthDropdownProps = props.monthDropdownProps,
|
|
79
80
|
shouldDisableDate = props.shouldDisableDate,
|
|
80
81
|
shouldDisableHour = props.shouldDisableHour,
|
|
81
82
|
shouldDisableMinute = props.shouldDisableMinute,
|
|
@@ -413,6 +414,7 @@ var DatePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
413
414
|
isoWeek: isoWeek,
|
|
414
415
|
weekStart: weekStart,
|
|
415
416
|
calendarDate: calendarDate,
|
|
417
|
+
monthDropdownProps: monthDropdownProps,
|
|
416
418
|
renderCellOnPicker: renderCell,
|
|
417
419
|
onMoveForward: handleMoveForward,
|
|
418
420
|
onMoveBackward: handleMoveBackward,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { DATERANGE_DISABLED_TARGET } from '../internals/constants';
|
|
3
2
|
import { CalendarProps as CalendarCoreProps } from '../Calendar/CalendarContainer';
|
|
3
|
+
import { DATERANGE_DISABLED_TARGET } from '../internals/constants';
|
|
4
4
|
import { DateRange } from './types';
|
|
5
5
|
import { RsRefForwardingComponent, WithAsProps } from '../internals/types';
|
|
6
6
|
import { DatePickerLocale } from '../locales';
|
|
@@ -16,13 +16,13 @@ export interface CalendarProps extends WithAsProps, Omit<CalendarCoreProps, Omit
|
|
|
16
16
|
limitEndYear?: number;
|
|
17
17
|
limitStartYear?: number;
|
|
18
18
|
locale?: DatePickerLocale;
|
|
19
|
+
showWeekNumbers?: boolean;
|
|
20
|
+
value?: [] | [Date] | [Date, Date];
|
|
19
21
|
onChangeCalendarMonth?: (index: number, date: Date) => void;
|
|
20
22
|
onChangeCalendarTime?: (index: number, date: Date) => void;
|
|
21
23
|
onToggleMeridian: (index: number, event: React.MouseEvent) => void;
|
|
22
24
|
onSelect?: (index: number, date: Date, event: React.SyntheticEvent) => void;
|
|
23
25
|
onMouseMove?: (date: Date) => void;
|
|
24
|
-
showWeekNumbers?: boolean;
|
|
25
|
-
value?: [] | [Date] | [Date, Date];
|
|
26
26
|
}
|
|
27
27
|
declare const Calendar: RsRefForwardingComponent<'div', CalendarProps>;
|
|
28
28
|
export default Calendar;
|
|
@@ -3,10 +3,10 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
3
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
4
|
var _excluded = ["as", "calendarDate", "format", "disabledDate", "index", "limitEndYear", "limitStartYear", "onChangeCalendarMonth", "onChangeCalendarTime", "onToggleMeridian", "onSelect", "value"];
|
|
5
5
|
import React from 'react';
|
|
6
|
+
import CalendarCore from "../Calendar/CalendarContainer.js";
|
|
6
7
|
import { addMonths } from "../internals/utils/date/index.js";
|
|
7
8
|
import { DATERANGE_DISABLED_TARGET } from "../internals/constants/index.js";
|
|
8
9
|
import { useEventCallback } from "../internals/hooks/index.js";
|
|
9
|
-
import CalendarCore from "../Calendar/CalendarContainer.js";
|
|
10
10
|
var Calendar = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
11
11
|
var _props$as = props.as,
|
|
12
12
|
Component = _props$as === void 0 ? CalendarCore : _props$as,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FormControlBaseProps, PickerBaseProps } from '../internals/types';
|
|
3
|
-
import { DateRangePickerLocale } from '../locales';
|
|
4
2
|
import { PickerComponent } from '../internals/Picker';
|
|
5
|
-
import { DisabledDateFunction, RangeType, DateRange } from './types';
|
|
3
|
+
import type { DisabledDateFunction, RangeType, DateRange } from './types';
|
|
4
|
+
import type { FormControlBaseProps, PickerBaseProps } from '../internals/types';
|
|
5
|
+
import type { DateRangePickerLocale } from '../locales';
|
|
6
|
+
import type { MonthDropdownProps } from '../Calendar/CalendarContext';
|
|
6
7
|
export interface DateRangePickerProps extends PickerBaseProps<DateRangePickerLocale>, FormControlBaseProps<DateRange | null> {
|
|
7
8
|
/**
|
|
8
9
|
* Custom caret component
|
|
@@ -85,6 +86,17 @@ export interface DateRangePickerProps extends PickerBaseProps<DateRangePickerLoc
|
|
|
85
86
|
* @default ' ~ '
|
|
86
87
|
*/
|
|
87
88
|
character?: string;
|
|
89
|
+
/**
|
|
90
|
+
* The props for the Month Dropdown component.
|
|
91
|
+
*/
|
|
92
|
+
monthDropdownProps?: MonthDropdownProps;
|
|
93
|
+
/**
|
|
94
|
+
* If the user selects a date on the right calendar first, it will automatically switch to the left calendar.
|
|
95
|
+
* Always keep the date on the left calendar as the start date.
|
|
96
|
+
* @default false
|
|
97
|
+
* @version 5.69.0
|
|
98
|
+
*/
|
|
99
|
+
calendarSnapping?: boolean;
|
|
88
100
|
/**
|
|
89
101
|
* Disabled date
|
|
90
102
|
* @deprecated Use {@link shouldDisableDate} instead
|
|
@@ -3,7 +3,7 @@ import _taggedTemplateLiteralLoose from "@babel/runtime/helpers/esm/taggedTempla
|
|
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
5
5
|
var _templateObject, _templateObject2;
|
|
6
|
-
var _excluded = ["as", "classPrefix", "className", "appearance", "editable", "cleanable", "character", "defaultCalendarValue", "defaultValue", "plaintext", "disabled", "disabledDate", "shouldDisableDate", "format", "hoverRange", "id", "isoWeek", "weekStart", "limitEndYear", "limitStartYear", "locale", "loading", "label", "menuClassName", "menuStyle", "oneTap", "placeholder", "placement", "ranges", "readOnly", "showOneCalendar", "showWeekNumbers", "showMeridian", "showHeader", "style", "size", "caretAs", "value", "onChange", "onClean", "onEnter", "onExit", "onOk", "onSelect", "onShortcutClick", "renderTitle", "renderValue"];
|
|
6
|
+
var _excluded = ["as", "classPrefix", "className", "appearance", "editable", "cleanable", "character", "calendarSnapping", "defaultCalendarValue", "defaultValue", "plaintext", "disabled", "disabledDate", "shouldDisableDate", "format", "hoverRange", "id", "isoWeek", "weekStart", "limitEndYear", "limitStartYear", "locale", "loading", "label", "menuClassName", "menuStyle", "oneTap", "placeholder", "placement", "ranges", "readOnly", "showOneCalendar", "showWeekNumbers", "showMeridian", "showHeader", "style", "size", "caretAs", "value", "monthDropdownProps", "onChange", "onClean", "onEnter", "onExit", "onOk", "onSelect", "onShortcutClick", "renderTitle", "renderValue"];
|
|
7
7
|
import React, { useEffect, useRef, useState, useMemo } from 'react';
|
|
8
8
|
import isNil from 'lodash/isNil';
|
|
9
9
|
import omit from 'lodash/omit';
|
|
@@ -14,20 +14,20 @@ import IconClockO from '@rsuite/icons/legacy/ClockO';
|
|
|
14
14
|
import Toolbar from "../DatePicker/Toolbar.js";
|
|
15
15
|
import PredefinedRanges from "../DatePicker/PredefinedRanges.js";
|
|
16
16
|
import Stack from "../Stack/index.js";
|
|
17
|
-
import { DATERANGE_DISABLED_TARGET as TARGET } from "../internals/constants/index.js";
|
|
18
|
-
import { omitTriggerPropKeys, PickerPopup, pickerPropTypes, PickerToggleTrigger, PickerIndicator, PickerLabel, pickTriggerPropKeys, usePickerClassName, usePickerRef, onMenuKeyDown } from "../internals/Picker/index.js";
|
|
19
|
-
import { useClassNames, useControlled, useCustom, useUniqueId, useEventCallback } from "../internals/hooks/index.js";
|
|
20
|
-
import { createChainedFunction, mergeRefs, partitionHTMLProps, getStringLength } from "../internals/utils/index.js";
|
|
21
|
-
import { addMonths, isValid, isBefore, isSameDay, addDays, startOfDay, endOfDay, shouldRenderTime, isAfter, isSameMonth, shouldRenderMonth, shouldRenderDate, calendarOnlyProps, getReversedTimeMeridian, reverseDateRangeOmitTime, copyTime, shouldOnlyRenderTime } from "../internals/utils/date/index.js";
|
|
22
|
-
import Calendar from "./Calendar.js";
|
|
23
|
-
import { getSafeCalendarDate, getMonthHoverRange, getWeekHoverRange, isSameRange } from "./utils.js";
|
|
24
|
-
import { deprecatePropTypeNew, oneOf } from "../internals/propTypes/index.js";
|
|
25
17
|
import DateRangePickerContext from "./DateRangePickerContext.js";
|
|
26
18
|
import DateRangeInput from "../DateRangeInput/index.js";
|
|
27
19
|
import InputGroup from "../InputGroup/index.js";
|
|
28
20
|
import Header from "./Header.js";
|
|
29
21
|
import useDateDisabled from "./hooks/useDateDisabled.js";
|
|
30
22
|
import useCustomizedInput from "../DatePicker/hooks/useCustomizedInput.js";
|
|
23
|
+
import Calendar from "./Calendar.js";
|
|
24
|
+
import { getSafeCalendarDate, getMonthHoverRange, getWeekHoverRange, isSameRange } from "./utils.js";
|
|
25
|
+
import { deprecatePropTypeNew, oneOf } from "../internals/propTypes/index.js";
|
|
26
|
+
import { DATERANGE_DISABLED_TARGET as TARGET } from "../internals/constants/index.js";
|
|
27
|
+
import { omitTriggerPropKeys, PickerPopup, pickerPropTypes, PickerToggleTrigger, PickerIndicator, PickerLabel, pickTriggerPropKeys, usePickerClassName, usePickerRef, onMenuKeyDown } from "../internals/Picker/index.js";
|
|
28
|
+
import { useClassNames, useControlled, useCustom, useUniqueId, useEventCallback } from "../internals/hooks/index.js";
|
|
29
|
+
import { createChainedFunction, mergeRefs, partitionHTMLProps, getStringLength } from "../internals/utils/index.js";
|
|
30
|
+
import { addMonths, isValid, isBefore, isSameDay, addDays, startOfDay, endOfDay, shouldRenderTime, isAfter, isSameMonth, shouldRenderMonth, shouldRenderDate, calendarOnlyProps, getReversedTimeMeridian, reverseDateRangeOmitTime, copyTime, shouldOnlyRenderTime } from "../internals/utils/date/index.js";
|
|
31
31
|
/**
|
|
32
32
|
* A date range picker allows you to select a date range from a calendar.
|
|
33
33
|
*
|
|
@@ -48,6 +48,7 @@ var DateRangePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
48
48
|
cleanable = _props$cleanable === void 0 ? true : _props$cleanable,
|
|
49
49
|
_props$character = props.character,
|
|
50
50
|
character = _props$character === void 0 ? ' ~ ' : _props$character,
|
|
51
|
+
calendarSnapping = props.calendarSnapping,
|
|
51
52
|
defaultCalendarValue = props.defaultCalendarValue,
|
|
52
53
|
defaultValue = props.defaultValue,
|
|
53
54
|
plaintext = props.plaintext,
|
|
@@ -87,6 +88,7 @@ var DateRangePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
87
88
|
size = props.size,
|
|
88
89
|
caretAsProp = props.caretAs,
|
|
89
90
|
valueProp = props.value,
|
|
91
|
+
monthDropdownProps = props.monthDropdownProps,
|
|
90
92
|
onChange = props.onChange,
|
|
91
93
|
onClean = props.onClean,
|
|
92
94
|
onEnter = props.onEnter,
|
|
@@ -368,11 +370,13 @@ var DateRangePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
368
370
|
setActiveCalendarKey('start');
|
|
369
371
|
}
|
|
370
372
|
setSelectedDates(nextSelectDates);
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
373
|
+
if (!isSameMonth(calendarDate[index], date) || calendarSnapping) {
|
|
374
|
+
setCalendarDateRange({
|
|
375
|
+
dateRange: nextSelectDates,
|
|
376
|
+
calendarKey: calendarKey,
|
|
377
|
+
eventName: 'changeDate'
|
|
378
|
+
});
|
|
379
|
+
}
|
|
376
380
|
onSelect === null || onSelect === void 0 ? void 0 : onSelect(date, event);
|
|
377
381
|
setSelectedIdle(!isSelectedIdle);
|
|
378
382
|
});
|
|
@@ -618,6 +622,7 @@ var DateRangePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
618
622
|
showWeekNumbers: showWeekNumbers,
|
|
619
623
|
format: formatStr,
|
|
620
624
|
value: selectedDates,
|
|
625
|
+
monthDropdownProps: monthDropdownProps,
|
|
621
626
|
hoverRangeValue: hoverDateRange !== null && hoverDateRange !== void 0 ? hoverDateRange : undefined,
|
|
622
627
|
disabledDate: disableCalendarDate,
|
|
623
628
|
onSelect: handleSelectDate,
|
|
@@ -9,6 +9,15 @@ export interface InputNumberProps<T = number | string | null> extends Omit<React
|
|
|
9
9
|
* An input can show that it is disabled
|
|
10
10
|
*/
|
|
11
11
|
disabled?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* Decimal separator
|
|
15
|
+
* https://en.wikipedia.org/wiki/Decimal_separator
|
|
16
|
+
*
|
|
17
|
+
* @default '.'
|
|
18
|
+
* @version 5.69.0
|
|
19
|
+
*/
|
|
20
|
+
decimalSeparator?: string;
|
|
12
21
|
/**
|
|
13
22
|
* Format the value of the input
|
|
14
23
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
|
-
var _excluded = ["as", "className", "classPrefix", "disabled", "formatter", "readOnly", "plaintext", "value", "defaultValue", "size", "prefix", "postfix", "step", "buttonAppearance", "min", "max", "scrollable", "onChange", "onWheel", "onBlur", "onFocus"];
|
|
5
|
-
import React, { useEffect, useRef, useState } from 'react';
|
|
4
|
+
var _excluded = ["as", "className", "classPrefix", "disabled", "decimalSeparator", "formatter", "readOnly", "plaintext", "value", "defaultValue", "size", "prefix", "postfix", "step", "buttonAppearance", "min", "max", "scrollable", "onChange", "onWheel", "onBlur", "onFocus"];
|
|
5
|
+
import React, { useEffect, useRef, useState, useMemo, useCallback } from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import isNil from 'lodash/isNil';
|
|
8
8
|
import AngleUpIcon from '@rsuite/icons/legacy/AngleUp';
|
|
@@ -82,6 +82,7 @@ var InputNumber = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
82
82
|
_props$classPrefix = props.classPrefix,
|
|
83
83
|
classPrefix = _props$classPrefix === void 0 ? 'input-number' : _props$classPrefix,
|
|
84
84
|
disabled = props.disabled,
|
|
85
|
+
decimalSeparator = props.decimalSeparator,
|
|
85
86
|
formatter = props.formatter,
|
|
86
87
|
readOnly = props.readOnly,
|
|
87
88
|
plaintext = props.plaintext,
|
|
@@ -201,14 +202,30 @@ var InputNumber = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
201
202
|
onWheel === null || onWheel === void 0 ? void 0 : onWheel(event);
|
|
202
203
|
});
|
|
203
204
|
var handleChange = useEventCallback(function (value, event) {
|
|
204
|
-
|
|
205
|
+
var separator = decimalSeparator || '.';
|
|
206
|
+
var escapedSeparator = separator.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
|
|
207
|
+
var regex = new RegExp("^-?(?:\\d+)?(" + escapedSeparator + ")?\\d*$");
|
|
208
|
+
if (!regex.test(value) && value !== '') {
|
|
205
209
|
return;
|
|
206
210
|
}
|
|
207
211
|
handleChangeValue(value, event);
|
|
208
212
|
});
|
|
213
|
+
var replaceDecimalSeparator = useCallback(function (value) {
|
|
214
|
+
if (decimalSeparator && value) {
|
|
215
|
+
return value.toString().replace('.', decimalSeparator);
|
|
216
|
+
}
|
|
217
|
+
return value;
|
|
218
|
+
}, [decimalSeparator]);
|
|
219
|
+
var restoreDecimalSeparator = useCallback(function (value) {
|
|
220
|
+
if (decimalSeparator && value) {
|
|
221
|
+
return value.replace(decimalSeparator, '.');
|
|
222
|
+
}
|
|
223
|
+
return value;
|
|
224
|
+
}, [decimalSeparator]);
|
|
209
225
|
var handleBlur = useEventCallback(function (event) {
|
|
210
226
|
var _event$target;
|
|
211
|
-
var
|
|
227
|
+
var value = restoreDecimalSeparator((_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.value);
|
|
228
|
+
var targetValue = Number.parseFloat(value);
|
|
212
229
|
handleChangeValue(getSafeValue(targetValue), event);
|
|
213
230
|
setIsFocused(false);
|
|
214
231
|
});
|
|
@@ -224,22 +241,25 @@ var InputNumber = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
224
241
|
(_wheelListener = wheelListener) === null || _wheelListener === void 0 ? void 0 : _wheelListener.off();
|
|
225
242
|
};
|
|
226
243
|
}, [handleWheel, scrollable]);
|
|
227
|
-
var
|
|
244
|
+
var inputValue = useMemo(function () {
|
|
228
245
|
if (isNil(value)) {
|
|
229
246
|
return '';
|
|
230
247
|
}
|
|
231
248
|
if (isFocused) {
|
|
232
|
-
return value;
|
|
249
|
+
return replaceDecimalSeparator(value);
|
|
233
250
|
}
|
|
234
|
-
|
|
235
|
-
|
|
251
|
+
if (formatter) {
|
|
252
|
+
return formatter(value);
|
|
253
|
+
}
|
|
254
|
+
return replaceDecimalSeparator(value);
|
|
255
|
+
}, [formatter, isFocused, replaceDecimalSeparator, value]);
|
|
236
256
|
var input = /*#__PURE__*/React.createElement(Input, _extends({}, htmlInputProps, {
|
|
237
257
|
ref: plaintext ? ref : undefined,
|
|
238
258
|
inputRef: inputRef,
|
|
239
259
|
autoComplete: "off",
|
|
240
260
|
inputMode: "numeric",
|
|
241
261
|
step: step,
|
|
242
|
-
value:
|
|
262
|
+
value: inputValue,
|
|
243
263
|
disabled: disabled,
|
|
244
264
|
readOnly: readOnly,
|
|
245
265
|
plaintext: plaintext,
|
|
@@ -5,5 +5,5 @@ import type { MultiCascadeTreeProps } from './types';
|
|
|
5
5
|
* The `MultiCascadeTree` component is used to select multiple values from cascading options.
|
|
6
6
|
* @see https://rsuitejs.com/components/multi-cascade-tree/
|
|
7
7
|
*/
|
|
8
|
-
declare const MultiCascadeTree: React.ForwardRefExoticComponent<MultiCascadeTreeProps<DataItemValue, DataItemValue[]> & React.RefAttributes<unknown>>;
|
|
8
|
+
declare const MultiCascadeTree: React.ForwardRefExoticComponent<MultiCascadeTreeProps<DataItemValue, DataItemValue[], any> & React.RefAttributes<unknown>>;
|
|
9
9
|
export default MultiCascadeTree;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
|
-
var _excluded = ["as", "data", "defaultValue", "className", "classPrefix", "value", "valueKey", "labelKey", "childrenKey", "disabledItemValues", "cascade", "columnWidth", "columnHeight", "searchable", "uncheckableItemValues", "getChildren", "renderColumn", "renderTreeNode", "onSelect", "onCheck", "onChange", "onSearch"];
|
|
4
|
+
var _excluded = ["as", "data", "defaultValue", "className", "classPrefix", "value", "valueKey", "labelKey", "locale", "childrenKey", "disabledItemValues", "cascade", "columnWidth", "columnHeight", "searchable", "uncheckableItemValues", "getChildren", "renderColumn", "renderTreeNode", "onSelect", "onCheck", "onChange", "onSearch"];
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import TreeView from "./TreeView.js";
|
|
7
7
|
import { useCascadeValue, useSelect, useSearch } from "./hooks/index.js";
|
|
@@ -27,6 +27,7 @@ var MultiCascadeTree = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
27
27
|
valueKey = _props$valueKey === void 0 ? 'value' : _props$valueKey,
|
|
28
28
|
_props$labelKey = props.labelKey,
|
|
29
29
|
labelKey = _props$labelKey === void 0 ? 'label' : _props$labelKey,
|
|
30
|
+
locale = props.locale,
|
|
30
31
|
_props$childrenKey = props.childrenKey,
|
|
31
32
|
childrenKey = _props$childrenKey === void 0 ? 'children' : _props$childrenKey,
|
|
32
33
|
_props$disabledItemVa = props.disabledItemValues,
|
|
@@ -94,11 +95,13 @@ var MultiCascadeTree = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
94
95
|
ref: ref,
|
|
95
96
|
className: classes
|
|
96
97
|
}, rest), searchable && /*#__PURE__*/React.createElement(SearchView, {
|
|
98
|
+
cascade: cascade,
|
|
97
99
|
data: items,
|
|
98
100
|
value: value,
|
|
99
101
|
searchKeyword: searchKeyword,
|
|
100
102
|
valueKey: valueKey,
|
|
101
103
|
labelKey: labelKey,
|
|
104
|
+
locale: locale,
|
|
102
105
|
childrenKey: childrenKey,
|
|
103
106
|
disabledItemValues: disabledItemValues,
|
|
104
107
|
onCheck: handleCheck,
|
|
@@ -9,6 +9,7 @@ interface SearchViewProps<T> extends WithAsProps {
|
|
|
9
9
|
data: ItemDataType<T>[];
|
|
10
10
|
disabledItemValues: any[];
|
|
11
11
|
cascade?: boolean;
|
|
12
|
+
locale?: Record<string, string>;
|
|
12
13
|
onSearch: (value: string, event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
13
14
|
onCheck: (item: ItemDataType<T>, event: React.SyntheticEvent, checked: boolean) => void;
|
|
14
15
|
inputRef?: React.RefObject<HTMLInputElement>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
|
-
var _excluded = ["as", "classPrefix", "className", "searchKeyword", "childrenKey", "labelKey", "valueKey", "value", "data", "disabledItemValues", "inputRef", "cascade", "onSearch", "onCheck"];
|
|
4
|
+
var _excluded = ["as", "classPrefix", "className", "searchKeyword", "childrenKey", "labelKey", "valueKey", "value", "data", "disabledItemValues", "inputRef", "cascade", "locale", "onSearch", "onCheck"];
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { useClassNames, useCustom } from "../internals/hooks/index.js";
|
|
7
7
|
import SearchBox from "../internals/SearchBox/index.js";
|
|
@@ -23,6 +23,7 @@ function SearchView(props) {
|
|
|
23
23
|
disabledItemValues = props.disabledItemValues,
|
|
24
24
|
inputRef = props.inputRef,
|
|
25
25
|
cascade = props.cascade,
|
|
26
|
+
overrideLocale = props.locale,
|
|
26
27
|
onSearch = props.onSearch,
|
|
27
28
|
onCheck = props.onCheck,
|
|
28
29
|
rest = _objectWithoutPropertiesLoose(props, _excluded);
|
|
@@ -32,7 +33,7 @@ function SearchView(props) {
|
|
|
32
33
|
withClassPrefix = _useClassNames.withClassPrefix,
|
|
33
34
|
rootPrefix = _useClassNames.rootPrefix;
|
|
34
35
|
var classes = merge(className, withClassPrefix());
|
|
35
|
-
var _useCustom = useCustom('Picker'),
|
|
36
|
+
var _useCustom = useCustom('Picker', overrideLocale),
|
|
36
37
|
locale = _useCustom.locale;
|
|
37
38
|
var renderSearchRow = function renderSearchRow(item, key) {
|
|
38
39
|
var _extends2;
|
|
@@ -6,7 +6,7 @@ export interface ItemKeys {
|
|
|
6
6
|
labelKey: string;
|
|
7
7
|
childrenKey: string;
|
|
8
8
|
}
|
|
9
|
-
export interface MultiCascadeTreeProps<T, V = T[]> extends WithAsProps, CascadeTreeProps<T, V> {
|
|
9
|
+
export interface MultiCascadeTreeProps<T, V = T[], L = any> extends WithAsProps, CascadeTreeProps<T, V> {
|
|
10
10
|
/**
|
|
11
11
|
* When set to true, selecting a child node will update the state of the parent node.
|
|
12
12
|
*/
|
|
@@ -19,6 +19,10 @@ export interface MultiCascadeTreeProps<T, V = T[]> extends WithAsProps, CascadeT
|
|
|
19
19
|
* Set the option value for the check box not to be rendered
|
|
20
20
|
*/
|
|
21
21
|
uncheckableItemValues?: T[];
|
|
22
|
+
/**
|
|
23
|
+
* A collection of localized strings.
|
|
24
|
+
*/
|
|
25
|
+
locale?: Partial<L>;
|
|
22
26
|
/**
|
|
23
27
|
* Called after the checkbox state changes.
|
|
24
28
|
*/
|
|
@@ -3,7 +3,7 @@ import { PickerLocale } from '../locales';
|
|
|
3
3
|
import { PickerComponent, PickerToggleProps } from '../internals/Picker';
|
|
4
4
|
import { FormControlPickerProps, ItemDataType, DataItemValue } from '../internals/types';
|
|
5
5
|
import type { MultiCascadeTreeProps } from '../MultiCascadeTree';
|
|
6
|
-
export interface MultiCascaderProps<T extends DataItemValue> extends FormControlPickerProps<T[], PickerLocale, ItemDataType<T>, T>, MultiCascadeTreeProps<T, T[]>, Pick<PickerToggleProps, 'loading'> {
|
|
6
|
+
export interface MultiCascaderProps<T extends DataItemValue> extends FormControlPickerProps<T[], PickerLocale, ItemDataType<T>, T>, MultiCascadeTreeProps<T, T[], PickerLocale>, Pick<PickerToggleProps, 'loading'> {
|
|
7
7
|
/**
|
|
8
8
|
* A picker that can be counted
|
|
9
9
|
*/
|
|
@@ -267,6 +267,8 @@ var MultiCascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
267
267
|
target: trigger,
|
|
268
268
|
onKeyDown: onPickerKeyDown
|
|
269
269
|
}, searchable && /*#__PURE__*/React.createElement(SearchView, {
|
|
270
|
+
locale: locale,
|
|
271
|
+
cascade: cascade,
|
|
270
272
|
data: items,
|
|
271
273
|
value: value,
|
|
272
274
|
searchKeyword: searchKeyword,
|
|
@@ -274,6 +276,7 @@ var MultiCascader = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
274
276
|
labelKey: labelKey,
|
|
275
277
|
childrenKey: childrenKey,
|
|
276
278
|
disabledItemValues: disabledItemValues,
|
|
279
|
+
inputRef: searchInput,
|
|
277
280
|
onCheck: handleCheck,
|
|
278
281
|
onSearch: handleSearch
|
|
279
282
|
}), !searchKeyword && /*#__PURE__*/React.createElement(TreeView, {
|
|
@@ -216,6 +216,7 @@ var TreePicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
216
216
|
searchable: searchable,
|
|
217
217
|
searchKeyword: searchKeyword,
|
|
218
218
|
searchBy: searchBy,
|
|
219
|
+
searchInputRef: searchInput,
|
|
219
220
|
loadingNodeValues: loadingNodeValues,
|
|
220
221
|
flattenedNodes: flattenedNodes,
|
|
221
222
|
listProps: listProps,
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { VariableSizeList, ListItemKeySelector, ListOnScrollProps, ListOnItemsRenderedProps, ListProps as BaseListProps } from 'react-window';
|
|
3
|
+
import { RsRefForwardingComponent } from '../types';
|
|
3
4
|
export declare const defaultItemSize: () => number;
|
|
4
|
-
export interface ListProps<T = any> extends
|
|
5
|
+
export interface ListProps<T = any> extends Omit<BaseListProps, 'width'> {
|
|
6
|
+
ref?: React.Ref<ListHandle>;
|
|
7
|
+
/**
|
|
8
|
+
* Width of the list.
|
|
9
|
+
*
|
|
10
|
+
* For horizontal lists, this must be a number. It affects the number of columns that will be rendered (and displayed) at any given time.
|
|
11
|
+
*
|
|
12
|
+
* For vertical lists, this can be a number or a string (e.g. "50%").
|
|
13
|
+
*/
|
|
14
|
+
width?: number | string;
|
|
5
15
|
/**
|
|
6
16
|
* @deprecated use itemSize instead
|
|
7
17
|
* Either a fixed row height (number) or a function that returns the height of a row given its index: ({ index: number }): number
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { default as AutoSizer } from './AutoSizer';
|
|
2
2
|
export { default as List, defaultItemSize } from './List';
|
|
3
3
|
export { FixedSizeList, VariableSizeList } from 'react-window';
|
|
4
|
-
export type { ListChildComponentProps } from 'react-window';
|
|
4
|
+
export type { ListChildComponentProps, FixedSizeListProps } from 'react-window';
|
|
5
5
|
export type { ListProps, ListHandle } from './List';
|