rsuite 5.13.0 → 5.15.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.
Files changed (149) hide show
  1. package/Button/styles/index.less +1 -0
  2. package/CHANGELOG.md +45 -0
  3. package/Dropdown/styles/index.less +8 -3
  4. package/Grid/styles/index.less +42 -10
  5. package/Sidenav/styles/index.less +45 -11
  6. package/Table/styles/index.less +0 -2
  7. package/Tooltip/styles/index.less +4 -4
  8. package/cjs/@types/common.d.ts +6 -0
  9. package/cjs/Cascader/utils.d.ts +1 -1
  10. package/cjs/Col/Col.d.ts +25 -5
  11. package/cjs/Col/Col.js +9 -1
  12. package/cjs/CustomProvider/CustomProvider.d.ts +20 -7
  13. package/cjs/CustomProvider/CustomProvider.js +24 -3
  14. package/cjs/Dropdown/useRenderDropdownItem.d.ts +1 -1
  15. package/cjs/Form/Form.d.ts +8 -8
  16. package/cjs/Form/test/Form.test.d.ts +1 -0
  17. package/cjs/Form/test/Form.test.js +18 -0
  18. package/cjs/Modal/test/Modal.test.d.ts +1 -0
  19. package/cjs/Modal/test/Modal.test.js +14 -0
  20. package/cjs/Modal/utils.d.ts +1 -1
  21. package/cjs/Nav/NavDropdownMenu.d.ts +12 -1
  22. package/cjs/Nav/NavDropdownMenu.js +9 -3
  23. package/cjs/Nav/test/Nav.test.d.ts +1 -0
  24. package/cjs/Nav/test/Nav.test.js +17 -0
  25. package/cjs/Navbar/NavbarDropdownMenu.d.ts +12 -1
  26. package/cjs/Navbar/NavbarDropdownMenu.js +9 -3
  27. package/cjs/Overlay/Modal.d.ts +1 -4
  28. package/cjs/Overlay/Overlay.d.ts +3 -1
  29. package/cjs/Overlay/Overlay.js +6 -2
  30. package/cjs/Overlay/OverlayTrigger.d.ts +8 -4
  31. package/cjs/Overlay/OverlayTrigger.js +32 -4
  32. package/cjs/Overlay/Position.d.ts +3 -1
  33. package/cjs/Overlay/Position.js +12 -4
  34. package/cjs/Overlay/positionUtils.d.ts +11 -4
  35. package/cjs/Overlay/positionUtils.js +48 -2
  36. package/cjs/Panel/Panel.js +9 -6
  37. package/cjs/Picker/utils.d.ts +1 -1
  38. package/cjs/Popover/Popover.d.ts +2 -0
  39. package/cjs/Popover/Popover.js +6 -3
  40. package/cjs/Sidenav/SidenavDropdownToggle.js +2 -1
  41. package/cjs/Sidenav/SidenavItem.d.ts +4 -0
  42. package/cjs/Sidenav/SidenavItem.js +40 -31
  43. package/cjs/Sidenav/SidenavToggle.d.ts +5 -1
  44. package/cjs/Sidenav/SidenavToggle.js +25 -9
  45. package/cjs/Toggle/Toggle.d.ts +1 -1
  46. package/cjs/Tooltip/Tooltip.d.ts +3 -1
  47. package/cjs/Tooltip/Tooltip.js +8 -3
  48. package/cjs/Whisper/Whisper.d.ts +3 -5
  49. package/cjs/Whisper/Whisper.js +6 -1
  50. package/cjs/Whisper/test/Whisper.test.d.ts +1 -0
  51. package/cjs/Whisper/test/Whisper.test.js +23 -0
  52. package/cjs/index.d.ts +3 -3
  53. package/cjs/index.js +3 -2
  54. package/cjs/toaster/ToastContainer.d.ts +1 -0
  55. package/cjs/toaster/ToastContainer.js +4 -1
  56. package/cjs/toaster/index.d.ts +1 -0
  57. package/cjs/toaster/index.js +4 -1
  58. package/cjs/toaster/toaster.d.ts +0 -1
  59. package/cjs/toaster/useToaster.d.ts +12 -0
  60. package/cjs/toaster/useToaster.js +43 -0
  61. package/cjs/utils/constants.d.ts +1 -0
  62. package/cjs/utils/constants.js +3 -1
  63. package/cjs/utils/stringToObject.d.ts +1 -1
  64. package/cjs/utils/tplTransform.d.ts +1 -1
  65. package/cjs/utils/treeUtils.d.ts +3 -3
  66. package/cjs/utils/treeUtils.js +8 -10
  67. package/cjs/utils/useCustom.d.ts +1 -1
  68. package/cjs/utils/useCustom.js +5 -3
  69. package/cjs/utils/useFocus.d.ts +1 -1
  70. package/dist/rsuite-rtl.css +741 -71
  71. package/dist/rsuite-rtl.min.css +1 -1
  72. package/dist/rsuite-rtl.min.css.map +1 -1
  73. package/dist/rsuite.css +741 -71
  74. package/dist/rsuite.js +92 -103
  75. package/dist/rsuite.js.map +1 -1
  76. package/dist/rsuite.min.css +1 -1
  77. package/dist/rsuite.min.css.map +1 -1
  78. package/dist/rsuite.min.js +1 -1
  79. package/dist/rsuite.min.js.map +1 -1
  80. package/esm/@types/common.d.ts +6 -0
  81. package/esm/Cascader/utils.d.ts +1 -1
  82. package/esm/Col/Col.d.ts +25 -5
  83. package/esm/Col/Col.js +10 -2
  84. package/esm/CustomProvider/CustomProvider.d.ts +20 -7
  85. package/esm/CustomProvider/CustomProvider.js +22 -3
  86. package/esm/Dropdown/useRenderDropdownItem.d.ts +1 -1
  87. package/esm/Form/Form.d.ts +8 -8
  88. package/esm/Form/test/Form.test.d.ts +1 -0
  89. package/esm/Form/test/Form.test.js +11 -0
  90. package/esm/Modal/test/Modal.test.d.ts +1 -0
  91. package/esm/Modal/test/Modal.test.js +9 -0
  92. package/esm/Modal/utils.d.ts +1 -1
  93. package/esm/Nav/NavDropdownMenu.d.ts +12 -1
  94. package/esm/Nav/NavDropdownMenu.js +8 -3
  95. package/esm/Nav/test/Nav.test.d.ts +1 -0
  96. package/esm/Nav/test/Nav.test.js +11 -0
  97. package/esm/Navbar/NavbarDropdownMenu.d.ts +12 -1
  98. package/esm/Navbar/NavbarDropdownMenu.js +8 -3
  99. package/esm/Overlay/Modal.d.ts +1 -4
  100. package/esm/Overlay/Overlay.d.ts +3 -1
  101. package/esm/Overlay/Overlay.js +6 -2
  102. package/esm/Overlay/OverlayTrigger.d.ts +8 -4
  103. package/esm/Overlay/OverlayTrigger.js +33 -5
  104. package/esm/Overlay/Position.d.ts +3 -1
  105. package/esm/Overlay/Position.js +12 -4
  106. package/esm/Overlay/positionUtils.d.ts +11 -4
  107. package/esm/Overlay/positionUtils.js +46 -2
  108. package/esm/Panel/Panel.js +9 -6
  109. package/esm/Picker/utils.d.ts +1 -1
  110. package/esm/Popover/Popover.d.ts +2 -0
  111. package/esm/Popover/Popover.js +6 -3
  112. package/esm/Sidenav/SidenavDropdownToggle.js +2 -1
  113. package/esm/Sidenav/SidenavItem.d.ts +4 -0
  114. package/esm/Sidenav/SidenavItem.js +38 -31
  115. package/esm/Sidenav/SidenavToggle.d.ts +5 -1
  116. package/esm/Sidenav/SidenavToggle.js +22 -9
  117. package/esm/Toggle/Toggle.d.ts +1 -1
  118. package/esm/Tooltip/Tooltip.d.ts +3 -1
  119. package/esm/Tooltip/Tooltip.js +8 -3
  120. package/esm/Whisper/Whisper.d.ts +3 -5
  121. package/esm/Whisper/Whisper.js +6 -1
  122. package/esm/Whisper/test/Whisper.test.d.ts +1 -0
  123. package/esm/Whisper/test/Whisper.test.js +16 -0
  124. package/esm/index.d.ts +3 -3
  125. package/esm/index.js +1 -1
  126. package/esm/toaster/ToastContainer.d.ts +1 -0
  127. package/esm/toaster/ToastContainer.js +1 -0
  128. package/esm/toaster/index.d.ts +1 -0
  129. package/esm/toaster/index.js +1 -0
  130. package/esm/toaster/toaster.d.ts +0 -1
  131. package/esm/toaster/useToaster.d.ts +12 -0
  132. package/esm/toaster/useToaster.js +34 -0
  133. package/esm/utils/constants.d.ts +1 -0
  134. package/esm/utils/constants.js +1 -0
  135. package/esm/utils/stringToObject.d.ts +1 -1
  136. package/esm/utils/tplTransform.d.ts +1 -1
  137. package/esm/utils/treeUtils.d.ts +3 -3
  138. package/esm/utils/treeUtils.js +8 -10
  139. package/esm/utils/useCustom.d.ts +1 -1
  140. package/esm/utils/useCustom.js +5 -3
  141. package/esm/utils/useFocus.d.ts +1 -1
  142. package/package.json +1 -1
  143. package/styles/color-modes/dark.less +223 -181
  144. package/styles/color-modes/high-contrast.less +221 -179
  145. package/styles/color-modes/light.less +47 -5
  146. package/styles/colors/dark.less +91 -91
  147. package/styles/colors/high-contrast.less +91 -91
  148. package/styles/variables.less +35 -12
  149. package/styles/color-modes/common.less +0 -44
@@ -36,6 +36,11 @@ Whisper.propTypes = {
36
36
  /**
37
37
  * Prevent floating element overflow
38
38
  */
39
- preventOverflow: PropTypes.bool
39
+ preventOverflow: PropTypes.bool,
40
+
41
+ /**
42
+ * Whether enable speaker follow cursor
43
+ */
44
+ followCursor: PropTypes.bool
40
45
  };
41
46
  export default Whisper;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ var _whisperRef$current, _whisperRef$current2, _whisperRef$current3, _whisperRef$current4, _whisperRef$current5;
2
+
3
+ import React from 'react';
4
+ import Whisper from '../Whisper';
5
+ var whisperRef = /*#__PURE__*/React.createRef();
6
+
7
+ /*#__PURE__*/
8
+ React.createElement(Whisper, {
9
+ ref: whisperRef,
10
+ speaker: /*#__PURE__*/React.createElement("div", null)
11
+ }, /*#__PURE__*/React.createElement("div", null));
12
+ (_whisperRef$current = whisperRef.current) === null || _whisperRef$current === void 0 ? void 0 : _whisperRef$current.open();
13
+ (_whisperRef$current2 = whisperRef.current) === null || _whisperRef$current2 === void 0 ? void 0 : _whisperRef$current2.open(300);
14
+ (_whisperRef$current3 = whisperRef.current) === null || _whisperRef$current3 === void 0 ? void 0 : _whisperRef$current3.close();
15
+ (_whisperRef$current4 = whisperRef.current) === null || _whisperRef$current4 === void 0 ? void 0 : _whisperRef$current4.close(300);
16
+ (_whisperRef$current5 = whisperRef.current) === null || _whisperRef$current5 === void 0 ? void 0 : _whisperRef$current5.updatePosition();
package/esm/index.d.ts CHANGED
@@ -7,7 +7,7 @@ export type { ButtonToolbarProps } from './ButtonToolbar';
7
7
  export { default as ButtonGroup } from './ButtonGroup';
8
8
  export type { ButtonGroupProps } from './ButtonGroup';
9
9
  export { default as Whisper } from './Whisper';
10
- export type { WhisperProps } from './Whisper';
10
+ export type { WhisperProps, WhisperInstance } from './Whisper';
11
11
  export { default as Tooltip } from './Tooltip';
12
12
  export type { TooltipProps } from './Tooltip';
13
13
  export { default as Popover } from './Popover';
@@ -32,7 +32,7 @@ export { default as Avatar } from './Avatar';
32
32
  export type { AvatarProps } from './Avatar';
33
33
  export { default as AvatarGroup } from './AvatarGroup';
34
34
  export type { AvatarGroupProps } from './AvatarGroup';
35
- export { default as toaster } from './toaster';
35
+ export { default as toaster, useToaster } from './toaster';
36
36
  export type { Toaster } from './toaster';
37
37
  export { default as Dropdown } from './Dropdown';
38
38
  export type { DropdownProps, DropdownMenuItemProps, DropdownMenuProps } from './Dropdown';
@@ -51,7 +51,7 @@ export type { StepsProps, StepItemProps } from './Steps';
51
51
  export { default as Toggle } from './Toggle';
52
52
  export type { ToggleProps } from './Toggle';
53
53
  export { default as Form, useFormClassNames } from './Form';
54
- export type { FormProps, FormGroupProps, FormErrorMessageProps, FormControlLabelProps, FormHelpTextProps, FormControlProps } from './Form';
54
+ export type { FormProps, FormInstance, FormGroupProps, FormErrorMessageProps, FormControlLabelProps, FormHelpTextProps, FormControlProps } from './Form';
55
55
  export { default as Input } from './Input';
56
56
  export type { InputProps } from './Input';
57
57
  export { default as MaskedInput } from './MaskedInput';
package/esm/index.js CHANGED
@@ -16,7 +16,7 @@ export { default as Placeholder } from './Placeholder';
16
16
  export { default as Badge } from './Badge';
17
17
  export { default as Avatar } from './Avatar';
18
18
  export { default as AvatarGroup } from './AvatarGroup';
19
- export { default as toaster } from './toaster';
19
+ export { default as toaster, useToaster } from './toaster';
20
20
  // Nav
21
21
  export { default as Dropdown } from './Dropdown';
22
22
  export { default as Nav } from './Nav';
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { WithAsProps, RsRefForwardingComponent } from '../@types/common';
3
3
  export declare type PlacementType = 'topCenter' | 'bottomCenter' | 'topStart' | 'topEnd' | 'bottomStart' | 'bottomEnd';
4
+ export declare const toastPlacements: PlacementType[];
4
5
  export interface ToastContainerProps extends WithAsProps {
5
6
  /** The placement of the message box */
6
7
  placement?: PlacementType;
@@ -6,6 +6,7 @@ import PropTypes from 'prop-types';
6
6
  import kebabCase from 'lodash/kebabCase';
7
7
  import Transition from '../Animation/Transition';
8
8
  import { useClassNames, guid, createChainedFunction } from '../utils';
9
+ export var toastPlacements = ['topCenter', 'bottomCenter', 'topStart', 'topEnd', 'bottomStart', 'bottomEnd'];
9
10
 
10
11
  var useMessages = function useMessages() {
11
12
  var _useState = useState([]),
@@ -1,3 +1,4 @@
1
1
  import toaster from './toaster';
2
2
  export type { Toaster } from './toaster';
3
+ export { default as useToaster } from './useToaster';
3
4
  export default toaster;
@@ -1,2 +1,3 @@
1
1
  import toaster from './toaster';
2
+ export { default as useToaster } from './useToaster';
2
3
  export default toaster;
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import { ToastContainerProps } from './ToastContainer';
3
- export declare type PlacementType = 'topStart' | 'topEnd' | 'bottomStart' | 'bottomEnd';
4
3
  export interface Toaster {
5
4
  /**
6
5
  * Add a message to the container.
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { ToastContainerProps } from './ToastContainer';
3
+ /**
4
+ * Hook to use the toaster
5
+ * @returns toaster { push, remove, clear }
6
+ */
7
+ declare const useToaster: () => {
8
+ push: (message: React.ReactNode, options?: ToastContainerProps) => string | undefined;
9
+ remove: (key: string) => void;
10
+ clear: () => void;
11
+ };
12
+ export default useToaster;
@@ -0,0 +1,34 @@
1
+ import toaster from './toaster';
2
+ import { useCustom } from '../utils';
3
+ /**
4
+ * Hook to use the toaster
5
+ * @returns toaster { push, remove, clear }
6
+ */
7
+
8
+ var useToaster = function useToaster() {
9
+ var _useCustom = useCustom(),
10
+ toasters = _useCustom.toasters;
11
+
12
+ return {
13
+ push: function push(message, options) {
14
+ var _toasters$current;
15
+
16
+ var customToaster = toasters === null || toasters === void 0 ? void 0 : (_toasters$current = toasters.current) === null || _toasters$current === void 0 ? void 0 : _toasters$current.get((options === null || options === void 0 ? void 0 : options.placement) || 'topCenter');
17
+ return customToaster ? customToaster.push(message) : toaster.push(message, options);
18
+ },
19
+ remove: function remove(key) {
20
+ toasters ? Array.from(toasters.current).forEach(function (_ref) {
21
+ var c = _ref[1];
22
+ return c === null || c === void 0 ? void 0 : c.remove(key);
23
+ }) : toaster.remove(key);
24
+ },
25
+ clear: function clear() {
26
+ toasters ? Array.from(toasters.current).forEach(function (_ref2) {
27
+ var c = _ref2[1];
28
+ return c === null || c === void 0 ? void 0 : c.clear();
29
+ }) : toaster.clear();
30
+ }
31
+ };
32
+ };
33
+
34
+ export default useToaster;
@@ -1,4 +1,5 @@
1
1
  export declare const SIZE: string[];
2
+ export declare const COLUMN_SIZE: string[];
2
3
  export declare const STATUS: string[];
3
4
  export declare const COLOR: string[];
4
5
  export declare const PLACEMENT_4: readonly ["top", "bottom", "right", "left"];
@@ -1,4 +1,5 @@
1
1
  export var SIZE = ['lg', 'md', 'sm', 'xs'];
2
+ export var COLUMN_SIZE = ['xxl', 'xl', 'lg', 'md', 'sm', 'xs'];
2
3
  export var STATUS = ['success', 'warning', 'error', 'info'];
3
4
  export var COLOR = ['red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'violet'];
4
5
  export var PLACEMENT_4 = ['top', 'bottom', 'right', 'left'];
@@ -1,2 +1,2 @@
1
- declare const _default: (value: any, labelKey?: string | undefined, valueKey?: string | undefined) => object | null;
1
+ declare const _default: (value: any, labelKey?: string, valueKey?: string) => object | null;
2
2
  export default _default;
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- declare const _default: (pattern: string, ...data: any[]) => React.ReactNode;
3
2
  /**
4
3
  * tplTransform('Show {0} data', <i>100</i>);
5
4
  * output:
6
5
  * Show <span><i>100</i></span> data
7
6
  */
7
+ declare const _default: (pattern: string, ...data: any[]) => React.ReactNode;
8
8
  export default _default;
@@ -70,7 +70,7 @@ export declare function filterNodesOfTree(data: any, check: any): TreeNodeType[]
70
70
  * @param isSearching - component is in Searching
71
71
  * @returns
72
72
  */
73
- export declare const getFocusableItems: (filteredData: ItemDataType[], props: Required<Pick<PartialTreeProps, 'disabledItemValues' | 'valueKey' | 'childrenKey' | 'expandItemValues'>>, isSearching?: boolean | undefined) => TreeNodeType[];
73
+ export declare const getFocusableItems: (filteredData: ItemDataType[], props: Required<Pick<PartialTreeProps, 'disabledItemValues' | 'valueKey' | 'childrenKey' | 'expandItemValues'>>, isSearching?: boolean) => TreeNodeType[];
74
74
  /**
75
75
  * return all focusable Item and active Element index
76
76
  * @param focusItemValue
@@ -190,7 +190,7 @@ interface UnSerializeListProps {
190
190
  export declare function useFlattenTreeData({ data, labelKey, valueKey, childrenKey, uncheckableItemValues, callback }: FlattenTreeDataProps): {
191
191
  forceUpdate: () => void;
192
192
  flattenNodes: TreeNodesType;
193
- flattenTreeData: (treeData: TreeNodeType[], ref: string, parent?: TreeNodeType | undefined, layer?: any) => never[] | undefined;
193
+ flattenTreeData: (treeData: TreeNodeType[], ref: string, parent?: TreeNodeType, layer?: any) => never[] | undefined;
194
194
  serializeListOnlyParent: (nodes: TreeNodesType, key: string) => (string | number)[];
195
195
  unSerializeList: ({ nodes, key, value, cascade, uncheckableItemValues }: UnSerializeListProps) => void;
196
196
  formatVirtualizedTreeData: (nodes: TreeNodesType, data: any[], expandItemValues: ItemDataType[], options: {
@@ -203,7 +203,7 @@ export declare function useFlattenTreeData({ data, labelKey, valueKey, childrenK
203
203
  */
204
204
  export declare function useTreeNodeRefs(): {
205
205
  treeNodesRefs: {};
206
- saveTreeNodeRef: (ref: React.Ref<any>, refKey?: string | undefined) => void;
206
+ saveTreeNodeRef: (ref: React.Ref<any>, refKey?: string) => void;
207
207
  };
208
208
  interface TreeSearchProps {
209
209
  labelKey: string;
@@ -686,11 +686,7 @@ export function useFlattenTreeData(_ref8) {
686
686
  var forceUpdate = useCallback(function () {
687
687
  dispatch(Object.create(null));
688
688
  }, [dispatch]);
689
-
690
- var _useRef = useRef({}),
691
- _useRef$current = _useRef.current,
692
- flattenNodes = _useRef$current === void 0 ? {} : _useRef$current;
693
-
689
+ var flattenNodes = useRef({});
694
690
  var flattenTreeData = useCallback(function (treeData, ref, parent, layer) {
695
691
  if (layer === void 0) {
696
692
  layer = 1;
@@ -705,20 +701,20 @@ export function useFlattenTreeData(_ref8) {
705
701
 
706
702
  var refKey = ref + "-" + index;
707
703
  node.refKey = refKey;
708
- flattenNodes[refKey] = _extends((_extends2 = {
704
+ flattenNodes.current[refKey] = _extends((_extends2 = {
709
705
  layer: layer
710
706
  }, _extends2[labelKey] = node[labelKey], _extends2[valueKey] = node[valueKey], _extends2.uncheckable = uncheckableItemValues.some(function (value) {
711
707
  return shallowEqual(node[valueKey], value);
712
708
  }), _extends2), node);
713
709
 
714
710
  if (parent) {
715
- flattenNodes[refKey].parent = _omit(parent, 'parent', 'children');
711
+ flattenNodes.current[refKey].parent = _omit(parent, 'parent', 'children');
716
712
  }
717
713
 
718
714
  flattenTreeData(node[childrenKey], refKey, node, layer + 1);
719
715
  });
720
- callback === null || callback === void 0 ? void 0 : callback(flattenNodes);
721
- }, [childrenKey, valueKey, labelKey, callback, uncheckableItemValues, flattenNodes]);
716
+ callback === null || callback === void 0 ? void 0 : callback(flattenNodes.current);
717
+ }, [childrenKey, valueKey, labelKey, callback, uncheckableItemValues]);
722
718
  var serializeListOnlyParent = useCallback(function (nodes, key) {
723
719
  var list = [];
724
720
  Object.keys(nodes).forEach(function (refKey) {
@@ -819,12 +815,14 @@ export function useFlattenTreeData(_ref8) {
819
815
  };
820
816
 
821
817
  useEffect(function () {
818
+ // when data is changed, should clear the flattenNodes, avoid duplicate keys
819
+ flattenNodes.current = {};
822
820
  flattenTreeData(data, '0');
823
821
  }, [data]); // eslint-disable-line react-hooks/exhaustive-deps
824
822
 
825
823
  return {
826
824
  forceUpdate: forceUpdate,
827
- flattenNodes: flattenNodes,
825
+ flattenNodes: flattenNodes.current,
828
826
  flattenTreeData: flattenTreeData,
829
827
  serializeListOnlyParent: serializeListOnlyParent,
830
828
  unSerializeList: unSerializeList,
@@ -3,5 +3,5 @@ import { CustomValue } from '../CustomProvider/CustomProvider';
3
3
  * A hook to get custom configuration of `<CustomProvider>`
4
4
  * @param keys
5
5
  */
6
- declare function useCustom<T = any>(keys: string | string[], overrideLocale?: any): CustomValue<T>;
6
+ declare function useCustom<T = any>(keys?: string | string[], overrideLocale?: any): CustomValue<T>;
7
7
  export default useCustom;
@@ -29,11 +29,12 @@ function useCustom(keys, overrideLocale) {
29
29
  _useContext$rtl = _useContext.rtl,
30
30
  rtl = _useContext$rtl === void 0 ? getDefaultRTL() : _useContext$rtl,
31
31
  formatDate = _useContext.formatDate,
32
- parseDate = _useContext.parseDate;
32
+ parseDate = _useContext.parseDate,
33
+ toasters = _useContext.toasters;
33
34
 
34
- var componentLocale = _extends({}, locale === null || locale === void 0 ? void 0 : locale.common, typeof keys === 'string' ? locale === null || locale === void 0 ? void 0 : locale[keys] : mergeObject(keys.map(function (key) {
35
+ var componentLocale = _extends({}, locale === null || locale === void 0 ? void 0 : locale.common, typeof keys === 'string' ? locale === null || locale === void 0 ? void 0 : locale[keys] : typeof keys === 'object' ? mergeObject(keys.map(function (key) {
35
36
  return locale === null || locale === void 0 ? void 0 : locale[key];
36
- }))); // Component custom locale
37
+ })) : {}); // Component custom locale
37
38
 
38
39
 
39
40
  if (overrideLocale) {
@@ -57,6 +58,7 @@ function useCustom(keys, overrideLocale) {
57
58
  return {
58
59
  locale: componentLocale,
59
60
  rtl: rtl,
61
+ toasters: toasters,
60
62
  formatDate: formatDate || defaultFormatDate,
61
63
  parseDate: parseDate || defaultParseDate
62
64
  };
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  export default function useFocus<E extends HTMLElement>(elementRef: React.RefObject<E>): {
3
3
  grab: () => void;
4
- release: (options?: FocusOptions | undefined) => void;
4
+ release: (options?: FocusOptions) => void;
5
5
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rsuite",
3
- "version": "5.13.0",
3
+ "version": "5.15.0",
4
4
  "description": "A suite of react components",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",