render-core 1.4.1 → 1.4.3
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/index.d.ts +31 -7
- package/index.js +30 -18
- package/kernel/delivery/delivery.d.ts +25 -1
- package/kernel/delivery/delivery.js +32 -2
- package/kernel/directive/data/v-el.d.ts +1 -1
- package/kernel/directive/data/v-html.d.ts +1 -1
- package/kernel/directive/data/v-txt.d.ts +1 -1
- package/kernel/directive/salt/v-solt.d.ts +1 -1
- package/kernel/proxyer/getProxy.d.ts +9 -1
- package/kernel/proxyer/getProxy.js +12 -0
- package/kernel/renderer/initRender.d.ts +1 -1
- package/kernel/renderer/initRender.js +8 -9
- package/kernel/renderer/postRender.d.ts +1 -1
- package/kernel/renderer/postRender.js +8 -9
- package/kernel/renderer/rawRender.d.ts +1 -1
- package/kernel/renderer/rawRender.js +8 -9
- package/kernel/renderer/updateRender.d.ts +1 -1
- package/kernel/router/router.d.ts +12 -0
- package/kernel/router/router.js +32 -0
- package/package.json +1 -1
- package/system/define/ContextController.d.ts +1 -1
- package/system/generic/component/ComponentGeneric.d.ts +13 -0
- package/system/generic/component/ComponentGeneric.js +1 -0
- package/system/generic/controller/ControllerGeneric.d.ts +21 -0
- package/system/generic/controller/ControllerGeneric.js +1 -0
- package/system/generic/data/OriginalDataGeneric.d.ts +12 -0
- package/system/generic/data/OriginalDataGeneric.js +1 -0
- package/system/generic/http/HttpGeneric.d.ts +4 -0
- package/system/generic/http/HttpGeneric.js +1 -0
- package/system/generic/render/RenderGeneric.d.ts +4 -0
- package/system/generic/render/RenderGeneric.js +1 -0
- package/system/injection/inject.d.ts +4 -2
- package/system/injection/inject.js +12 -3
- package/system/injection/injection.d.ts +1 -6
- package/system/injection/injection.js +1 -11
- package/system/lifecycle/lifeCycle.d.ts +1 -1
- package/system/lifecycle/mount.d.ts +1 -1
- package/system/prototype/ContextController.d.ts +29 -0
- package/system/prototype/ContextController.js +23 -0
- package/system/prototype/HttpAction.d.ts +9 -0
- package/system/prototype/HttpAction.js +37 -0
- package/system/recorder/table0/system_func_0.d.ts +4 -21
- package/system/recorder/table0/system_func_0.js +2 -26
- package/system/recorder/table0/system_t_0.d.ts +1 -3
- package/system/recorder/table0/system_t_0.js +1 -3
- package/system/recorder/table1/system_func_1.d.ts +6 -0
- package/system/recorder/table1/system_func_1.js +18 -0
- package/system/recorder/table1/system_t_1.d.ts +3 -0
- package/system/recorder/table1/system_t_1.js +4 -1
- package/system/recorder/table3/system_func_3.d.ts +10 -0
- package/system/recorder/table3/system_func_3.js +25 -0
- package/system/recorder/table3/system_t_3.d.ts +10 -0
- package/system/recorder/table3/system_t_3.js +9 -0
- package/system/router/router.js +1 -1
- package/system/utility/cmdUtility.d.ts +1 -1
- package/system/utility/dataUtility.d.ts +4 -0
- package/system/utility/dataUtility.js +4 -0
- package/system/utility/inputType.d.ts +1 -1
- package/system/utility/sectionUtility.d.ts +1 -1
- package/system/utility/templateUtility.js +0 -2
- package/tension/DefaultRouterPlugin.d.ts +3 -3
- package/tension/SystemInitPlugin.d.ts +6 -0
- package/tension/SystemInitPlugin.js +12 -0
- package/tension/generic/plugin/PluginGeneric.d.ts +5 -0
- package/tension/generic/plugin/PluginGeneric.js +1 -0
- package/tension/generic/plugin/hooks/HooksGeneric.d.ts +6 -0
- package/tension/generic/plugin/hooks/HooksGeneric.js +1 -0
- package/tension/generic/plugin/preface/PrefaceGeneric.d.ts +11 -0
- package/tension/generic/plugin/preface/PrefaceGeneric.js +1 -0
- package/tension/generic/router/RouterGeneric.d.ts +5 -0
- package/tension/generic/router/RouterGeneric.js +1 -0
- package/tension/prototype/AbstractComponent.d.ts +1 -1
- package/tension/prototype/AbstractRouter.d.ts +1 -1
- package/tension/prototype/HooksAction.d.ts +3 -3
- package/tension/prototype/HooksAction.js +4 -9
- package/tension/prototype/PrefaceAction.d.ts +10 -5
- package/tension/prototype/PrefaceAction.js +19 -6
- package/tension/prototype/RouterAction.d.ts +6 -13
- package/tension/prototype/RouterAction.js +13 -6
- package/xboot/Entrance.d.ts +4 -0
- package/xboot/Entrance.js +6 -2
- package/xboot/RenderProcessor.d.ts +1 -1
- package/xboot/RenderProcessor.js +3 -11
- package/xboot/TagProcessor.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { ContextController } from "../
|
|
1
|
+
import { ContextController } from "../prototype/ContextController";
|
|
2
2
|
import { Component } from "../../index";
|
|
3
3
|
export declare function inject_$name_to_data(name: string, origin: {}): void;
|
|
4
4
|
export declare function inject_$props_to_data(childNode: ChildNode, meta: {} | [], origin: object): void;
|
|
5
5
|
export declare function inject_$refs_to_data(template: Element, origin: object): void;
|
|
6
|
-
export declare function inject_$
|
|
6
|
+
export declare function inject_$http_to_data(origin: {}): void;
|
|
7
|
+
export declare function inject_$pathVariable_to_data(origin: {}): void;
|
|
8
|
+
export declare function inject_$plugin_to_data(config: object): void;
|
|
7
9
|
/**
|
|
8
10
|
*
|
|
9
11
|
* @param controller
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { resolve_props } from "../resolver/props";
|
|
2
2
|
import { parse_directive_refs } from "../../kernel/directive/ref/v-ref";
|
|
3
|
-
import {
|
|
3
|
+
import { get_user_anonymous_ext, get_user_ext_http } from "../recorder/table3/system_func_3";
|
|
4
|
+
import { get_path_variable } from "../recorder/table1/system_func_1";
|
|
4
5
|
export function inject_$name_to_data(name, origin) {
|
|
5
6
|
Reflect.set(origin, "$name", name);
|
|
6
7
|
}
|
|
@@ -13,8 +14,16 @@ export function inject_$refs_to_data(template, origin) {
|
|
|
13
14
|
parse_directive_refs(template.children, refs);
|
|
14
15
|
Reflect.set(origin, "$refs", refs);
|
|
15
16
|
}
|
|
16
|
-
export function inject_$
|
|
17
|
-
Reflect.set(
|
|
17
|
+
export function inject_$http_to_data(origin) {
|
|
18
|
+
Reflect.set(origin, "$http", get_user_ext_http());
|
|
19
|
+
}
|
|
20
|
+
export function inject_$pathVariable_to_data(origin) {
|
|
21
|
+
Reflect.set(origin, "$pathVariable", get_path_variable());
|
|
22
|
+
}
|
|
23
|
+
export function inject_$plugin_to_data(config) {
|
|
24
|
+
Reflect.set(config, "$plugins", function (name) {
|
|
25
|
+
return get_user_anonymous_ext(name);
|
|
26
|
+
});
|
|
18
27
|
}
|
|
19
28
|
/**
|
|
20
29
|
*
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import { ContextController } from "../
|
|
1
|
+
import { ContextController } from "../prototype/ContextController";
|
|
2
2
|
/**
|
|
3
3
|
*
|
|
4
4
|
* @param controller
|
|
5
5
|
*/
|
|
6
6
|
export declare function getCommitMethod(controller: ContextController): any;
|
|
7
|
-
/**
|
|
8
|
-
*
|
|
9
|
-
* @param controller
|
|
10
|
-
*/
|
|
11
|
-
export declare function getSetterMethod(controller: ContextController): any;
|
|
12
7
|
/**
|
|
13
8
|
*
|
|
14
9
|
* @param controller
|
|
@@ -12,23 +12,13 @@ export function getCommitMethod(controller) {
|
|
|
12
12
|
};
|
|
13
13
|
return commit.bind(controller);
|
|
14
14
|
}
|
|
15
|
-
/**
|
|
16
|
-
*
|
|
17
|
-
* @param controller
|
|
18
|
-
*/
|
|
19
|
-
export function getSetterMethod(controller) {
|
|
20
|
-
var setter = function (property, value) {
|
|
21
|
-
this["$plugins"].set(property, value);
|
|
22
|
-
};
|
|
23
|
-
return setter.bind(controller.componentConfig);
|
|
24
|
-
}
|
|
25
15
|
/**
|
|
26
16
|
*
|
|
27
17
|
* @param controller
|
|
28
18
|
*/
|
|
29
19
|
export function getGetterMethod(controller) {
|
|
30
20
|
var getter = function (property) {
|
|
31
|
-
return this[
|
|
21
|
+
return this[property];
|
|
32
22
|
};
|
|
33
23
|
return getter.bind(controller.componentConfig);
|
|
34
24
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ControllerGeneric } from "../generic/controller/ControllerGeneric";
|
|
2
|
+
import { Component } from "../../index";
|
|
3
|
+
export declare class ContextController implements ControllerGeneric {
|
|
4
|
+
componentAttachedRootElement: ParentNode | Element;
|
|
5
|
+
prototypeOfComponent: Component;
|
|
6
|
+
parentController: ContextController;
|
|
7
|
+
anchor: HTMLElement;
|
|
8
|
+
begin: HTMLElement;
|
|
9
|
+
componentConfig: {
|
|
10
|
+
boxMode: boolean;
|
|
11
|
+
plugins?: Map<string, any>;
|
|
12
|
+
};
|
|
13
|
+
originalData: {};
|
|
14
|
+
dataForMethod: {};
|
|
15
|
+
dataForComputed: {};
|
|
16
|
+
dataForWatcher: {};
|
|
17
|
+
salt: Map<string, any>;
|
|
18
|
+
lazyComponent: Map<string, {}>;
|
|
19
|
+
slaveComponent: ContextController[];
|
|
20
|
+
method: {};
|
|
21
|
+
computed: {};
|
|
22
|
+
watcher: {};
|
|
23
|
+
constructor(config: {
|
|
24
|
+
boxMode: boolean;
|
|
25
|
+
$plugins?: Map<string, any>;
|
|
26
|
+
});
|
|
27
|
+
receiver(method: string, ...args: any[]): any;
|
|
28
|
+
flush(): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { update_Render } from "../../kernel/renderer/updateRender";
|
|
2
|
+
var ContextController = /** @class */ (function () {
|
|
3
|
+
//构造函数
|
|
4
|
+
function ContextController(config) {
|
|
5
|
+
this.lazyComponent = new Map();
|
|
6
|
+
this.slaveComponent = Array();
|
|
7
|
+
this.salt = new Map();
|
|
8
|
+
this.componentConfig = config;
|
|
9
|
+
}
|
|
10
|
+
//接收器
|
|
11
|
+
ContextController.prototype.receiver = function (method) {
|
|
12
|
+
var args = [];
|
|
13
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
14
|
+
args[_i - 1] = arguments[_i];
|
|
15
|
+
}
|
|
16
|
+
return this.prototypeOfComponent.getMethods()[method].apply(this.dataForMethod, args);
|
|
17
|
+
};
|
|
18
|
+
ContextController.prototype.flush = function () {
|
|
19
|
+
update_Render(this);
|
|
20
|
+
};
|
|
21
|
+
return ContextController;
|
|
22
|
+
}());
|
|
23
|
+
export { ContextController };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var HttpAction = /** @class */ (function () {
|
|
2
|
+
function HttpAction() {
|
|
3
|
+
}
|
|
4
|
+
HttpAction.prototype.redirect = function (url, parameters) {
|
|
5
|
+
if (parameters !== null) {
|
|
6
|
+
var params = Object.getOwnPropertyNames(parameters);
|
|
7
|
+
if (params.length !== 0) {
|
|
8
|
+
var queries_1 = "";
|
|
9
|
+
params.forEach(function (value) {
|
|
10
|
+
if (queries_1 === "") {
|
|
11
|
+
queries_1 = queries_1 + value + "=" + parameters[value].toString();
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
queries_1 = queries_1 + "&" + value + "=" + parameters[value].toString();
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
queries_1 = encodeURI(queries_1);
|
|
18
|
+
location.href = url + "?" + queries_1;
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
location.href = url;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
location.href = url;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* locate the position
|
|
30
|
+
* @param position
|
|
31
|
+
*/
|
|
32
|
+
HttpAction.prototype.relocate = function (position) {
|
|
33
|
+
location.hash = position;
|
|
34
|
+
};
|
|
35
|
+
return HttpAction;
|
|
36
|
+
}());
|
|
37
|
+
export { HttpAction };
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ContextController } from "../../
|
|
3
|
-
import { AbstractRouter } from "../../../tension/prototype/AbstractRouter";
|
|
1
|
+
import { Component } from "../../../index";
|
|
2
|
+
import { ContextController } from "../../prototype/ContextController";
|
|
4
3
|
/**
|
|
5
4
|
* Use the func to inject a tag component to the tag-library.
|
|
6
5
|
* @param tagName The tag name
|
|
7
|
-
* @param tagDefine The tag
|
|
6
|
+
* @param tagDefine The tag prototype class
|
|
8
7
|
*/
|
|
9
8
|
export declare function tag_library_inject(tagName: string, tagDefine: Component): void;
|
|
10
9
|
/**
|
|
11
|
-
* Use the func to get a tag
|
|
10
|
+
* Use the func to get a tag prototype class
|
|
12
11
|
* @param tagName The name of tag you want to search
|
|
13
12
|
*/
|
|
14
13
|
export declare function tag_library_search(tagName: string): Component | null;
|
|
@@ -20,14 +19,6 @@ export declare function get_tag_library(): Map<string, Component>;
|
|
|
20
19
|
* From the system_t_0 table, get style library
|
|
21
20
|
*/
|
|
22
21
|
export declare function get_style_library(): Map<string, Map<string, string>>;
|
|
23
|
-
/**
|
|
24
|
-
* Set plugin to system_t_0
|
|
25
|
-
*/
|
|
26
|
-
export declare function set_plugin_library(name: string, plugin: AbstractPlugin): void;
|
|
27
|
-
/**
|
|
28
|
-
* From the system_t_o table, get plugin library
|
|
29
|
-
*/
|
|
30
|
-
export declare function get_plugin_library(): Map<string, AbstractPlugin>;
|
|
31
22
|
/**
|
|
32
23
|
* Get context controller from system_t_0
|
|
33
24
|
*/
|
|
@@ -37,11 +28,3 @@ export declare function get_context_controller(): ContextController;
|
|
|
37
28
|
* @param context
|
|
38
29
|
*/
|
|
39
30
|
export declare function set_context_controller(context: ContextController): void;
|
|
40
|
-
/**
|
|
41
|
-
* Get router from system_t_0
|
|
42
|
-
*/
|
|
43
|
-
export declare function get_router_for_application(): AbstractRouter;
|
|
44
|
-
/**
|
|
45
|
-
* Set router for system_t_0
|
|
46
|
-
*/
|
|
47
|
-
export declare function set_router_for_application(router: AbstractRouter): void;
|
|
@@ -2,7 +2,7 @@ import system_t_0 from "./system_t_0";
|
|
|
2
2
|
/**
|
|
3
3
|
* Use the func to inject a tag component to the tag-library.
|
|
4
4
|
* @param tagName The tag name
|
|
5
|
-
* @param tagDefine The tag
|
|
5
|
+
* @param tagDefine The tag prototype class
|
|
6
6
|
*/
|
|
7
7
|
export function tag_library_inject(tagName, tagDefine) {
|
|
8
8
|
if (system_t_0.tagLib.has(tagName))
|
|
@@ -11,7 +11,7 @@ export function tag_library_inject(tagName, tagDefine) {
|
|
|
11
11
|
system_t_0.tagLib.set(tagName, tagDefine);
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* Use the func to get a tag
|
|
14
|
+
* Use the func to get a tag prototype class
|
|
15
15
|
* @param tagName The name of tag you want to search
|
|
16
16
|
*/
|
|
17
17
|
export function tag_library_search(tagName) {
|
|
@@ -32,18 +32,6 @@ export function get_tag_library() {
|
|
|
32
32
|
export function get_style_library() {
|
|
33
33
|
return system_t_0.styleLib;
|
|
34
34
|
}
|
|
35
|
-
/**
|
|
36
|
-
* Set plugin to system_t_0
|
|
37
|
-
*/
|
|
38
|
-
export function set_plugin_library(name, plugin) {
|
|
39
|
-
Reflect.get(system_t_0, "extendLib").set(name, plugin);
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* From the system_t_o table, get plugin library
|
|
43
|
-
*/
|
|
44
|
-
export function get_plugin_library() {
|
|
45
|
-
return system_t_0.extendLib;
|
|
46
|
-
}
|
|
47
35
|
/**
|
|
48
36
|
* Get context controller from system_t_0
|
|
49
37
|
*/
|
|
@@ -57,15 +45,3 @@ export function get_context_controller() {
|
|
|
57
45
|
export function set_context_controller(context) {
|
|
58
46
|
Reflect.set(system_t_0, "contextController", context);
|
|
59
47
|
}
|
|
60
|
-
/**
|
|
61
|
-
* Get router from system_t_0
|
|
62
|
-
*/
|
|
63
|
-
export function get_router_for_application() {
|
|
64
|
-
return system_t_0.router;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Set router for system_t_0
|
|
68
|
-
*/
|
|
69
|
-
export function set_router_for_application(router) {
|
|
70
|
-
Reflect.set(system_t_0, "router", router);
|
|
71
|
-
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Component } from "../../../index";
|
|
2
2
|
declare const _default: {
|
|
3
3
|
tagLib: Map<string, Component>;
|
|
4
4
|
styleLib: Map<string, Map<string, string>>;
|
|
5
|
-
extendLib: Map<string, AbstractPlugin>;
|
|
6
5
|
contextController: any;
|
|
7
|
-
router: any;
|
|
8
6
|
};
|
|
9
7
|
export default _default;
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
export declare function get_theme_style(): string;
|
|
2
2
|
export declare function set_theme_style(style: string): void;
|
|
3
|
+
export declare function set_router_mode(value: boolean): void;
|
|
4
|
+
export declare function get_route_mode(): boolean;
|
|
5
|
+
export declare function set_path_variable(value: object): void;
|
|
6
|
+
export declare function get_path_variable(): Map<string, string>;
|
|
7
|
+
export declare function get_route_table(): object;
|
|
8
|
+
export declare function set_route_table(value: object): void;
|
|
@@ -5,3 +5,21 @@ export function get_theme_style() {
|
|
|
5
5
|
export function set_theme_style(style) {
|
|
6
6
|
Reflect.set(system_t_1, "styleTheme", style);
|
|
7
7
|
}
|
|
8
|
+
export function set_router_mode(value) {
|
|
9
|
+
Reflect.set(system_t_1, "routerMode", value);
|
|
10
|
+
}
|
|
11
|
+
export function get_route_mode() {
|
|
12
|
+
return Reflect.get(system_t_1, "routeMode");
|
|
13
|
+
}
|
|
14
|
+
export function set_path_variable(value) {
|
|
15
|
+
Reflect.set(system_t_1, "pathVariable", value);
|
|
16
|
+
}
|
|
17
|
+
export function get_path_variable() {
|
|
18
|
+
return Reflect.get(system_t_1, "pathVariable");
|
|
19
|
+
}
|
|
20
|
+
export function get_route_table() {
|
|
21
|
+
return Reflect.get(system_t_1, "routeTable");
|
|
22
|
+
}
|
|
23
|
+
export function set_route_table(value) {
|
|
24
|
+
Reflect.set(system_t_1, "routeTable", value);
|
|
25
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RouterAction } from "../../../tension/prototype/RouterAction";
|
|
2
|
+
import { HttpAction } from "../../prototype/HttpAction";
|
|
3
|
+
export declare function set_system_ext_router(router: RouterAction): void;
|
|
4
|
+
export declare function get_system_ext_router(): RouterAction;
|
|
5
|
+
export declare function get_user_ext_http(): HttpAction;
|
|
6
|
+
export declare function set_user_ext_http(http: HttpAction): void;
|
|
7
|
+
export declare function set_user_anonymous_ext(name: string, ext: any): void;
|
|
8
|
+
export declare function get_user_anonymous_ext(name: string): any;
|
|
9
|
+
export declare function set_user_anonymous_field(name: string, value: any): void;
|
|
10
|
+
export declare function get_user_anonymous_field(name: string): any;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import system_t_3 from "./system_t_3";
|
|
2
|
+
export function set_system_ext_router(router) {
|
|
3
|
+
Reflect.set(system_t_3, "router", router);
|
|
4
|
+
}
|
|
5
|
+
export function get_system_ext_router() {
|
|
6
|
+
return Reflect.get(system_t_3, "router");
|
|
7
|
+
}
|
|
8
|
+
export function get_user_ext_http() {
|
|
9
|
+
return Reflect.get(system_t_3.user, "http");
|
|
10
|
+
}
|
|
11
|
+
export function set_user_ext_http(http) {
|
|
12
|
+
Reflect.set(system_t_3.user, "http", http);
|
|
13
|
+
}
|
|
14
|
+
export function set_user_anonymous_ext(name, ext) {
|
|
15
|
+
Reflect.set(system_t_3.user.Anonymous, name, ext);
|
|
16
|
+
}
|
|
17
|
+
export function get_user_anonymous_ext(name) {
|
|
18
|
+
return Reflect.get(system_t_3.user.Anonymous, name);
|
|
19
|
+
}
|
|
20
|
+
export function set_user_anonymous_field(name, value) {
|
|
21
|
+
Reflect.set(system_t_3.user.Anonymous, name, value);
|
|
22
|
+
}
|
|
23
|
+
export function get_user_anonymous_field(name) {
|
|
24
|
+
return Reflect.get(system_t_3.user.Anonymous, name);
|
|
25
|
+
}
|
package/system/router/router.js
CHANGED
|
@@ -4,7 +4,7 @@ export function router_listener_with_router(view) {
|
|
|
4
4
|
if (view !== null) {
|
|
5
5
|
var controller = get_context_controller();
|
|
6
6
|
var router = get_router_for_application();
|
|
7
|
-
var component = router.getComponentByUrl(location.
|
|
7
|
+
var component = router.getComponentByUrl(location.pathname);
|
|
8
8
|
spa_delivery(component, view.parentNode, view, controller);
|
|
9
9
|
}
|
|
10
10
|
else
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContextController } from "../
|
|
1
|
+
import { ContextController } from "../prototype/ContextController";
|
|
2
2
|
import { Component } from "../../index";
|
|
3
3
|
/**
|
|
4
4
|
* This function is used to parse_directive those commands which should be executed before mount.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContextController } from "../
|
|
1
|
+
import { ContextController } from "../prototype/ContextController";
|
|
2
2
|
export declare function textType(target: any, doc: any, controller: ContextController): void;
|
|
3
3
|
export declare function assignType(target: any, controller: ContextController): void;
|
|
4
4
|
export declare function fileType(target: any, controller: ContextController): void;
|
|
@@ -2,11 +2,9 @@
|
|
|
2
2
|
* @param proto
|
|
3
3
|
*/
|
|
4
4
|
export function getTemplate(proto) {
|
|
5
|
-
//生成DOM
|
|
6
5
|
var temp = document.createElement("div");
|
|
7
6
|
temp.innerHTML = proto.getTemplate();
|
|
8
7
|
var template = temp.getElementsByTagName("template")[0];
|
|
9
8
|
var content = template.content;
|
|
10
|
-
//获得模板元素
|
|
11
9
|
return content.querySelector("view");
|
|
12
10
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PrefaceGeneric } from "./generic/PrefaceGeneric";
|
|
2
|
-
import { HooksGeneric } from "./generic/HooksGeneric";
|
|
1
|
+
import { PrefaceGeneric } from "./generic/plugin/preface/PrefaceGeneric";
|
|
2
|
+
import { HooksGeneric } from "./generic/plugin/hooks/HooksGeneric";
|
|
3
3
|
import { Component } from "../index";
|
|
4
|
-
import { PluginGeneric } from "./generic/PluginGeneric";
|
|
4
|
+
import { PluginGeneric } from "./generic/plugin/PluginGeneric";
|
|
5
5
|
export declare class DefaultRouterPlugin implements PluginGeneric {
|
|
6
6
|
private readonly routerTable;
|
|
7
7
|
constructor(routeTable: {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PrefaceGeneric } from "./generic/plugin/preface/PrefaceGeneric";
|
|
2
|
+
import { HooksGeneric } from "./generic/plugin/hooks/HooksGeneric";
|
|
3
|
+
import { PluginGeneric } from "./generic/plugin/PluginGeneric";
|
|
4
|
+
export declare class SystemInitPlugin implements PluginGeneric {
|
|
5
|
+
plugin(preface: PrefaceGeneric, hooks: HooksGeneric): void;
|
|
6
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HttpAction } from "../system/prototype/HttpAction";
|
|
2
|
+
import { RouterAction } from "./prototype/RouterAction";
|
|
3
|
+
var SystemInitPlugin = /** @class */ (function () {
|
|
4
|
+
function SystemInitPlugin() {
|
|
5
|
+
}
|
|
6
|
+
SystemInitPlugin.prototype.plugin = function (preface, hooks) {
|
|
7
|
+
preface.add_system_router(new RouterAction(hooks));
|
|
8
|
+
preface.add_user_http(new HttpAction());
|
|
9
|
+
};
|
|
10
|
+
return SystemInitPlugin;
|
|
11
|
+
}());
|
|
12
|
+
export { SystemInitPlugin };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HttpAction } from "../../../../system/prototype/HttpAction";
|
|
2
|
+
import { RouterAction } from "../../../prototype/RouterAction";
|
|
3
|
+
import { Component } from "../../../../index";
|
|
4
|
+
export interface PrefaceGeneric {
|
|
5
|
+
add_system_router(router: RouterAction): void;
|
|
6
|
+
add_user_http(http: HttpAction): void;
|
|
7
|
+
add_anonymous_extension(name: string, plugin: object): void;
|
|
8
|
+
add_anonymous_filed(name: string, value: any): void;
|
|
9
|
+
register_component(component: Component): void;
|
|
10
|
+
set_field_route_mode(value: boolean): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RouterGeneric } from "../generic/RouterGeneric";
|
|
1
|
+
import { RouterGeneric } from "../generic/router/RouterGeneric";
|
|
2
2
|
import { Component } from "../../index";
|
|
3
3
|
export declare class AbstractRouter implements RouterGeneric {
|
|
4
4
|
getComponentByUrl(url: string): Component;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { HooksGeneric } from "../generic/HooksGeneric";
|
|
1
|
+
import { HooksGeneric } from "../generic/plugin/hooks/HooksGeneric";
|
|
2
|
+
import { Component } from "../../index";
|
|
2
3
|
export declare class HooksAction implements HooksGeneric {
|
|
3
|
-
relocate(position: string): void;
|
|
4
|
-
redirect(url: string, parameters: {}): void;
|
|
5
4
|
changeStyle(tag: string, theme: string): void;
|
|
6
5
|
changeTheme(theme: string): void;
|
|
6
|
+
directDelivery(component: Component): void;
|
|
7
7
|
}
|
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
import { changeStyle, changeTheme } from "../../system/utility/styleUtility";
|
|
2
|
-
import {
|
|
2
|
+
import { direct_delivery } from "../../kernel/delivery/delivery";
|
|
3
3
|
var HooksAction = /** @class */ (function () {
|
|
4
4
|
function HooksAction() {
|
|
5
5
|
}
|
|
6
|
-
//文档hash定位
|
|
7
|
-
HooksAction.prototype.relocate = function (position) {
|
|
8
|
-
relocate(position);
|
|
9
|
-
};
|
|
10
|
-
//文档URL跳转
|
|
11
|
-
HooksAction.prototype.redirect = function (url, parameters) {
|
|
12
|
-
redirect(url, parameters);
|
|
13
|
-
};
|
|
14
6
|
//更改tag样式
|
|
15
7
|
HooksAction.prototype.changeStyle = function (tag, theme) {
|
|
16
8
|
changeStyle(tag, theme);
|
|
@@ -19,6 +11,9 @@ var HooksAction = /** @class */ (function () {
|
|
|
19
11
|
HooksAction.prototype.changeTheme = function (theme) {
|
|
20
12
|
changeTheme(theme);
|
|
21
13
|
};
|
|
14
|
+
HooksAction.prototype.directDelivery = function (component) {
|
|
15
|
+
direct_delivery(component);
|
|
16
|
+
};
|
|
22
17
|
return HooksAction;
|
|
23
18
|
}());
|
|
24
19
|
export { HooksAction };
|