@singularsystems/neo-react 1.0.11 → 1.0.13

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) {
@@ -10,7 +10,7 @@ export declare abstract class DropDownBase<T, TProps> extends ComponentBase<TPro
10
10
  protected cachedDataSource: Data.IDataCacheEntry | null;
11
11
  protected fieldInfoContainer: Model.IModelFieldInfoContainer | null;
12
12
  protected getItems(itemSource: ItemSource<T>): T[];
13
- afterRender(): Promise<void>;
13
+ afterRender(isInitial: boolean): Promise<void>;
14
14
  private fieldDisplayInfo;
15
15
  protected setFieldInfo(bindProperty: Model.IPropertyInstance, displayValue: string, readableName?: string): void;
16
16
  }
@@ -52,12 +52,12 @@ var DropDownBase = /** @class */ (function (_super) {
52
52
  }
53
53
  return items;
54
54
  };
55
- DropDownBase.prototype.afterRender = function () {
55
+ DropDownBase.prototype.afterRender = function (isInitial) {
56
56
  return __awaiter(this, void 0, void 0, function () {
57
57
  var _a, bindProperty, displayValue, readableName, fieldInfo;
58
58
  return __generator(this, function (_b) {
59
59
  if (this.cachedDataSource) {
60
- this.dataSource = this.cachedDataSource.get();
60
+ this.dataSource = this.cachedDataSource.get(isInitial);
61
61
  }
62
62
  else if (this.dataSource) {
63
63
  this.dataSource.fetchInitial();
@@ -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.11",
3
+ "version": "1.0.13",
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.8",
34
+ "@singularsystems/neo-core": "1.0.10",
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.8",
52
+ "@singularsystems/neo-core": ">=1.0.10",
53
53
  "axios": ">=1.6.2",
54
54
  "inversify": ">=5.0.1",
55
55
  "mobx": ">=6.9.0",