@norges-domstoler/dds-components 0.0.0-dev-20250331092559 → 0.0.0-dev-20250331113238
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 +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -23
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -2164,6 +2164,14 @@ type PopoverProps = BaseComponentPropsWithChildren<HTMLDivElement, {
|
|
|
2164
2164
|
* @default "bottom"
|
|
2165
2165
|
*/
|
|
2166
2166
|
placement?: Placement;
|
|
2167
|
+
/**Angir rotnode hvor popover skal rendres.
|
|
2168
|
+
* @default themeProviderRef
|
|
2169
|
+
*/
|
|
2170
|
+
parentElement?: HTMLElement;
|
|
2171
|
+
/**Angir om popover skal rendre i en portal eller ikke.
|
|
2172
|
+
* @default "false"
|
|
2173
|
+
*/
|
|
2174
|
+
portal?: boolean;
|
|
2167
2175
|
/**Avstand fra anchor-elementet i px.
|
|
2168
2176
|
* @default 8
|
|
2169
2177
|
*/
|
|
@@ -2184,7 +2192,7 @@ type PopoverProps = BaseComponentPropsWithChildren<HTMLDivElement, {
|
|
|
2184
2192
|
onClose?: () => void;
|
|
2185
2193
|
}>;
|
|
2186
2194
|
declare const Popover: {
|
|
2187
|
-
({ id, header, withCloseButton, onBlur, children, placement, offset, sizeProps, returnFocusOnBlur, className, htmlProps, anchorRef, isOpen: propIsOpen, onClose: propOnClose, ref, ...rest }: PopoverProps): react_jsx_runtime.JSX.Element | null;
|
|
2195
|
+
({ id, header, withCloseButton, onBlur, children, placement, parentElement, portal, offset, sizeProps, returnFocusOnBlur, className, htmlProps, anchorRef, isOpen: propIsOpen, onClose: propOnClose, ref, ...rest }: PopoverProps): react_jsx_runtime.JSX.Element | null;
|
|
2188
2196
|
displayName: string;
|
|
2189
2197
|
};
|
|
2190
2198
|
|
package/dist/index.d.ts
CHANGED
|
@@ -2164,6 +2164,14 @@ type PopoverProps = BaseComponentPropsWithChildren<HTMLDivElement, {
|
|
|
2164
2164
|
* @default "bottom"
|
|
2165
2165
|
*/
|
|
2166
2166
|
placement?: Placement;
|
|
2167
|
+
/**Angir rotnode hvor popover skal rendres.
|
|
2168
|
+
* @default themeProviderRef
|
|
2169
|
+
*/
|
|
2170
|
+
parentElement?: HTMLElement;
|
|
2171
|
+
/**Angir om popover skal rendre i en portal eller ikke.
|
|
2172
|
+
* @default "false"
|
|
2173
|
+
*/
|
|
2174
|
+
portal?: boolean;
|
|
2167
2175
|
/**Avstand fra anchor-elementet i px.
|
|
2168
2176
|
* @default 8
|
|
2169
2177
|
*/
|
|
@@ -2184,7 +2192,7 @@ type PopoverProps = BaseComponentPropsWithChildren<HTMLDivElement, {
|
|
|
2184
2192
|
onClose?: () => void;
|
|
2185
2193
|
}>;
|
|
2186
2194
|
declare const Popover: {
|
|
2187
|
-
({ id, header, withCloseButton, onBlur, children, placement, offset, sizeProps, returnFocusOnBlur, className, htmlProps, anchorRef, isOpen: propIsOpen, onClose: propOnClose, ref, ...rest }: PopoverProps): react_jsx_runtime.JSX.Element | null;
|
|
2195
|
+
({ id, header, withCloseButton, onBlur, children, placement, parentElement, portal, offset, sizeProps, returnFocusOnBlur, className, htmlProps, anchorRef, isOpen: propIsOpen, onClose: propOnClose, ref, ...rest }: PopoverProps): react_jsx_runtime.JSX.Element | null;
|
|
2188
2196
|
displayName: string;
|
|
2189
2197
|
};
|
|
2190
2198
|
|
package/dist/index.js
CHANGED
|
@@ -9606,6 +9606,7 @@ var getCallingCode = (s) => {
|
|
|
9606
9606
|
|
|
9607
9607
|
// src/components/Popover/Popover.tsx
|
|
9608
9608
|
var import_react61 = require("react");
|
|
9609
|
+
var import_react_dom5 = require("react-dom");
|
|
9609
9610
|
|
|
9610
9611
|
// src/components/Popover/Popover.module.css
|
|
9611
9612
|
var Popover_default = {
|
|
@@ -9629,6 +9630,8 @@ var Popover = ({
|
|
|
9629
9630
|
onBlur,
|
|
9630
9631
|
children,
|
|
9631
9632
|
placement = "bottom",
|
|
9633
|
+
parentElement,
|
|
9634
|
+
portal = false,
|
|
9632
9635
|
offset = 8,
|
|
9633
9636
|
sizeProps,
|
|
9634
9637
|
returnFocusOnBlur = true,
|
|
@@ -9645,6 +9648,8 @@ var Popover = ({
|
|
|
9645
9648
|
placement
|
|
9646
9649
|
});
|
|
9647
9650
|
const context = usePopoverContext();
|
|
9651
|
+
const themeContext = (0, import_react61.useContext)(ThemeContext);
|
|
9652
|
+
const portalTarget = parentElement != null ? parentElement : themeContext == null ? void 0 : themeContext.el;
|
|
9648
9653
|
const {
|
|
9649
9654
|
floatStyling: contextFloatStyling,
|
|
9650
9655
|
setFloatOptions,
|
|
@@ -9703,7 +9708,7 @@ var Popover = ({
|
|
|
9703
9708
|
});
|
|
9704
9709
|
const hasTitle = !!header;
|
|
9705
9710
|
const openCn = hasTransitionedIn && isOpen ? "open" : "closed";
|
|
9706
|
-
|
|
9711
|
+
const popover = /* @__PURE__ */ (0, import_jsx_runtime272.jsxs)(
|
|
9707
9712
|
Paper,
|
|
9708
9713
|
{
|
|
9709
9714
|
...getBaseHTMLProps(
|
|
@@ -9750,7 +9755,8 @@ var Popover = ({
|
|
|
9750
9755
|
)
|
|
9751
9756
|
]
|
|
9752
9757
|
}
|
|
9753
|
-
)
|
|
9758
|
+
);
|
|
9759
|
+
return isOpen || hasTransitionedIn ? portal && portalTarget ? (0, import_react_dom5.createPortal)(popover, portalTarget) : popover : null;
|
|
9754
9760
|
};
|
|
9755
9761
|
Popover.displayName = "Popover";
|
|
9756
9762
|
|