@logicflow/core 2.0.2 → 2.0.3

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.
@@ -350,10 +350,7 @@ var BaseEdgeModel = /** @class */ (function () {
350
350
  * @param val 属性值
351
351
  */
352
352
  BaseEdgeModel.prototype.setProperty = function (key, val) {
353
- var preProperties = toJS(this.properties);
354
- var newProperties = cloneDeep(preProperties);
355
- set(newProperties, key, formatData(val));
356
- this.properties = newProperties;
353
+ set(this.properties, key, formatData(val));
357
354
  this.setAttributes();
358
355
  };
359
356
  /**
@@ -699,7 +699,6 @@ var BaseNodeModel = /** @class */ (function () {
699
699
  var nextProperties = cloneDeep(preProperties);
700
700
  // https://lodash.com/docs/4.17.15#set
701
701
  // 使用 lodash 的 set 方法更新某个属性,可以支持 key 为 'a.b.c' 的情况
702
- // TODO:待测试
703
702
  set(nextProperties, key, formatData(val));
704
703
  this.updateProperties(nextProperties, [key]);
705
704
  };
@@ -1 +1 @@
1
- export declare const isIe: boolean;
1
+ export declare const isIe: () => boolean;
@@ -1,2 +1,4 @@
1
1
  import { get } from 'lodash-es';
2
- export var isIe = get(window, 'navigator.userAgent', '').match(/MSIE|Trident/) !== null;
2
+ export var isIe = function () {
3
+ return get(window, 'navigator.userAgent', '').match(/MSIE|Trident/) !== null;
4
+ };
@@ -165,7 +165,7 @@ var BaseNode = /** @class */ (function (_super) {
165
165
  model.isDragging = false;
166
166
  };
167
167
  _this.onMouseOut = function (ev) {
168
- if (isIe) {
168
+ if (isIe()) {
169
169
  _this.setHoverOff(ev);
170
170
  }
171
171
  };
@@ -353,10 +353,7 @@ var BaseEdgeModel = /** @class */ (function () {
353
353
  * @param val 属性值
354
354
  */
355
355
  BaseEdgeModel.prototype.setProperty = function (key, val) {
356
- var preProperties = (0, mobx_1.toJS)(this.properties);
357
- var newProperties = (0, lodash_es_1.cloneDeep)(preProperties);
358
- (0, mobx_1.set)(newProperties, key, (0, util_1.formatData)(val));
359
- this.properties = newProperties;
356
+ (0, mobx_1.set)(this.properties, key, (0, util_1.formatData)(val));
360
357
  this.setAttributes();
361
358
  };
362
359
  /**
@@ -702,7 +702,6 @@ var BaseNodeModel = /** @class */ (function () {
702
702
  var nextProperties = (0, lodash_es_1.cloneDeep)(preProperties);
703
703
  // https://lodash.com/docs/4.17.15#set
704
704
  // 使用 lodash 的 set 方法更新某个属性,可以支持 key 为 'a.b.c' 的情况
705
- // TODO:待测试
706
705
  (0, lodash_es_1.set)(nextProperties, key, (0, util_1.formatData)(val));
707
706
  this.updateProperties(nextProperties, [key]);
708
707
  };
@@ -1 +1 @@
1
- export declare const isIe: boolean;
1
+ export declare const isIe: () => boolean;
@@ -2,4 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isIe = void 0;
4
4
  var lodash_es_1 = require("lodash-es");
5
- exports.isIe = (0, lodash_es_1.get)(window, 'navigator.userAgent', '').match(/MSIE|Trident/) !== null;
5
+ var isIe = function () {
6
+ return (0, lodash_es_1.get)(window, 'navigator.userAgent', '').match(/MSIE|Trident/) !== null;
7
+ };
8
+ exports.isIe = isIe;
@@ -169,7 +169,7 @@ var BaseNode = /** @class */ (function (_super) {
169
169
  model.isDragging = false;
170
170
  };
171
171
  _this.onMouseOut = function (ev) {
172
- if (util_1.isIe) {
172
+ if ((0, util_1.isIe)()) {
173
173
  _this.setHoverOff(ev);
174
174
  }
175
175
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logicflow/core",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "LogicFlow, help you quickly create flowcharts",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -426,11 +426,7 @@ export class BaseEdgeModel<P extends PropertiesType = PropertiesType>
426
426
  * @param val 属性值
427
427
  */
428
428
  @action setProperty(key: string, val: any): void {
429
- const preProperties = toJS(this.properties)
430
- const newProperties = cloneDeep(preProperties)
431
- set(newProperties, key, formatData(val))
432
-
433
- this.properties = newProperties
429
+ set(this.properties, key, formatData(val))
434
430
  this.setAttributes()
435
431
  }
436
432
 
@@ -801,7 +801,6 @@ export class BaseNodeModel<P extends PropertiesType = PropertiesType>
801
801
  const nextProperties = cloneDeep(preProperties)
802
802
  // https://lodash.com/docs/4.17.15#set
803
803
  // 使用 lodash 的 set 方法更新某个属性,可以支持 key 为 'a.b.c' 的情况
804
- // TODO:待测试
805
804
  set(nextProperties, key, formatData(val))
806
805
 
807
806
  this.updateProperties(nextProperties, [key])
@@ -1,4 +1,4 @@
1
1
  import { get } from 'lodash-es'
2
2
 
3
- export const isIe =
3
+ export const isIe = () =>
4
4
  get(window, 'navigator.userAgent', '').match(/MSIE|Trident/) !== null
@@ -321,7 +321,7 @@ export abstract class BaseNode<P extends IProps = IProps> extends Component<
321
321
  model.isDragging = false
322
322
  }
323
323
  onMouseOut = (ev: MouseEvent) => {
324
- if (isIe) {
324
+ if (isIe()) {
325
325
  this.setHoverOff(ev)
326
326
  }
327
327
  }