@zhongguo168a/yxeditor-common 0.0.30 → 0.0.32
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/README.md +14 -0
- package/dist/index.d.ts +95 -86
- package/dist/index.esm.js +163 -147
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,3 +27,17 @@ A TypeScript project template with Rollup and Vitest.
|
|
|
27
27
|
- `npm run test:ui` - Run tests with UI
|
|
28
28
|
- `npm run test:run` - Run tests once
|
|
29
29
|
- `npm run coverage` - Run tests with coverage report
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
```shell
|
|
33
|
+
npm version patch && npm publish --access public
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
```shell
|
|
38
|
+
npm version patch && npm publish --access public
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
```shell
|
|
42
|
+
npm version patch && npm publish --access public
|
|
43
|
+
```
|
package/dist/index.d.ts
CHANGED
|
@@ -298,7 +298,7 @@ interface IEventManager {
|
|
|
298
298
|
/**
|
|
299
299
|
* 事件派发器
|
|
300
300
|
*/
|
|
301
|
-
declare class
|
|
301
|
+
declare class EventDispatcher implements IEventManager {
|
|
302
302
|
constructor();
|
|
303
303
|
dispose(): void;
|
|
304
304
|
/**
|
|
@@ -347,7 +347,7 @@ declare class EventManager implements IEventManager {
|
|
|
347
347
|
/**
|
|
348
348
|
* 全局的事件派发器
|
|
349
349
|
*/
|
|
350
|
-
declare const eventmgr:
|
|
350
|
+
declare const eventmgr: EventDispatcher;
|
|
351
351
|
|
|
352
352
|
declare class TreeIterator {
|
|
353
353
|
break(): void;
|
|
@@ -507,7 +507,7 @@ declare class TreeNode<T = any> {
|
|
|
507
507
|
fixDepthAndRoot(depth: number, root: TreeRoot): void;
|
|
508
508
|
toString(): string;
|
|
509
509
|
}
|
|
510
|
-
declare class TreeRoot<NODE = any> extends
|
|
510
|
+
declare class TreeRoot<NODE = any> extends EventDispatcher {
|
|
511
511
|
/**
|
|
512
512
|
* 添加数据节点
|
|
513
513
|
* dispatchParams = {node:TreeNode, parent:TreeNode|TreeRoot}
|
|
@@ -622,7 +622,7 @@ declare class ListNode {
|
|
|
622
622
|
getTag(name: string): any;
|
|
623
623
|
setTag(name: string, value: any): void;
|
|
624
624
|
}
|
|
625
|
-
declare class ListSource extends
|
|
625
|
+
declare class ListSource extends EventDispatcher {
|
|
626
626
|
/**
|
|
627
627
|
* 通过数组创建 ListSource。ListSource的id自动生成。如果需要指定编号,可设置 idCreator
|
|
628
628
|
* @param arr
|
|
@@ -807,8 +807,8 @@ declare class DictSource extends Dictionary<string, DictNode> {
|
|
|
807
807
|
static EVENT_TAGS_SET: string;
|
|
808
808
|
setNodeTags(node: DictNode, tag: string, value: any): void;
|
|
809
809
|
refreshNode(node: DictNode): void;
|
|
810
|
-
get dispatcher():
|
|
811
|
-
protected _dispatcher:
|
|
810
|
+
get dispatcher(): EventDispatcher;
|
|
811
|
+
protected _dispatcher: EventDispatcher;
|
|
812
812
|
}
|
|
813
813
|
|
|
814
814
|
declare class ListIterator {
|
|
@@ -919,10 +919,11 @@ declare class ControllerDict extends Dictionary<string, IController> {
|
|
|
919
919
|
}
|
|
920
920
|
declare class ControllerRepo extends ControllerDict {
|
|
921
921
|
constructor();
|
|
922
|
-
|
|
922
|
+
register(controller: IController): void;
|
|
923
923
|
remove(name: string): void;
|
|
924
924
|
dispose(): void;
|
|
925
925
|
}
|
|
926
|
+
declare const ctrlrepo: ControllerRepo;
|
|
926
927
|
|
|
927
928
|
interface IModule {
|
|
928
929
|
}
|
|
@@ -935,7 +936,7 @@ declare class SimpleModel {
|
|
|
935
936
|
get core(): IModule;
|
|
936
937
|
protected _mod: any;
|
|
937
938
|
}
|
|
938
|
-
declare class Model extends
|
|
939
|
+
declare class Model extends EventDispatcher {
|
|
939
940
|
constructor(core?: IModule);
|
|
940
941
|
get module(): IModule;
|
|
941
942
|
protected _module: any;
|
|
@@ -1006,44 +1007,7 @@ declare class Route {
|
|
|
1006
1007
|
private _params;
|
|
1007
1008
|
protected _route: string;
|
|
1008
1009
|
}
|
|
1009
|
-
|
|
1010
|
-
declare class ViewController extends Controller {
|
|
1011
|
-
constructor(routeName: string, config?: {
|
|
1012
|
-
layer?: string;
|
|
1013
|
-
tags?: string[];
|
|
1014
|
-
enableHistory?: boolean;
|
|
1015
|
-
});
|
|
1016
|
-
open(...args: any[]): void;
|
|
1017
|
-
close(...args: any[]): void;
|
|
1018
|
-
protected onOpening(view: View): void;
|
|
1019
|
-
protected onOpened(view: View): void;
|
|
1020
|
-
protected onClosing(view: View): void;
|
|
1021
|
-
protected onClosed(view: View): void;
|
|
1022
|
-
protected onRefresh(view: View): void;
|
|
1023
|
-
openByRoute(route: Route): View;
|
|
1024
|
-
private openView;
|
|
1025
|
-
openComplete(view: View): void;
|
|
1026
|
-
/**
|
|
1027
|
-
* viewrepo中存在页面才会关闭
|
|
1028
|
-
* @param route
|
|
1029
|
-
* @returns
|
|
1030
|
-
*/
|
|
1031
|
-
closeByRoute(route?: Route): View;
|
|
1032
|
-
private closeView;
|
|
1033
|
-
closeComplete(view: View): void;
|
|
1034
|
-
refresh(): void;
|
|
1035
|
-
get layer(): string;
|
|
1036
|
-
hasTags(tags: string[]): boolean;
|
|
1037
|
-
setLayer(name: string): this;
|
|
1038
|
-
setTags(tags: string[]): this;
|
|
1039
|
-
get lastView(): View;
|
|
1040
|
-
get route(): Route;
|
|
1041
|
-
get enableHistory(): boolean;
|
|
1042
|
-
protected _enableHistory: boolean;
|
|
1043
|
-
protected _route: Route;
|
|
1044
|
-
protected _lastView: View;
|
|
1045
|
-
protected _tags: {};
|
|
1046
|
-
protected _layer: string;
|
|
1010
|
+
declare class RouteList extends List<Route> {
|
|
1047
1011
|
}
|
|
1048
1012
|
|
|
1049
1013
|
declare enum ViewState {
|
|
@@ -1071,16 +1035,8 @@ declare enum ViewEvent {
|
|
|
1071
1035
|
Closed = "closed",
|
|
1072
1036
|
Stop = "stop"
|
|
1073
1037
|
}
|
|
1074
|
-
declare class View extends
|
|
1038
|
+
declare class View extends EventDispatcher {
|
|
1075
1039
|
constructor(controller: ViewController, route: Route);
|
|
1076
|
-
/**
|
|
1077
|
-
* 等待打开完成指令
|
|
1078
|
-
*/
|
|
1079
|
-
waitOpenComplete(): void;
|
|
1080
|
-
waitCloseComplete(): void;
|
|
1081
|
-
openComplete(): void;
|
|
1082
|
-
closeComplete(): void;
|
|
1083
|
-
stop(reason: LinkError): void;
|
|
1084
1040
|
/**
|
|
1085
1041
|
* 等待发送的结果
|
|
1086
1042
|
* 如果返回 null,表示主动取消 [cancel]
|
|
@@ -1099,26 +1055,6 @@ declare class View extends EventManager {
|
|
|
1099
1055
|
protected _route: Route;
|
|
1100
1056
|
}
|
|
1101
1057
|
|
|
1102
|
-
/**
|
|
1103
|
-
* 视图管理器
|
|
1104
|
-
* 打开一个视图的时候,可能会听过加载资源,读取数据,调整布局,切换特效等处理,所以使用视图模式封装视图打开关闭的逻辑
|
|
1105
|
-
*/
|
|
1106
|
-
declare class ViewLayer {
|
|
1107
|
-
name: string;
|
|
1108
|
-
constructor(name: string);
|
|
1109
|
-
close(): void;
|
|
1110
|
-
/**
|
|
1111
|
-
* 历史记录
|
|
1112
|
-
*/
|
|
1113
|
-
getHistory(): Route[];
|
|
1114
|
-
back(): void;
|
|
1115
|
-
/**
|
|
1116
|
-
* 当前的页面
|
|
1117
|
-
*/
|
|
1118
|
-
currentView: View;
|
|
1119
|
-
protected _history: Route[];
|
|
1120
|
-
}
|
|
1121
|
-
|
|
1122
1058
|
declare class UIObjectDict extends Dictionary<string, any | List> {
|
|
1123
1059
|
/**
|
|
1124
1060
|
* 获取唯一的
|
|
@@ -1134,7 +1070,12 @@ declare var uidict: UIObjectDict;
|
|
|
1134
1070
|
|
|
1135
1071
|
declare class ViewList extends List<View> {
|
|
1136
1072
|
}
|
|
1137
|
-
|
|
1073
|
+
/**
|
|
1074
|
+
* 路由唯一编号->视图
|
|
1075
|
+
*/
|
|
1076
|
+
declare class ViewDict extends Dictionary<string, View> {
|
|
1077
|
+
}
|
|
1078
|
+
declare class ViewRepo extends ViewDict {
|
|
1138
1079
|
constructor();
|
|
1139
1080
|
openByString(route: string): View;
|
|
1140
1081
|
/**
|
|
@@ -1152,22 +1093,90 @@ declare class ViewRepo extends ViewList {
|
|
|
1152
1093
|
getByRoute(route: Route): View;
|
|
1153
1094
|
listByRoutePath(path: string): ViewList;
|
|
1154
1095
|
listByTags(tags: string[]): ViewList;
|
|
1155
|
-
|
|
1156
|
-
/**
|
|
1157
|
-
* @param name
|
|
1158
|
-
*/
|
|
1159
|
-
getLayer(name: string): ViewLayer;
|
|
1160
|
-
protected getOrNewLayer(name: string): ViewLayer;
|
|
1161
|
-
getController(name: string): ViewController;
|
|
1162
|
-
registerController(ctrl: ViewController): void;
|
|
1096
|
+
protected getController(name: string): ViewController;
|
|
1163
1097
|
get objectDict(): UIObjectDict;
|
|
1164
1098
|
protected _objectDict: UIObjectDict;
|
|
1165
1099
|
protected _indexLayer: {};
|
|
1166
1100
|
protected _indexRoute: {};
|
|
1167
|
-
protected _ctrlDict: ControllerDict;
|
|
1168
1101
|
}
|
|
1169
1102
|
declare const viewrepo: ViewRepo;
|
|
1170
1103
|
|
|
1104
|
+
declare class ViewController extends Controller {
|
|
1105
|
+
constructor(routeName: string);
|
|
1106
|
+
/**
|
|
1107
|
+
* 当视图需要通过路由打开时,需要实现此方法
|
|
1108
|
+
* @param route
|
|
1109
|
+
*/
|
|
1110
|
+
open(route: Route): View;
|
|
1111
|
+
protected onOpening(view: View): void;
|
|
1112
|
+
protected onOpened(view: View): void;
|
|
1113
|
+
protected onClosing(view: View): void;
|
|
1114
|
+
protected onClosed(view: View): void;
|
|
1115
|
+
protected refreshView(view: View): void;
|
|
1116
|
+
protected openView(view: View): void;
|
|
1117
|
+
/**
|
|
1118
|
+
* 等待打开完成指令
|
|
1119
|
+
*/
|
|
1120
|
+
protected waitOpenComplete(view: View): void;
|
|
1121
|
+
protected openComplete(view: View): void;
|
|
1122
|
+
/**
|
|
1123
|
+
* 当视图需要通过路由关闭时,需要实现此方法
|
|
1124
|
+
* @param route
|
|
1125
|
+
* @returns
|
|
1126
|
+
*/
|
|
1127
|
+
close(route?: Route): View;
|
|
1128
|
+
/**
|
|
1129
|
+
* 关闭相斥的视图对象
|
|
1130
|
+
* 1. 关闭同一层的所有视图对象
|
|
1131
|
+
* 2. 关闭符合相斥规则的视图对象
|
|
1132
|
+
* @param view
|
|
1133
|
+
* @param validFunc 符合条件的视图对象会被关闭
|
|
1134
|
+
* @returns 被关闭的视图
|
|
1135
|
+
*/
|
|
1136
|
+
closeExclusion(validFunc?: (existed: View) => boolean): ViewList;
|
|
1137
|
+
protected closeView(view: View): void;
|
|
1138
|
+
protected waitCloseComplete(view: View): void;
|
|
1139
|
+
protected closeComplete(view: View): void;
|
|
1140
|
+
refresh(): void;
|
|
1141
|
+
get layer(): string;
|
|
1142
|
+
hasTags(tags: string[]): boolean;
|
|
1143
|
+
setLayer(name: string): this;
|
|
1144
|
+
setTags(tags: string[]): this;
|
|
1145
|
+
useHistory(): this;
|
|
1146
|
+
get lastView(): View;
|
|
1147
|
+
get route(): Route;
|
|
1148
|
+
get enableHistory(): boolean;
|
|
1149
|
+
protected _enableHistory: boolean;
|
|
1150
|
+
protected _route: Route;
|
|
1151
|
+
protected _lastView: View;
|
|
1152
|
+
protected _tags: {};
|
|
1153
|
+
protected _layer: string;
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
declare class ViewHistory extends RouteList {
|
|
1157
|
+
back(): void;
|
|
1158
|
+
}
|
|
1159
|
+
declare const viewhistorys: RouteList;
|
|
1160
|
+
|
|
1161
|
+
declare class PageController extends ViewController {
|
|
1162
|
+
constructor(routeName: string);
|
|
1163
|
+
/**
|
|
1164
|
+
* 打开视图,如果视图已经存在则刷新视图
|
|
1165
|
+
* @param route
|
|
1166
|
+
*/
|
|
1167
|
+
open(route: Route): View;
|
|
1168
|
+
/**
|
|
1169
|
+
* @param route
|
|
1170
|
+
* @returns
|
|
1171
|
+
*/
|
|
1172
|
+
close(route?: Route): View;
|
|
1173
|
+
useHistory(): this;
|
|
1174
|
+
get route(): Route;
|
|
1175
|
+
get enableHistory(): boolean;
|
|
1176
|
+
protected _enableHistory: boolean;
|
|
1177
|
+
protected _layer: string;
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1171
1180
|
/**
|
|
1172
1181
|
* 事件字符串分隔符
|
|
1173
1182
|
*/
|
|
@@ -2030,5 +2039,5 @@ declare class WidgetUtil {
|
|
|
2030
2039
|
}
|
|
2031
2040
|
declare var widgetutil: WidgetUtil;
|
|
2032
2041
|
|
|
2033
|
-
export { ArrayUtil, AssetLoader, AssetURI, BitUtil, CallbackList, CameraUtil, CanvasUtil, Controller, ControllerDict, ControllerRepo, ConvertUtil, DictIterator, DictNode, DictSource, Dictionary, Dispatcher, DocUtil, ErrorUtil,
|
|
2042
|
+
export { ArrayUtil, AssetLoader, AssetURI, BitUtil, CallbackList, CameraUtil, CanvasUtil, Controller, ControllerDict, ControllerRepo, ConvertUtil, DictIterator, DictNode, DictSource, Dictionary, Dispatcher, DocUtil, ErrorUtil, EventDispatcher, EventItem, EventUtil, Factory, FloatUtil, GeometryUtil, IdentUtil, LOGGER_EVENT, LinkError, List, ListIterator, ListNode, ListSource, Listener, LogLevel, LogManager, Logger, MapUtil, MathUtil, Model, NetUtil, PageController, PathUtil, Pool, RandUtil, Route, RouteList, SampleCallbackList, SamplePool, SamplePoolSet, ScaleUtil, SimpleModel, StringUtil, TimeUtil, Timer, TreeIterator, TreeNode, TreeNodePlugin, TreeRoot, TreeRootPlugin, TreeUtil, UIManager, UIObjectDict, UIPoolConfig, UISingleConfig, UIUtil, View, ViewController, ViewDict, ViewEvent, ViewHistory, ViewList, ViewRepo, ViewState, WidgetAlign, WidgetUtil, XAssetManager, XEvent, arrayutil, assetx, bitutil, camerautil, canvasutil, convertutil, ctrlrepo, docutil, errorutil, eventmgr, eventutil, floatutil, formatutil, geoutil, identutil, loadAtlas, logmgr, maputil, mathutil, netutil, parseAtlas, parsePlist, pathutil, randutil, resutil, scaleutil, stringutil, timer, timeutil, treeutil, uidict, uimgr, uiutil, viewhistorys, viewrepo, widgetutil };
|
|
2034
2043
|
export type { CreatorFunction, DisposeFunction, IController, IError, IEventManager, IExtend, IListItem, IModel, IModule, ITreeListItem, RecycleFunction };
|