@vertigis/react-ui 15.2.1 → 15.2.3

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.
@@ -24,6 +24,16 @@ export interface IconMenuProps extends BoxProps {
24
24
  * The icon to show.
25
25
  */
26
26
  icon: ReactNode;
27
+ /**
28
+ * A ref for the menu element
29
+ */
30
+ menuRef?: React.MutableRefObject<HTMLDivElement>;
31
+ /**
32
+ * A 'virtual anchor' that can be provided to override the default behavior.
33
+ * Use if the component hosting this could be destroyed while the menu is
34
+ * open.
35
+ */
36
+ virtualAnchor?: DOMRect;
27
37
  /**
28
38
  * Attributes applied to the `IconButton` component.
29
39
  */
@@ -11,7 +11,7 @@ export const iconMenuClasses = {
11
11
  root: `${PREFIX}-root`,
12
12
  iconButton: `${PREFIX}-iconButton`,
13
13
  };
14
- const IconMenu = forwardRef(({ id: idProp, children, icon, className, classes: classesProp, disabled, IconButtonProps, MenuProps, ...others }, ref) => {
14
+ const IconMenu = forwardRef(({ id: idProp, children, icon, className, classes: classesProp, disabled, menuRef, virtualAnchor, IconButtonProps, MenuProps, ...others }, ref) => {
15
15
  const anchorRef = useRef();
16
16
  const [open, setOpen] = useState(false);
17
17
  const id = useId(idProp);
@@ -19,7 +19,9 @@ const IconMenu = forwardRef(({ id: idProp, children, icon, className, classes: c
19
19
  return (_jsxs(Box, { className: clsx(classes.root, className), ref: ref, ...others, children: [_jsx(IconButton, { ...IconButtonProps, "aria-label": "More", "aria-owns": open ? id : undefined, "aria-haspopup": "true", "data-test": "IconMenu-btn", disabled: disabled, className: clsx(classes.iconButton, IconButtonProps?.className), onClick: event => {
20
20
  setOpen(true);
21
21
  IconButtonProps?.onClick?.(event);
22
- }, ref: ref => (anchorRef.current = anchorRef.current ?? ref), children: icon }), _jsx(Menu, { ...MenuProps, open: MenuProps?.open ?? open, id: id, "data-test": "IconMenu-menu", anchorEl: anchorRef.current, onClose: (event, reason) => {
22
+ }, ref: ref => (anchorRef.current = anchorRef.current ?? ref), children: icon }), _jsx(Menu, { ...MenuProps, open: MenuProps?.open ?? open, id: id, ref: menuRef, "data-test": "IconMenu-menu", anchorEl: virtualAnchor
23
+ ? { nodeType: 1, getBoundingClientRect: () => virtualAnchor }
24
+ : anchorRef.current, onClose: (event, reason) => {
23
25
  setOpen(false);
24
26
  MenuProps?.onClose?.(event, reason);
25
27
  }, onClick: event => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertigis/react-ui",
3
- "version": "15.2.1",
3
+ "version": "15.2.3",
4
4
  "description": "Utilities and React components used in VertiGIS applications.",
5
5
  "keywords": [
6
6
  "vertigis",
@@ -388,6 +388,20 @@ function getOverrides(theme) {
388
388
  focusRipple: false,
389
389
  },
390
390
  },
391
+ MuiClock: {
392
+ styleOverrides: {
393
+ amButton: {
394
+ "& .MuiTypography-caption": {
395
+ fontStyle: "normal",
396
+ },
397
+ },
398
+ pmButton: {
399
+ "& .MuiTypography-caption": {
400
+ fontStyle: "normal",
401
+ },
402
+ },
403
+ },
404
+ },
391
405
  MuiCssBaseline: {
392
406
  styleOverrides: {
393
407
  html: {
@@ -440,6 +454,20 @@ function getOverrides(theme) {
440
454
  PopperProps: { dir: theme.direction },
441
455
  },
442
456
  },
457
+ MuiDayPicker: {
458
+ styleOverrides: {
459
+ header: {
460
+ "& .MuiTypography-caption": {
461
+ fontStyle: "normal",
462
+ },
463
+ },
464
+ weekContainer: {
465
+ button: {
466
+ fontStyle: "normal",
467
+ },
468
+ },
469
+ },
470
+ },
443
471
  MuiDialogActions: {
444
472
  styleOverrides: {
445
473
  root: {