@singularsystems/neo-react 0.10.55 → 0.10.57

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.
@@ -2,9 +2,9 @@ import { Model } from '@singularsystems/neo-core';
2
2
  import { ModelCreatorBase } from '@singularsystems/neo-core/dist/Model/ModelCreatorBase';
3
3
  import { NeoTypeInfo } from '@singularsystems/neo-core/dist/Model/NeoTypeInfo';
4
4
  export declare class ReactModelCreator extends ModelCreatorBase {
5
- convertInstance(instance: {}): {};
6
- setupModel(typeInfo: NeoTypeInfo, model: Model.IModelBase): void;
7
- setupObject(typeInfo: NeoTypeInfo, object: any): void;
5
+ convertInstance(instance: {}, options: Model.IMakeBindableOptions): {};
6
+ setupModel(typeInfo: NeoTypeInfo, model: Model.IModelBase, options: Model.IMakeBindableOptions): void;
7
+ setupObject(typeInfo: NeoTypeInfo, object: any, options: Model.IMakeBindableOptions): void;
8
8
  private convertToObservable;
9
9
  private addChangeTracking;
10
10
  }
@@ -4,38 +4,34 @@ import { createObservableList } from './Utils';
4
4
  import { Misc, Validation, Utils } from '@singularsystems/neo-core';
5
5
  import { ModelCreatorBase } from '@singularsystems/neo-core/dist/Model/ModelCreatorBase';
6
6
  import PropertyInstance from '@singularsystems/neo-core/dist/Model/PropertyInstance';
7
- var hasConvertedSymbol = Symbol("hasConvertedModel");
8
7
  var ReactModelCreator = /** @class */ (function (_super) {
9
8
  __extends(ReactModelCreator, _super);
10
9
  function ReactModelCreator() {
11
10
  return _super !== null && _super.apply(this, arguments) || this;
12
11
  }
13
- ReactModelCreator.prototype.convertInstance = function (instance) {
14
- if (!instance[hasConvertedSymbol]) {
15
- if (this.typeInfo.inheritsBindableBase) {
16
- this.setupModel(this.typeInfo, instance);
17
- }
18
- else {
19
- this.setupObject(this.typeInfo, instance);
20
- }
21
- instance[hasConvertedSymbol] = true;
12
+ ReactModelCreator.prototype.convertInstance = function (instance, options) {
13
+ if (this.typeInfo.inheritsBindableBase) {
14
+ this.setupModel(this.typeInfo, instance, options);
15
+ }
16
+ else {
17
+ this.setupObject(this.typeInfo, instance, options);
22
18
  }
23
19
  return instance;
24
20
  };
25
- ReactModelCreator.prototype.setupModel = function (typeInfo, model) {
21
+ ReactModelCreator.prototype.setupModel = function (typeInfo, model, options) {
26
22
  if (this.typeInfo.inheritsModelBase) {
27
23
  model.validator = new Validation.ModelValidator(model, typeInfo.objectRules);
28
24
  }
29
25
  model.meta = {};
30
26
  model.isSuspended = true;
31
- this.setupObject(typeInfo, model);
27
+ this.setupObject(typeInfo, model, options);
32
28
  model.isSuspended = false;
33
29
  };
34
- ReactModelCreator.prototype.setupObject = function (typeInfo, object) {
30
+ ReactModelCreator.prototype.setupObject = function (typeInfo, object, options) {
35
31
  for (var _i = 0, _a = typeInfo.properties; _i < _a.length; _i++) {
36
32
  var propertyInfo = _a[_i];
37
33
  if (propertyInfo.isObservable !== false) {
38
- var propertyName = propertyInfo.propertyName, makeObservable = this.typeInfo.inheritsModelBase || propertyInfo.isObservable === true;
34
+ var propertyName = propertyInfo.propertyName, makeObservable = options.makeObservable || propertyInfo.isObservable === true;
39
35
  var propertyInstance = void 0;
40
36
  if (this.typeInfo.inheritsBindableBase) {
41
37
  var model = object;
@@ -86,7 +86,7 @@ interface ICommonContainerOwnProps {
86
86
  /**
87
87
  * Tooltip to display on hover of the editor.
88
88
  */
89
- editorTooltip?: string;
89
+ editorTooltip?: string | Components.Tooltip.ITooltipOptions;
90
90
  /**
91
91
  * Classname to add to the editor.
92
92
  */
@@ -8,6 +8,7 @@ import RadioList from './RadioList';
8
8
  import * as React from 'react';
9
9
  import { DataType } from '@singularsystems/neo-core/dist/Model/Misc';
10
10
  import FileInput from './FileManager/FileInput';
11
+ import Tooltip from './Tooltip';
11
12
  export var ControlType;
12
13
  (function (ControlType) {
13
14
  ControlType[ControlType["Date"] = 0] = "Date";
@@ -148,7 +149,7 @@ var BindPropsHelper = /** @class */ (function () {
148
149
  if (!editorProps)
149
150
  editorProps = {};
150
151
  if (editorTooltip) {
151
- editorProps["data-tip"] = editorTooltip;
152
+ Tooltip.setDomProperties(editorProps, editorTooltip);
152
153
  }
153
154
  if (editorClassName) {
154
155
  editorProps.className = editorClassName;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@singularsystems/neo-react",
3
- "version": "0.10.55",
3
+ "version": "0.10.57",
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",
@@ -33,7 +33,7 @@
33
33
  "@types/rc-slider": "^8.6.5",
34
34
  "@types/react-color": "^3.0.1",
35
35
  "@types/react-select": "3.1.0",
36
- "@singularsystems/neo-core": "^0.10.58",
36
+ "@singularsystems/neo-core": "^0.10.62",
37
37
  "axios": "^0.21.1",
38
38
  "decimal.js-light": "2.5.1",
39
39
  "history": "4.10.1",
@@ -47,7 +47,7 @@
47
47
  "react-router-dom": "5.1.0"
48
48
  },
49
49
  "peerDependencies": {
50
- "@singularsystems/neo-core": ">=0.10.58",
50
+ "@singularsystems/neo-core": ">=0.10.62",
51
51
  "axios": ">=0.21.1",
52
52
  "inversify": ">=5.0.1",
53
53
  "react": ">=16.13.1",