@edux-design/forms 0.0.17 → 0.0.19
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/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5 -3
- package/dist/index.mjs +5 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -246,6 +246,7 @@ declare const Option: react.ForwardRefExoticComponent<react.RefAttributes<any>>;
|
|
|
246
246
|
* @property {string} [contentClassName] - optional class for the popover content
|
|
247
247
|
* @property {string} [listClassName] - optional class for the list element
|
|
248
248
|
* @property {string} [optionClassName] - optional class for each option
|
|
249
|
+
* @property {HTMLElement|null} [portalContainer] - explicit portal container for the popover content
|
|
249
250
|
* @property {"default"|"small"} [size="default"] - size variant for the combobox input
|
|
250
251
|
* @property {"full"|"small"|"medium"|"large"} [width="full"] - width size for the combobox container
|
|
251
252
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -246,6 +246,7 @@ declare const Option: react.ForwardRefExoticComponent<react.RefAttributes<any>>;
|
|
|
246
246
|
* @property {string} [contentClassName] - optional class for the popover content
|
|
247
247
|
* @property {string} [listClassName] - optional class for the list element
|
|
248
248
|
* @property {string} [optionClassName] - optional class for each option
|
|
249
|
+
* @property {HTMLElement|null} [portalContainer] - explicit portal container for the popover content
|
|
249
250
|
* @property {"default"|"small"} [size="default"] - size variant for the combobox input
|
|
250
251
|
* @property {"full"|"small"|"medium"|"large"} [width="full"] - width size for the combobox container
|
|
251
252
|
*/
|
package/dist/index.js
CHANGED
|
@@ -884,6 +884,7 @@ var ComboboxRoot = (0, import_react10.forwardRef)(
|
|
|
884
884
|
contentClassName,
|
|
885
885
|
listClassName,
|
|
886
886
|
optionClassName,
|
|
887
|
+
portalContainer,
|
|
887
888
|
size = "default",
|
|
888
889
|
width = "full",
|
|
889
890
|
...inputProps
|
|
@@ -999,15 +1000,16 @@ var ComboboxRoot = (0, import_react10.forwardRef)(
|
|
|
999
1000
|
setActiveIndex((prev) => prev >= 0 ? prev : 0);
|
|
1000
1001
|
}, [open, filteredOptions, singleSelectedValue, isMultiSelectEnabled]);
|
|
1001
1002
|
const [contentWidth, setContentWidth] = (0, import_react10.useState)(0);
|
|
1002
|
-
const [
|
|
1003
|
+
const [inferredPortalContainer, setInferredPortalContainer] = (0, import_react10.useState)(null);
|
|
1003
1004
|
(0, import_react10.useLayoutEffect)(() => {
|
|
1004
1005
|
if (anchorRef.current) {
|
|
1005
1006
|
setContentWidth(anchorRef.current.offsetWidth);
|
|
1006
|
-
|
|
1007
|
+
setInferredPortalContainer(
|
|
1007
1008
|
anchorRef.current.closest("[role='dialog']") ?? null
|
|
1008
1009
|
);
|
|
1009
1010
|
}
|
|
1010
1011
|
}, [open]);
|
|
1012
|
+
const resolvedPortalContainer = portalContainer ?? inferredPortalContainer;
|
|
1011
1013
|
const isNarrowPopover = contentWidth > 0 && contentWidth < 100;
|
|
1012
1014
|
const emitChange = (0, import_react10.useCallback)(
|
|
1013
1015
|
(nextValue, option) => {
|
|
@@ -1295,7 +1297,7 @@ var ComboboxRoot = (0, import_react10.forwardRef)(
|
|
|
1295
1297
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1296
1298
|
import_popovers.PopoverContent,
|
|
1297
1299
|
{
|
|
1298
|
-
container:
|
|
1300
|
+
container: resolvedPortalContainer,
|
|
1299
1301
|
side: "bottom",
|
|
1300
1302
|
align: "start",
|
|
1301
1303
|
sideOffset: 4,
|
package/dist/index.mjs
CHANGED
|
@@ -855,6 +855,7 @@ var ComboboxRoot = forwardRef6(
|
|
|
855
855
|
contentClassName,
|
|
856
856
|
listClassName,
|
|
857
857
|
optionClassName,
|
|
858
|
+
portalContainer,
|
|
858
859
|
size = "default",
|
|
859
860
|
width = "full",
|
|
860
861
|
...inputProps
|
|
@@ -970,15 +971,16 @@ var ComboboxRoot = forwardRef6(
|
|
|
970
971
|
setActiveIndex((prev) => prev >= 0 ? prev : 0);
|
|
971
972
|
}, [open, filteredOptions, singleSelectedValue, isMultiSelectEnabled]);
|
|
972
973
|
const [contentWidth, setContentWidth] = useState3(0);
|
|
973
|
-
const [
|
|
974
|
+
const [inferredPortalContainer, setInferredPortalContainer] = useState3(null);
|
|
974
975
|
useLayoutEffect(() => {
|
|
975
976
|
if (anchorRef.current) {
|
|
976
977
|
setContentWidth(anchorRef.current.offsetWidth);
|
|
977
|
-
|
|
978
|
+
setInferredPortalContainer(
|
|
978
979
|
anchorRef.current.closest("[role='dialog']") ?? null
|
|
979
980
|
);
|
|
980
981
|
}
|
|
981
982
|
}, [open]);
|
|
983
|
+
const resolvedPortalContainer = portalContainer ?? inferredPortalContainer;
|
|
982
984
|
const isNarrowPopover = contentWidth > 0 && contentWidth < 100;
|
|
983
985
|
const emitChange = useCallback4(
|
|
984
986
|
(nextValue, option) => {
|
|
@@ -1266,7 +1268,7 @@ var ComboboxRoot = forwardRef6(
|
|
|
1266
1268
|
/* @__PURE__ */ jsx9(
|
|
1267
1269
|
PopoverContent,
|
|
1268
1270
|
{
|
|
1269
|
-
container:
|
|
1271
|
+
container: resolvedPortalContainer,
|
|
1270
1272
|
side: "bottom",
|
|
1271
1273
|
align: "start",
|
|
1272
1274
|
sideOffset: 4,
|