gantt-task-react-v 1.1.7 → 1.1.8

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.
@@ -17998,9 +17998,9 @@ const useContextMenu = (wrapperRef, scrollToTask) => {
17998
17998
  handleOpenContextMenu
17999
17999
  };
18000
18000
  };
18001
- const menuOption = "_menuOption_1ulvi_3";
18002
- const icon = "_icon_1ulvi_55";
18003
- const label = "_label_1ulvi_63";
18001
+ const menuOption = "_menuOption_1frh4_3";
18002
+ const icon = "_icon_1frh4_79";
18003
+ const label = "_label_1frh4_87";
18004
18004
  const styles$1 = {
18005
18005
  menuOption,
18006
18006
  icon,
@@ -18016,20 +18016,25 @@ function MenuOption(props) {
18016
18016
  },
18017
18017
  handleAction,
18018
18018
  option,
18019
- option: { icon: icon2, label: label2 }
18019
+ option: { icon: icon2, label: label2, disabled }
18020
18020
  } = props;
18021
18021
  const onClick = useCallback(
18022
18022
  (e) => {
18023
18023
  e.preventDefault();
18024
+ if (disabled) {
18025
+ return;
18026
+ }
18024
18027
  handleAction(option);
18025
- onClose();
18028
+ onClose == null ? void 0 : onClose();
18026
18029
  },
18027
- [onClose, handleAction, option]
18030
+ [onClose, handleAction, option, disabled]
18028
18031
  );
18029
18032
  return /* @__PURE__ */ jsxs(
18030
18033
  "button",
18031
18034
  {
18032
18035
  className: styles$1.menuOption,
18036
+ "aria-disabled": disabled,
18037
+ disabled,
18033
18038
  style: {
18034
18039
  height: contextMenuOptionHeight,
18035
18040
  paddingLeft: contextMenuSidePadding,
@@ -18045,7 +18050,7 @@ function MenuOption(props) {
18045
18050
  style: {
18046
18051
  width: contextMenuIconWidth,
18047
18052
  color: "var(--gantt-context-menu-text-color)",
18048
- opacity: 0.5
18053
+ opacity: disabled ? 0.3 : 0.5
18049
18054
  },
18050
18055
  children: icon2
18051
18056
  }
@@ -18015,9 +18015,9 @@
18015
18015
  handleOpenContextMenu
18016
18016
  };
18017
18017
  };
18018
- const menuOption = "_menuOption_1ulvi_3";
18019
- const icon = "_icon_1ulvi_55";
18020
- const label = "_label_1ulvi_63";
18018
+ const menuOption = "_menuOption_1frh4_3";
18019
+ const icon = "_icon_1frh4_79";
18020
+ const label = "_label_1frh4_87";
18021
18021
  const styles$1 = {
18022
18022
  menuOption,
18023
18023
  icon,
@@ -18033,20 +18033,25 @@
18033
18033
  },
18034
18034
  handleAction,
18035
18035
  option,
18036
- option: { icon: icon2, label: label2 }
18036
+ option: { icon: icon2, label: label2, disabled }
18037
18037
  } = props;
18038
18038
  const onClick = React.useCallback(
18039
18039
  (e) => {
18040
18040
  e.preventDefault();
18041
+ if (disabled) {
18042
+ return;
18043
+ }
18041
18044
  handleAction(option);
18042
- onClose();
18045
+ onClose == null ? void 0 : onClose();
18043
18046
  },
18044
- [onClose, handleAction, option]
18047
+ [onClose, handleAction, option, disabled]
18045
18048
  );
18046
18049
  return /* @__PURE__ */ jsxRuntime.jsxs(
18047
18050
  "button",
18048
18051
  {
18049
18052
  className: styles$1.menuOption,
18053
+ "aria-disabled": disabled,
18054
+ disabled,
18050
18055
  style: {
18051
18056
  height: contextMenuOptionHeight,
18052
18057
  paddingLeft: contextMenuSidePadding,
@@ -18062,7 +18067,7 @@
18062
18067
  style: {
18063
18068
  width: contextMenuIconWidth,
18064
18069
  color: "var(--gantt-context-menu-text-color)",
18065
- opacity: 0.5
18070
+ opacity: disabled ? 0.3 : 0.5
18066
18071
  },
18067
18072
  children: icon2
18068
18073
  }
package/dist/style.css CHANGED
@@ -636,7 +636,7 @@
636
636
  cursor: grabbing;
637
637
  }
638
638
  /*noinspection CssUnresolvedCustomProperty*/
639
- ._menuOption_1ulvi_3 {
639
+ ._menuOption_1frh4_3 {
640
640
  display: flex;
641
641
  align-items: center;
642
642
  text-align: left;
@@ -653,20 +653,32 @@
653
653
  fill: var(--gantt-table-action-color);
654
654
  }
655
655
 
656
- ._menuOption_1ulvi_3 svg {
656
+ ._menuOption_1frh4_3 svg {
657
657
  width: 20px;
658
658
  height: 20px;
659
659
  }
660
660
 
661
- ._menuOption_1ulvi_3:hover {
661
+ ._menuOption_1frh4_3:hover {
662
662
  background-color: #eeeeee;
663
663
  }
664
664
 
665
- ._icon_1ulvi_55 {
665
+ ._menuOption_1frh4_3[aria-disabled="true"],
666
+ ._menuOption_1frh4_3:disabled {
667
+ opacity: 0.6;
668
+ cursor: default;
669
+ background-color: transparent;
670
+ }
671
+
672
+ ._menuOption_1frh4_3[aria-disabled="true"]:hover,
673
+ ._menuOption_1frh4_3:disabled:hover {
674
+ background-color: transparent;
675
+ }
676
+
677
+ ._icon_1frh4_79 {
666
678
  font-size: inherit;
667
679
  }
668
680
 
669
- ._label_1ulvi_63 {
681
+ ._label_1frh4_87 {
670
682
  flex: 1;
671
683
  }
672
684
  /* HTML: <div class="loader"></div> */
@@ -570,6 +570,10 @@ export type ContextMenuOptionType = {
570
570
  * @param meta Metadata for checking
571
571
  */
572
572
  checkIsAvailable?: (meta: CheckIsAvailableMetaType) => void;
573
+ /**
574
+ * Optional flag to render the option as disabled (not clickable)
575
+ */
576
+ disabled?: boolean;
573
577
  label: ReactNode;
574
578
  icon?: ReactNode;
575
579
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gantt-task-react-v",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "description": "Interactive Gantt Chart for React with TypeScript.",
5
5
  "author": "aguilanbon",
6
6
  "homepage": "https://github.com/aguilanbon/gantt-task-react-v",