@zhongguo168a/yxeditor-common 0.0.148 → 0.0.149

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.
package/dist/index.d.ts CHANGED
@@ -1360,6 +1360,9 @@ declare class ViewModel extends EventDispatcher {
1360
1360
  protected _waitCloseComplete: boolean;
1361
1361
  get controller(): RouteController;
1362
1362
  get route(): Route;
1363
+ /**
1364
+ * 停止的原因
1365
+ */
1363
1366
  get reason(): LinkError;
1364
1367
  node: Node;
1365
1368
  datas: MapObject;
@@ -1370,6 +1373,7 @@ declare class ViewModel extends EventDispatcher {
1370
1373
  protected _controller: RouteController;
1371
1374
  protected _route: Route;
1372
1375
  protected _reason: LinkError;
1376
+ protected _result: boolean;
1373
1377
  protected _viewModelComponent: ViewModelComponent;
1374
1378
  protected onOpen(): void;
1375
1379
  protected onOpened(): void;
package/dist/index.esm.js CHANGED
@@ -4335,6 +4335,7 @@ class ViewModel extends EventDispatcher {
4335
4335
  this.tags = new MapObject({});
4336
4336
  this.enableHistory = false;
4337
4337
  this.state = 0;
4338
+ this._result = false;
4338
4339
  this.name = name;
4339
4340
  }
4340
4341
  /**
@@ -4450,32 +4451,37 @@ class ViewModel extends EventDispatcher {
4450
4451
  * 如果返回 null,表示主动取消 [cancel]
4451
4452
  */
4452
4453
  wait() {
4454
+ this._result = false;
4453
4455
  switch (this.state) {
4454
4456
  case ViewState.Opening:
4455
4457
  return new Promise((resolve, reject) => {
4456
4458
  let opened = () => {
4457
4459
  this.off("opened", this, opened);
4458
- this.off("canceled", this, opened);
4460
+ this.off("closed", this, opened);
4461
+ this._result = true;
4459
4462
  resolve(this);
4460
4463
  };
4461
4464
  let canceled = () => {
4462
4465
  this.off("opened", this, opened);
4463
- this.off("canceled", this, opened);
4466
+ this.off("closed", this, opened);
4467
+ this._result = false;
4464
4468
  resolve(this);
4465
4469
  };
4466
4470
  this.on("opened", this, opened);
4467
- this.on("canceled", this, canceled);
4471
+ this.on("closed", this, canceled);
4468
4472
  });
4469
4473
  case ViewState.Closeing:
4470
4474
  return new Promise((resolve, reject) => {
4471
4475
  let opened = () => {
4472
4476
  this.off("closed", this, opened);
4477
+ this._result = true;
4473
4478
  resolve(this);
4474
4479
  };
4475
4480
  this.on("closed", this, opened);
4476
4481
  });
4477
4482
  default:
4478
4483
  return new Promise((resolve, reject) => {
4484
+ this._result = true;
4479
4485
  resolve(this);
4480
4486
  });
4481
4487
  }
@@ -4539,6 +4545,9 @@ class ViewModel extends EventDispatcher {
4539
4545
  get route() {
4540
4546
  return this._route;
4541
4547
  }
4548
+ /**
4549
+ * 停止的原因
4550
+ */
4542
4551
  get reason() {
4543
4552
  return this._reason;
4544
4553
  }