render-core 1.0.129 → 1.0.131
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/class/component/component.d.ts +3 -0
- package/class/component/component.js +10 -0
- package/class/controller/contextController.d.ts +0 -6
- package/class/controller/contextController.js +0 -8
- package/class/controller/pageController.d.ts +0 -2
- package/class/controller/pageController.js +0 -4
- package/class/tips/componentTip.d.ts +1 -0
- package/class/tips/renderTip.d.ts +0 -2
- package/core/lifecycle/mount.d.ts +5 -0
- package/core/lifecycle/mount.js +10 -0
- package/core/render/PostRender.js +4 -1
- package/core/render/initRender.js +4 -1
- package/core/render/rawRender.js +4 -1
- package/core/resolver/query.js +2 -2
- package/index.d.ts +0 -10
- package/index.js +0 -14
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ import { RenderBase } from "../tips/componentTip";
|
|
|
5
5
|
export declare class Component implements RenderBase {
|
|
6
6
|
private readonly name;
|
|
7
7
|
private readonly template;
|
|
8
|
+
private readonly mode;
|
|
8
9
|
private readonly boxStyle?;
|
|
9
10
|
private readonly props?;
|
|
10
11
|
private readonly data?;
|
|
@@ -16,6 +17,7 @@ export declare class Component implements RenderBase {
|
|
|
16
17
|
constructor(config: {
|
|
17
18
|
name: string;
|
|
18
19
|
template: string;
|
|
20
|
+
mode?: string;
|
|
19
21
|
boxStyle?: string;
|
|
20
22
|
props?: {} | string[];
|
|
21
23
|
data?: {};
|
|
@@ -27,6 +29,7 @@ export declare class Component implements RenderBase {
|
|
|
27
29
|
});
|
|
28
30
|
getName(): string;
|
|
29
31
|
getTemplate(): string;
|
|
32
|
+
getMode(): string;
|
|
30
33
|
getBoxStyle(): string;
|
|
31
34
|
getProps(): {};
|
|
32
35
|
getData(): {};
|
|
@@ -8,6 +8,13 @@ var Component = /** @class */ (function () {
|
|
|
8
8
|
//标签模板样式
|
|
9
9
|
this.template = config.template;
|
|
10
10
|
//添加box样式
|
|
11
|
+
if (typeof config.mode === "undefined") {
|
|
12
|
+
this.mode = "box";
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
this.mode = "insert";
|
|
16
|
+
}
|
|
17
|
+
//添加box样式
|
|
11
18
|
if (typeof config.boxStyle === "undefined") {
|
|
12
19
|
this.boxStyle = "";
|
|
13
20
|
}
|
|
@@ -69,6 +76,9 @@ var Component = /** @class */ (function () {
|
|
|
69
76
|
Component.prototype.getTemplate = function () {
|
|
70
77
|
return this.template;
|
|
71
78
|
};
|
|
79
|
+
Component.prototype.getMode = function () {
|
|
80
|
+
return this.mode;
|
|
81
|
+
};
|
|
72
82
|
Component.prototype.getBoxStyle = function () {
|
|
73
83
|
return this.boxStyle;
|
|
74
84
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export declare class ContextController {
|
|
2
2
|
private fileds;
|
|
3
|
-
private mixinData;
|
|
4
3
|
constructor();
|
|
5
4
|
saveFileds(fileds: {}): void;
|
|
6
5
|
loadFileds(): void;
|
|
@@ -16,9 +15,4 @@ export declare class ContextController {
|
|
|
16
15
|
* @param filed
|
|
17
16
|
*/
|
|
18
17
|
getFiled(filed: string): any;
|
|
19
|
-
/**
|
|
20
|
-
* 混入数据
|
|
21
|
-
* @param mix
|
|
22
|
-
*/
|
|
23
|
-
mixin(mix: {}): void;
|
|
24
18
|
}
|
|
@@ -3,7 +3,6 @@ import { status_read, status_write } from "render-status";
|
|
|
3
3
|
import { reloadStyle } from "../../core/utility/styleUtility";
|
|
4
4
|
var ContextController = /** @class */ (function () {
|
|
5
5
|
function ContextController() {
|
|
6
|
-
this.mixinData = {};
|
|
7
6
|
this.fileds = {
|
|
8
7
|
system_theme: {
|
|
9
8
|
data: "default",
|
|
@@ -83,13 +82,6 @@ var ContextController = /** @class */ (function () {
|
|
|
83
82
|
return null;
|
|
84
83
|
}
|
|
85
84
|
};
|
|
86
|
-
/**
|
|
87
|
-
* 混入数据
|
|
88
|
-
* @param mix
|
|
89
|
-
*/
|
|
90
|
-
ContextController.prototype.mixin = function (mix) {
|
|
91
|
-
this.mixinData = mix;
|
|
92
|
-
};
|
|
93
85
|
return ContextController;
|
|
94
86
|
}());
|
|
95
87
|
export { ContextController };
|
|
@@ -4,12 +4,10 @@ export declare class PageController {
|
|
|
4
4
|
private currentTag;
|
|
5
5
|
solt: Map<string, any>;
|
|
6
6
|
raw_data: {};
|
|
7
|
-
private mixinData;
|
|
8
7
|
to: ComponentController[];
|
|
9
8
|
link: Map<string, {}>;
|
|
10
9
|
constructor();
|
|
11
10
|
receiver(method: string, ...args: any[]): void;
|
|
12
|
-
mixin(mix: {}): void;
|
|
13
11
|
set crtTag(element: Element);
|
|
14
12
|
get crtTag(): Element;
|
|
15
13
|
}
|
|
@@ -7,7 +7,6 @@ var PageController = /** @class */ (function () {
|
|
|
7
7
|
this.to = Array();
|
|
8
8
|
this.crtTag = null;
|
|
9
9
|
this.solt = new Map();
|
|
10
|
-
this.mixinData = {};
|
|
11
10
|
}
|
|
12
11
|
//接收器
|
|
13
12
|
PageController.prototype.receiver = function (method) {
|
|
@@ -17,9 +16,6 @@ var PageController = /** @class */ (function () {
|
|
|
17
16
|
}
|
|
18
17
|
this.methods[method].call(window, args);
|
|
19
18
|
};
|
|
20
|
-
PageController.prototype.mixin = function (mix) {
|
|
21
|
-
this.mixinData = mix;
|
|
22
|
-
};
|
|
23
19
|
Object.defineProperty(PageController.prototype, "crtTag", {
|
|
24
20
|
//返回当前页面的渲染元素
|
|
25
21
|
get: function () {
|
|
@@ -9,3 +9,8 @@ import { Component } from "../../class/component/component";
|
|
|
9
9
|
* @param tagTemplate
|
|
10
10
|
*/
|
|
11
11
|
export declare function mount(controller: ComponentController, proto: Component, parent: ParentNode, child: Element, tagTemplate: Element): void;
|
|
12
|
+
/**
|
|
13
|
+
* insert elements without div elment
|
|
14
|
+
* @param root
|
|
15
|
+
*/
|
|
16
|
+
export declare function unBox(root: ParentNode): void;
|
package/core/lifecycle/mount.js
CHANGED
|
@@ -19,3 +19,13 @@ export function mount(controller, proto, parent, child, tagTemplate) {
|
|
|
19
19
|
renderSpace.append(tagTemplate.firstChild);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* insert elements without div elment
|
|
24
|
+
* @param root
|
|
25
|
+
*/
|
|
26
|
+
export function unBox(root) {
|
|
27
|
+
while (root.hasChildNodes()) {
|
|
28
|
+
root.parentNode.insertBefore(root.firstChild, root);
|
|
29
|
+
}
|
|
30
|
+
root.parentNode.removeChild(root);
|
|
31
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentController } from "../../class/controller/componentController";
|
|
2
2
|
import { controllerCycleTypeTwo } from "../lifecycle/controllerCycle";
|
|
3
3
|
import { afterCmd, cmdUtility } from "../utility/cmdUtility";
|
|
4
|
-
import { mount } from "../lifecycle/mount";
|
|
4
|
+
import { mount, unBox } from "../lifecycle/mount";
|
|
5
5
|
import { injectRefs } from "../inject/inject";
|
|
6
6
|
import { afterMethodsTypeOne } from "../lifecycle/afterMethods";
|
|
7
7
|
import { findComponent } from "./delivery";
|
|
@@ -38,4 +38,7 @@ export function post_render(proto, parent, child, link, tagTemplate) {
|
|
|
38
38
|
afterRender();
|
|
39
39
|
//深度渲染
|
|
40
40
|
findComponent(controller.root.children, controller);
|
|
41
|
+
if (proto.getMode() === "insert") {
|
|
42
|
+
unBox(controller.root);
|
|
43
|
+
}
|
|
41
44
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentController } from "../../class/controller/componentController";
|
|
2
2
|
import { controllerCycleTypeOne } from "../lifecycle/controllerCycle";
|
|
3
3
|
import { afterCmd, cmdUtility } from "../utility/cmdUtility";
|
|
4
|
-
import { mount } from "../lifecycle/mount";
|
|
4
|
+
import { mount, unBox } from "../lifecycle/mount";
|
|
5
5
|
import { injectRefs } from "../inject/inject";
|
|
6
6
|
import { afterMethodsTypeOne } from "../lifecycle/afterMethods";
|
|
7
7
|
import { findComponent } from "./delivery";
|
|
@@ -33,4 +33,7 @@ export function init_render(proto, parent, child, link, tagTemplate) {
|
|
|
33
33
|
afterMethodsTypeOne(controller, child, link);
|
|
34
34
|
//深度渲染
|
|
35
35
|
findComponent(tagTemplate.children, controller);
|
|
36
|
+
if (proto.getMode() === "insert") {
|
|
37
|
+
unBox(controller.root);
|
|
38
|
+
}
|
|
36
39
|
}
|
package/core/render/rawRender.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentController } from "../../class/controller/componentController";
|
|
2
2
|
import { controllerCycleTypeTwo } from "../lifecycle/controllerCycle";
|
|
3
3
|
import { afterCmd, cmdUtility } from "../utility/cmdUtility";
|
|
4
|
-
import { mount } from "../lifecycle/mount";
|
|
4
|
+
import { mount, unBox } from "../lifecycle/mount";
|
|
5
5
|
import { injectRefs } from "../inject/inject";
|
|
6
6
|
import { afterMethodsTypeTwo } from "../lifecycle/afterMethods";
|
|
7
7
|
import { findComponent } from "./delivery";
|
|
@@ -39,4 +39,7 @@ export function raw_render(proto, parent, child, link, tagTemplate) {
|
|
|
39
39
|
afterRender();
|
|
40
40
|
//深度渲染
|
|
41
41
|
findComponent(controller.root.children, controller);
|
|
42
|
+
if (proto.getMode() === "insert") {
|
|
43
|
+
unBox(controller.root);
|
|
44
|
+
}
|
|
42
45
|
}
|
package/core/resolver/query.js
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export function resolve_Queries() {
|
|
5
5
|
var query = new Map();
|
|
6
|
-
if (location.search !==
|
|
6
|
+
if (location.search !== "") {
|
|
7
7
|
var parameters = location.search.replace("?", "");
|
|
8
8
|
var listPara = parameters.split("&");
|
|
9
9
|
listPara.forEach(function (value) {
|
|
10
10
|
var results = value.split("=");
|
|
11
|
-
|
|
11
|
+
query.set(results[0], results[1]);
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
return query;
|
package/index.d.ts
CHANGED
|
@@ -27,16 +27,6 @@ export declare class RenderJS implements RenderTip {
|
|
|
27
27
|
* @param callable
|
|
28
28
|
*/
|
|
29
29
|
use(callable: any): void;
|
|
30
|
-
/**
|
|
31
|
-
*
|
|
32
|
-
* @param mix
|
|
33
|
-
*/
|
|
34
|
-
contextMixin(mix: {}): void;
|
|
35
|
-
/**
|
|
36
|
-
*
|
|
37
|
-
* @param mix
|
|
38
|
-
*/
|
|
39
|
-
pageMixin(mix: {}): void;
|
|
40
30
|
/**
|
|
41
31
|
* You can use the method to register your single component or an array of components.
|
|
42
32
|
* @param component
|
package/index.js
CHANGED
|
@@ -45,20 +45,6 @@ var RenderJS = /** @class */ (function () {
|
|
|
45
45
|
RenderJS.prototype.use = function (callable) {
|
|
46
46
|
callable(this);
|
|
47
47
|
};
|
|
48
|
-
/**
|
|
49
|
-
*
|
|
50
|
-
* @param mix
|
|
51
|
-
*/
|
|
52
|
-
RenderJS.prototype.contextMixin = function (mix) {
|
|
53
|
-
this.context.mixin(mix);
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
*
|
|
57
|
-
* @param mix
|
|
58
|
-
*/
|
|
59
|
-
RenderJS.prototype.pageMixin = function (mix) {
|
|
60
|
-
this.page.mixin(mix);
|
|
61
|
-
};
|
|
62
48
|
/**
|
|
63
49
|
* You can use the method to register your single component or an array of components.
|
|
64
50
|
* @param component
|