@zhongguo168a/yxeditor-common 0.0.51 → 0.0.53

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
@@ -1040,7 +1040,7 @@ declare class RouteView extends EventDispatcher {
1040
1040
  open(): void;
1041
1041
  close(): void;
1042
1042
  refresh(): void;
1043
- stop(): void;
1043
+ stop(reason?: LinkError): void;
1044
1044
  /**
1045
1045
  * 等待发送的结果
1046
1046
  * 如果返回 null,表示主动取消 [cancel]
@@ -1063,7 +1063,13 @@ declare class RouteView extends EventDispatcher {
1063
1063
  onClose(value: (ctx: this) => void): this;
1064
1064
  onClosed(value: (ctx: this) => void): this;
1065
1065
  onRefresh(value: (ctx: this) => void): this;
1066
+ /**
1067
+ * 默认执行 close();
1068
+ * @param value
1069
+ * @returns
1070
+ */
1066
1071
  onStop(value: (ctx: this) => void): this;
1072
+ get reason(): LinkError;
1067
1073
  node: Node;
1068
1074
  datas: {};
1069
1075
  tags: {};
@@ -1072,6 +1078,7 @@ declare class RouteView extends EventDispatcher {
1072
1078
  state: ViewState;
1073
1079
  protected _controller: RouteController;
1074
1080
  protected _route: Route;
1081
+ protected _reason: LinkError;
1075
1082
  private _onOpen;
1076
1083
  private _onOpened;
1077
1084
  private _onClose;
package/dist/index.esm.js CHANGED
@@ -3859,6 +3859,9 @@ class RouteView extends EventDispatcher {
3859
3859
  this.tags = {};
3860
3860
  this.enableHistory = false;
3861
3861
  this.state = 0;
3862
+ this._onStop = (ctx) => {
3863
+ ctx.close();
3864
+ };
3862
3865
  this._controller = controller;
3863
3866
  this._route = route;
3864
3867
  }
@@ -3931,7 +3934,7 @@ class RouteView extends EventDispatcher {
3931
3934
  console.error(e.stack);
3932
3935
  }
3933
3936
  }
3934
- stop() {
3937
+ stop(reason) {
3935
3938
  try {
3936
3939
  if (this._onStop) {
3937
3940
  this._onStop(this);
@@ -3942,6 +3945,7 @@ class RouteView extends EventDispatcher {
3942
3945
  console.error(`stop view ${this.route.key}`);
3943
3946
  console.error(e.stack);
3944
3947
  }
3948
+ this.dispatch(ViewEvent.Stop);
3945
3949
  }
3946
3950
  /**
3947
3951
  * 等待发送的结果
@@ -4041,10 +4045,18 @@ class RouteView extends EventDispatcher {
4041
4045
  this._onRefresh = value;
4042
4046
  return this;
4043
4047
  }
4048
+ /**
4049
+ * 默认执行 close();
4050
+ * @param value
4051
+ * @returns
4052
+ */
4044
4053
  onStop(value) {
4045
4054
  this._onStop = value;
4046
4055
  return this;
4047
4056
  }
4057
+ get reason() {
4058
+ return this._reason;
4059
+ }
4048
4060
  }
4049
4061
 
4050
4062
  class ViewHistory extends RouteList {