@geotab/zenith 1.18.0-beta.0 → 1.18.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.
@@ -32,12 +32,13 @@ const PageToolbarCollapsedItemsControl = ({ children }) => {
32
32
  const clickHandler = (0, react_1.useCallback)((propsOnClick) => ((_, e) => { propsOnClick(e); }), []);
33
33
  react_1.Children.forEach(children, (child) => {
34
34
  if ((0, headerHelpers_1.isNamedChildComponent)(child, headerButton_1.HeaderButtonDisplayName)) {
35
+ const onClick = child.props.onClick;
35
36
  const el = (0, react_1.createElement)(menu_1.Menu.Item, {
36
37
  id: child.props.id,
37
38
  key: child.props.id,
38
39
  name: typeof child.props.children === "string" ? child.props.children : "",
39
40
  disabled: child.props.disabled,
40
- onClick: child.props.onClick ? clickHandler(child.props.onClick) : undefined,
41
+ onClick: onClick ? clickHandler((e) => onClick(child.props.id, e)) : undefined,
41
42
  link: child.props.link,
42
43
  target: child.props.target,
43
44
  rel: child.props.rel,
@@ -3,13 +3,14 @@ import { IButton } from "../button/button";
3
3
  import { TButtonIconPosition } from "../textIconButton/textIconButton";
4
4
  import { TSvgIconSize } from "../svgIcon/svgIconSize";
5
5
  import { IIcon } from "../icons/icon";
6
- export interface IHeaderButton extends IButton {
6
+ export interface IHeaderButton extends Omit<IButton, "onClick"> {
7
7
  id: string;
8
8
  important?: boolean;
9
9
  icon?: React.FC<IIcon>;
10
10
  iconPosition?: TButtonIconPosition;
11
11
  iconClasses?: string;
12
12
  iconSize?: TSvgIconSize;
13
+ onClick?: (id: string, event: React.MouseEvent) => void;
13
14
  }
14
15
  export declare const HeaderButtonDisplayName = "HeaderButton";
15
16
  export declare const HeaderButton: React.FC<IHeaderButton>;
@@ -22,8 +22,8 @@ const HeaderButton = (_a) => {
22
22
  const fullClassName = (0, classNames_1.classNames)(["zen-header-button", className]);
23
23
  const props = Object.assign(Object.assign({}, restProps), { "data-important": important ? "1" : "0" });
24
24
  return icon
25
- ? (0, jsx_runtime_1.jsx)(textIconButton_1.TextIconButton, Object.assign({ id: id, icon: icon, iconPosition: iconPosition, className: fullClassName, onClick: onClick ? (e) => onClick(e) : undefined }, props, { children: children }))
26
- : (0, jsx_runtime_1.jsx)(button_1.Button, Object.assign({ id: id, className: fullClassName, onClick: onClick ? (e) => onClick(e) : undefined }, props, { children: children }));
25
+ ? (0, jsx_runtime_1.jsx)(textIconButton_1.TextIconButton, Object.assign({ id: id, icon: icon, iconPosition: iconPosition, className: fullClassName, onClick: onClick ? (e) => onClick(id, e) : undefined }, props, { children: children }))
26
+ : (0, jsx_runtime_1.jsx)(button_1.Button, Object.assign({ id: id, className: fullClassName, onClick: onClick ? (e) => onClick(id, e) : undefined }, props, { children: children }));
27
27
  };
28
28
  exports.HeaderButton = HeaderButton;
29
29
  exports.HeaderButton.displayName = exports.HeaderButtonDisplayName;
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@geotab/zenith",
3
- "version": "1.18.0-beta.0",
3
+ "version": "1.18.0",
4
4
  "description": "Zenith components library on React",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "publishConfig": {
8
- "access": "public"
9
- },
8
+ "access": "public"
9
+ },
10
10
  "scripts": {
11
11
  "test": "npm run clean && npm run test-build && jest",
12
12
  "start": "npm run storybook --loglevel verbose",