@zhongguo168a/yxeditor-common 0.0.148 → 0.0.150
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 +5 -0
- package/dist/index.esm.js +15 -3
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1360,6 +1360,10 @@ declare class ViewModel extends EventDispatcher {
|
|
|
1360
1360
|
protected _waitCloseComplete: boolean;
|
|
1361
1361
|
get controller(): RouteController;
|
|
1362
1362
|
get route(): Route;
|
|
1363
|
+
get result(): boolean;
|
|
1364
|
+
/**
|
|
1365
|
+
* 停止的原因
|
|
1366
|
+
*/
|
|
1363
1367
|
get reason(): LinkError;
|
|
1364
1368
|
node: Node;
|
|
1365
1369
|
datas: MapObject;
|
|
@@ -1370,6 +1374,7 @@ declare class ViewModel extends EventDispatcher {
|
|
|
1370
1374
|
protected _controller: RouteController;
|
|
1371
1375
|
protected _route: Route;
|
|
1372
1376
|
protected _reason: LinkError;
|
|
1377
|
+
protected _result: boolean;
|
|
1373
1378
|
protected _viewModelComponent: ViewModelComponent;
|
|
1374
1379
|
protected onOpen(): void;
|
|
1375
1380
|
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("
|
|
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("
|
|
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("
|
|
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,12 @@ class ViewModel extends EventDispatcher {
|
|
|
4539
4545
|
get route() {
|
|
4540
4546
|
return this._route;
|
|
4541
4547
|
}
|
|
4548
|
+
get result() {
|
|
4549
|
+
return this._result;
|
|
4550
|
+
}
|
|
4551
|
+
/**
|
|
4552
|
+
* 停止的原因
|
|
4553
|
+
*/
|
|
4542
4554
|
get reason() {
|
|
4543
4555
|
return this._reason;
|
|
4544
4556
|
}
|