@zhongguo168a/yxeditor-common 0.0.151 → 0.0.153
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.esm.js +5 -5
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -4378,6 +4378,7 @@ class ViewModel extends EventDispatcher {
|
|
|
4378
4378
|
}
|
|
4379
4379
|
routeViews.set(route.key, this);
|
|
4380
4380
|
}
|
|
4381
|
+
this._result = false;
|
|
4381
4382
|
this.state = ViewState.Opening;
|
|
4382
4383
|
this.dispatch(ViewEvent.Opening);
|
|
4383
4384
|
//
|
|
@@ -4408,6 +4409,7 @@ class ViewModel extends EventDispatcher {
|
|
|
4408
4409
|
if (route) {
|
|
4409
4410
|
routeViews.delete(this._route.key);
|
|
4410
4411
|
}
|
|
4412
|
+
this._result = false;
|
|
4411
4413
|
this.state = ViewState.Closeing;
|
|
4412
4414
|
this.dispatch(ViewEvent.Closeing);
|
|
4413
4415
|
try {
|
|
@@ -4437,6 +4439,7 @@ class ViewModel extends EventDispatcher {
|
|
|
4437
4439
|
}
|
|
4438
4440
|
stop(reason) {
|
|
4439
4441
|
try {
|
|
4442
|
+
this._result = false;
|
|
4440
4443
|
this._reason = reason;
|
|
4441
4444
|
this.onStop();
|
|
4442
4445
|
}
|
|
@@ -4451,20 +4454,17 @@ class ViewModel extends EventDispatcher {
|
|
|
4451
4454
|
* 如果返回 null,表示主动取消 [cancel]
|
|
4452
4455
|
*/
|
|
4453
4456
|
wait() {
|
|
4454
|
-
this._result = false;
|
|
4455
4457
|
switch (this.state) {
|
|
4456
4458
|
case ViewState.Opening:
|
|
4457
4459
|
return new Promise((resolve, reject) => {
|
|
4458
4460
|
let opened = () => {
|
|
4459
4461
|
this.off("opened", this, opened);
|
|
4460
4462
|
this.off("closed", this, opened);
|
|
4461
|
-
this._result = true;
|
|
4462
4463
|
resolve(this);
|
|
4463
4464
|
};
|
|
4464
4465
|
let canceled = () => {
|
|
4465
4466
|
this.off("opened", this, opened);
|
|
4466
4467
|
this.off("closed", this, opened);
|
|
4467
|
-
this._result = false;
|
|
4468
4468
|
resolve(this);
|
|
4469
4469
|
};
|
|
4470
4470
|
this.on("opened", this, opened);
|
|
@@ -4474,14 +4474,12 @@ class ViewModel extends EventDispatcher {
|
|
|
4474
4474
|
return new Promise((resolve, reject) => {
|
|
4475
4475
|
let opened = () => {
|
|
4476
4476
|
this.off("closed", this, opened);
|
|
4477
|
-
this._result = true;
|
|
4478
4477
|
resolve(this);
|
|
4479
4478
|
};
|
|
4480
4479
|
this.on("closed", this, opened);
|
|
4481
4480
|
});
|
|
4482
4481
|
default:
|
|
4483
4482
|
return new Promise((resolve, reject) => {
|
|
4484
|
-
this._result = true;
|
|
4485
4483
|
resolve(this);
|
|
4486
4484
|
});
|
|
4487
4485
|
}
|
|
@@ -4522,6 +4520,7 @@ class ViewModel extends EventDispatcher {
|
|
|
4522
4520
|
this.state = ViewState.Opened;
|
|
4523
4521
|
// @ts-ignore
|
|
4524
4522
|
this._waitOpenComplete = false;
|
|
4523
|
+
this._result = true;
|
|
4525
4524
|
this.onOpened();
|
|
4526
4525
|
this.dispatch(ViewEvent.Opened);
|
|
4527
4526
|
}
|
|
@@ -4535,6 +4534,7 @@ class ViewModel extends EventDispatcher {
|
|
|
4535
4534
|
}
|
|
4536
4535
|
routeViews.delete(this.getIdent());
|
|
4537
4536
|
this._waitCloseComplete = false;
|
|
4537
|
+
this._result = true;
|
|
4538
4538
|
this.state = ViewState.Closed;
|
|
4539
4539
|
this.dispatch(ViewEvent.Closed);
|
|
4540
4540
|
this.onClosed();
|