@zhongguo168a/yxeditor-common 0.0.147 → 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
  /**
@@ -4436,6 +4437,7 @@ class ViewModel extends EventDispatcher {
4436
4437
  }
4437
4438
  stop(reason) {
4438
4439
  try {
4440
+ this._reason = reason;
4439
4441
  this.onStop();
4440
4442
  }
4441
4443
  catch (e) {
@@ -4449,32 +4451,37 @@ class ViewModel extends EventDispatcher {
4449
4451
  * 如果返回 null,表示主动取消 [cancel]
4450
4452
  */
4451
4453
  wait() {
4454
+ this._result = false;
4452
4455
  switch (this.state) {
4453
4456
  case ViewState.Opening:
4454
4457
  return new Promise((resolve, reject) => {
4455
4458
  let opened = () => {
4456
4459
  this.off("opened", this, opened);
4457
- this.off("canceled", this, opened);
4460
+ this.off("closed", this, opened);
4461
+ this._result = true;
4458
4462
  resolve(this);
4459
4463
  };
4460
4464
  let canceled = () => {
4461
4465
  this.off("opened", this, opened);
4462
- this.off("canceled", this, opened);
4466
+ this.off("closed", this, opened);
4467
+ this._result = false;
4463
4468
  resolve(this);
4464
4469
  };
4465
4470
  this.on("opened", this, opened);
4466
- this.on("canceled", this, canceled);
4471
+ this.on("closed", this, canceled);
4467
4472
  });
4468
4473
  case ViewState.Closeing:
4469
4474
  return new Promise((resolve, reject) => {
4470
4475
  let opened = () => {
4471
4476
  this.off("closed", this, opened);
4477
+ this._result = true;
4472
4478
  resolve(this);
4473
4479
  };
4474
4480
  this.on("closed", this, opened);
4475
4481
  });
4476
4482
  default:
4477
4483
  return new Promise((resolve, reject) => {
4484
+ this._result = true;
4478
4485
  resolve(this);
4479
4486
  });
4480
4487
  }
@@ -4538,6 +4545,9 @@ class ViewModel extends EventDispatcher {
4538
4545
  get route() {
4539
4546
  return this._route;
4540
4547
  }
4548
+ /**
4549
+ * 停止的原因
4550
+ */
4541
4551
  get reason() {
4542
4552
  return this._reason;
4543
4553
  }