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.
Files changed (132) hide show
  1. package/Button/styles/index.less +1 -0
  2. package/CHANGELOG.md +25 -0
  3. package/Dropdown/styles/index.less +8 -3
  4. package/Grid/styles/index.less +42 -10
  5. package/Sidenav/styles/index.less +7 -9
  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 +4 -0
  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/Toggle/Toggle.d.ts +1 -1
  44. package/cjs/Tooltip/Tooltip.d.ts +3 -1
  45. package/cjs/Tooltip/Tooltip.js +8 -3
  46. package/cjs/Whisper/Whisper.js +6 -1
  47. package/cjs/index.d.ts +2 -2
  48. package/cjs/index.js +3 -2
  49. package/cjs/toaster/ToastContainer.d.ts +1 -0
  50. package/cjs/toaster/ToastContainer.js +4 -1
  51. package/cjs/toaster/index.d.ts +1 -0
  52. package/cjs/toaster/index.js +4 -1
  53. package/cjs/toaster/toaster.d.ts +0 -1
  54. package/cjs/toaster/useToaster.d.ts +12 -0
  55. package/cjs/toaster/useToaster.js +43 -0
  56. package/cjs/utils/constants.d.ts +1 -0
  57. package/cjs/utils/constants.js +3 -1
  58. package/cjs/utils/stringToObject.d.ts +1 -1
  59. package/cjs/utils/tplTransform.d.ts +1 -1
  60. package/cjs/utils/treeUtils.d.ts +3 -3
  61. package/cjs/utils/useCustom.d.ts +1 -1
  62. package/cjs/utils/useCustom.js +5 -3
  63. package/cjs/utils/useFocus.d.ts +1 -1
  64. package/dist/rsuite-rtl.css +660 -47
  65. package/dist/rsuite-rtl.min.css +1 -1
  66. package/dist/rsuite-rtl.min.css.map +1 -1
  67. package/dist/rsuite.css +660 -47
  68. package/dist/rsuite.js +90 -101
  69. package/dist/rsuite.js.map +1 -1
  70. package/dist/rsuite.min.css +1 -1
  71. package/dist/rsuite.min.css.map +1 -1
  72. package/dist/rsuite.min.js +1 -1
  73. package/dist/rsuite.min.js.map +1 -1
  74. package/esm/@types/common.d.ts +6 -0
  75. package/esm/Cascader/utils.d.ts +1 -1
  76. package/esm/Col/Col.d.ts +25 -5
  77. package/esm/Col/Col.js +10 -2
  78. package/esm/CustomProvider/CustomProvider.d.ts +20 -7
  79. package/esm/CustomProvider/CustomProvider.js +22 -3
  80. package/esm/Dropdown/useRenderDropdownItem.d.ts +1 -1
  81. package/esm/Form/Form.d.ts +8 -8
  82. package/esm/Form/test/Form.test.d.ts +1 -0
  83. package/esm/Form/test/Form.test.js +11 -0
  84. package/esm/Modal/test/Modal.test.d.ts +1 -0
  85. package/esm/Modal/test/Modal.test.js +9 -0
  86. package/esm/Modal/utils.d.ts +1 -1
  87. package/esm/Nav/NavDropdownMenu.d.ts +12 -1
  88. package/esm/Nav/NavDropdownMenu.js +8 -3
  89. package/esm/Nav/test/Nav.test.d.ts +1 -0
  90. package/esm/Nav/test/Nav.test.js +11 -0
  91. package/esm/Navbar/NavbarDropdownMenu.d.ts +12 -1
  92. package/esm/Navbar/NavbarDropdownMenu.js +8 -3
  93. package/esm/Overlay/Modal.d.ts +1 -4
  94. package/esm/Overlay/Overlay.d.ts +3 -1
  95. package/esm/Overlay/Overlay.js +6 -2
  96. package/esm/Overlay/OverlayTrigger.d.ts +4 -0
  97. package/esm/Overlay/OverlayTrigger.js +33 -5
  98. package/esm/Overlay/Position.d.ts +3 -1
  99. package/esm/Overlay/Position.js +12 -4
  100. package/esm/Overlay/positionUtils.d.ts +11 -4
  101. package/esm/Overlay/positionUtils.js +46 -2
  102. package/esm/Panel/Panel.js +9 -6
  103. package/esm/Picker/utils.d.ts +1 -1
  104. package/esm/Popover/Popover.d.ts +2 -0
  105. package/esm/Popover/Popover.js +6 -3
  106. package/esm/Sidenav/SidenavDropdownToggle.js +2 -1
  107. package/esm/Sidenav/SidenavItem.d.ts +4 -0
  108. package/esm/Sidenav/SidenavItem.js +38 -31
  109. package/esm/Toggle/Toggle.d.ts +1 -1
  110. package/esm/Tooltip/Tooltip.d.ts +3 -1
  111. package/esm/Tooltip/Tooltip.js +8 -3
  112. package/esm/Whisper/Whisper.js +6 -1
  113. package/esm/index.d.ts +2 -2
  114. package/esm/index.js +1 -1
  115. package/esm/toaster/ToastContainer.d.ts +1 -0
  116. package/esm/toaster/ToastContainer.js +1 -0
  117. package/esm/toaster/index.d.ts +1 -0
  118. package/esm/toaster/index.js +1 -0
  119. package/esm/toaster/toaster.d.ts +0 -1
  120. package/esm/toaster/useToaster.d.ts +12 -0
  121. package/esm/toaster/useToaster.js +34 -0
  122. package/esm/utils/constants.d.ts +1 -0
  123. package/esm/utils/constants.js +1 -0
  124. package/esm/utils/stringToObject.d.ts +1 -1
  125. package/esm/utils/tplTransform.d.ts +1 -1
  126. package/esm/utils/treeUtils.d.ts +3 -3
  127. package/esm/utils/useCustom.d.ts +1 -1
  128. package/esm/utils/useCustom.js +5 -3
  129. package/esm/utils/useFocus.d.ts +1 -1
  130. package/package.json +1 -1
  131. package/styles/color-modes/light.less +2 -2
  132. package/styles/variables.less +30 -12
@@ -35,6 +35,7 @@
35
35
  .button-activated({
36
36
  color: var(--rs-btn-default-hover-text);
37
37
  background-color: var(--rs-btn-default-hover-bg);
38
+ text-decoration: none;
38
39
  });
39
40
 
40
41
  .button-pressed({
package/CHANGELOG.md CHANGED
@@ -1,3 +1,28 @@
1
+ # [5.14.0](https://github.com/rsuite/rsuite/compare/v5.13.1...v5.14.0) (2022-06-02)
2
+
3
+ ### Bug Fixes
4
+
5
+ - **Button:** remove underline when hovered ([#2516](https://github.com/rsuite/rsuite/issues/2516)) ([8bbb10d](https://github.com/rsuite/rsuite/commit/8bbb10db425dadd4110db60b8b7066d8f97bab54))
6
+ - **Dropdown:** fix vertical alignment of submenus ([#2524](https://github.com/rsuite/rsuite/issues/2524)) ([7c0ef52](https://github.com/rsuite/rsuite/commit/7c0ef52e9c7f57abfd97814725f5b3b82cc5dd70))
7
+ - **Form:** make FormInstance methods non-nullable ([#2521](https://github.com/rsuite/rsuite/issues/2521)) ([225af8a](https://github.com/rsuite/rsuite/commit/225af8a9abdffaf76101f28e3690b7ede6a16139))
8
+ - **Modal:** expose missing props ([#2522](https://github.com/rsuite/rsuite/issues/2522)) ([2ed7040](https://github.com/rsuite/rsuite/commit/2ed704002d03cec1478de879b08c0d3e7fd2dcf1))
9
+ - **Panel:** fix accordion not collapsible expanded panel ([#2514](https://github.com/rsuite/rsuite/issues/2514)) ([10c80f2](https://github.com/rsuite/rsuite/commit/10c80f26622e2f5b8c2e81731b66e2276d5622c4))
10
+ - **Sidenav:** display tooltip when hovering collapsed Sidenav item ([#2504](https://github.com/rsuite/rsuite/issues/2504)) ([d1238eb](https://github.com/rsuite/rsuite/commit/d1238ebb22e2458a780846903e042de72c1d8143))
11
+ - **Sidenav:** remove subtle item bg when focused by mouse ([#2511](https://github.com/rsuite/rsuite/issues/2511)) ([819461c](https://github.com/rsuite/rsuite/commit/819461c918e809fa397fe3dc6146510a9ffb1bd2))
12
+ - **Table:** fix elements in merged cells being occluded ([#2513](https://github.com/rsuite/rsuite/issues/2513)) ([22e5467](https://github.com/rsuite/rsuite/commit/22e54671cbeb3e63d8480469c3d53744732308f2))
13
+
14
+ ### Features
15
+
16
+ - **grid:** synchronize all grid size and breakpoint with bootstrap5 ([e8d2d37](https://github.com/rsuite/rsuite/commit/e8d2d372e2280336482de648d9619607b9cb1798))
17
+ - **Nav.Menu:** add `openDirection` prop ([#2523](https://github.com/rsuite/rsuite/issues/2523)) ([bd824ac](https://github.com/rsuite/rsuite/commit/bd824ac9359cc5cebb848424d8045986e32c6462))
18
+ - **toaster:** add support for useToaster ([#2518](https://github.com/rsuite/rsuite/issues/2518)) ([75cb960](https://github.com/rsuite/rsuite/commit/75cb9601b56fbdc64a09b9bbc93aaf2b22b715c4))
19
+ - **Tooltip,Popover:** add arrow props to hide arrow indicator ([48d876f](https://github.com/rsuite/rsuite/commit/48d876f7d2211f5e9cb1db7e8f552152821e05ac))
20
+ - **Tooltip,Popover:** add followCursor props to enable speaker follow cursor ([e3bf75d](https://github.com/rsuite/rsuite/commit/e3bf75d4e4c537bf677c404fce84b76266531630))
21
+
22
+ ### Performance Improvements
23
+
24
+ - **Dropdown:** improve contrast of active Dropdown item background color ([#2510](https://github.com/rsuite/rsuite/issues/2510)) ([35a418a](https://github.com/rsuite/rsuite/commit/35a418ae5f2104e6ac56ebe5c91d426025fce94a))
25
+
1
26
  ## [5.13.1](https://github.com/rsuite/rsuite/compare/v5.13.0...v5.13.1) (2022-05-27)
2
27
 
3
28
  ### Bug Fixes
@@ -94,8 +94,8 @@
94
94
  font-size: @font-size-base;
95
95
  text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer)
96
96
  background-color: var(--rs-bg-overlay);
97
- border-radius: @border-radius;
98
- padding: @border-radius 0;
97
+ border-radius: @dropdown-menu-radius;
98
+ padding: @dropdown-menu-padding-y 0;
99
99
  outline: 0;
100
100
 
101
101
  &:focus-visible {
@@ -202,7 +202,7 @@
202
202
 
203
203
  > .rs-dropdown-menu {
204
204
  position: absolute;
205
- top: 0;
205
+ top: -@dropdown-menu-padding-y;
206
206
  }
207
207
  }
208
208
 
@@ -223,6 +223,11 @@
223
223
 
224
224
  .rs-dropdown-menu {
225
225
  left: 100%;
226
+
227
+ &[data-direction='start'] {
228
+ left: unset;
229
+ right: 100%;
230
+ }
226
231
  }
227
232
 
228
233
  // Open
@@ -13,17 +13,25 @@
13
13
  .rs-grid-container {
14
14
  .container-fixed();
15
15
 
16
- @media (min-width: @screen-phone) {
16
+ @media (min-width: @screen-sm) {
17
17
  width: @container-sm;
18
18
  }
19
19
 
20
- @media (min-width: @screen-desktop) {
20
+ @media (min-width: @screen-md) {
21
21
  width: @container-md;
22
22
  }
23
23
 
24
- @media (min-width: @screen-lg-desktop) {
24
+ @media (min-width: @screen-lg) {
25
25
  width: @container-lg;
26
26
  }
27
+
28
+ @media (min-width: @screen-xl) {
29
+ width: @container-xl;
30
+ }
31
+
32
+ @media (min-width: @screen-xxl) {
33
+ width: @container-xxl;
34
+ }
27
35
  }
28
36
 
29
37
  // Fluid container
@@ -60,7 +68,7 @@
60
68
  // Columns, offsets, pushes, and pulls for the small device range, from phones
61
69
  // to tablets / phones.
62
70
 
63
- @media (min-width: @screen-phone) {
71
+ @media (min-width: @screen-sm) {
64
72
  .make-grid(sm);
65
73
  }
66
74
 
@@ -68,7 +76,7 @@
68
76
  //
69
77
  // Columns, offsets, pushes, and pulls for the desktop device range.
70
78
 
71
- @media (min-width: @screen-desktop) {
79
+ @media (min-width: @screen-md) {
72
80
  .make-grid(md);
73
81
  }
74
82
 
@@ -76,26 +84,50 @@
76
84
  //
77
85
  // Columns, offsets, pushes, and pulls for the large desktop device range.
78
86
 
79
- @media (min-width: @screen-lg-desktop) {
87
+ @media (min-width: @screen-lg) {
80
88
  .make-grid(lg);
81
89
  }
82
90
 
91
+ // Extra Large grid
92
+ //
93
+ // Columns, offsets, pushes, and pulls for the large desktop device range.
94
+
95
+ @media (min-width: @screen-xl) {
96
+ .make-grid(xl);
97
+ }
98
+
99
+ // Extra extra Large grid
100
+ //
101
+ // Columns, offsets, pushes, and pulls for the large desktop device range.
102
+
103
+ @media (min-width: @screen-xxl) {
104
+ .make-grid(xxl);
105
+ }
106
+
83
107
  // Hiddens
84
108
  //
85
109
  // All hidden styles.
86
110
 
87
- @media (max-width: (@screen-phone - 1)) {
111
+ @media (max-width: (@screen-sm - 1)) {
88
112
  .hidden(xs);
89
113
  }
90
114
 
91
- @media (min-width: @screen-phone) and (max-width: (@screen-desktop - 1)) {
115
+ @media (min-width: @screen-sm) and (max-width: (@screen-md - 1)) {
92
116
  .hidden(sm);
93
117
  }
94
118
 
95
- @media (min-width: @screen-desktop) and (max-width: (@screen-lg-desktop - 1)) {
119
+ @media (min-width: @screen-md) and (max-width: (@screen-lg - 1)) {
96
120
  .hidden(md);
97
121
  }
98
122
 
99
- @media (min-width: @screen-lg-desktop) {
123
+ @media (min-width: @screen-lg) and (max-width: (@screen-xl - 1)) {
100
124
  .hidden(lg);
101
125
  }
126
+
127
+ @media (min-width: @screen-xl) and (max-width: (@screen-xxl - 1)) {
128
+ .hidden(xl);
129
+ }
130
+
131
+ @media (min-width: @screen-xxl) {
132
+ .hidden(xxl);
133
+ }
@@ -20,8 +20,8 @@
20
20
  list-style: none;
21
21
  padding: 0;
22
22
 
23
- > .rs-sidenav-item,
24
- > .rs-dropdown .rs-dropdown-toggle,
23
+ .rs-sidenav-item,
24
+ .rs-dropdown-toggle,
25
25
  .rs-dropdown-item,
26
26
  .rs-dropdown-item-toggle {
27
27
  padding: @sidenav-padding-vertical @sidenav-padding-horizontal;
@@ -562,16 +562,16 @@
562
562
  // Subtle Sidenav
563
563
  .rs-sidenav-subtle {
564
564
  background-color: transparent;
565
- color: var(--rs-sidenav-subtle-text);
566
565
 
567
566
  .rs-sidenav-item,
568
- .rs-dropdown .rs-dropdown-toggle,
569
- .rs-dropdown .rs-dropdown-item:not(.rs-dropdown-item-submenu),
567
+ .rs-dropdown-toggle,
568
+ .rs-dropdown-item,
570
569
  .rs-sidenav-toggle-button {
571
570
  background-color: transparent;
571
+ color: var(--rs-sidenav-subtle-text);
572
572
 
573
573
  &:hover,
574
- &:focus {
574
+ &:focus-visible {
575
575
  background-color: var(--rs-sidenav-subtle-hover-bg);
576
576
  color: var(--rs-sidenav-subtle-hover-text);
577
577
  }
@@ -605,7 +605,7 @@
605
605
  color: var(--rs-sidenav-subtle-text);
606
606
 
607
607
  &:hover,
608
- &:focus {
608
+ &:focus-visible {
609
609
  background-color: var(--rs-sidenav-subtle-hover-bg);
610
610
  color: var(--rs-sidenav-subtle-hover-text);
611
611
  }
@@ -622,8 +622,6 @@
622
622
  .rs-sidenav-subtle.rs-sidenav-collapse-out {
623
623
  // Set active Level1 style
624
624
  .rs-dropdown.rs-dropdown-selected-within .rs-dropdown-toggle {
625
- color: var(--rs-sidenav-subtle-text);
626
-
627
625
  &:hover {
628
626
  background-color: var(--rs-sidenav-subtle-hover-bg);
629
627
  }
@@ -222,9 +222,7 @@
222
222
  &-column-resize-spanner {
223
223
  .column-resize-spanner();
224
224
 
225
- border-left: @table-column-resize-spanner-gap-width solid var(--rs-bg-card);
226
225
  box-sizing: content-box;
227
- margin-left: (-1 * @table-column-resize-spanner-gap-width);
228
226
 
229
227
  &::after,
230
228
  &::before {
@@ -31,8 +31,8 @@
31
31
  }
32
32
 
33
33
  // Arrows
34
- &::before,
35
- &::after {
34
+ &-arrow::before,
35
+ &-arrow::after {
36
36
  content: ' ';
37
37
  display: block;
38
38
  position: absolute;
@@ -42,14 +42,14 @@
42
42
  border-style: solid;
43
43
  }
44
44
 
45
- &::before {
45
+ &-arrow::before {
46
46
  display: none;
47
47
  }
48
48
 
49
49
  .high-contrast-mode({
50
50
  border: 1px solid var(--rs-border-primary);
51
51
 
52
- &::before {
52
+ &-arrow::before {
53
53
  display: block;
54
54
  }
55
55
  });
@@ -149,4 +149,10 @@ export interface Offset {
149
149
  height: number;
150
150
  }
151
151
  export declare type OnChangeCallback<T, E = React.SyntheticEvent> = (value: T, event: E) => void;
152
+ export declare type CursorPosition = {
153
+ top: number;
154
+ left: number;
155
+ clientTop: number;
156
+ clientLeft: number;
157
+ };
152
158
  export {};
@@ -6,7 +6,7 @@ export declare function getColumnsAndPaths<T extends ItemDataType>(data: T[], va
6
6
  paths: T[];
7
7
  };
8
8
  export declare function usePaths(props: CascaderProps): {
9
- enforceUpdate: (nextValue: any, isAttachChildren?: boolean | undefined) => void;
9
+ enforceUpdate: (nextValue: any, isAttachChildren?: boolean) => void;
10
10
  columnData: ItemDataType<string | number>[][];
11
11
  valueToPaths: ItemDataType<string | number>[];
12
12
  selectedPaths: ItemDataType<string | number>[];
package/cjs/Col/Col.d.ts CHANGED
@@ -1,21 +1,29 @@
1
1
  import { WithAsProps, RsRefForwardingComponent } from '../@types/common';
2
2
  export interface ColProps extends WithAsProps {
3
- /** The number of columns you wish to span for Extra small devices Phones (< 480px) */
3
+ /** The number of columns you wish to span for Extra small devices Phones (< 576px) */
4
4
  xs?: number;
5
- /** The number of columns you wish to span for Small devices Tablets (≥ 480px) */
5
+ /** The number of columns you wish to span for Small devices Tablets (≥ 576px) */
6
6
  sm?: number;
7
- /** The number of columns you wish to span for Medium devices Desktops (≥ 992px) */
7
+ /** The number of columns you wish to span for Medium devices Desktops (≥ 768px) */
8
8
  md?: number;
9
- /** The number of columns you wish to span for Large devices Desktops (≥ 1200px) */
9
+ /** The number of columns you wish to span for Large devices Desktops (≥ 992px) */
10
10
  lg?: number;
11
+ /** The number of columns you wish to span for Extra Large devices Desktops (≥ 1200px) */
12
+ xl?: number;
13
+ /** The number of columns you wish to span for Ultra Large devices Desktops (≥ 1400px) */
14
+ xxl?: number;
11
15
  /** Move columns to the right for Extra small devices Phones */
12
16
  xsOffset?: number;
13
17
  /** Move columns to the right for Small devices Tablets */
14
18
  smOffset?: number;
15
19
  /** Move columns to the right for Medium devices Desktops */
16
20
  mdOffset?: number;
17
- /** Move columns to the right for Medium devices Desktops */
21
+ /** Move columns to the right for Large devices Desktops */
18
22
  lgOffset?: number;
23
+ /** Move columns to the right for Extra large devices Desktops */
24
+ xlOffset?: number;
25
+ /** Move columns to the right for Ultra large devices Desktops */
26
+ xxlOffset?: number;
19
27
  /** Change the order of grid columns to the right for Extra small devices Phones */
20
28
  xsPush?: number;
21
29
  /** Change the order of grid columns to the right for Small devices Tablets */
@@ -24,6 +32,10 @@ export interface ColProps extends WithAsProps {
24
32
  mdPush?: number;
25
33
  /** Change the order of grid columns to the right for Large devices Desktops */
26
34
  lgPush?: number;
35
+ /** Change the order of grid columns to the right for Extra large devices Desktops */
36
+ xlPush?: number;
37
+ /** Change the order of grid columns to the right for Ultra large devices Desktops */
38
+ xxlPush?: number;
27
39
  /** Change the order of grid columns to the left for Extra small devices Phones */
28
40
  xsPull?: number;
29
41
  /** Change the order of grid columns to the left for Small devices Tablets */
@@ -32,6 +44,10 @@ export interface ColProps extends WithAsProps {
32
44
  mdPull?: number;
33
45
  /** Change the order of grid columns to the left for Large devices Desktops */
34
46
  lgPull?: number;
47
+ /** Change the order of grid columns to the left for Extra large devices Desktops */
48
+ xlPull?: number;
49
+ /** Change the order of grid columns to the left for Ultra large devices Desktops */
50
+ xxlPull?: number;
35
51
  /** Hide column on Extra small devices Phones */
36
52
  xsHidden?: boolean;
37
53
  /** Hide column on Small devices Tablets */
@@ -40,6 +56,10 @@ export interface ColProps extends WithAsProps {
40
56
  mdHidden?: boolean;
41
57
  /** Hide column on Large devices Desktops */
42
58
  lgHidden?: boolean;
59
+ /** Hide column on Extra large devices Desktops */
60
+ xlHidden?: boolean;
61
+ /** Hide column on Ultra large devices Desktops */
62
+ xxlHidden?: boolean;
43
63
  }
44
64
  declare const Col: RsRefForwardingComponent<'div', ColProps>;
45
65
  export default Col;
package/cjs/Col/Col.js CHANGED
@@ -39,7 +39,7 @@ var Col = /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
39
39
  return rest[key];
40
40
  };
41
41
 
42
- _utils.SIZE.forEach(function (size) {
42
+ _utils.COLUMN_SIZE.forEach(function (size) {
43
43
  var col = getPropValue(size);
44
44
  var hidden = getPropValue(size + "Hidden");
45
45
  var offset = getPropValue(size + "Offset");
@@ -70,10 +70,14 @@ Col.propTypes = {
70
70
  sm: _propTypes.default.number,
71
71
  md: _propTypes.default.number,
72
72
  lg: _propTypes.default.number,
73
+ xl: _propTypes.default.number,
74
+ xxl: _propTypes.default.number,
73
75
  xsOffset: _propTypes.default.number,
74
76
  smOffset: _propTypes.default.number,
75
77
  mdOffset: _propTypes.default.number,
76
78
  lgOffset: _propTypes.default.number,
79
+ xlOffset: _propTypes.default.number,
80
+ xxlOffset: _propTypes.default.number,
77
81
  xsPush: _propTypes.default.number,
78
82
  smPush: _propTypes.default.number,
79
83
  mdPush: _propTypes.default.number,
@@ -82,10 +86,14 @@ Col.propTypes = {
82
86
  smPull: _propTypes.default.number,
83
87
  mdPull: _propTypes.default.number,
84
88
  lgPull: _propTypes.default.number,
89
+ xlPull: _propTypes.default.number,
90
+ xxlPull: _propTypes.default.number,
85
91
  xsHidden: _propTypes.default.bool,
86
92
  smHidden: _propTypes.default.bool,
87
93
  mdHidden: _propTypes.default.bool,
88
94
  lgHidden: _propTypes.default.bool,
95
+ xlHidden: _propTypes.default.bool,
96
+ xxlHidden: _propTypes.default.bool,
89
97
  as: _propTypes.default.elementType
90
98
  };
91
99
  var _default = Col;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Locale } from '../locales';
3
+ import { ToastContainerInstance } from '../toaster/ToastContainer';
3
4
  export interface CustomValue<T = Locale> {
4
5
  /** Language configuration */
5
6
  locale: T;
@@ -33,6 +34,10 @@ export interface CustomValue<T = Locale> {
33
34
  *
34
35
  * */
35
36
  parseDate: (dateString: string, formatString: string) => Date;
37
+ /**
38
+ * A Map of toast containers
39
+ */
40
+ toasters?: React.MutableRefObject<Map<string, ToastContainerInstance>>;
36
41
  }
37
42
  export interface CustomProviderProps<T = Locale> extends Partial<CustomValue<T>> {
38
43
  /** Supported themes */
@@ -41,6 +46,8 @@ export interface CustomProviderProps<T = Locale> extends Partial<CustomValue<T>>
41
46
  classPrefix?: string;
42
47
  /** Primary content */
43
48
  children?: React.ReactNode;
49
+ /** Sets a container for toast rendering */
50
+ toastContainer?: HTMLElement | (() => HTMLElement | null) | null;
44
51
  }
45
52
  declare const CustomContext: React.Context<CustomProviderProps<{
46
53
  common?: {
@@ -75,7 +82,7 @@ declare const CustomContext: React.Context<CustomProviderProps<{
75
82
  yesterday: string;
76
83
  hours: string;
77
84
  minutes: string;
78
- seconds: string; /** Support right-to-left */
85
+ seconds: string;
79
86
  formattedMonthPattern: string;
80
87
  formattedDayPattern: string;
81
88
  dateLocale: any;
@@ -93,7 +100,7 @@ declare const CustomContext: React.Context<CustomProviderProps<{
93
100
  yesterday: string;
94
101
  hours: string;
95
102
  minutes: string;
96
- seconds: string; /** Support right-to-left */
103
+ seconds: string;
97
104
  formattedMonthPattern: string;
98
105
  formattedDayPattern: string;
99
106
  dateLocale: any;
@@ -112,7 +119,7 @@ declare const CustomContext: React.Context<CustomProviderProps<{
112
119
  yesterday: string;
113
120
  hours: string;
114
121
  minutes: string;
115
- seconds: string; /** Support right-to-left */
122
+ seconds: string;
116
123
  formattedMonthPattern: string;
117
124
  formattedDayPattern: string;
118
125
  dateLocale: any;
@@ -125,6 +132,9 @@ declare const CustomContext: React.Context<CustomProviderProps<{
125
132
  } | undefined;
126
133
  InputPicker?: {
127
134
  newItem: string;
135
+ /**
136
+ * A Map of toast containers
137
+ */
128
138
  createOption: string;
129
139
  } | undefined;
130
140
  Uploader?: {
@@ -179,7 +189,7 @@ declare const Consumer: React.Consumer<CustomProviderProps<{
179
189
  yesterday: string;
180
190
  hours: string;
181
191
  minutes: string;
182
- seconds: string; /** Support right-to-left */
192
+ seconds: string;
183
193
  formattedMonthPattern: string;
184
194
  formattedDayPattern: string;
185
195
  dateLocale: any;
@@ -197,7 +207,7 @@ declare const Consumer: React.Consumer<CustomProviderProps<{
197
207
  yesterday: string;
198
208
  hours: string;
199
209
  minutes: string;
200
- seconds: string; /** Support right-to-left */
210
+ seconds: string;
201
211
  formattedMonthPattern: string;
202
212
  formattedDayPattern: string;
203
213
  dateLocale: any;
@@ -216,7 +226,7 @@ declare const Consumer: React.Consumer<CustomProviderProps<{
216
226
  yesterday: string;
217
227
  hours: string;
218
228
  minutes: string;
219
- seconds: string; /** Support right-to-left */
229
+ seconds: string;
220
230
  formattedMonthPattern: string;
221
231
  formattedDayPattern: string;
222
232
  dateLocale: any;
@@ -229,6 +239,9 @@ declare const Consumer: React.Consumer<CustomProviderProps<{
229
239
  } | undefined;
230
240
  InputPicker?: {
231
241
  newItem: string;
242
+ /**
243
+ * A Map of toast containers
244
+ */
232
245
  createOption: string;
233
246
  } | undefined;
234
247
  Uploader?: {
@@ -250,6 +263,6 @@ declare const Consumer: React.Consumer<CustomProviderProps<{
250
263
  off: string;
251
264
  } | undefined;
252
265
  }>>;
253
- declare const CustomProvider: (props: CustomProviderProps) => JSX.Element;
266
+ declare const CustomProvider: (props: Omit<CustomProviderProps, 'toasters'>) => JSX.Element;
254
267
  export { CustomContext, Consumer as CustomConsumer };
255
268
  export default CustomProvider;
@@ -17,6 +17,10 @@ var _prefix = require("../utils/prefix");
17
17
 
18
18
  var _DOMHelper = require("../DOMHelper");
19
19
 
20
+ var _ToastContainer = _interopRequireWildcard(require("../toaster/ToastContainer"));
21
+
22
+ var _utils = require("../utils");
23
+
20
24
  var CustomContext = /*#__PURE__*/_react.default.createContext({});
21
25
 
22
26
  exports.CustomContext = CustomContext;
@@ -30,12 +34,21 @@ var CustomProvider = function CustomProvider(props) {
30
34
  _props$classPrefix = props.classPrefix,
31
35
  classPrefix = _props$classPrefix === void 0 ? (0, _prefix.getClassNamePrefix)() : _props$classPrefix,
32
36
  theme = props.theme,
33
- rest = (0, _objectWithoutPropertiesLoose2.default)(props, ["children", "classPrefix", "theme"]);
37
+ container = props.toastContainer,
38
+ rest = (0, _objectWithoutPropertiesLoose2.default)(props, ["children", "classPrefix", "theme", "toastContainer"]);
39
+
40
+ var toasters = _react.default.useRef(new Map());
41
+
42
+ var _usePortal = (0, _utils.usePortal)({
43
+ container: container
44
+ }),
45
+ Portal = _usePortal.Portal;
34
46
 
35
47
  var value = _react.default.useMemo(function () {
36
48
  return (0, _extends2.default)({
37
49
  classPrefix: classPrefix,
38
- theme: theme
50
+ theme: theme,
51
+ toasters: toasters
39
52
  }, rest);
40
53
  }, [classPrefix, theme, rest]);
41
54
 
@@ -52,7 +65,15 @@ var CustomProvider = function CustomProvider(props) {
52
65
  }, [classPrefix, theme]);
53
66
  return /*#__PURE__*/_react.default.createElement(Provider, {
54
67
  value: value
55
- }, children);
68
+ }, children, /*#__PURE__*/_react.default.createElement(Portal, null, _ToastContainer.toastPlacements.map(function (placement) {
69
+ return /*#__PURE__*/_react.default.createElement(_ToastContainer.default, {
70
+ key: placement,
71
+ placement: placement,
72
+ ref: function ref(_ref) {
73
+ toasters.current.set(placement, _ref);
74
+ }
75
+ });
76
+ })));
56
77
  };
57
78
 
58
79
  var _default = CustomProvider;
@@ -1,2 +1,2 @@
1
1
  import React from 'react';
2
- export declare function useRenderDropdownItem(Component: React.ElementType): (props: any, OverrideComponent?: React.ElementType<any> | undefined) => JSX.Element;
2
+ export declare function useRenderDropdownItem(Component: React.ElementType): (props: any, OverrideComponent?: React.ElementType) => JSX.Element;
@@ -44,21 +44,21 @@ export interface FormProps<T = Record<string, any>, errorMsgType = any, E = {
44
44
  export interface FormInstance<T = Record<string, any>, errorMsg = string, E = {
45
45
  [P in keyof T]?: errorMsg;
46
46
  }> {
47
- root: React.FormHTMLAttributes<HTMLFormElement>;
47
+ root: HTMLFormElement | null;
48
48
  /** Verify form data */
49
- check?: (callback?: (formError: E) => void) => boolean;
49
+ check: (callback?: (formError: E) => void) => boolean;
50
50
  /** Asynchronously check form data */
51
- checkAsync?: () => Promise<any>;
51
+ checkAsync: () => Promise<any>;
52
52
  /** Check the data field */
53
- checkForField?: (fieldName: keyof T, callback?: (checkResult: CheckResult<errorMsg>) => void) => boolean;
53
+ checkForField: (fieldName: keyof T, callback?: (checkResult: CheckResult<errorMsg>) => void) => boolean;
54
54
  /** Asynchronous verification as a data field */
55
- checkForFieldAsync?: (fieldName: keyof T) => Promise<CheckResult>;
55
+ checkForFieldAsync: (fieldName: keyof T) => Promise<CheckResult>;
56
56
  /** Clear all error messages */
57
- cleanErrors?: (callback?: () => void) => void;
57
+ cleanErrors: (callback?: () => void) => void;
58
58
  /** Clear the error message of the specified field */
59
- cleanErrorForField?: (fieldName: keyof E, callback?: () => void) => void;
59
+ cleanErrorForField: (fieldName: keyof E, callback?: () => void) => void;
60
60
  /** All error messages are reset, and an initial value can be set */
61
- resetErrors?: (formError: E, callback?: () => void) => void;
61
+ resetErrors: (formError: E, callback?: () => void) => void;
62
62
  }
63
63
  export interface FormComponent extends RsRefForwardingComponent<'form', FormProps & {
64
64
  ref?: React.Ref<FormInstance>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ var _react = _interopRequireDefault(require("react"));
6
+
7
+ var _Form = _interopRequireDefault(require("../Form"));
8
+
9
+ var _formRef$current;
10
+
11
+ var formRef = /*#__PURE__*/_react.default.createRef();
12
+
13
+ /*#__PURE__*/
14
+ _react.default.createElement(_Form.default, {
15
+ ref: formRef
16
+ });
17
+
18
+ (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : _formRef$current.check();
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ var _react = _interopRequireDefault(require("react"));
6
+
7
+ var _Modal = _interopRequireDefault(require("../Modal"));
8
+
9
+ /*#__PURE__*/
10
+ _react.default.createElement(_Modal.default, {
11
+ container: function container() {
12
+ return document.body;
13
+ }
14
+ });
@@ -3,4 +3,4 @@ export declare const useBodyStyles: (ref: React.RefObject<HTMLElement>, options:
3
3
  overflow: boolean;
4
4
  drawer: boolean;
5
5
  prefix: (...classes: any) => string;
6
- }) => [import("react").CSSProperties, (entering?: boolean | undefined) => void, () => void];
6
+ }) => [import("react").CSSProperties, (entering?: boolean) => void, () => void];
@@ -4,8 +4,19 @@ import { IconProps } from '@rsuite/icons/lib/Icon';
4
4
  export interface NavDropdownMenuProps<T = any> extends StandardProps {
5
5
  /** Define the title as a submenu */
6
6
  title?: React.ReactNode;
7
- /** The submenu expands from the left and defaults to the right */
7
+ /**
8
+ * The submenu expands from the left and defaults to the right
9
+ * @deprecated Use openDirection="start" instead
10
+ */
8
11
  pullLeft?: boolean;
12
+ /**
13
+ * Direction that the sub-menu open towards
14
+ * - start: towards the head of the reading direction (right by default, left in RTL)
15
+ * - end: towards the end of the reading direction (left by default, right in RTL)
16
+ *
17
+ * @default 'end'
18
+ */
19
+ openDirection?: 'start' | 'end';
9
20
  /**
10
21
  * Only used for setting the default expand state when it's a submenu.
11
22
  */