@zhongguo168a/yxeditor-common 0.0.89 → 0.0.91

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
@@ -1326,6 +1326,8 @@ declare class ViewModel extends EventDispatcher {
1326
1326
  closeComplete(): void;
1327
1327
  protected _waitOpenComplete: boolean;
1328
1328
  protected _waitCloseComplete: boolean;
1329
+ get controller(): RouteController;
1330
+ get route(): Route;
1329
1331
  get reason(): LinkError;
1330
1332
  node: Node;
1331
1333
  datas: MapObject;
@@ -1352,7 +1354,7 @@ declare class ViewList extends List<ViewModel> {
1352
1354
  /**
1353
1355
  * 路由唯一编号->视图
1354
1356
  */
1355
- declare class ViewDict extends Dictionary<string, any> {
1357
+ declare class ViewDict extends Dictionary<string, ViewModel> {
1356
1358
  /**
1357
1359
  * 关闭相斥的视图对象
1358
1360
  * 1. 关闭同一层的所有视图对象
@@ -1364,11 +1366,6 @@ declare class ViewDict extends Dictionary<string, any> {
1364
1366
  closeExclusion(validFunc?: (existed: ViewModel) => boolean): ViewList;
1365
1367
  listByRoutePath(path: string): ViewList;
1366
1368
  listByTags(tags: string[]): ViewList;
1367
- /**
1368
- * 往上追踪,返回第一个包含 RouteComponent 的节点, 返回节点中的 RouteView
1369
- * @param node
1370
- */
1371
- tailNode(node: Node): ViewModel;
1372
1369
  }
1373
1370
  declare class RouteViewDict extends ViewDict {
1374
1371
  constructor();
@@ -1385,10 +1382,10 @@ declare class RouteViewDict extends ViewDict {
1385
1382
  * @param route
1386
1383
  */
1387
1384
  refresh(route: Route): void;
1388
- getByRoute(route: Route): RouteView;
1385
+ getByRoute(route: Route): ViewModel;
1389
1386
  protected getController(name: string): RouteController;
1390
1387
  }
1391
- declare const routeviews: RouteViewDict;
1388
+ declare const routeViews: RouteViewDict;
1392
1389
 
1393
1390
  /**
1394
1391
  * 事件字符串分隔符
@@ -2180,5 +2177,5 @@ declare class WidgetUtil {
2180
2177
  }
2181
2178
  declare var widgetutil: WidgetUtil;
2182
2179
 
2183
- export { ArrayUtil, AssetLoader, AssetURI, BitUtil, CallbackList, CameraUtil, CanvasUtil, Controller, ControllerDict, ControllerRepo, ConvertUtil, DictIterator, DictNode, DictSource, Dictionary, DirectionMode, Dispatcher, DocUtil, ErrorUtil, EventDispatcher, EventItem, EventUtil, Factory, FloatUtil, GeometryDirection, GeometryUtil, IdentUtil, LOGGER_EVENT, LinkError, List, ListIterator, ListNode, ListSource, Listener, LogLevel, LogManager, Logger, MapObject, MapUtil, MathUtil, Model, NetUtil, PathUtil, Pool, RandUtil, Route, RouteController, RouteList, RouteView, RouteViewDict, SampleCallbackList, SamplePool, SamplePoolSet, ScaleUtil, SimpleModel, StringUtil, TimeUtil, Timer, TreeIterator, TreeNode, TreeNodePlugin, TreeRoot, TreeRootPlugin, TreeUtil, UIManager, UIObjectRepo, UIPoolConfig, UISingleConfig, UIUtil, ViewDict, ViewEvent, ViewHistory, ViewList, ViewModel, ViewState, WidgetAlign, WidgetUtil, XAssetManager, XEvent, arrayutil, assetx, bitutil, camerautil, canvasutil, convertutil, create等距图集, ctrlrepo, docutil, errorutil, eventmgr, eventutil, floatutil, formatutil, geoutil, identutil, loadAtlas, logmgr, maputil, mathutil, netutil, parseAtlas, parsePlist, pathutil, randutil, resutil, routeviews, scaleutil, stringutil, timer, timeutil, treeutil, uimgr, uirepo, uiutil, viewhistorys, widgetutil };
2180
+ export { ArrayUtil, AssetLoader, AssetURI, BitUtil, CallbackList, CameraUtil, CanvasUtil, Controller, ControllerDict, ControllerRepo, ConvertUtil, DictIterator, DictNode, DictSource, Dictionary, DirectionMode, Dispatcher, DocUtil, ErrorUtil, EventDispatcher, EventItem, EventUtil, Factory, FloatUtil, GeometryDirection, GeometryUtil, IdentUtil, LOGGER_EVENT, LinkError, List, ListIterator, ListNode, ListSource, Listener, LogLevel, LogManager, Logger, MapObject, MapUtil, MathUtil, Model, NetUtil, PathUtil, Pool, RandUtil, Route, RouteController, RouteList, RouteView, RouteViewDict, SampleCallbackList, SamplePool, SamplePoolSet, ScaleUtil, SimpleModel, StringUtil, TimeUtil, Timer, TreeIterator, TreeNode, TreeNodePlugin, TreeRoot, TreeRootPlugin, TreeUtil, UIManager, UIObjectRepo, UIPoolConfig, UISingleConfig, UIUtil, ViewDict, ViewEvent, ViewHistory, ViewList, ViewModel, ViewState, WidgetAlign, WidgetUtil, XAssetManager, XEvent, arrayutil, assetx, bitutil, camerautil, canvasutil, convertutil, create等距图集, ctrlrepo, docutil, errorutil, eventmgr, eventutil, floatutil, formatutil, geoutil, identutil, loadAtlas, logmgr, maputil, mathutil, netutil, parseAtlas, parsePlist, pathutil, randutil, resutil, routeViews, scaleutil, stringutil, timer, timeutil, treeutil, uimgr, uirepo, uiutil, viewhistorys, widgetutil };
2184
2181
  export type { CreatorFunction, DisposeFunction, IController, IError, IEventDispatcher, IExtend, IListItem, IModel, IModule, ITreeListItem, RecycleFunction };
package/dist/index.esm.js CHANGED
@@ -4067,42 +4067,6 @@ class RouteView extends EventDispatcher {
4067
4067
  }
4068
4068
  }
4069
4069
 
4070
- /******************************************************************************
4071
- Copyright (c) Microsoft Corporation.
4072
-
4073
- Permission to use, copy, modify, and/or distribute this software for any
4074
- purpose with or without fee is hereby granted.
4075
-
4076
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
4077
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
4078
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
4079
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
4080
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
4081
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
4082
- PERFORMANCE OF THIS SOFTWARE.
4083
- ***************************************************************************** */
4084
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
4085
-
4086
-
4087
- function __decorate(decorators, target, key, desc) {
4088
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4089
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4090
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
4091
- return c > 3 && r && Object.defineProperty(target, key, r), r;
4092
- }
4093
-
4094
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
4095
- var e = new Error(message);
4096
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
4097
- };
4098
-
4099
- const { ccclass, property, menu } = _decorator;
4100
- let ViewModelComponent = class ViewModelComponent extends Component {
4101
- };
4102
- ViewModelComponent = __decorate([
4103
- ccclass('ViewModelComponent')
4104
- ], ViewModelComponent);
4105
-
4106
4070
  class ViewList extends List {
4107
4071
  }
4108
4072
  /**
@@ -4150,21 +4114,6 @@ class ViewDict extends Dictionary {
4150
4114
  });
4151
4115
  return list;
4152
4116
  }
4153
- /**
4154
- * 往上追踪,返回第一个包含 RouteComponent 的节点, 返回节点中的 RouteView
4155
- * @param node
4156
- */
4157
- tailNode(node) {
4158
- let current = node;
4159
- while (current != null) {
4160
- let com = current.getComponent(ViewModelComponent);
4161
- if (com) {
4162
- return com.viewModel;
4163
- }
4164
- current = current.parent;
4165
- }
4166
- return null;
4167
- }
4168
4117
  }
4169
4118
  class RouteViewDict extends ViewDict {
4170
4119
  constructor() {
@@ -4209,22 +4158,74 @@ class RouteViewDict extends ViewDict {
4209
4158
  return ctrlrepo.get(name);
4210
4159
  }
4211
4160
  }
4212
- const routeviews = new RouteViewDict();
4161
+ const routeViews = new RouteViewDict();
4213
4162
 
4214
4163
  class ViewHistory extends RouteList {
4215
4164
  back() {
4216
4165
  if (viewhistorys.length == 0) {
4217
4166
  return;
4218
4167
  }
4219
- routeviews.close(viewhistorys.shift());
4168
+ routeViews.close(viewhistorys.shift());
4220
4169
  if (viewhistorys.length == 0) {
4221
4170
  return;
4222
4171
  }
4223
- routeviews.open(viewhistorys.last());
4172
+ routeViews.open(viewhistorys.last());
4224
4173
  }
4225
4174
  }
4226
4175
  const viewhistorys = new ViewHistory();
4227
4176
 
4177
+ /******************************************************************************
4178
+ Copyright (c) Microsoft Corporation.
4179
+
4180
+ Permission to use, copy, modify, and/or distribute this software for any
4181
+ purpose with or without fee is hereby granted.
4182
+
4183
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
4184
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
4185
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
4186
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
4187
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
4188
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
4189
+ PERFORMANCE OF THIS SOFTWARE.
4190
+ ***************************************************************************** */
4191
+ /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
4192
+
4193
+
4194
+ function __decorate(decorators, target, key, desc) {
4195
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4196
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4197
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
4198
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
4199
+ }
4200
+
4201
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
4202
+ var e = new Error(message);
4203
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
4204
+ };
4205
+
4206
+ var ViewModelComponent_1;
4207
+ const { ccclass, property, menu } = _decorator;
4208
+ let ViewModelComponent = ViewModelComponent_1 = class ViewModelComponent extends Component {
4209
+ /**
4210
+ * 往上追踪,返回第一个包含 RouteComponent 的节点, 返回节点中的 RouteView
4211
+ * @param node
4212
+ */
4213
+ static tailNode(node) {
4214
+ let current = node;
4215
+ while (current != null) {
4216
+ let com = current.getComponent(ViewModelComponent_1);
4217
+ if (com) {
4218
+ return com.viewModel;
4219
+ }
4220
+ current = current.parent;
4221
+ }
4222
+ return null;
4223
+ }
4224
+ };
4225
+ ViewModelComponent = ViewModelComponent_1 = __decorate([
4226
+ ccclass('ViewModelComponent')
4227
+ ], ViewModelComponent);
4228
+
4228
4229
  class ViewModel extends EventDispatcher {
4229
4230
  /**
4230
4231
  * 视图模型的名称
@@ -4274,10 +4275,10 @@ class ViewModel extends EventDispatcher {
4274
4275
  }
4275
4276
  let route = this._route;
4276
4277
  if (route) {
4277
- if (routeviews.get(route.key)) {
4278
+ if (routeViews.get(route.key)) {
4278
4279
  throw `视图已存在: route=${route.key}`;
4279
4280
  }
4280
- routeviews.set(route.key, this);
4281
+ routeViews.set(route.key, this);
4281
4282
  }
4282
4283
  this.state = ViewState.Opening;
4283
4284
  this.dispatch(ViewEvent.Opening);
@@ -4306,7 +4307,7 @@ class ViewModel extends EventDispatcher {
4306
4307
  }
4307
4308
  let route = this._route;
4308
4309
  if (route) {
4309
- routeviews.delete(this._route.key);
4310
+ routeViews.delete(this._route.key);
4310
4311
  }
4311
4312
  this.state = ViewState.Closeing;
4312
4313
  this.dispatch(ViewEvent.Closeing);
@@ -4406,12 +4407,18 @@ class ViewModel extends EventDispatcher {
4406
4407
  if (this.state == ViewState.Closed) {
4407
4408
  return;
4408
4409
  }
4409
- routeviews.delete(this.getIdent());
4410
+ routeViews.delete(this.getIdent());
4410
4411
  this._waitCloseComplete = false;
4411
4412
  this.state = ViewState.Closed;
4412
4413
  this.dispatch(ViewEvent.Closed);
4413
4414
  this.onClosed();
4414
4415
  }
4416
+ get controller() {
4417
+ return this._controller;
4418
+ }
4419
+ get route() {
4420
+ return this._route;
4421
+ }
4415
4422
  get reason() {
4416
4423
  return this._reason;
4417
4424
  }
@@ -6846,5 +6853,5 @@ class WidgetUtil {
6846
6853
  }
6847
6854
  var widgetutil = new WidgetUtil();
6848
6855
 
6849
- export { ArrayUtil, AssetLoader, AssetURI, BitUtil, CallbackList, CameraUtil, CanvasUtil, Controller, ControllerDict, ControllerRepo, ConvertUtil, DictIterator, DictNode, DictSource, Dictionary, DirectionMode, Dispatcher, DocUtil, ErrorUtil, EventDispatcher, EventItem, EventUtil, Factory, FloatUtil, GeometryDirection, GeometryUtil, IdentUtil, LOGGER_EVENT, LinkError, List, ListIterator, ListNode, ListSource, Listener, LogLevel, LogManager, Logger, MapObject, MapUtil, MathUtil, Model, NetUtil, PathUtil, Pool, RandUtil, Route, RouteController, RouteList, RouteView, RouteViewDict, SampleCallbackList, SamplePool, SamplePoolSet, ScaleUtil, SimpleModel, StringUtil, TimeUtil, Timer, TreeIterator, TreeNode, TreeNodePlugin, TreeRoot, TreeRootPlugin, TreeUtil, UIManager, UIObjectRepo, UIPoolConfig, UISingleConfig, UIUtil, ViewDict, ViewEvent, ViewHistory, ViewList, ViewModel, ViewState, WidgetAlign, WidgetUtil, XAssetManager, XEvent, arrayutil, assetx, bitutil, camerautil, canvasutil, convertutil, create等距图集, ctrlrepo, docutil, errorutil, eventmgr, eventutil, floatutil, formatutil, geoutil, identutil, loadAtlas, logmgr, maputil, mathutil, netutil, parseAtlas, parsePlist, pathutil, randutil, resutil, routeviews, scaleutil, stringutil, timer, timeutil, treeutil, uimgr, uirepo, uiutil, viewhistorys, widgetutil };
6856
+ export { ArrayUtil, AssetLoader, AssetURI, BitUtil, CallbackList, CameraUtil, CanvasUtil, Controller, ControllerDict, ControllerRepo, ConvertUtil, DictIterator, DictNode, DictSource, Dictionary, DirectionMode, Dispatcher, DocUtil, ErrorUtil, EventDispatcher, EventItem, EventUtil, Factory, FloatUtil, GeometryDirection, GeometryUtil, IdentUtil, LOGGER_EVENT, LinkError, List, ListIterator, ListNode, ListSource, Listener, LogLevel, LogManager, Logger, MapObject, MapUtil, MathUtil, Model, NetUtil, PathUtil, Pool, RandUtil, Route, RouteController, RouteList, RouteView, RouteViewDict, SampleCallbackList, SamplePool, SamplePoolSet, ScaleUtil, SimpleModel, StringUtil, TimeUtil, Timer, TreeIterator, TreeNode, TreeNodePlugin, TreeRoot, TreeRootPlugin, TreeUtil, UIManager, UIObjectRepo, UIPoolConfig, UISingleConfig, UIUtil, ViewDict, ViewEvent, ViewHistory, ViewList, ViewModel, ViewState, WidgetAlign, WidgetUtil, XAssetManager, XEvent, arrayutil, assetx, bitutil, camerautil, canvasutil, convertutil, create等距图集, ctrlrepo, docutil, errorutil, eventmgr, eventutil, floatutil, formatutil, geoutil, identutil, loadAtlas, logmgr, maputil, mathutil, netutil, parseAtlas, parsePlist, pathutil, randutil, resutil, routeViews, scaleutil, stringutil, timer, timeutil, treeutil, uimgr, uirepo, uiutil, viewhistorys, widgetutil };
6850
6857
  //# sourceMappingURL=index.esm.js.map