rsuite 5.46.0 → 5.47.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 +19 -0
- package/CloseButton/styles/index.less +13 -7
- package/Message/styles/mixin.less +8 -0
- package/Notification/styles/index.less +8 -0
- package/Picker/styles/index.less +0 -9
- package/Tag/styles/index.less +2 -5
- package/Uploader/styles/index.less +1 -2
- package/cjs/Calendar/Table.js +2 -1
- package/cjs/Calendar/TableRow.d.ts +1 -0
- package/cjs/Calendar/TableRow.js +10 -4
- package/cjs/Checkbox/Checkbox.d.ts +2 -0
- package/cjs/CloseButton/CloseButton.js +3 -5
- package/cjs/CustomProvider/CustomProvider.d.ts +3 -3
- package/cjs/InputPicker/InputPicker.d.ts +3 -22
- package/cjs/InputPicker/InputPicker.js +8 -8
- package/cjs/InputPicker/InputPickerContext.d.ts +26 -0
- package/cjs/InputPicker/InputPickerContext.js +13 -0
- package/cjs/Picker/DropdownMenu.d.ts +1 -0
- package/cjs/Picker/DropdownMenu.js +7 -3
- package/cjs/Picker/DropdownMenuCheckItem.d.ts +2 -0
- package/cjs/Picker/DropdownMenuCheckItem.js +18 -14
- package/cjs/Picker/PickerToggle.js +3 -1
- package/cjs/RadioTile/RadioTile.d.ts +5 -0
- package/cjs/RadioTile/RadioTile.js +5 -0
- package/cjs/RangeSlider/RangeSlider.js +14 -6
- package/cjs/Slider/Slider.js +7 -3
- package/cjs/Table/Table.d.ts +3 -3
- package/cjs/Tag/Tag.js +7 -1
- package/cjs/TagInput/index.d.ts +3 -15
- package/cjs/TagInput/index.js +3 -2
- package/cjs/TagPicker/index.d.ts +12 -10
- package/cjs/TagPicker/index.js +12 -5
- package/cjs/Uploader/UploadFileItem.js +19 -5
- package/cjs/locales/ar_EG.d.ts +3 -0
- package/cjs/locales/ar_EG.js +5 -2
- package/cjs/locales/da_DK.d.ts +3 -0
- package/cjs/locales/da_DK.js +5 -2
- package/cjs/locales/de_DE.d.ts +3 -0
- package/cjs/locales/de_DE.js +5 -2
- package/cjs/locales/default.d.ts +3 -0
- package/cjs/locales/default.js +5 -2
- package/cjs/locales/en_US.d.ts +3 -0
- package/cjs/locales/en_US.js +5 -2
- package/cjs/locales/es_AR.d.ts +3 -0
- package/cjs/locales/es_AR.js +5 -2
- package/cjs/locales/es_ES.d.ts +3 -0
- package/cjs/locales/es_ES.js +5 -2
- package/cjs/locales/fa_IR.d.ts +3 -0
- package/cjs/locales/fa_IR.js +5 -2
- package/cjs/locales/fi_FI.d.ts +3 -0
- package/cjs/locales/fi_FI.js +5 -2
- package/cjs/locales/fr_FR.d.ts +3 -0
- package/cjs/locales/fr_FR.js +5 -2
- package/cjs/locales/hu_HU.d.ts +3 -0
- package/cjs/locales/hu_HU.js +5 -2
- package/cjs/locales/index.d.ts +1 -1
- package/cjs/locales/it_IT.d.ts +3 -0
- package/cjs/locales/it_IT.js +5 -2
- package/cjs/locales/ja_JP.d.ts +3 -0
- package/cjs/locales/ja_JP.js +5 -2
- package/cjs/locales/kk_KZ.d.ts +3 -0
- package/cjs/locales/kk_KZ.js +5 -2
- package/cjs/locales/ko_KR.d.ts +3 -0
- package/cjs/locales/ko_KR.js +5 -2
- package/cjs/locales/ne_NP.d.ts +3 -0
- package/cjs/locales/ne_NP.js +5 -2
- package/cjs/locales/nl_NL.d.ts +3 -0
- package/cjs/locales/nl_NL.js +5 -2
- package/cjs/locales/pt_BR.d.ts +3 -0
- package/cjs/locales/pt_BR.js +5 -2
- package/cjs/locales/ru_RU.d.ts +3 -0
- package/cjs/locales/ru_RU.js +6 -3
- package/cjs/locales/sv_SE.d.ts +3 -0
- package/cjs/locales/sv_SE.js +5 -2
- package/cjs/locales/tr_TR.d.ts +3 -0
- package/cjs/locales/tr_TR.js +5 -2
- package/cjs/locales/zh_CN.d.ts +3 -0
- package/cjs/locales/zh_CN.js +5 -2
- package/cjs/locales/zh_TW.d.ts +3 -0
- package/cjs/locales/zh_TW.js +5 -2
- package/dist/rsuite-no-reset-rtl.css +56 -27
- 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 +56 -27
- package/dist/rsuite-no-reset.min.css +1 -1
- package/dist/rsuite-no-reset.min.css.map +1 -1
- package/dist/rsuite-rtl.css +56 -27
- package/dist/rsuite-rtl.min.css +1 -1
- package/dist/rsuite-rtl.min.css.map +1 -1
- package/dist/rsuite.css +56 -27
- package/dist/rsuite.js +28 -17
- 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/Table.js +2 -1
- package/esm/Calendar/TableRow.d.ts +1 -0
- package/esm/Calendar/TableRow.js +10 -4
- package/esm/Checkbox/Checkbox.d.ts +2 -0
- package/esm/CloseButton/CloseButton.js +3 -5
- package/esm/CustomProvider/CustomProvider.d.ts +3 -3
- package/esm/InputPicker/InputPicker.d.ts +3 -22
- package/esm/InputPicker/InputPicker.js +6 -5
- package/esm/InputPicker/InputPickerContext.d.ts +26 -0
- package/esm/InputPicker/InputPickerContext.js +7 -0
- package/esm/Picker/DropdownMenu.d.ts +1 -0
- package/esm/Picker/DropdownMenu.js +7 -3
- package/esm/Picker/DropdownMenuCheckItem.d.ts +2 -0
- package/esm/Picker/DropdownMenuCheckItem.js +18 -14
- package/esm/Picker/PickerToggle.js +4 -2
- package/esm/RadioTile/RadioTile.d.ts +5 -0
- package/esm/RadioTile/RadioTile.js +5 -0
- package/esm/RangeSlider/RangeSlider.js +14 -6
- package/esm/Slider/Slider.js +7 -3
- package/esm/Table/Table.d.ts +3 -3
- package/esm/Tag/Tag.js +8 -2
- package/esm/TagInput/index.d.ts +3 -15
- package/esm/TagInput/index.js +2 -1
- package/esm/TagPicker/index.d.ts +12 -10
- package/esm/TagPicker/index.js +11 -4
- package/esm/Uploader/UploadFileItem.js +19 -5
- package/esm/locales/ar_EG.d.ts +3 -0
- package/esm/locales/ar_EG.js +5 -2
- package/esm/locales/da_DK.d.ts +3 -0
- package/esm/locales/da_DK.js +5 -2
- package/esm/locales/de_DE.d.ts +3 -0
- package/esm/locales/de_DE.js +5 -2
- package/esm/locales/default.d.ts +3 -0
- package/esm/locales/default.js +5 -2
- package/esm/locales/en_US.d.ts +3 -0
- package/esm/locales/en_US.js +5 -2
- package/esm/locales/es_AR.d.ts +3 -0
- package/esm/locales/es_AR.js +5 -2
- package/esm/locales/es_ES.d.ts +3 -0
- package/esm/locales/es_ES.js +5 -2
- package/esm/locales/fa_IR.d.ts +3 -0
- package/esm/locales/fa_IR.js +5 -2
- package/esm/locales/fi_FI.d.ts +3 -0
- package/esm/locales/fi_FI.js +5 -2
- package/esm/locales/fr_FR.d.ts +3 -0
- package/esm/locales/fr_FR.js +5 -2
- package/esm/locales/hu_HU.d.ts +3 -0
- package/esm/locales/hu_HU.js +5 -2
- package/esm/locales/index.d.ts +1 -1
- package/esm/locales/it_IT.d.ts +3 -0
- package/esm/locales/it_IT.js +5 -2
- package/esm/locales/ja_JP.d.ts +3 -0
- package/esm/locales/ja_JP.js +5 -2
- package/esm/locales/kk_KZ.d.ts +3 -0
- package/esm/locales/kk_KZ.js +5 -2
- package/esm/locales/ko_KR.d.ts +3 -0
- package/esm/locales/ko_KR.js +5 -2
- package/esm/locales/ne_NP.d.ts +3 -0
- package/esm/locales/ne_NP.js +5 -2
- package/esm/locales/nl_NL.d.ts +3 -0
- package/esm/locales/nl_NL.js +5 -2
- package/esm/locales/pt_BR.d.ts +3 -0
- package/esm/locales/pt_BR.js +5 -2
- package/esm/locales/ru_RU.d.ts +3 -0
- package/esm/locales/ru_RU.js +6 -3
- package/esm/locales/sv_SE.d.ts +3 -0
- package/esm/locales/sv_SE.js +5 -2
- package/esm/locales/tr_TR.d.ts +3 -0
- package/esm/locales/tr_TR.js +5 -2
- package/esm/locales/zh_CN.d.ts +3 -0
- package/esm/locales/zh_CN.js +5 -2
- package/esm/locales/zh_TW.d.ts +3 -0
- package/esm/locales/zh_TW.js +5 -2
- package/package.json +2 -2
- package/styles/color-modes/dark.less +4 -2
- package/styles/color-modes/high-contrast.less +4 -2
- package/styles/color-modes/light.less +3 -1
package/esm/Calendar/Table.js
CHANGED
|
@@ -27,7 +27,8 @@ var Table = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
27
27
|
}), /*#__PURE__*/React.createElement(TableHeaderRow, null), rows.map(function (week, index) {
|
|
28
28
|
return /*#__PURE__*/React.createElement(TableRow, {
|
|
29
29
|
key: index,
|
|
30
|
-
weekendDate: week
|
|
30
|
+
weekendDate: week,
|
|
31
|
+
rowIndex: index + 1
|
|
31
32
|
});
|
|
32
33
|
}));
|
|
33
34
|
});
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { RsRefForwardingComponent, WithAsProps } from '../@types/common';
|
|
2
2
|
export interface TableRowProps extends WithAsProps {
|
|
3
3
|
weekendDate?: Date;
|
|
4
|
+
rowIndex?: number;
|
|
4
5
|
}
|
|
5
6
|
declare const TableRow: RsRefForwardingComponent<'div', TableRowProps>;
|
|
6
7
|
export default TableRow;
|
package/esm/Calendar/TableRow.js
CHANGED
|
@@ -15,7 +15,8 @@ var TableRow = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
15
15
|
classPrefix = _props$classPrefix === void 0 ? 'calendar-table' : _props$classPrefix,
|
|
16
16
|
_props$weekendDate = props.weekendDate,
|
|
17
17
|
weekendDate = _props$weekendDate === void 0 ? new Date() : _props$weekendDate,
|
|
18
|
-
|
|
18
|
+
rowIndex = props.rowIndex,
|
|
19
|
+
rest = _objectWithoutPropertiesLoose(props, ["as", "className", "classPrefix", "weekendDate", "rowIndex"]);
|
|
19
20
|
var _useCalendarContext = useCalendarContext(),
|
|
20
21
|
_useCalendarContext$d = _useCalendarContext.date,
|
|
21
22
|
selected = _useCalendarContext$d === void 0 ? new Date() : _useCalendarContext$d,
|
|
@@ -89,14 +90,19 @@ var TableRow = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
89
90
|
return days;
|
|
90
91
|
};
|
|
91
92
|
var classes = merge(className, prefix('row'));
|
|
93
|
+
var week = format(weekendDate, isoWeek ? 'I' : 'w', {
|
|
94
|
+
firstWeekContainsDate: 4
|
|
95
|
+
});
|
|
92
96
|
return /*#__PURE__*/React.createElement(Component, _extends({}, rest, {
|
|
93
97
|
ref: ref,
|
|
94
98
|
role: "row",
|
|
99
|
+
"aria-rowindex": rowIndex,
|
|
95
100
|
className: classes
|
|
96
101
|
}), showWeekNumbers && /*#__PURE__*/React.createElement("div", {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
102
|
+
role: "rowheader",
|
|
103
|
+
"aria-label": "Week " + week,
|
|
104
|
+
className: prefix('cell-week-number')
|
|
105
|
+
}, week), renderDays());
|
|
100
106
|
});
|
|
101
107
|
TableRow.displayName = 'CalendarTableRow';
|
|
102
108
|
TableRow.propTypes = {
|
|
@@ -36,6 +36,8 @@ export interface CheckboxProps<V = ValueType> extends WithAsProps {
|
|
|
36
36
|
onClick?: (event: React.SyntheticEvent) => void;
|
|
37
37
|
/** Called when the checkbox is clicked. */
|
|
38
38
|
onCheckboxClick?: (event: React.SyntheticEvent) => void;
|
|
39
|
+
/** Called when the user presses down a key. */
|
|
40
|
+
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
39
41
|
}
|
|
40
42
|
declare const Checkbox: RsRefForwardingComponent<'div', CheckboxProps>;
|
|
41
43
|
export default Checkbox;
|
|
@@ -9,7 +9,7 @@ import { useClassNames, useCustom } from '../utils';
|
|
|
9
9
|
*/
|
|
10
10
|
var CloseButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
11
11
|
var _props$as = props.as,
|
|
12
|
-
Component = _props$as === void 0 ? '
|
|
12
|
+
Component = _props$as === void 0 ? 'button' : _props$as,
|
|
13
13
|
_props$classPrefix = props.classPrefix,
|
|
14
14
|
classPrefix = _props$classPrefix === void 0 ? 'btn-close' : _props$classPrefix,
|
|
15
15
|
className = props.className,
|
|
@@ -22,13 +22,11 @@ var CloseButton = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
22
22
|
locale = _useCustom.locale;
|
|
23
23
|
var classes = merge(className, withClassPrefix());
|
|
24
24
|
return /*#__PURE__*/React.createElement(Component, _extends({
|
|
25
|
-
|
|
26
|
-
}, rest, {
|
|
25
|
+
type: "button",
|
|
27
26
|
ref: ref,
|
|
28
27
|
className: classes,
|
|
29
|
-
title: locale === null || locale === void 0 ? void 0 : locale.closeLabel,
|
|
30
28
|
"aria-label": locale === null || locale === void 0 ? void 0 : locale.closeLabel
|
|
31
|
-
}), /*#__PURE__*/React.createElement(Close, null));
|
|
29
|
+
}, rest), /*#__PURE__*/React.createElement(Close, null));
|
|
32
30
|
});
|
|
33
31
|
CloseButton.displayName = 'CloseButton';
|
|
34
32
|
export default CloseButton;
|
|
@@ -55,6 +55,8 @@ declare const CustomContext: React.Context<CustomProviderProps<{
|
|
|
55
55
|
common?: {
|
|
56
56
|
loading: string;
|
|
57
57
|
emptyMessage: string;
|
|
58
|
+
remove: string;
|
|
59
|
+
clear: string;
|
|
58
60
|
} | undefined;
|
|
59
61
|
Plaintext?: {
|
|
60
62
|
unfilled: string;
|
|
@@ -134,9 +136,6 @@ declare const CustomContext: React.Context<CustomProviderProps<{
|
|
|
134
136
|
} | undefined;
|
|
135
137
|
InputPicker?: {
|
|
136
138
|
newItem: string;
|
|
137
|
-
/**
|
|
138
|
-
* A Map of toast containers
|
|
139
|
-
*/
|
|
140
139
|
createOption: string;
|
|
141
140
|
} | undefined;
|
|
142
141
|
Uploader?: {
|
|
@@ -146,6 +145,7 @@ declare const CustomContext: React.Context<CustomProviderProps<{
|
|
|
146
145
|
complete: string;
|
|
147
146
|
emptyFile: string;
|
|
148
147
|
upload: string;
|
|
148
|
+
removeFile: string;
|
|
149
149
|
} | undefined;
|
|
150
150
|
CloseButton?: {
|
|
151
151
|
closeLabel: string;
|
|
@@ -1,27 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { InputPickerLocale } from '../locales';
|
|
3
2
|
import { PickerComponent, PickerToggleProps } from '../Picker';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { SelectProps } from '../SelectPicker';
|
|
7
|
-
export declare type TriggerType = 'Enter' | 'Space' | 'Comma';
|
|
8
|
-
export interface InputPickerContextProps {
|
|
9
|
-
/** Multiple selections are allowed */
|
|
10
|
-
multi?: boolean;
|
|
11
|
-
/** Tag related props. */
|
|
12
|
-
tagProps: TagProps;
|
|
13
|
-
/**
|
|
14
|
-
* Set the trigger for creating tags. only valid when creatable
|
|
15
|
-
*/
|
|
16
|
-
trigger: TriggerType | TriggerType[];
|
|
17
|
-
/**
|
|
18
|
-
* No overlay provides options
|
|
19
|
-
*/
|
|
20
|
-
disabledOptions?: boolean;
|
|
21
|
-
/** Callback fired when a tag is removed. */
|
|
22
|
-
onTagRemove?: (tag: string, event: React.MouseEvent) => void;
|
|
23
|
-
}
|
|
24
|
-
export declare const InputPickerContext: React.Context<InputPickerContextProps>;
|
|
3
|
+
import type { ItemDataType, FormControlPickerProps } from '../@types/common';
|
|
4
|
+
import type { InputPickerLocale } from '../locales';
|
|
5
|
+
import type { SelectProps } from '../SelectPicker';
|
|
25
6
|
interface InputItemDataType extends ItemDataType {
|
|
26
7
|
create?: boolean;
|
|
27
8
|
}
|
|
@@ -23,10 +23,7 @@ import { DropdownMenu, DropdownMenuItem, DropdownMenuCheckItem, PickerToggle, Pi
|
|
|
23
23
|
import Tag from '../Tag';
|
|
24
24
|
import InputAutosize from './InputAutosize';
|
|
25
25
|
import InputSearch from './InputSearch';
|
|
26
|
-
|
|
27
|
-
tagProps: {},
|
|
28
|
-
trigger: 'Enter'
|
|
29
|
-
});
|
|
26
|
+
import InputPickerContext from './InputPickerContext';
|
|
30
27
|
var InputPicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
31
28
|
var _merge;
|
|
32
29
|
var _props$as = props.as,
|
|
@@ -102,7 +99,8 @@ var InputPicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
102
99
|
tagProps = _useContext.tagProps,
|
|
103
100
|
trigger = _useContext.trigger,
|
|
104
101
|
disabledOptions = _useContext.disabledOptions,
|
|
105
|
-
onTagRemove = _useContext.onTagRemove
|
|
102
|
+
onTagRemove = _useContext.onTagRemove,
|
|
103
|
+
renderMenuItemCheckbox = _useContext.renderMenuItemCheckbox;
|
|
106
104
|
if (groupBy === valueKey || groupBy === labelKey) {
|
|
107
105
|
throw Error('`groupBy` can not be equal to `valueKey` and `labelKey`');
|
|
108
106
|
}
|
|
@@ -557,6 +555,9 @@ var InputPicker = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
557
555
|
classPrefix: menuClassPrefix,
|
|
558
556
|
dropdownMenuItemClassPrefix: multi ? undefined : menuClassPrefix + "-item",
|
|
559
557
|
dropdownMenuItemAs: multi ? DropdownMenuCheckItem : DropdownMenuItem,
|
|
558
|
+
dropdownMenuItemProps: {
|
|
559
|
+
renderMenuItemCheckbox: renderMenuItemCheckbox
|
|
560
|
+
},
|
|
560
561
|
activeItemValues: multi ? value : [value],
|
|
561
562
|
focusItemValue: focusItemValue,
|
|
562
563
|
maxHeight: menuMaxHeight,
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { TagProps } from '../Tag';
|
|
3
|
+
import type { CheckboxProps } from '../Checkbox';
|
|
4
|
+
export declare type TriggerType = 'Enter' | 'Space' | 'Comma';
|
|
5
|
+
export interface TagOnlyProps {
|
|
6
|
+
/** Tag related props. */
|
|
7
|
+
tagProps: TagProps;
|
|
8
|
+
/**
|
|
9
|
+
* Set the trigger for creating tags. only valid when creatable
|
|
10
|
+
*/
|
|
11
|
+
trigger: TriggerType | TriggerType[];
|
|
12
|
+
/** Callback fired when a tag is removed. */
|
|
13
|
+
onTagRemove?: (tag: string, event: React.MouseEvent) => void;
|
|
14
|
+
}
|
|
15
|
+
export interface InputPickerContextProps extends TagOnlyProps {
|
|
16
|
+
/** Multiple selections are allowed */
|
|
17
|
+
multi?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* No overlay provides options
|
|
20
|
+
*/
|
|
21
|
+
disabledOptions?: boolean;
|
|
22
|
+
/** Custom render checkbox on menu item */
|
|
23
|
+
renderMenuItemCheckbox?: (checkboxProps: CheckboxProps) => React.ReactNode;
|
|
24
|
+
}
|
|
25
|
+
declare const InputPickerContext: React.Context<InputPickerContextProps>;
|
|
26
|
+
export default InputPickerContext;
|
|
@@ -17,6 +17,7 @@ export interface DropdownMenuProps<Multiple = false> extends StandardProps, Omit
|
|
|
17
17
|
style?: React.CSSProperties;
|
|
18
18
|
dropdownMenuItemAs: React.ElementType | string;
|
|
19
19
|
dropdownMenuItemClassPrefix?: string;
|
|
20
|
+
dropdownMenuItemProps?: any;
|
|
20
21
|
rowHeight?: number;
|
|
21
22
|
rowGroupHeight?: number;
|
|
22
23
|
virtualized?: boolean;
|
|
@@ -9,6 +9,7 @@ import isUndefined from 'lodash/isUndefined';
|
|
|
9
9
|
import isString from 'lodash/isString';
|
|
10
10
|
import isNumber from 'lodash/isNumber';
|
|
11
11
|
import findIndex from 'lodash/findIndex';
|
|
12
|
+
import pickBy from 'lodash/pickBy';
|
|
12
13
|
import getPosition from 'dom-lib/getPosition';
|
|
13
14
|
import scrollTop from 'dom-lib/scrollTop';
|
|
14
15
|
import getHeight from 'dom-lib/getHeight';
|
|
@@ -43,6 +44,7 @@ var DropdownMenu = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
43
44
|
focusItemValue = props.focusItemValue,
|
|
44
45
|
dropdownMenuItemClassPrefix = props.dropdownMenuItemClassPrefix,
|
|
45
46
|
DropdownMenuItem = props.dropdownMenuItemAs,
|
|
47
|
+
dropdownMenuItemProps = props.dropdownMenuItemProps,
|
|
46
48
|
_props$rowHeight = props.rowHeight,
|
|
47
49
|
rowHeight = _props$rowHeight === void 0 ? 36 : _props$rowHeight,
|
|
48
50
|
_props$rowGroupHeight = props.rowGroupHeight,
|
|
@@ -51,7 +53,7 @@ var DropdownMenu = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
51
53
|
renderMenuItem = props.renderMenuItem,
|
|
52
54
|
onGroupTitleClick = props.onGroupTitleClick,
|
|
53
55
|
onSelect = props.onSelect,
|
|
54
|
-
rest = _objectWithoutPropertiesLoose(props, ["data", "group", "groupBy", "maxHeight", "activeItemValues", "disabledItemValues", "classPrefix", "valueKey", "labelKey", "virtualized", "listProps", "listRef", "className", "style", "focusItemValue", "dropdownMenuItemClassPrefix", "dropdownMenuItemAs", "rowHeight", "rowGroupHeight", "renderMenuGroup", "renderMenuItem", "onGroupTitleClick", "onSelect"]);
|
|
56
|
+
rest = _objectWithoutPropertiesLoose(props, ["data", "group", "groupBy", "maxHeight", "activeItemValues", "disabledItemValues", "classPrefix", "valueKey", "labelKey", "virtualized", "listProps", "listRef", "className", "style", "focusItemValue", "dropdownMenuItemClassPrefix", "dropdownMenuItemAs", "dropdownMenuItemProps", "rowHeight", "rowGroupHeight", "renderMenuGroup", "renderMenuItem", "onGroupTitleClick", "onSelect"]);
|
|
55
57
|
var _useClassNames = useClassNames(classPrefix),
|
|
56
58
|
withClassPrefix = _useClassNames.withClassPrefix,
|
|
57
59
|
prefix = _useClassNames.prefix,
|
|
@@ -149,7 +151,7 @@ var DropdownMenu = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
149
151
|
return shallowEqual(v, value);
|
|
150
152
|
});
|
|
151
153
|
var focus = !isUndefined(focusItemValue) && shallowEqual(focusItemValue, value);
|
|
152
|
-
return /*#__PURE__*/React.createElement(DropdownMenuItem, {
|
|
154
|
+
return /*#__PURE__*/React.createElement(DropdownMenuItem, _extends({
|
|
153
155
|
style: style,
|
|
154
156
|
key: itemKey,
|
|
155
157
|
disabled: disabled,
|
|
@@ -158,7 +160,9 @@ var DropdownMenu = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
158
160
|
value: value,
|
|
159
161
|
classPrefix: dropdownMenuItemClassPrefix,
|
|
160
162
|
onSelect: handleSelect.bind(null, item)
|
|
161
|
-
},
|
|
163
|
+
}, pickBy(dropdownMenuItemProps, function (v) {
|
|
164
|
+
return v !== undefined;
|
|
165
|
+
})), renderMenuItem ? renderMenuItem(label, item) : label);
|
|
162
166
|
};
|
|
163
167
|
var filteredItems = group ? data.filter(function (item) {
|
|
164
168
|
var _item$parent;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { CheckboxProps } from '../Checkbox';
|
|
2
3
|
import { WithAsProps, RsRefForwardingComponent } from '../@types/common';
|
|
3
4
|
export interface DropdownMenuCheckItemProps extends WithAsProps {
|
|
4
5
|
active?: boolean;
|
|
@@ -16,6 +17,7 @@ export interface DropdownMenuCheckItemProps extends WithAsProps {
|
|
|
16
17
|
onCheck?: (value: any, event: React.SyntheticEvent, checked: boolean) => void;
|
|
17
18
|
onSelectItem?: (value: any, event: React.SyntheticEvent, checked: boolean) => void;
|
|
18
19
|
onKeyDown?: (event: React.KeyboardEvent) => void;
|
|
20
|
+
renderMenuItemCheckbox?: (checkboxProps: CheckboxProps) => React.ReactNode;
|
|
19
21
|
}
|
|
20
22
|
declare const DropdownMenuCheckItem: RsRefForwardingComponent<'div', DropdownMenuCheckItemProps>;
|
|
21
23
|
export default DropdownMenuCheckItem;
|
|
@@ -26,7 +26,8 @@ var DropdownMenuCheckItem = /*#__PURE__*/React.forwardRef(function (props, ref)
|
|
|
26
26
|
onSelect = props.onSelect,
|
|
27
27
|
onCheck = props.onCheck,
|
|
28
28
|
onSelectItem = props.onSelectItem,
|
|
29
|
-
|
|
29
|
+
renderMenuItemCheckbox = props.renderMenuItemCheckbox,
|
|
30
|
+
rest = _objectWithoutPropertiesLoose(props, ["active", "as", "checkboxAs", "classPrefix", "checkable", "disabled", "value", "focus", "children", "className", "indeterminate", "onKeyDown", "onSelect", "onCheck", "onSelectItem", "renderMenuItemCheckbox"]);
|
|
30
31
|
var handleChange = useCallback(function (value, checked, event) {
|
|
31
32
|
onSelect === null || onSelect === void 0 ? void 0 : onSelect(value, event, checked);
|
|
32
33
|
}, [onSelect]);
|
|
@@ -45,6 +46,19 @@ var DropdownMenuCheckItem = /*#__PURE__*/React.forwardRef(function (props, ref)
|
|
|
45
46
|
var checkboxItemClasses = withClassPrefix({
|
|
46
47
|
focus: focus
|
|
47
48
|
});
|
|
49
|
+
var checkboxProps = {
|
|
50
|
+
value: value,
|
|
51
|
+
disabled: disabled,
|
|
52
|
+
indeterminate: indeterminate,
|
|
53
|
+
checkable: checkable,
|
|
54
|
+
children: children,
|
|
55
|
+
checked: active,
|
|
56
|
+
className: checkboxItemClasses,
|
|
57
|
+
onKeyDown: disabled ? undefined : onKeyDown,
|
|
58
|
+
onChange: handleChange,
|
|
59
|
+
onClick: handleSelectItem,
|
|
60
|
+
onCheckboxClick: handleCheck
|
|
61
|
+
};
|
|
48
62
|
return /*#__PURE__*/React.createElement(Component, _extends({
|
|
49
63
|
role: "option",
|
|
50
64
|
"aria-selected": active,
|
|
@@ -54,19 +68,9 @@ var DropdownMenuCheckItem = /*#__PURE__*/React.forwardRef(function (props, ref)
|
|
|
54
68
|
ref: ref,
|
|
55
69
|
className: className,
|
|
56
70
|
tabIndex: -1
|
|
57
|
-
}), /*#__PURE__*/React.createElement(CheckboxItem, {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
disabled: disabled,
|
|
61
|
-
checked: active,
|
|
62
|
-
checkable: checkable,
|
|
63
|
-
indeterminate: indeterminate,
|
|
64
|
-
className: checkboxItemClasses,
|
|
65
|
-
onKeyDown: disabled ? null : onKeyDown,
|
|
66
|
-
onChange: handleChange,
|
|
67
|
-
onClick: handleSelectItem,
|
|
68
|
-
onCheckboxClick: handleCheck
|
|
69
|
-
}, children));
|
|
71
|
+
}), renderMenuItemCheckbox ? renderMenuItemCheckbox(checkboxProps) : /*#__PURE__*/React.createElement(CheckboxItem, _extends({
|
|
72
|
+
role: "checkbox"
|
|
73
|
+
}, checkboxProps)));
|
|
70
74
|
});
|
|
71
75
|
DropdownMenuCheckItem.displayName = 'DropdownMenuCheckItem';
|
|
72
76
|
DropdownMenuCheckItem.propTypes = {
|
|
@@ -8,7 +8,7 @@ import PropTypes from 'prop-types';
|
|
|
8
8
|
import debounce from 'lodash/debounce';
|
|
9
9
|
import ToggleButton from './ToggleButton';
|
|
10
10
|
import CloseButton from '../CloseButton';
|
|
11
|
-
import { useClassNames, KEY_VALUES, mergeRefs } from '../utils';
|
|
11
|
+
import { useClassNames, useCustom, KEY_VALUES, mergeRefs } from '../utils';
|
|
12
12
|
import Plaintext from '../Plaintext';
|
|
13
13
|
import useToggleCaret from '../utils/useToggleCaret';
|
|
14
14
|
import TextMask from '../MaskedInput/TextMask';
|
|
@@ -58,6 +58,8 @@ var PickerToggle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
58
58
|
label = props.label,
|
|
59
59
|
name = props.name,
|
|
60
60
|
rest = _objectWithoutPropertiesLoose(props, ["active", "as", "classPrefix", "children", "caret", "className", "disabled", "readOnly", "plaintext", "hasValue", "editable", "loading", "cleanable", "tabIndex", "id", "value", "inputPlaceholder", "inputValue", "inputMask", "onInputChange", "onInputPressEnter", "onInputBackspace", "onInputBlur", "onInputFocus", "onClean", "onFocus", "onBlur", "placement", "caretComponent", "caretAs", "label", "name"]);
|
|
61
|
+
var _useCustom = useCustom(),
|
|
62
|
+
locale = _useCustom.locale;
|
|
61
63
|
var inputRef = useRef(null);
|
|
62
64
|
var comboboxRef = useRef(null);
|
|
63
65
|
var _useState = useState(false),
|
|
@@ -218,7 +220,7 @@ var PickerToggle = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
218
220
|
className: prefix(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["clean"]))),
|
|
219
221
|
tabIndex: -1,
|
|
220
222
|
locale: {
|
|
221
|
-
closeLabel:
|
|
223
|
+
closeLabel: locale === null || locale === void 0 ? void 0 : locale.clear
|
|
222
224
|
},
|
|
223
225
|
onClick: handleClean
|
|
224
226
|
}), caret && !showCleanButton && /*#__PURE__*/React.createElement(Caret, {
|
|
@@ -21,5 +21,10 @@ export interface RadioTileProps<T = ValueType> extends WithAsProps, Omit<React.H
|
|
|
21
21
|
/** Callback function with value changed */
|
|
22
22
|
onChange?: (value?: T, event?: React.ChangeEvent<HTMLInputElement>) => void;
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* A series of selectable tile components that behave like Radio.
|
|
26
|
+
* @version 5.35.0
|
|
27
|
+
* @see https://rsuitejs.com/components/radio-tile/
|
|
28
|
+
*/
|
|
24
29
|
declare const RadioTile: React.ForwardRefExoticComponent<RadioTileProps<ValueType> & React.RefAttributes<unknown>>;
|
|
25
30
|
export default RadioTile;
|
|
@@ -8,6 +8,11 @@ import Stack from '../Stack';
|
|
|
8
8
|
import { RadioTileContext } from '../RadioTileGroup/RadioTileGroup';
|
|
9
9
|
import { useClassNames, useControlled, partitionHTMLProps } from '../utils';
|
|
10
10
|
import useUniqueId from '../utils/useUniqueId';
|
|
11
|
+
/**
|
|
12
|
+
* A series of selectable tile components that behave like Radio.
|
|
13
|
+
* @version 5.35.0
|
|
14
|
+
* @see https://rsuitejs.com/components/radio-tile/
|
|
15
|
+
*/
|
|
11
16
|
var RadioTile = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
12
17
|
var _useContext = useContext(RadioTileContext),
|
|
13
18
|
groupValue = _useContext.value,
|
|
@@ -30,6 +30,7 @@ var RangeSlider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
30
30
|
progress = _props$progress === void 0 ? true : _props$progress,
|
|
31
31
|
vertical = props.vertical,
|
|
32
32
|
disabled = props.disabled,
|
|
33
|
+
readOnly = props.readOnly,
|
|
33
34
|
_props$classPrefix = props.classPrefix,
|
|
34
35
|
classPrefix = _props$classPrefix === void 0 ? 'slider' : _props$classPrefix,
|
|
35
36
|
_props$min = props.min,
|
|
@@ -49,7 +50,7 @@ var RangeSlider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
49
50
|
renderMark = props.renderMark,
|
|
50
51
|
onChange = props.onChange,
|
|
51
52
|
onChangeCommitted = props.onChangeCommitted,
|
|
52
|
-
rest = _objectWithoutPropertiesLoose(props, ["aria-label", "aria-labelledby", "aria-valuetext", "as", "barClassName", "className", "constraint", "defaultValue", "graduated", "progress", "vertical", "disabled", "classPrefix", "min", "max", "step", "value", "handleClassName", "handleStyle", "handleTitle", "tooltip", "getAriaValueText", "renderTooltip", "renderMark", "onChange", "onChangeCommitted"]);
|
|
53
|
+
rest = _objectWithoutPropertiesLoose(props, ["aria-label", "aria-labelledby", "aria-valuetext", "as", "barClassName", "className", "constraint", "defaultValue", "graduated", "progress", "vertical", "disabled", "readOnly", "classPrefix", "min", "max", "step", "value", "handleClassName", "handleStyle", "handleTitle", "tooltip", "getAriaValueText", "renderTooltip", "renderMark", "onChange", "onChangeCommitted"]);
|
|
53
54
|
var barRef = useRef(null);
|
|
54
55
|
|
|
55
56
|
// Define the parameter position of the handle
|
|
@@ -162,6 +163,9 @@ var RangeSlider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
162
163
|
* Callback function that is fired when the mousemove is triggered
|
|
163
164
|
*/
|
|
164
165
|
var handleDragMove = useEventCallback(function (event, dataset) {
|
|
166
|
+
if (disabled || readOnly) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
165
169
|
var nextValue = getNextValue(event, dataset);
|
|
166
170
|
if (isRangeMatchingConstraint(nextValue)) {
|
|
167
171
|
setValue(nextValue);
|
|
@@ -173,12 +177,15 @@ var RangeSlider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
173
177
|
* Callback function that is fired when the mouseup is triggered
|
|
174
178
|
*/
|
|
175
179
|
var handleChangeCommitted = useCallback(function (event, dataset) {
|
|
180
|
+
if (disabled || readOnly) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
176
183
|
var nextValue = getNextValue(event, dataset);
|
|
177
184
|
if (isRangeMatchingConstraint(nextValue)) {
|
|
178
185
|
setValue(nextValue);
|
|
179
186
|
onChangeCommitted === null || onChangeCommitted === void 0 ? void 0 : onChangeCommitted(nextValue, event);
|
|
180
187
|
}
|
|
181
|
-
}, [
|
|
188
|
+
}, [disabled, readOnly, getNextValue, isRangeMatchingConstraint, setValue, onChangeCommitted]);
|
|
182
189
|
var handleKeyDown = useCallback(function (event) {
|
|
183
190
|
var _event$target;
|
|
184
191
|
var _event$target$dataset = (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target['dataset'],
|
|
@@ -219,8 +226,8 @@ var RangeSlider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
219
226
|
onChange === null || onChange === void 0 ? void 0 : onChange(nextValue, event);
|
|
220
227
|
}
|
|
221
228
|
}, [max, min, onChange, rtl, isRangeMatchingConstraint, setValue, step, value]);
|
|
222
|
-
var
|
|
223
|
-
if (disabled) {
|
|
229
|
+
var handleBarClick = useCallback(function (event) {
|
|
230
|
+
if (disabled || readOnly) {
|
|
224
231
|
return;
|
|
225
232
|
}
|
|
226
233
|
var start = value[0],
|
|
@@ -239,8 +246,9 @@ var RangeSlider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
239
246
|
if (isRangeMatchingConstraint(nextValue)) {
|
|
240
247
|
setValue(nextValue);
|
|
241
248
|
onChange === null || onChange === void 0 ? void 0 : onChange(nextValue, event);
|
|
249
|
+
onChangeCommitted === null || onChangeCommitted === void 0 ? void 0 : onChangeCommitted(nextValue, event);
|
|
242
250
|
}
|
|
243
|
-
}, [disabled, getValidValue, getValueByPosition, isRangeMatchingConstraint, onChange, setValue, value]);
|
|
251
|
+
}, [disabled, readOnly, getValidValue, getValueByPosition, isRangeMatchingConstraint, onChange, onChangeCommitted, setValue, value]);
|
|
244
252
|
var handleProps = useMemo(function () {
|
|
245
253
|
return [{
|
|
246
254
|
value: value[0],
|
|
@@ -281,7 +289,7 @@ var RangeSlider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
281
289
|
}), /*#__PURE__*/React.createElement("div", {
|
|
282
290
|
className: merge(barClassName, prefix('bar')),
|
|
283
291
|
ref: barRef,
|
|
284
|
-
onClick:
|
|
292
|
+
onClick: handleBarClick
|
|
285
293
|
}, progress && /*#__PURE__*/React.createElement(ProgressBar, {
|
|
286
294
|
rtl: rtl,
|
|
287
295
|
vertical: vertical,
|
package/esm/Slider/Slider.js
CHANGED
|
@@ -83,9 +83,9 @@ var Slider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
83
83
|
var classes = merge(className, withClassPrefix({
|
|
84
84
|
vertical: vertical,
|
|
85
85
|
disabled: disabled,
|
|
86
|
-
readOnly: readOnly,
|
|
87
86
|
graduated: graduated,
|
|
88
|
-
'with-mark': renderMark
|
|
87
|
+
'with-mark': renderMark,
|
|
88
|
+
readonly: readOnly
|
|
89
89
|
}));
|
|
90
90
|
var max = useMemo(function () {
|
|
91
91
|
return precisionMath(Math.floor((maxProp - min) / step) * step + min);
|
|
@@ -159,6 +159,10 @@ var Slider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
159
159
|
var nextValue = getValidValue(getValueByPosition(event));
|
|
160
160
|
onChangeCommitted === null || onChangeCommitted === void 0 ? void 0 : onChangeCommitted(nextValue, event);
|
|
161
161
|
}, [disabled, getValidValue, getValueByPosition, onChangeCommitted, readOnly]);
|
|
162
|
+
var handleClickBar = useCallback(function (event) {
|
|
163
|
+
handleChangeValue(event);
|
|
164
|
+
handleChangeCommitted(event);
|
|
165
|
+
}, [handleChangeCommitted, handleChangeValue]);
|
|
162
166
|
var handleKeyDown = useCallback(function (event) {
|
|
163
167
|
var nextValue;
|
|
164
168
|
var increaseKey = rtl ? 'ArrowLeft' : 'ArrowRight';
|
|
@@ -200,7 +204,7 @@ var Slider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
200
204
|
}), /*#__PURE__*/React.createElement("div", {
|
|
201
205
|
ref: barRef,
|
|
202
206
|
className: merge(barClassName, prefix('bar')),
|
|
203
|
-
onClick:
|
|
207
|
+
onClick: handleClickBar
|
|
204
208
|
}, progress && /*#__PURE__*/React.createElement(ProgressBar, {
|
|
205
209
|
rtl: rtl,
|
|
206
210
|
vertical: vertical,
|
package/esm/Table/Table.d.ts
CHANGED
|
@@ -6,10 +6,10 @@ export interface CellProps<Row extends RowDataType> extends Omit<TableCellProps<
|
|
|
6
6
|
/** Row Data */
|
|
7
7
|
rowData?: Row;
|
|
8
8
|
}
|
|
9
|
-
declare const _default: (<Row extends RowDataType<
|
|
10
|
-
Cell: <Row_1 extends RowDataType<
|
|
9
|
+
declare const _default: (<Row extends RowDataType<any>, Key extends RowKeyType>(props: TableProps<Row, Key> & React.RefAttributes<TableInstance<Row, Key>>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>) & {
|
|
10
|
+
Cell: <Row_1 extends RowDataType<any>, Key_1 extends RowKeyType>(props: import("rsuite-table/lib/Cell").InnerCellProps<Row_1, Key_1> & React.RefAttributes<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
11
11
|
Column: typeof Column;
|
|
12
|
-
HeaderCell: <Row_2 extends RowDataType<
|
|
12
|
+
HeaderCell: <Row_2 extends RowDataType<any>, Key_2 extends RowKeyType>(props: import("rsuite-table").HeaderCellProps<Row_2, Key_2> & React.RefAttributes<HTMLDivElement>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
13
13
|
ColumnGroup: React.ForwardRefExoticComponent<import("rsuite-table").ColumnGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
14
|
};
|
|
15
15
|
export default _default;
|
package/esm/Tag/Tag.js
CHANGED
|
@@ -5,7 +5,7 @@ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWith
|
|
|
5
5
|
var _templateObject, _templateObject2;
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
-
import { useClassNames } from '../utils';
|
|
8
|
+
import { useClassNames, useCustom } from '../utils';
|
|
9
9
|
import CloseButton from '../CloseButton';
|
|
10
10
|
var Tag = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
11
11
|
var _props$as = props.as,
|
|
@@ -28,6 +28,8 @@ var Tag = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
28
28
|
var classes = merge(className, withClassPrefix(size, color, {
|
|
29
29
|
closable: closable
|
|
30
30
|
}));
|
|
31
|
+
var _useCustom = useCustom(),
|
|
32
|
+
locale = _useCustom.locale;
|
|
31
33
|
return /*#__PURE__*/React.createElement(Component, _extends({}, rest, {
|
|
32
34
|
ref: ref,
|
|
33
35
|
className: classes
|
|
@@ -35,7 +37,11 @@ var Tag = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
35
37
|
className: prefix(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["text"])))
|
|
36
38
|
}, children), closable && /*#__PURE__*/React.createElement(CloseButton, {
|
|
37
39
|
className: prefix(_templateObject2 || (_templateObject2 = _taggedTemplateLiteralLoose(["icon-close"]))),
|
|
38
|
-
onClick: onClose
|
|
40
|
+
onClick: onClose,
|
|
41
|
+
tabIndex: -1,
|
|
42
|
+
locale: {
|
|
43
|
+
closeLabel: locale === null || locale === void 0 ? void 0 : locale.remove
|
|
44
|
+
}
|
|
39
45
|
}));
|
|
40
46
|
});
|
|
41
47
|
Tag.displayName = 'Tag';
|
package/esm/TagInput/index.d.ts
CHANGED
|
@@ -1,18 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { InputPickerProps } from '../InputPicker/InputPicker';
|
|
2
|
+
import { TagOnlyProps } from '../InputPicker/InputPickerContext';
|
|
3
3
|
import type { PickerComponent } from '../Picker/types';
|
|
4
|
-
|
|
5
|
-
export interface TagInputProps extends Omit<InputPickerProps<readonly string[]>, 'data'> {
|
|
6
|
-
/** Tag related props. */
|
|
7
|
-
tagProps?: TagProps;
|
|
8
|
-
/**
|
|
9
|
-
* Set the trigger for creating tags. only valid when creatable
|
|
10
|
-
*
|
|
11
|
-
* @todo Declare as readonly array
|
|
12
|
-
*/
|
|
13
|
-
trigger?: TriggerType | TriggerType[];
|
|
14
|
-
/** Callback fired when a tag is removed. */
|
|
15
|
-
onTagRemove?: (tag: string, event: React.MouseEvent) => void;
|
|
16
|
-
}
|
|
4
|
+
export declare type TagInputProps = Omit<InputPickerProps<readonly string[]>, 'data'> & Partial<TagOnlyProps>;
|
|
17
5
|
declare const TagInput: PickerComponent<TagInputProps>;
|
|
18
6
|
export default TagInput;
|
package/esm/TagInput/index.js
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
4
|
import React, { useMemo } from 'react';
|
|
5
|
-
import InputPicker
|
|
5
|
+
import InputPicker from '../InputPicker/InputPicker';
|
|
6
|
+
import InputPickerContext from '../InputPicker/InputPickerContext';
|
|
6
7
|
var TagInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
7
8
|
var _props$tagProps = props.tagProps,
|
|
8
9
|
tagProps = _props$tagProps === void 0 ? {} : _props$tagProps,
|
package/esm/TagPicker/index.d.ts
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { InputPickerProps
|
|
2
|
+
import { InputPickerProps } from '../InputPicker/InputPicker';
|
|
3
|
+
import { TagOnlyProps } from '../InputPicker/InputPickerContext';
|
|
3
4
|
import type { PickerComponent } from '../Picker/types';
|
|
4
|
-
import type {
|
|
5
|
-
export interface TagPickerProps extends InputPickerProps {
|
|
6
|
-
/** Tag related props. */
|
|
7
|
-
tagProps?: TagProps;
|
|
5
|
+
import type { CheckboxProps } from '../Checkbox';
|
|
6
|
+
export interface TagPickerProps extends InputPickerProps, Partial<TagOnlyProps> {
|
|
8
7
|
/**
|
|
9
|
-
*
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
onTagRemove?: (tag: string, event: React.MouseEvent) => void;
|
|
8
|
+
* Custom render checkbox on menu item
|
|
9
|
+
* @version 5.47.0
|
|
10
|
+
**/
|
|
11
|
+
renderMenuItemCheckbox?: (checkboxProps: CheckboxProps) => React.ReactNode;
|
|
14
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Multi-select by tag and support new options
|
|
15
|
+
* @see https://rsuitejs.com/components/tag-picker/
|
|
16
|
+
*/
|
|
15
17
|
declare const TagPicker: PickerComponent<TagPickerProps>;
|
|
16
18
|
export default TagPicker;
|