@speakapbv/dough-component-library 9.25.0 → 9.26.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.
@@ -1,4 +1,4 @@
1
- import React, { ReactNode, FunctionComponent } from "react";
1
+ import React, { ReactNode, MouseEvent, FunctionComponent } from "react";
2
2
  import { Colors, ColorsText, Sizes, DoughDataAttributes } from "../../utils/constants";
3
3
  import { ButtonProps } from "../button/button";
4
4
  import "./drop-menu.scss";
@@ -36,5 +36,6 @@ export interface DropMenuProps {
36
36
  innerButtonSize?: Sizes.NORMAL | Sizes.SMALL;
37
37
  rightShift?: number;
38
38
  overlaySelector?: string;
39
+ customClickHandler?: (e: MouseEvent) => void;
39
40
  }
40
41
  export declare const DropMenu: React.ForwardRefExoticComponent<DropMenuProps & React.RefAttributes<DoughDropMenuRef>>;
package/dist/index.es.js CHANGED
@@ -1528,7 +1528,7 @@ var css_248z$c = "/* COLORS */\n/* Typography*/\n/*Dennis should provide medium
1528
1528
  styleInject(css_248z$c);
1529
1529
 
1530
1530
  var DropMenu = forwardRef(function (_a, ref) {
1531
- var _b = _a.alignIconRight, alignIconRight = _b === void 0 ? false : _b, _c = _a.color, color = _c === void 0 ? Colors.TRANSPARENT : _c, _d = _a.closeOnClickOutside, closeOnClickOutside = _d === void 0 ? true : _d, _e = _a.closeOnEscape, closeOnEscape = _e === void 0 ? true : _e, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.showCaret, showCaret = _g === void 0 ? true : _g, _h = _a.rightShift, rightShift = _h === void 0 ? 0 : _h, _j = _a.shadow, shadow = _j === void 0 ? false : _j, _k = _a.show, show = _k === void 0 ? false : _k, _l = _a.rounded, rounded = _l === void 0 ? true : _l, _m = _a.icon, icon = _m === void 0 ? React.createElement(EllipsisVIcon, null) : _m, _o = _a.size, size = _o === void 0 ? Sizes.SMALL : _o, _p = _a.innerButtonSize, innerButtonSize = _p === void 0 ? Sizes.NORMAL : _p, ButtonComponent = _a.ButtonComponent, className = _a.className, onOpen = _a.onOpen, onClose = _a.onClose, children = _a.children, asInvisibleLine = _a.asInvisibleLine, alignFromRight = _a.alignFromRight, alignToCenter = _a.alignToCenter, dataAttributes = _a.dataAttributes, padding = _a.padding, label = _a.label, fullWidth = _a.fullWidth, strictToReferenceWidth = _a.strictToReferenceWidth, buttonClassName = _a.buttonClassName, overlaySelector = _a.overlaySelector, overlayWidth = _a.overlayWidth;
1531
+ var _b = _a.alignIconRight, alignIconRight = _b === void 0 ? false : _b, _c = _a.color, color = _c === void 0 ? Colors.TRANSPARENT : _c, _d = _a.closeOnClickOutside, closeOnClickOutside = _d === void 0 ? true : _d, _e = _a.closeOnEscape, closeOnEscape = _e === void 0 ? true : _e, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.showCaret, showCaret = _g === void 0 ? true : _g, _h = _a.rightShift, rightShift = _h === void 0 ? 0 : _h, _j = _a.shadow, shadow = _j === void 0 ? false : _j, _k = _a.show, show = _k === void 0 ? false : _k, _l = _a.rounded, rounded = _l === void 0 ? true : _l, _m = _a.icon, icon = _m === void 0 ? React.createElement(EllipsisVIcon, null) : _m, _o = _a.size, size = _o === void 0 ? Sizes.SMALL : _o, _p = _a.innerButtonSize, innerButtonSize = _p === void 0 ? Sizes.NORMAL : _p, ButtonComponent = _a.ButtonComponent, className = _a.className, onOpen = _a.onOpen, onClose = _a.onClose, children = _a.children, asInvisibleLine = _a.asInvisibleLine, alignFromRight = _a.alignFromRight, alignToCenter = _a.alignToCenter, dataAttributes = _a.dataAttributes, padding = _a.padding, label = _a.label, fullWidth = _a.fullWidth, strictToReferenceWidth = _a.strictToReferenceWidth, buttonClassName = _a.buttonClassName, overlaySelector = _a.overlaySelector, overlayWidth = _a.overlayWidth, customClickHandler = _a.customClickHandler;
1532
1532
  var componentRef = useRef(null);
1533
1533
  var _q = useState(false), showDropArea = _q[0], setShowDropArea = _q[1];
1534
1534
  var openDropArea = function (e) {
@@ -1598,7 +1598,10 @@ var DropMenu = forwardRef(function (_a, ref) {
1598
1598
  size: size,
1599
1599
  shadow: shadow,
1600
1600
  onClick: function (e) {
1601
- if (showDropArea === true) {
1601
+ if (customClickHandler) {
1602
+ customClickHandler(e);
1603
+ }
1604
+ else if (showDropArea === true) {
1602
1605
  closeDropArea();
1603
1606
  }
1604
1607
  else {
package/dist/index.js CHANGED
@@ -1513,7 +1513,7 @@ var css_248z$c = "/* COLORS */\n/* Typography*/\n/*Dennis should provide medium
1513
1513
  styleInject(css_248z$c);
1514
1514
 
1515
1515
  var DropMenu = React.forwardRef(function (_a, ref) {
1516
- var _b = _a.alignIconRight, alignIconRight = _b === void 0 ? false : _b, _c = _a.color, color = _c === void 0 ? exports.Colors.TRANSPARENT : _c, _d = _a.closeOnClickOutside, closeOnClickOutside = _d === void 0 ? true : _d, _e = _a.closeOnEscape, closeOnEscape = _e === void 0 ? true : _e, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.showCaret, showCaret = _g === void 0 ? true : _g, _h = _a.rightShift, rightShift = _h === void 0 ? 0 : _h, _j = _a.shadow, shadow = _j === void 0 ? false : _j, _k = _a.show, show = _k === void 0 ? false : _k, _l = _a.rounded, rounded = _l === void 0 ? true : _l, _m = _a.icon, icon = _m === void 0 ? React__default.createElement(EllipsisVIcon, null) : _m, _o = _a.size, size = _o === void 0 ? exports.Sizes.SMALL : _o, _p = _a.innerButtonSize, innerButtonSize = _p === void 0 ? exports.Sizes.NORMAL : _p, ButtonComponent = _a.ButtonComponent, className = _a.className, onOpen = _a.onOpen, onClose = _a.onClose, children = _a.children, asInvisibleLine = _a.asInvisibleLine, alignFromRight = _a.alignFromRight, alignToCenter = _a.alignToCenter, dataAttributes = _a.dataAttributes, padding = _a.padding, label = _a.label, fullWidth = _a.fullWidth, strictToReferenceWidth = _a.strictToReferenceWidth, buttonClassName = _a.buttonClassName, overlaySelector = _a.overlaySelector, overlayWidth = _a.overlayWidth;
1516
+ var _b = _a.alignIconRight, alignIconRight = _b === void 0 ? false : _b, _c = _a.color, color = _c === void 0 ? exports.Colors.TRANSPARENT : _c, _d = _a.closeOnClickOutside, closeOnClickOutside = _d === void 0 ? true : _d, _e = _a.closeOnEscape, closeOnEscape = _e === void 0 ? true : _e, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.showCaret, showCaret = _g === void 0 ? true : _g, _h = _a.rightShift, rightShift = _h === void 0 ? 0 : _h, _j = _a.shadow, shadow = _j === void 0 ? false : _j, _k = _a.show, show = _k === void 0 ? false : _k, _l = _a.rounded, rounded = _l === void 0 ? true : _l, _m = _a.icon, icon = _m === void 0 ? React__default.createElement(EllipsisVIcon, null) : _m, _o = _a.size, size = _o === void 0 ? exports.Sizes.SMALL : _o, _p = _a.innerButtonSize, innerButtonSize = _p === void 0 ? exports.Sizes.NORMAL : _p, ButtonComponent = _a.ButtonComponent, className = _a.className, onOpen = _a.onOpen, onClose = _a.onClose, children = _a.children, asInvisibleLine = _a.asInvisibleLine, alignFromRight = _a.alignFromRight, alignToCenter = _a.alignToCenter, dataAttributes = _a.dataAttributes, padding = _a.padding, label = _a.label, fullWidth = _a.fullWidth, strictToReferenceWidth = _a.strictToReferenceWidth, buttonClassName = _a.buttonClassName, overlaySelector = _a.overlaySelector, overlayWidth = _a.overlayWidth, customClickHandler = _a.customClickHandler;
1517
1517
  var componentRef = React.useRef(null);
1518
1518
  var _q = React.useState(false), showDropArea = _q[0], setShowDropArea = _q[1];
1519
1519
  var openDropArea = function (e) {
@@ -1583,7 +1583,10 @@ var DropMenu = React.forwardRef(function (_a, ref) {
1583
1583
  size: size,
1584
1584
  shadow: shadow,
1585
1585
  onClick: function (e) {
1586
- if (showDropArea === true) {
1586
+ if (customClickHandler) {
1587
+ customClickHandler(e);
1588
+ }
1589
+ else if (showDropArea === true) {
1587
1590
  closeDropArea();
1588
1591
  }
1589
1592
  else {
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react").ReactFramework, import("./drop-menu").DropMenuProps & React.RefAttributes<import("./drop-menu").DoughDropMenuRef>>;
3
+ export default _default;
4
+ export declare const Default: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, import("./drop-menu").DropMenuProps & React.RefAttributes<import("./drop-menu").DoughDropMenuRef>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@speakapbv/dough-component-library",
3
- "version": "9.25.0",
3
+ "version": "9.26.0",
4
4
  "description": "DOUGH: Speakap React Component Library",
5
5
  "author": "Speakap",
6
6
  "license": "MIT",