render-core 1.4.30 → 1.4.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/index.d.ts +66 -33
- package/index.js +55 -49
- package/kernel/delivery/delivery.d.ts +4 -10
- package/kernel/delivery/delivery.js +4 -17
- 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/justify/v-if.js +2 -2
- package/kernel/directive/slot/v-slot.d.ts +13 -0
- package/kernel/directive/slot/v-slot.js +46 -0
- package/kernel/proxyer/getProxy.d.ts +1 -1
- package/kernel/renderer/initRender.d.ts +3 -3
- package/kernel/renderer/initRender.js +7 -6
- package/kernel/renderer/pageRender.d.ts +9 -0
- package/kernel/renderer/pageRender.js +53 -0
- package/kernel/renderer/postRender.d.ts +3 -3
- package/kernel/renderer/postRender.js +5 -4
- package/kernel/renderer/rawRender.d.ts +3 -3
- package/kernel/renderer/rawRender.js +5 -4
- package/kernel/renderer/updateRender.d.ts +1 -1
- package/kernel/router/router.d.ts +3 -9
- package/kernel/router/router.js +10 -30
- package/package.json +1 -1
- package/system/generic/component/ComponentGeneric.d.ts +2 -2
- package/system/generic/component/instance/AbstractComponent.d.ts +41 -0
- package/system/generic/component/instance/AbstractComponent.js +98 -0
- package/system/generic/controller/ControllerGeneric.d.ts +3 -3
- package/system/generic/controller/prototype/ContextController.d.ts +30 -0
- package/system/generic/controller/prototype/ContextController.js +17 -0
- package/system/generic/controller/prototype/HttpAction.d.ts +9 -0
- package/system/generic/controller/prototype/HttpAction.js +37 -0
- package/system/generic/data/ComputedDataGeneric.d.ts +1 -1
- package/system/generic/data/OriginalDataGeneric.d.ts +1 -1
- package/system/generic/data/WatcherDataGeneric.d.ts +1 -1
- package/system/generic/render/RenderGeneric.d.ts +2 -4
- package/system/injection/injection.d.ts +1 -1
- package/system/injection/injector.d.ts +5 -5
- package/system/lifecycle/lifeCycle.d.ts +1 -1
- package/system/lifecycle/mount.d.ts +3 -3
- package/system/lifecycle/mount.js +1 -1
- package/system/recorder/table0/system_func_0.d.ts +5 -5
- package/system/recorder/table0/system_t_0.d.ts +2 -2
- package/system/recorder/table1/system_func_1.d.ts +2 -0
- package/system/recorder/table1/system_func_1.js +6 -0
- package/system/recorder/table3/system_func_3.d.ts +1 -1
- package/system/utility/directive/cmdUtility.d.ts +3 -3
- package/system/utility/directive/cmdUtility.js +1 -1
- package/system/utility/initiate/miscUtility.js +2 -1
- package/system/utility/initiate/templateUtility.d.ts +2 -2
- package/system/utility/react/inputType.d.ts +1 -1
- package/system/utility/react/sectionUtility.d.ts +1 -1
- package/system/utility/style/styleUtility.d.ts +13 -2
- package/system/utility/style/styleUtility.js +43 -2
- package/tension/SystemInitPlugin.js +1 -1
- package/tension/generic/plugin/hooks/HooksGeneric.d.ts +0 -2
- package/tension/generic/plugin/preface/PrefaceGeneric.d.ts +3 -3
- package/tension/generic/router/RouterGeneric.d.ts +6 -3
- package/tension/prototype/HooksAction.d.ts +0 -2
- package/tension/prototype/HooksAction.js +0 -4
- package/tension/prototype/PrefaceAction.d.ts +3 -3
- package/verify/directive-linter.d.ts +0 -4
- package/verify/directive-linter.js +152 -123
- package/xboot/entrance.d.ts +1 -13
- package/xboot/entrance.js +3 -49
- package/xboot/renderProcessor.d.ts +1 -1
- package/xboot/tagProcessor.d.ts +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AdjustComponent, ControlComponent } from "../../../index";
|
|
2
2
|
/**
|
|
3
3
|
*
|
|
4
4
|
* @param tag
|
|
@@ -9,7 +9,7 @@ export declare function checkStyleLabel(tag: string): boolean;
|
|
|
9
9
|
* @param component
|
|
10
10
|
* @param styleLib
|
|
11
11
|
*/
|
|
12
|
-
export declare function themeStyle(component:
|
|
12
|
+
export declare function themeStyle(component: AdjustComponent | ControlComponent, styleLib: Map<string, object>): void;
|
|
13
13
|
/**
|
|
14
14
|
* Here is the function to resolve
|
|
15
15
|
* @param tag
|
|
@@ -27,3 +27,14 @@ export declare function changeStyle(tag: string, theme: string): void;
|
|
|
27
27
|
* @param theme
|
|
28
28
|
*/
|
|
29
29
|
export declare function changeTheme(theme: string): void;
|
|
30
|
+
/**
|
|
31
|
+
* 给 CSS 中所有选择器添加 V-data 属性选择器
|
|
32
|
+
* @param {string} cssText - 原始 CSS 字符串
|
|
33
|
+
* @param {string} salt - 盐值
|
|
34
|
+
* @returns {string} 处理后的 CSS 字符串
|
|
35
|
+
*/
|
|
36
|
+
/**
|
|
37
|
+
* Simple synchronous string hash (djb2) — used to produce a unique salt per component name.
|
|
38
|
+
*/
|
|
39
|
+
export declare function hashName(name: string): string;
|
|
40
|
+
export declare function style_slot_func(cssText: string, salt: string): string;
|
|
@@ -29,7 +29,7 @@ export function themeStyle(component, styleLib) {
|
|
|
29
29
|
var styles = dom.getElementsByTagName("template")[0].content.querySelectorAll("style");
|
|
30
30
|
var componentStyleList = new Map();
|
|
31
31
|
for (var i = 0; i < styles.length; i++) {
|
|
32
|
-
componentStyleList.set(styles[i].getAttribute("theme"), styles[i].innerText);
|
|
32
|
+
componentStyleList.set(styles[i].getAttribute("theme"), style_slot_func(styles[i].innerText, hashName(component.getName())));
|
|
33
33
|
}
|
|
34
34
|
styleLib.set(component.getName().toUpperCase(), componentStyleList);
|
|
35
35
|
}
|
|
@@ -64,7 +64,7 @@ export function loader_tag_style(tag, styleLib) {
|
|
|
64
64
|
export function changeStyle(tag, theme) {
|
|
65
65
|
var styleTxt = get_style_library().get(tag.toUpperCase()).get(theme);
|
|
66
66
|
if (styleTxt === undefined) {
|
|
67
|
-
console.log("
|
|
67
|
+
console.log("Don`t find this style!");
|
|
68
68
|
}
|
|
69
69
|
else {
|
|
70
70
|
var style = document.createElement('style');
|
|
@@ -100,3 +100,44 @@ export function changeTheme(theme) {
|
|
|
100
100
|
});
|
|
101
101
|
set_theme_style(theme);
|
|
102
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* 给 CSS 中所有选择器添加 V-data 属性选择器
|
|
105
|
+
* @param {string} cssText - 原始 CSS 字符串
|
|
106
|
+
* @param {string} salt - 盐值
|
|
107
|
+
* @returns {string} 处理后的 CSS 字符串
|
|
108
|
+
*/
|
|
109
|
+
/**
|
|
110
|
+
* Simple synchronous string hash (djb2) — used to produce a unique salt per component name.
|
|
111
|
+
*/
|
|
112
|
+
export function hashName(name) {
|
|
113
|
+
var hash = 0;
|
|
114
|
+
for (var i = 0; i < name.length; i++) {
|
|
115
|
+
hash = ((hash << 5) - hash) + name.charCodeAt(i);
|
|
116
|
+
hash |= 0;
|
|
117
|
+
}
|
|
118
|
+
return Math.abs(hash).toString(16);
|
|
119
|
+
}
|
|
120
|
+
export function style_slot_func(cssText, salt) {
|
|
121
|
+
if (!cssText || !salt)
|
|
122
|
+
return cssText;
|
|
123
|
+
// 正则匹配:选择器部分 { 声明部分 }
|
|
124
|
+
// 注意:这里不处理嵌套规则(如 @media 内部的选择器),如果需要可以调整
|
|
125
|
+
return cssText.replace(/([^{]+)(\{)/g, function (match, selectors, brace) {
|
|
126
|
+
// 如果是 @ 开头的规则,不处理
|
|
127
|
+
if (selectors.trim().startsWith('@')) {
|
|
128
|
+
return match;
|
|
129
|
+
}
|
|
130
|
+
// 将每个选择器(以逗号分隔)都加上 [V-data="salt"]
|
|
131
|
+
var newSelectors = selectors
|
|
132
|
+
.split(',')
|
|
133
|
+
.map(function (sel) {
|
|
134
|
+
var trimmed = sel.trim();
|
|
135
|
+
if (!trimmed)
|
|
136
|
+
return '';
|
|
137
|
+
return "".concat(trimmed, "[v-data=\"").concat(salt, "\"]");
|
|
138
|
+
})
|
|
139
|
+
.filter(function (s) { return s; })
|
|
140
|
+
.join(', ');
|
|
141
|
+
return newSelectors + brace;
|
|
142
|
+
});
|
|
143
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { HttpAction } from "../../../../system/prototype/HttpAction";
|
|
2
|
-
import {
|
|
1
|
+
import { HttpAction } from "../../../../system/generic/controller/prototype/HttpAction";
|
|
2
|
+
import { AdjustComponent, ControlComponent } from "../../../../index";
|
|
3
3
|
import { RouterGeneric } from "../../router/RouterGeneric";
|
|
4
4
|
export interface PrefaceGeneric {
|
|
5
5
|
add_system_router(router: RouterGeneric): void;
|
|
6
6
|
add_user_http(http: HttpAction): void;
|
|
7
7
|
add_anonymous_extension(name: string, plugin: object): void;
|
|
8
8
|
add_anonymous_filed(name: string, value: any): void;
|
|
9
|
-
register_component(component:
|
|
9
|
+
register_component(component: AdjustComponent | ControlComponent): void;
|
|
10
10
|
set_field_route_mode(value: boolean): void;
|
|
11
11
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PageComponent } from "../../../index";
|
|
2
2
|
export interface RouterGeneric {
|
|
3
|
-
getComponent():
|
|
4
|
-
|
|
3
|
+
getComponent(): {
|
|
4
|
+
params: Map<string, any>;
|
|
5
|
+
pathParams: Map<string, any>;
|
|
6
|
+
component: PageComponent;
|
|
7
|
+
};
|
|
5
8
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { HooksGeneric } from "../generic/plugin/hooks/HooksGeneric";
|
|
2
|
-
import { Component } from "../../index";
|
|
3
2
|
export declare class HooksAction implements HooksGeneric {
|
|
4
3
|
changeStyle(tag: string, theme: string): void;
|
|
5
4
|
changeTheme(theme: string): void;
|
|
6
|
-
directDelivery(component: Component): void;
|
|
7
5
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { changeStyle, changeTheme } from "../../system/utility/style/styleUtility";
|
|
2
|
-
import { direct_delivery } from "../../kernel/delivery/delivery";
|
|
3
2
|
var HooksAction = /** @class */ (function () {
|
|
4
3
|
function HooksAction() {
|
|
5
4
|
}
|
|
@@ -11,9 +10,6 @@ var HooksAction = /** @class */ (function () {
|
|
|
11
10
|
HooksAction.prototype.changeTheme = function (theme) {
|
|
12
11
|
changeTheme(theme);
|
|
13
12
|
};
|
|
14
|
-
HooksAction.prototype.directDelivery = function (component) {
|
|
15
|
-
direct_delivery(component);
|
|
16
|
-
};
|
|
17
13
|
return HooksAction;
|
|
18
14
|
}());
|
|
19
15
|
export { HooksAction };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { PrefaceGeneric } from "../generic/plugin/preface/PrefaceGeneric";
|
|
2
|
-
import {
|
|
3
|
-
import { HttpAction } from "../../system/prototype/HttpAction";
|
|
2
|
+
import { AdjustComponent, ControlComponent } from "../../index";
|
|
3
|
+
import { HttpAction } from "../../system/generic/controller/prototype/HttpAction";
|
|
4
4
|
import { RouterGeneric } from "../generic/router/RouterGeneric";
|
|
5
5
|
export declare class PrefaceAction implements PrefaceGeneric {
|
|
6
6
|
add_anonymous_extension(name: string, plugin: object): void;
|
|
7
7
|
add_anonymous_filed(name: string, value: any): void;
|
|
8
8
|
add_system_router(router: RouterGeneric): void;
|
|
9
9
|
add_user_http(http: HttpAction): void;
|
|
10
|
-
register_component(component:
|
|
10
|
+
register_component(component: AdjustComponent | ControlComponent): void;
|
|
11
11
|
set_field_route_mode(value: boolean): void;
|
|
12
12
|
}
|
|
@@ -1,123 +1,152 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
1
|
+
// import {Component} from "../index";
|
|
2
|
+
// import DirectiveLocation from "./generic/location";
|
|
3
|
+
// import LintError from "./generic/lintError";
|
|
4
|
+
//
|
|
5
|
+
// const BOOLEAN_CONDITION_DIRECTIVES = ["@if", "@show"];
|
|
6
|
+
// const ARRAY_ITERATION_DIRECTIVES = ["@for", "@map"];
|
|
7
|
+
// const MODEL_ELEMENT = ["INPUT", "SELECT", "TEXTAREA"];
|
|
8
|
+
//
|
|
9
|
+
// function parseTemplateForDirectives(template: string): DirectiveLocation[] {
|
|
10
|
+
// const directives: DirectiveLocation[] = [];
|
|
11
|
+
// const lines = template.split("\n");
|
|
12
|
+
//
|
|
13
|
+
// for (let lineIndex = 0; lineIndex < lines.length; lineIndex++) {
|
|
14
|
+
// const line = lines[lineIndex];
|
|
15
|
+
//
|
|
16
|
+
// const directiveRegex = /@(\w+)(?:\s*=\s*"([^"]*)"|\s*=\s*'([^']*)')?/g;
|
|
17
|
+
// let match;
|
|
18
|
+
//
|
|
19
|
+
// while ((match = directiveRegex.exec(line)) !== null) {
|
|
20
|
+
// const directiveName = match[1];
|
|
21
|
+
// const expression = match[2] || match[3] || "";
|
|
22
|
+
//
|
|
23
|
+
// const elementMatch = line.match(/<(\w+)/);
|
|
24
|
+
// const element = elementMatch ? elementMatch[1] : "unknown";
|
|
25
|
+
//
|
|
26
|
+
// directives.push({
|
|
27
|
+
// directive: `@${directiveName}`,
|
|
28
|
+
// expression: expression,
|
|
29
|
+
// element: element.toUpperCase(),
|
|
30
|
+
// line: lineIndex + 1,
|
|
31
|
+
// column: match.index + 1
|
|
32
|
+
// });
|
|
33
|
+
// }
|
|
34
|
+
// }
|
|
35
|
+
//
|
|
36
|
+
// return directives;
|
|
37
|
+
// }
|
|
38
|
+
//
|
|
39
|
+
// function inferType(value: any): string {
|
|
40
|
+
// if (value === true || value === false) return "boolean";
|
|
41
|
+
// if (Array.isArray(value)) return "array";
|
|
42
|
+
// if (typeof value === "number") return "number";
|
|
43
|
+
// if (typeof value === "string") return "string";
|
|
44
|
+
// if (typeof value === "object" && value !== null) return "object";
|
|
45
|
+
// if (value === null) return "null";
|
|
46
|
+
// return "unknown";
|
|
47
|
+
// }
|
|
48
|
+
//
|
|
49
|
+
// function getDataTypes(component: Component): Map<string, string> {
|
|
50
|
+
// const types = new Map<string, string>();
|
|
51
|
+
// const data = component.getData();
|
|
52
|
+
//
|
|
53
|
+
// if (data && typeof data === "object") {
|
|
54
|
+
// Object.keys(data).forEach(function(key: string) {
|
|
55
|
+
// types.set(key, inferType((data as any)[key]));
|
|
56
|
+
// });
|
|
57
|
+
// }
|
|
58
|
+
//
|
|
59
|
+
// return types;
|
|
60
|
+
// }
|
|
61
|
+
//
|
|
62
|
+
// function validateBooleanCondition(
|
|
63
|
+
// directive: DirectiveLocation,
|
|
64
|
+
// component: Component
|
|
65
|
+
// ): LintError | null {
|
|
66
|
+
// const dataTypes = getDataTypes(component);
|
|
67
|
+
// const actualType = dataTypes.get(directive.expression);
|
|
68
|
+
//
|
|
69
|
+
// if (actualType && actualType !== "boolean") {
|
|
70
|
+
// return {
|
|
71
|
+
// rule: "boolean-condition",
|
|
72
|
+
// message: `Directive '${directive.directive}' expects boolean but '${directive.expression}' is ${actualType}`,
|
|
73
|
+
// line: directive.line,
|
|
74
|
+
// column: directive.column
|
|
75
|
+
// };
|
|
76
|
+
// }
|
|
77
|
+
//
|
|
78
|
+
// return null;
|
|
79
|
+
// }
|
|
80
|
+
//
|
|
81
|
+
// function validateArrayIteration(
|
|
82
|
+
// directive: DirectiveLocation,
|
|
83
|
+
// component: Component
|
|
84
|
+
// ): LintError | null {
|
|
85
|
+
// const dataTypes = getDataTypes(component);
|
|
86
|
+
// const actualType = dataTypes.get(directive.expression);
|
|
87
|
+
//
|
|
88
|
+
// if (actualType && actualType !== "array") {
|
|
89
|
+
// return {
|
|
90
|
+
// rule: "array-iteration",
|
|
91
|
+
// message: `Directive '${directive.directive}' expects array but '${directive.expression}' is ${actualType}`,
|
|
92
|
+
// line: directive.line,
|
|
93
|
+
// column: directive.column
|
|
94
|
+
// };
|
|
95
|
+
// }
|
|
96
|
+
//
|
|
97
|
+
// return null;
|
|
98
|
+
// }
|
|
99
|
+
//
|
|
100
|
+
// function validateModelElement(
|
|
101
|
+
// directive: DirectiveLocation,
|
|
102
|
+
// component: Component
|
|
103
|
+
// ): LintError | null {
|
|
104
|
+
// if (MODEL_ELEMENT.indexOf(directive.element) === -1) {
|
|
105
|
+
// return {
|
|
106
|
+
// rule: "valid-model-element",
|
|
107
|
+
// message: `Directive '@model' can only be used on INPUT, SELECT, or TEXTAREA, but found '${directive.element}'`,
|
|
108
|
+
// line: directive.line,
|
|
109
|
+
// column: directive.column
|
|
110
|
+
// };
|
|
111
|
+
// }
|
|
112
|
+
//
|
|
113
|
+
// return null;
|
|
114
|
+
// }
|
|
115
|
+
//
|
|
116
|
+
// export function lintComponent(component: Component): LintError[] {
|
|
117
|
+
// const errors: LintError[] = [];
|
|
118
|
+
// const template = component.getTemplate();
|
|
119
|
+
// const directives = parseTemplateForDirectives(template);
|
|
120
|
+
//
|
|
121
|
+
// for (const directive of directives) {
|
|
122
|
+
// if (BOOLEAN_CONDITION_DIRECTIVES.indexOf(directive.directive) !== -1) {
|
|
123
|
+
// const error = validateBooleanCondition(directive, component);
|
|
124
|
+
// if (error) errors.push(error);
|
|
125
|
+
// }
|
|
126
|
+
//
|
|
127
|
+
// if (ARRAY_ITERATION_DIRECTIVES.indexOf(directive.directive) !== -1) {
|
|
128
|
+
// const error = validateArrayIteration(directive, component);
|
|
129
|
+
// if (error) errors.push(error);
|
|
130
|
+
// }
|
|
131
|
+
//
|
|
132
|
+
// if (directive.directive === "@model") {
|
|
133
|
+
// const error = validateModelElement(directive, component);
|
|
134
|
+
// if (error) errors.push(error);
|
|
135
|
+
// }
|
|
136
|
+
// }
|
|
137
|
+
//
|
|
138
|
+
// return errors;
|
|
139
|
+
// }
|
|
140
|
+
//
|
|
141
|
+
// export function lintComponents(components: Component[]): Map<string, LintError[]> {
|
|
142
|
+
// const allErrors = new Map<string, LintError[]>();
|
|
143
|
+
//
|
|
144
|
+
// for (const component of components) {
|
|
145
|
+
// const errors = lintComponent(component);
|
|
146
|
+
// if (errors.length > 0) {
|
|
147
|
+
// allErrors.set(component.getName(), errors);
|
|
148
|
+
// }
|
|
149
|
+
// }
|
|
150
|
+
//
|
|
151
|
+
// return allErrors;
|
|
152
|
+
// }
|
package/xboot/entrance.d.ts
CHANGED
|
@@ -1,16 +1,4 @@
|
|
|
1
|
-
import { Component } from "../index";
|
|
2
|
-
/**
|
|
3
|
-
* The entrance of weave
|
|
4
|
-
* @param root
|
|
5
|
-
*/
|
|
6
|
-
export declare function render_for_weave(root?: string): void;
|
|
7
1
|
/**
|
|
8
2
|
* The entrance of listen
|
|
9
3
|
*/
|
|
10
|
-
export declare function render_for_listen(): void;
|
|
11
|
-
/**
|
|
12
|
-
* The entrance of render
|
|
13
|
-
* @param component
|
|
14
|
-
* @param mounter
|
|
15
|
-
*/
|
|
16
|
-
export declare function render_for_render(component: Component, mounter: string): void;
|
|
4
|
+
export declare function render_for_listen(params: Map<string, any>, pathParams: Map<string, any>): void;
|
package/xboot/entrance.js
CHANGED
|
@@ -1,53 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { renderHtml } from "./renderProcessor";
|
|
3
|
-
import { get_context_controller, get_style_library, get_tag_library } from "../system/recorder/table0/system_func_0";
|
|
4
|
-
import { router_listener_with_router, router_listener_without_router } from "../kernel/router/router";
|
|
5
|
-
/**
|
|
6
|
-
* The entrance of weave
|
|
7
|
-
* @param root
|
|
8
|
-
*/
|
|
9
|
-
export function render_for_weave(root) {
|
|
10
|
-
get_tag_library().forEach(function (component) {
|
|
11
|
-
themeStyle(component, get_style_library());
|
|
12
|
-
});
|
|
13
|
-
if (root == null) {
|
|
14
|
-
//开始渲染
|
|
15
|
-
get_context_controller().componentAttachedRootElement = document.body;
|
|
16
|
-
renderHtml(document.children, get_context_controller());
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
var mountPoint = document.getElementById(root);
|
|
20
|
-
if (mountPoint == null) {
|
|
21
|
-
get_context_controller().componentAttachedRootElement = document.body;
|
|
22
|
-
//开始渲染
|
|
23
|
-
console.warn("Mount point not found");
|
|
24
|
-
console.warn("Mount point was selected to body");
|
|
25
|
-
renderHtml(document.body.children, get_context_controller());
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
//开始渲染
|
|
29
|
-
get_context_controller().componentAttachedRootElement = mountPoint;
|
|
30
|
-
renderHtml(mountPoint.children, get_context_controller());
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
1
|
+
import { router_listener_with_router } from "../kernel/router/router";
|
|
34
2
|
/**
|
|
35
3
|
* The entrance of listen
|
|
36
4
|
*/
|
|
37
|
-
export function render_for_listen() {
|
|
38
|
-
|
|
39
|
-
themeStyle(component, get_style_library());
|
|
40
|
-
});
|
|
41
|
-
router_listener_with_router(document.querySelector("webview"));
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* The entrance of render
|
|
45
|
-
* @param component
|
|
46
|
-
* @param mounter
|
|
47
|
-
*/
|
|
48
|
-
export function render_for_render(component, mounter) {
|
|
49
|
-
get_tag_library().forEach(function (component) {
|
|
50
|
-
themeStyle(component, get_style_library());
|
|
51
|
-
});
|
|
52
|
-
router_listener_without_router(component, document.getElementById(mounter));
|
|
5
|
+
export function render_for_listen(params, pathParams) {
|
|
6
|
+
router_listener_with_router(document.body, params, pathParams);
|
|
53
7
|
}
|
package/xboot/tagProcessor.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AdjustComponent, ControlComponent } from "../index";
|
|
2
2
|
/**
|
|
3
3
|
* This function is used to save the prototype component proto in the window object.
|
|
4
4
|
* So, you can have a tip that we custom a property named 'tagLib' in the window object.
|
|
5
5
|
* @param component
|
|
6
6
|
*/
|
|
7
|
-
export declare function registerTagLib(component:
|
|
7
|
+
export declare function registerTagLib(component: AdjustComponent | AdjustComponent[] | ControlComponent | ControlComponent[]): void;
|