@zhongguo168a/yxeditor-common 0.0.44 → 0.0.46
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 +12 -7
- package/dist/index.esm.js +30 -18
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1057,11 +1057,11 @@ declare class RouteView extends EventDispatcher {
|
|
|
1057
1057
|
protected _waitCloseComplete: boolean;
|
|
1058
1058
|
get controller(): RouteController;
|
|
1059
1059
|
get route(): Route;
|
|
1060
|
-
onOpen: () => void;
|
|
1061
|
-
onOpened: () => void;
|
|
1062
|
-
onClose: () => void;
|
|
1063
|
-
onClosed: () => void;
|
|
1064
|
-
onRefresh: () => void;
|
|
1060
|
+
onOpen(value: () => void): this;
|
|
1061
|
+
onOpened(value: () => void): this;
|
|
1062
|
+
onClose(value: () => void): this;
|
|
1063
|
+
onClosed(value: () => void): this;
|
|
1064
|
+
onRefresh(value: () => void): this;
|
|
1065
1065
|
node: Node;
|
|
1066
1066
|
datas: {};
|
|
1067
1067
|
tags: {};
|
|
@@ -1070,18 +1070,23 @@ declare class RouteView extends EventDispatcher {
|
|
|
1070
1070
|
state: ViewState;
|
|
1071
1071
|
protected _controller: RouteController;
|
|
1072
1072
|
protected _route: Route;
|
|
1073
|
+
private _onOpen;
|
|
1074
|
+
private _onOpened;
|
|
1075
|
+
private _onClose;
|
|
1076
|
+
private _onClosed;
|
|
1077
|
+
private _onRefresh;
|
|
1073
1078
|
}
|
|
1074
1079
|
|
|
1075
1080
|
declare class RouteController extends Controller {
|
|
1076
1081
|
constructor(routePath: string);
|
|
1077
|
-
open(...args: any[]):
|
|
1082
|
+
open(...args: any[]): RouteView;
|
|
1078
1083
|
/**
|
|
1079
1084
|
* 当视图需要通过路由打开时,需要实现此方法
|
|
1080
1085
|
* @param route
|
|
1081
1086
|
*/
|
|
1082
1087
|
openByRoute(route?: Route): RouteView;
|
|
1083
1088
|
protected refreshView(view: RouteView): void;
|
|
1084
|
-
close(...args: any[]):
|
|
1089
|
+
close(...args: any[]): RouteView;
|
|
1085
1090
|
/**
|
|
1086
1091
|
* 当视图需要通过路由关闭时,需要实现此方法
|
|
1087
1092
|
* @param route
|
package/dist/index.esm.js
CHANGED
|
@@ -3611,7 +3611,7 @@ class RouteController extends Controller {
|
|
|
3611
3611
|
this._route = new Route(routePath);
|
|
3612
3612
|
}
|
|
3613
3613
|
open(...args) {
|
|
3614
|
-
this.openByRoute();
|
|
3614
|
+
return this.openByRoute();
|
|
3615
3615
|
}
|
|
3616
3616
|
/**
|
|
3617
3617
|
* 当视图需要通过路由打开时,需要实现此方法
|
|
@@ -3623,7 +3623,7 @@ class RouteController extends Controller {
|
|
|
3623
3623
|
refreshView(view) {
|
|
3624
3624
|
}
|
|
3625
3625
|
close(...args) {
|
|
3626
|
-
this.closeByRoute();
|
|
3626
|
+
return this.closeByRoute();
|
|
3627
3627
|
}
|
|
3628
3628
|
/**
|
|
3629
3629
|
* 当视图需要通过路由关闭时,需要实现此方法
|
|
@@ -3871,8 +3871,8 @@ class RouteView extends EventDispatcher {
|
|
|
3871
3871
|
//
|
|
3872
3872
|
try {
|
|
3873
3873
|
//
|
|
3874
|
-
if (this.
|
|
3875
|
-
this.
|
|
3874
|
+
if (this._onOpen) {
|
|
3875
|
+
this._onOpen.call(this);
|
|
3876
3876
|
}
|
|
3877
3877
|
// @ts-ignore
|
|
3878
3878
|
if (!this._waitOpenComplete) {
|
|
@@ -3897,8 +3897,8 @@ class RouteView extends EventDispatcher {
|
|
|
3897
3897
|
this.state = ViewState.Closeing;
|
|
3898
3898
|
this.dispatch(ViewEvent.Closeing);
|
|
3899
3899
|
try {
|
|
3900
|
-
if (this.
|
|
3901
|
-
this.
|
|
3900
|
+
if (this._onClose) {
|
|
3901
|
+
this._onClose.call(this);
|
|
3902
3902
|
}
|
|
3903
3903
|
// @ts-ignore
|
|
3904
3904
|
if (!this._waitCloseComplete) {
|
|
@@ -3916,16 +3916,8 @@ class RouteView extends EventDispatcher {
|
|
|
3916
3916
|
}
|
|
3917
3917
|
refresh() {
|
|
3918
3918
|
try {
|
|
3919
|
-
if (this.
|
|
3920
|
-
this.
|
|
3921
|
-
}
|
|
3922
|
-
// @ts-ignore
|
|
3923
|
-
if (!this._waitCloseComplete) {
|
|
3924
|
-
// 没有被打断,关闭完成
|
|
3925
|
-
this.closeComplete();
|
|
3926
|
-
}
|
|
3927
|
-
else {
|
|
3928
|
-
// 被打断了,等待完成1
|
|
3919
|
+
if (this._onRefresh) {
|
|
3920
|
+
this._onRefresh.call(this);
|
|
3929
3921
|
}
|
|
3930
3922
|
}
|
|
3931
3923
|
catch (e) {
|
|
@@ -3981,8 +3973,8 @@ class RouteView extends EventDispatcher {
|
|
|
3981
3973
|
this.state = ViewState.Opened;
|
|
3982
3974
|
// @ts-ignore
|
|
3983
3975
|
this._waitOpenComplete = false;
|
|
3984
|
-
if (this.
|
|
3985
|
-
this.
|
|
3976
|
+
if (this._onOpened) {
|
|
3977
|
+
this._onOpened.call(this);
|
|
3986
3978
|
}
|
|
3987
3979
|
this.dispatch(ViewEvent.Opened);
|
|
3988
3980
|
}
|
|
@@ -4005,6 +3997,26 @@ class RouteView extends EventDispatcher {
|
|
|
4005
3997
|
get route() {
|
|
4006
3998
|
return this._route;
|
|
4007
3999
|
}
|
|
4000
|
+
onOpen(value) {
|
|
4001
|
+
this._onOpen = value;
|
|
4002
|
+
return this;
|
|
4003
|
+
}
|
|
4004
|
+
onOpened(value) {
|
|
4005
|
+
this._onOpened = value;
|
|
4006
|
+
return this;
|
|
4007
|
+
}
|
|
4008
|
+
onClose(value) {
|
|
4009
|
+
this._onClose = value;
|
|
4010
|
+
return this;
|
|
4011
|
+
}
|
|
4012
|
+
onClosed(value) {
|
|
4013
|
+
this._onClosed = value;
|
|
4014
|
+
return this;
|
|
4015
|
+
}
|
|
4016
|
+
onRefresh(value) {
|
|
4017
|
+
this._onRefresh = value;
|
|
4018
|
+
return this;
|
|
4019
|
+
}
|
|
4008
4020
|
}
|
|
4009
4021
|
|
|
4010
4022
|
class ViewHistory extends RouteList {
|