@singularsystems/neo-react 1.0.10 → 1.0.12

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,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import ComponentBase from './ComponentBase';
3
3
  import { Components } from '@singularsystems/neo-core';
4
- type IButtonProps = Components.IButtonOptions & React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
4
+ type IButtonProps = Components.IButtonOptions & Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<Button>;
5
5
  interface IButtonState {
6
6
  isExpanded: boolean;
7
7
  }
@@ -14,8 +14,8 @@ export default class Button extends ComponentBase<IButtonProps, IButtonState> {
14
14
  private iconFactory;
15
15
  private windowClickHandler;
16
16
  constructor(props: IButtonProps);
17
- private showMenu;
18
- private hideMenu;
17
+ showMenu(): void;
18
+ hideMenu(): void;
19
19
  private menuItemClicked;
20
20
  private windowClicked;
21
21
  afterRender(): void;
@@ -42,6 +42,9 @@ var Button = /** @class */ (function (_super) {
42
42
  };
43
43
  Button.prototype.windowClicked = function (e) {
44
44
  this.hideMenu();
45
+ if (this.props.onMenuClosed !== undefined) {
46
+ this.props.onMenuClosed();
47
+ }
45
48
  };
46
49
  Button.prototype.afterRender = function () {
47
50
  if (this.btnGroupDom.current && this.menuDom.current) {
@@ -108,7 +111,7 @@ var Button = /** @class */ (function (_super) {
108
111
  if (isDropDown) {
109
112
  var menu = React.createElement("div", { className: "dropdown-menu" + (this.state.isExpanded ? " show" : ""), ref: this.menuDom }, menuItems.map(function (item, index) { return (item.header ? React.createElement("h6", { key: index, className: "dropdown-header" }, item.header)
110
113
  : item.isDivider ? React.createElement("div", { key: index, className: "dropdown-divider" })
111
- : React.createElement("div", { key: index, className: "dropdown-item", onClick: function (e) { return _this.menuItemClicked(e, item.data, item.onClick); } },
114
+ : React.createElement("div", { key: index, className: Utils.joinWithSpaces("dropdown-item", item.disabled ? " disabled" : "", item.className), onClick: function (e) { return !item.disabled ? _this.menuItemClicked(e, item.data, item.onClick) : undefined; } },
112
115
  _this.iconFactory.getIconComponent(item.icon, { fixedWidth: true }),
113
116
  " ",
114
117
  item.text)); }));
@@ -1,5 +1,5 @@
1
1
  import { Components } from '@singularsystems/neo-core';
2
- import React, { HTMLProps } from 'react';
2
+ import React, { HTMLAttributes } from 'react';
3
3
  export interface ITooltipProps extends Components.Tooltip.ITooltipOptions<string | JSX.Element> {
4
4
  /**
5
5
  * True if the div wrapping the content must display inline.
@@ -18,7 +18,7 @@ export default class Tooltip extends React.Component<ITooltipProps> {
18
18
  static fromDataAttributes(element: JSX.Element, attributes: {
19
19
  [key: string]: any;
20
20
  }): React.JSX.Element;
21
- static setDomProperties(dom: HTMLProps<HTMLElement> & {
21
+ static setDomProperties(dom: HTMLAttributes<HTMLElement> & {
22
22
  [key: string]: any;
23
23
  }, tooltipOptions: string | Components.Tooltip.ITooltipOptions): void;
24
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@singularsystems/neo-react",
3
- "version": "1.0.10",
3
+ "version": "1.0.12",
4
4
  "description": "React application logic and components for the Neo client library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -31,7 +31,7 @@
31
31
  "typescript": "5.4.2"
32
32
  },
33
33
  "dependencies": {
34
- "@singularsystems/neo-core": "1.0.7",
34
+ "@singularsystems/neo-core": "1.0.9",
35
35
  "@types/rc-slider": "^8.6.5",
36
36
  "@types/react-color": "^3.0.1",
37
37
  "axios": "1.6.7",
@@ -49,7 +49,7 @@
49
49
  "tslib": "2.5.0"
50
50
  },
51
51
  "peerDependencies": {
52
- "@singularsystems/neo-core": ">=1.0.4",
52
+ "@singularsystems/neo-core": ">=1.0.9",
53
53
  "axios": ">=1.6.2",
54
54
  "inversify": ">=5.0.1",
55
55
  "mobx": ">=6.9.0",