rsuite 5.13.1 → 5.14.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/Button/styles/index.less +1 -0
- package/CHANGELOG.md +25 -0
- package/Dropdown/styles/index.less +8 -3
- package/Grid/styles/index.less +42 -10
- package/Sidenav/styles/index.less +7 -9
- package/Table/styles/index.less +0 -2
- package/Tooltip/styles/index.less +4 -4
- package/cjs/@types/common.d.ts +6 -0
- package/cjs/Cascader/utils.d.ts +1 -1
- package/cjs/Col/Col.d.ts +25 -5
- package/cjs/Col/Col.js +9 -1
- package/cjs/CustomProvider/CustomProvider.d.ts +20 -7
- package/cjs/CustomProvider/CustomProvider.js +24 -3
- package/cjs/Dropdown/useRenderDropdownItem.d.ts +1 -1
- package/cjs/Form/Form.d.ts +8 -8
- package/cjs/Form/test/Form.test.d.ts +1 -0
- package/cjs/Form/test/Form.test.js +18 -0
- package/cjs/Modal/test/Modal.test.d.ts +1 -0
- package/cjs/Modal/test/Modal.test.js +14 -0
- package/cjs/Modal/utils.d.ts +1 -1
- package/cjs/Nav/NavDropdownMenu.d.ts +12 -1
- package/cjs/Nav/NavDropdownMenu.js +9 -3
- package/cjs/Nav/test/Nav.test.d.ts +1 -0
- package/cjs/Nav/test/Nav.test.js +17 -0
- package/cjs/Navbar/NavbarDropdownMenu.d.ts +12 -1
- package/cjs/Navbar/NavbarDropdownMenu.js +9 -3
- package/cjs/Overlay/Modal.d.ts +1 -4
- package/cjs/Overlay/Overlay.d.ts +3 -1
- package/cjs/Overlay/Overlay.js +6 -2
- package/cjs/Overlay/OverlayTrigger.d.ts +4 -0
- package/cjs/Overlay/OverlayTrigger.js +32 -4
- package/cjs/Overlay/Position.d.ts +3 -1
- package/cjs/Overlay/Position.js +12 -4
- package/cjs/Overlay/positionUtils.d.ts +11 -4
- package/cjs/Overlay/positionUtils.js +48 -2
- package/cjs/Panel/Panel.js +9 -6
- package/cjs/Picker/utils.d.ts +1 -1
- package/cjs/Popover/Popover.d.ts +2 -0
- package/cjs/Popover/Popover.js +6 -3
- package/cjs/Sidenav/SidenavDropdownToggle.js +2 -1
- package/cjs/Sidenav/SidenavItem.d.ts +4 -0
- package/cjs/Sidenav/SidenavItem.js +40 -31
- package/cjs/Toggle/Toggle.d.ts +1 -1
- package/cjs/Tooltip/Tooltip.d.ts +3 -1
- package/cjs/Tooltip/Tooltip.js +8 -3
- package/cjs/Whisper/Whisper.js +6 -1
- package/cjs/index.d.ts +2 -2
- package/cjs/index.js +3 -2
- package/cjs/toaster/ToastContainer.d.ts +1 -0
- package/cjs/toaster/ToastContainer.js +4 -1
- package/cjs/toaster/index.d.ts +1 -0
- package/cjs/toaster/index.js +4 -1
- package/cjs/toaster/toaster.d.ts +0 -1
- package/cjs/toaster/useToaster.d.ts +12 -0
- package/cjs/toaster/useToaster.js +43 -0
- package/cjs/utils/constants.d.ts +1 -0
- package/cjs/utils/constants.js +3 -1
- package/cjs/utils/stringToObject.d.ts +1 -1
- package/cjs/utils/tplTransform.d.ts +1 -1
- package/cjs/utils/treeUtils.d.ts +3 -3
- package/cjs/utils/useCustom.d.ts +1 -1
- package/cjs/utils/useCustom.js +5 -3
- package/cjs/utils/useFocus.d.ts +1 -1
- package/dist/rsuite-rtl.css +660 -47
- package/dist/rsuite-rtl.min.css +1 -1
- package/dist/rsuite-rtl.min.css.map +1 -1
- package/dist/rsuite.css +660 -47
- package/dist/rsuite.js +90 -101
- 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/@types/common.d.ts +6 -0
- package/esm/Cascader/utils.d.ts +1 -1
- package/esm/Col/Col.d.ts +25 -5
- package/esm/Col/Col.js +10 -2
- package/esm/CustomProvider/CustomProvider.d.ts +20 -7
- package/esm/CustomProvider/CustomProvider.js +22 -3
- package/esm/Dropdown/useRenderDropdownItem.d.ts +1 -1
- package/esm/Form/Form.d.ts +8 -8
- package/esm/Form/test/Form.test.d.ts +1 -0
- package/esm/Form/test/Form.test.js +11 -0
- package/esm/Modal/test/Modal.test.d.ts +1 -0
- package/esm/Modal/test/Modal.test.js +9 -0
- package/esm/Modal/utils.d.ts +1 -1
- package/esm/Nav/NavDropdownMenu.d.ts +12 -1
- package/esm/Nav/NavDropdownMenu.js +8 -3
- package/esm/Nav/test/Nav.test.d.ts +1 -0
- package/esm/Nav/test/Nav.test.js +11 -0
- package/esm/Navbar/NavbarDropdownMenu.d.ts +12 -1
- package/esm/Navbar/NavbarDropdownMenu.js +8 -3
- package/esm/Overlay/Modal.d.ts +1 -4
- package/esm/Overlay/Overlay.d.ts +3 -1
- package/esm/Overlay/Overlay.js +6 -2
- package/esm/Overlay/OverlayTrigger.d.ts +4 -0
- package/esm/Overlay/OverlayTrigger.js +33 -5
- package/esm/Overlay/Position.d.ts +3 -1
- package/esm/Overlay/Position.js +12 -4
- package/esm/Overlay/positionUtils.d.ts +11 -4
- package/esm/Overlay/positionUtils.js +46 -2
- package/esm/Panel/Panel.js +9 -6
- package/esm/Picker/utils.d.ts +1 -1
- package/esm/Popover/Popover.d.ts +2 -0
- package/esm/Popover/Popover.js +6 -3
- package/esm/Sidenav/SidenavDropdownToggle.js +2 -1
- package/esm/Sidenav/SidenavItem.d.ts +4 -0
- package/esm/Sidenav/SidenavItem.js +38 -31
- package/esm/Toggle/Toggle.d.ts +1 -1
- package/esm/Tooltip/Tooltip.d.ts +3 -1
- package/esm/Tooltip/Tooltip.js +8 -3
- package/esm/Whisper/Whisper.js +6 -1
- package/esm/index.d.ts +2 -2
- package/esm/index.js +1 -1
- package/esm/toaster/ToastContainer.d.ts +1 -0
- package/esm/toaster/ToastContainer.js +1 -0
- package/esm/toaster/index.d.ts +1 -0
- package/esm/toaster/index.js +1 -0
- package/esm/toaster/toaster.d.ts +0 -1
- package/esm/toaster/useToaster.d.ts +12 -0
- package/esm/toaster/useToaster.js +34 -0
- package/esm/utils/constants.d.ts +1 -0
- package/esm/utils/constants.js +1 -0
- package/esm/utils/stringToObject.d.ts +1 -1
- package/esm/utils/tplTransform.d.ts +1 -1
- package/esm/utils/treeUtils.d.ts +3 -3
- package/esm/utils/useCustom.d.ts +1 -1
- package/esm/utils/useCustom.js +5 -3
- package/esm/utils/useFocus.d.ts +1 -1
- package/package.json +1 -1
- package/styles/color-modes/light.less +2 -2
- package/styles/variables.less +30 -12
|
@@ -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;
|
package/esm/utils/constants.d.ts
CHANGED
package/esm/utils/constants.js
CHANGED
|
@@ -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
|
|
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;
|
package/esm/utils/treeUtils.d.ts
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
206
|
+
saveTreeNodeRef: (ref: React.Ref<any>, refKey?: string) => void;
|
|
207
207
|
};
|
|
208
208
|
interface TreeSearchProps {
|
|
209
209
|
labelKey: string;
|
package/esm/utils/useCustom.d.ts
CHANGED
|
@@ -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
|
|
6
|
+
declare function useCustom<T = any>(keys?: string | string[], overrideLocale?: any): CustomValue<T>;
|
|
7
7
|
export default useCustom;
|
package/esm/utils/useCustom.js
CHANGED
|
@@ -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
|
};
|
package/esm/utils/useFocus.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -120,8 +120,8 @@
|
|
|
120
120
|
|
|
121
121
|
// Dropdown
|
|
122
122
|
--rs-dropdown-divider: @B200;
|
|
123
|
-
--rs-dropdown-item-bg-hover: @
|
|
124
|
-
--rs-dropdown-item-bg-active:
|
|
123
|
+
--rs-dropdown-item-bg-hover: fade(@H100, 50%);
|
|
124
|
+
--rs-dropdown-item-bg-active: @H050;
|
|
125
125
|
--rs-dropdown-item-text-active: @H700;
|
|
126
126
|
--rs-dropdown-header-text: @B500;
|
|
127
127
|
--rs-dropdown-shadow: 0 0 10px rgba(0, 0, 0, 0.06), 0 4px 4px rgba(0, 0, 0, 0.12);
|
package/styles/variables.less
CHANGED
|
@@ -23,17 +23,25 @@
|
|
|
23
23
|
// Media queries breakpoints
|
|
24
24
|
// Define the breakpoints at which your layout will change, adapting to different screen sizes.
|
|
25
25
|
|
|
26
|
-
//
|
|
27
|
-
// @screen-
|
|
28
|
-
@screen-
|
|
26
|
+
// Small screen / phone
|
|
27
|
+
// @screen-sm
|
|
28
|
+
@screen-sm: 576px;
|
|
29
29
|
|
|
30
30
|
// Medium screen / desktop
|
|
31
31
|
// @screen-md
|
|
32
|
-
@screen-
|
|
32
|
+
@screen-md: 768px;
|
|
33
33
|
|
|
34
34
|
// Large screen / wide desktop
|
|
35
35
|
// @screen-lg
|
|
36
|
-
@screen-lg
|
|
36
|
+
@screen-lg: 992px;
|
|
37
|
+
|
|
38
|
+
// Extra large devices / extra wide desktop
|
|
39
|
+
// @screen-xl
|
|
40
|
+
@screen-xl: 1200px;
|
|
41
|
+
|
|
42
|
+
// Extra extra large devices / ultra wide desktop
|
|
43
|
+
// @screen-xxl
|
|
44
|
+
@screen-xxl: 1400px;
|
|
37
45
|
|
|
38
46
|
|
|
39
47
|
// Grid system
|
|
@@ -48,16 +56,24 @@
|
|
|
48
56
|
// Define the maximum width of `.container` for different screen sizes.
|
|
49
57
|
|
|
50
58
|
// Small screen / phone / tablet
|
|
51
|
-
@container-phone:
|
|
52
|
-
@container-sm:
|
|
59
|
+
@container-phone: (540px + @grid-gutter-width);
|
|
60
|
+
@container-sm: @container-phone;
|
|
53
61
|
|
|
54
62
|
// Medium screen / desktop
|
|
55
|
-
@container-desktop:
|
|
56
|
-
@container-md:
|
|
63
|
+
@container-desktop: (720px + @grid-gutter-width);
|
|
64
|
+
@container-md: @container-desktop;
|
|
57
65
|
|
|
58
66
|
// Large screen / wide desktop
|
|
59
|
-
@container-large-desktop:
|
|
60
|
-
@container-lg:
|
|
67
|
+
@container-large-desktop: (960px + @grid-gutter-width);
|
|
68
|
+
@container-lg: @container-large-desktop;
|
|
69
|
+
|
|
70
|
+
// Extra large devices / ultra wide desktop
|
|
71
|
+
@container-extra-large-desktop: (1140px + @grid-gutter-width);
|
|
72
|
+
@container-xl: @container-large-desktop;
|
|
73
|
+
|
|
74
|
+
// Extra large devices / ultra wide desktop
|
|
75
|
+
@container-extra-extra-large-desktop: (1320px + @grid-gutter-width);
|
|
76
|
+
@container-xxl: @container-large-desktop;
|
|
61
77
|
|
|
62
78
|
// Color system
|
|
63
79
|
|
|
@@ -199,7 +215,6 @@
|
|
|
199
215
|
@table-header-sort-wrapper-margin-left: 5px;
|
|
200
216
|
|
|
201
217
|
@table-column-resize-spanner-width: 3px;
|
|
202
|
-
@table-column-resize-spanner-gap-width: 3px;
|
|
203
218
|
@table-column-resize-spanner-triangle-side-length: 3px;
|
|
204
219
|
|
|
205
220
|
@table-body-content-padding-vertical: 13px; // @deprecated use @table-cell-padding-y instead
|
|
@@ -323,6 +338,9 @@
|
|
|
323
338
|
@dropdown-divider-bg: @divider-border-color;
|
|
324
339
|
@dropdown-shadow: 0 0 10px rgba(0, 0, 0, 0.06), 0 4px 4px rgba(0, 0, 0, 0.12);
|
|
325
340
|
|
|
341
|
+
@dropdown-menu-radius: @border-radius;
|
|
342
|
+
@dropdown-menu-padding-y: @dropdown-menu-radius;
|
|
343
|
+
|
|
326
344
|
@dropdown-item-padding-vertical: 8px; // @deprecated use @dropdown-item-padding-y instead
|
|
327
345
|
@dropdown-item-padding-horizontal: 12px; // @deprecated use @dropdown-item-padding-x instead
|
|
328
346
|
|