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
package/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { RenderGeneric } from "./system/generic/render/RenderGeneric";
|
|
2
|
-
import { ContextController } from "./system/prototype/ContextController";
|
|
2
|
+
import { ContextController } from "./system/generic/controller/prototype/ContextController";
|
|
3
3
|
import { PluginGeneric } from "./tension/generic/plugin/PluginGeneric";
|
|
4
4
|
import { HooksGeneric } from "./tension/generic/plugin/hooks/HooksGeneric";
|
|
5
|
-
import { AbstractComponent } from "./
|
|
5
|
+
import { AbstractComponent } from "./system/generic/component/instance/AbstractComponent";
|
|
6
6
|
import { PrefaceGeneric } from "./tension/generic/plugin/preface/PrefaceGeneric";
|
|
7
7
|
import { RouterGeneric } from "./tension/generic/router/RouterGeneric";
|
|
8
8
|
/**
|
|
@@ -15,6 +15,12 @@ export declare class PropertyType {
|
|
|
15
15
|
static BOOLEAN: 'boolean';
|
|
16
16
|
static JSON: 'json';
|
|
17
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* This func is used to extend window environment
|
|
20
|
+
* @param on
|
|
21
|
+
* @param func
|
|
22
|
+
*/
|
|
23
|
+
export declare function extend_window(on: string, func: any): void;
|
|
18
24
|
/**
|
|
19
25
|
* This abstract class is the plugin interface class for those who want to develop plugin for the system
|
|
20
26
|
*/
|
|
@@ -28,23 +34,62 @@ export declare abstract class AbstractRouter implements RouterGeneric {
|
|
|
28
34
|
/**
|
|
29
35
|
* The method must be overwritten by developer
|
|
30
36
|
*/
|
|
31
|
-
getComponent():
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
37
|
+
getComponent(): {
|
|
38
|
+
params: Map<string, any>;
|
|
39
|
+
pathParams: Map<string, any>;
|
|
40
|
+
component: PageComponent;
|
|
41
|
+
};
|
|
36
42
|
}
|
|
37
43
|
/**
|
|
38
44
|
* Here is the template class for render component!
|
|
39
45
|
*/
|
|
40
|
-
export declare class
|
|
46
|
+
export declare class AdjustComponent extends AbstractComponent {
|
|
47
|
+
constructor(config: {
|
|
48
|
+
template: {
|
|
49
|
+
name: string;
|
|
50
|
+
vDate: string;
|
|
51
|
+
template: string;
|
|
52
|
+
};
|
|
53
|
+
style?: string;
|
|
54
|
+
props?: {} | string[];
|
|
55
|
+
data?: {};
|
|
56
|
+
computed?: {};
|
|
57
|
+
methods?: {};
|
|
58
|
+
watcher?: {};
|
|
59
|
+
beforeRender?: () => void;
|
|
60
|
+
afterRender?: () => void;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Here is the template class for render component!
|
|
65
|
+
*/
|
|
66
|
+
export declare class ControlComponent extends AbstractComponent {
|
|
67
|
+
constructor(config: {
|
|
68
|
+
template: {
|
|
69
|
+
name: string;
|
|
70
|
+
vDate: string;
|
|
71
|
+
template: string;
|
|
72
|
+
};
|
|
73
|
+
style?: string;
|
|
74
|
+
props?: {} | string[];
|
|
75
|
+
data?: {};
|
|
76
|
+
computed?: {};
|
|
77
|
+
methods?: {};
|
|
78
|
+
watcher?: {};
|
|
79
|
+
beforeRender?: () => void;
|
|
80
|
+
afterRender?: () => void;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Here is the template class for render pageComponent!
|
|
85
|
+
*/
|
|
86
|
+
export declare class PageComponent extends AbstractComponent {
|
|
41
87
|
constructor(config: {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
88
|
+
template: {
|
|
89
|
+
name: string;
|
|
90
|
+
vDate: string;
|
|
91
|
+
template: string;
|
|
46
92
|
};
|
|
47
|
-
boxStyle?: string;
|
|
48
93
|
props?: {} | string[];
|
|
49
94
|
data?: {};
|
|
50
95
|
computed?: {};
|
|
@@ -53,38 +98,26 @@ export declare class Component extends AbstractComponent {
|
|
|
53
98
|
beforeRender?: () => void;
|
|
54
99
|
afterRender?: () => void;
|
|
55
100
|
});
|
|
101
|
+
render_method_for_listen(params: Map<string, any>, pathParams: Map<string, any>): void;
|
|
56
102
|
}
|
|
57
103
|
/**
|
|
58
104
|
* This proto is the application proto.
|
|
59
105
|
*/
|
|
60
106
|
export declare class RenderJS implements RenderGeneric {
|
|
61
107
|
contextController: ContextController;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
* This func is used to execute plugins
|
|
65
|
-
*/
|
|
66
|
-
use_plugin(plugin: PluginGeneric): void;
|
|
108
|
+
renderRouter: AbstractRouter;
|
|
109
|
+
constructor(router: AbstractRouter);
|
|
67
110
|
/**
|
|
68
111
|
* This unc is used to register component to system
|
|
69
112
|
* @param component
|
|
70
113
|
*/
|
|
71
|
-
add_tag(component:
|
|
114
|
+
add_tag(component: AdjustComponent | ControlComponent): void;
|
|
72
115
|
/**
|
|
73
|
-
* This func is used to
|
|
74
|
-
*/
|
|
75
|
-
listen(): void;
|
|
76
|
-
/**
|
|
77
|
-
* This func is used to work under the directive render mode
|
|
116
|
+
* This func is used to execute plugins
|
|
78
117
|
*/
|
|
79
|
-
|
|
118
|
+
use_plugin(plugin: PluginGeneric): void;
|
|
80
119
|
/**
|
|
81
|
-
* This func is used to work under the
|
|
120
|
+
* This func is used to work under the route mode
|
|
82
121
|
*/
|
|
83
|
-
|
|
122
|
+
listen(): void;
|
|
84
123
|
}
|
|
85
|
-
/**
|
|
86
|
-
* This func is used to extend window environment
|
|
87
|
-
* @param on
|
|
88
|
-
* @param func
|
|
89
|
-
*/
|
|
90
|
-
export declare function extend_window(on: string, func: any): void;
|
package/index.js
CHANGED
|
@@ -13,16 +13,14 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
13
13
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
14
|
};
|
|
15
15
|
})();
|
|
16
|
-
import { render_for_listen
|
|
16
|
+
import { render_for_listen } from "./xboot/entrance";
|
|
17
17
|
import { registerTagLib } from "./xboot/tagProcessor";
|
|
18
18
|
import { HooksAction } from "./tension/prototype/HooksAction";
|
|
19
|
-
import { ContextController } from "./system/prototype/ContextController";
|
|
20
|
-
import { AbstractComponent } from "./
|
|
19
|
+
import { ContextController } from "./system/generic/controller/prototype/ContextController";
|
|
20
|
+
import { AbstractComponent } from "./system/generic/component/instance/AbstractComponent";
|
|
21
21
|
import { set_context_controller } from "./system/recorder/table0/system_func_0";
|
|
22
22
|
import { PrefaceAction } from "./tension/prototype/PrefaceAction";
|
|
23
23
|
import { SystemInitPlugin } from "./tension/SystemInitPlugin";
|
|
24
|
-
import { lintComponent } from "./verify/directive-linter";
|
|
25
|
-
import { errorDisplay } from "./system/output/errorUtility";
|
|
26
24
|
/**
|
|
27
25
|
* This class is used to prototype the properties type
|
|
28
26
|
*/
|
|
@@ -32,6 +30,14 @@ var PropertyType = /** @class */ (function () {
|
|
|
32
30
|
return PropertyType;
|
|
33
31
|
}());
|
|
34
32
|
export { PropertyType };
|
|
33
|
+
/**
|
|
34
|
+
* This func is used to extend window environment
|
|
35
|
+
* @param on
|
|
36
|
+
* @param func
|
|
37
|
+
*/
|
|
38
|
+
export function extend_window(on, func) {
|
|
39
|
+
Reflect.set(window, on, func);
|
|
40
|
+
}
|
|
35
41
|
/**
|
|
36
42
|
* This abstract class is the plugin interface class for those who want to develop plugin for the system
|
|
37
43
|
*/
|
|
@@ -54,84 +60,84 @@ var AbstractRouter = /** @class */ (function () {
|
|
|
54
60
|
AbstractRouter.prototype.getComponent = function () {
|
|
55
61
|
return undefined;
|
|
56
62
|
};
|
|
57
|
-
/**
|
|
58
|
-
* The method must be overwritten by developer
|
|
59
|
-
*/
|
|
60
|
-
AbstractRouter.prototype.getPathVariable = function () {
|
|
61
|
-
return new Map();
|
|
62
|
-
};
|
|
63
63
|
return AbstractRouter;
|
|
64
64
|
}());
|
|
65
65
|
export { AbstractRouter };
|
|
66
66
|
/**
|
|
67
67
|
* Here is the template class for render component!
|
|
68
68
|
*/
|
|
69
|
-
var
|
|
70
|
-
__extends(
|
|
71
|
-
function
|
|
69
|
+
var AdjustComponent = /** @class */ (function (_super) {
|
|
70
|
+
__extends(AdjustComponent, _super);
|
|
71
|
+
function AdjustComponent(config) {
|
|
72
|
+
return _super.call(this, config) || this;
|
|
73
|
+
}
|
|
74
|
+
return AdjustComponent;
|
|
75
|
+
}(AbstractComponent));
|
|
76
|
+
export { AdjustComponent };
|
|
77
|
+
/**
|
|
78
|
+
* Here is the template class for render component!
|
|
79
|
+
*/
|
|
80
|
+
var ControlComponent = /** @class */ (function (_super) {
|
|
81
|
+
__extends(ControlComponent, _super);
|
|
82
|
+
function ControlComponent(config) {
|
|
72
83
|
return _super.call(this, config) || this;
|
|
73
84
|
}
|
|
74
|
-
return
|
|
85
|
+
return ControlComponent;
|
|
75
86
|
}(AbstractComponent));
|
|
76
|
-
export {
|
|
87
|
+
export { ControlComponent };
|
|
88
|
+
/**
|
|
89
|
+
* Here is the template class for render pageComponent!
|
|
90
|
+
*/
|
|
91
|
+
var PageComponent = /** @class */ (function (_super) {
|
|
92
|
+
__extends(PageComponent, _super);
|
|
93
|
+
function PageComponent(config) {
|
|
94
|
+
return _super.call(this, config) || this;
|
|
95
|
+
}
|
|
96
|
+
PageComponent.prototype.render_method_for_listen = function (params, pathParams) {
|
|
97
|
+
render_for_listen(params, pathParams);
|
|
98
|
+
};
|
|
99
|
+
return PageComponent;
|
|
100
|
+
}(AbstractComponent));
|
|
101
|
+
export { PageComponent };
|
|
77
102
|
/**
|
|
78
103
|
* This proto is the application proto.
|
|
79
104
|
*/
|
|
80
105
|
var RenderJS = /** @class */ (function () {
|
|
81
|
-
function RenderJS() {
|
|
106
|
+
function RenderJS(router) {
|
|
107
|
+
var _this = this;
|
|
82
108
|
/* initiate the page controller */
|
|
83
109
|
this.contextController = new ContextController({
|
|
84
110
|
boxMode: false,
|
|
85
111
|
});
|
|
112
|
+
this.renderRouter = router;
|
|
86
113
|
/* init the basis extension */
|
|
87
114
|
this.use_plugin(new SystemInitPlugin());
|
|
115
|
+
/* init the event */
|
|
116
|
+
window.addEventListener("route:change", function () {
|
|
117
|
+
_this.listen();
|
|
118
|
+
});
|
|
88
119
|
}
|
|
89
|
-
/**
|
|
90
|
-
* This func is used to execute plugins
|
|
91
|
-
*/
|
|
92
|
-
RenderJS.prototype.use_plugin = function (plugin) {
|
|
93
|
-
plugin.plugin(new PrefaceAction(), new HooksAction());
|
|
94
|
-
};
|
|
95
120
|
/**
|
|
96
121
|
* This unc is used to register component to system
|
|
97
122
|
* @param component
|
|
98
123
|
*/
|
|
99
124
|
RenderJS.prototype.add_tag = function (component) {
|
|
100
|
-
var errors = lintComponent(component);
|
|
101
|
-
errors.map(function (error) {
|
|
102
|
-
errorDisplay(component.getName(), error);
|
|
103
|
-
});
|
|
104
125
|
registerTagLib(component);
|
|
105
126
|
};
|
|
106
127
|
/**
|
|
107
|
-
* This func is used to
|
|
108
|
-
*/
|
|
109
|
-
RenderJS.prototype.listen = function () {
|
|
110
|
-
set_context_controller(this.contextController);
|
|
111
|
-
render_for_listen();
|
|
112
|
-
};
|
|
113
|
-
/**
|
|
114
|
-
* This func is used to work under the directive render mode
|
|
128
|
+
* This func is used to execute plugins
|
|
115
129
|
*/
|
|
116
|
-
RenderJS.prototype.
|
|
117
|
-
|
|
118
|
-
render_for_render(component, mounter);
|
|
130
|
+
RenderJS.prototype.use_plugin = function (plugin) {
|
|
131
|
+
plugin.plugin(new PrefaceAction(), new HooksAction());
|
|
119
132
|
};
|
|
120
133
|
/**
|
|
121
|
-
* This func is used to work under the
|
|
134
|
+
* This func is used to work under the route mode
|
|
122
135
|
*/
|
|
123
|
-
RenderJS.prototype.
|
|
136
|
+
RenderJS.prototype.listen = function () {
|
|
124
137
|
set_context_controller(this.contextController);
|
|
125
|
-
|
|
138
|
+
var component = this.renderRouter.getComponent();
|
|
139
|
+
component.component.render_method_for_listen(component.params, component.pathParams);
|
|
126
140
|
};
|
|
127
141
|
return RenderJS;
|
|
128
142
|
}());
|
|
129
143
|
export { RenderJS };
|
|
130
|
-
/**
|
|
131
|
-
* This func is used to extend window environment
|
|
132
|
-
* @param on
|
|
133
|
-
* @param func
|
|
134
|
-
*/
|
|
135
|
-
export function extend_window(on, func) {
|
|
136
|
-
Reflect.set(window, on, func);
|
|
137
|
-
}
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import { ContextController } from "../../system/prototype/ContextController";
|
|
2
|
-
import {
|
|
1
|
+
import { ContextController } from "../../system/generic/controller/prototype/ContextController";
|
|
2
|
+
import { AdjustComponent, ControlComponent } from "../../index";
|
|
3
3
|
/**
|
|
4
4
|
* @param protoTypeComponent
|
|
5
5
|
* @param componentAttachedRootElement
|
|
6
|
-
* @param child
|
|
7
6
|
* @param parentController
|
|
8
7
|
*/
|
|
9
|
-
export declare function spa_delivery(protoTypeComponent:
|
|
10
|
-
/**
|
|
11
|
-
*
|
|
12
|
-
* @param protoTypeComponent
|
|
13
|
-
*/
|
|
14
|
-
export declare function direct_delivery(protoTypeComponent: Component): void;
|
|
8
|
+
export declare function spa_delivery(protoTypeComponent: ControlComponent | AdjustComponent, componentAttachedRootElement: Element, parentController: ContextController): void;
|
|
15
9
|
/**
|
|
16
10
|
*
|
|
17
11
|
* @param protoTypeComponent
|
|
@@ -19,7 +13,7 @@ export declare function direct_delivery(protoTypeComponent: Component): void;
|
|
|
19
13
|
* @param child
|
|
20
14
|
* @param parentController
|
|
21
15
|
*/
|
|
22
|
-
export declare function mpa_delivery(protoTypeComponent:
|
|
16
|
+
export declare function mpa_delivery(protoTypeComponent: ControlComponent | AdjustComponent, componentAttachedRootElement: ParentNode, child: Element, parentController: ContextController): void;
|
|
23
17
|
/**
|
|
24
18
|
*
|
|
25
19
|
* @param collection
|
|
@@ -1,30 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { get_tag_library, set_context_controller } from "../../system/recorder/table0/system_func_0";
|
|
1
|
+
import { get_tag_library } from "../../system/recorder/table0/system_func_0";
|
|
3
2
|
import { init_renderer } from "../renderer/initRender";
|
|
4
3
|
import { post_renderer } from "../renderer/postRender";
|
|
5
4
|
import { raw_renderer } from "../renderer/rawRender";
|
|
6
5
|
import { renderHtml } from "../../xboot/renderProcessor";
|
|
7
6
|
import { tag_unknown_check } from "../../system/recorder/table2/system_func_2";
|
|
7
|
+
import { page_renderer } from "../renderer/pageRender";
|
|
8
8
|
/**
|
|
9
9
|
* @param protoTypeComponent
|
|
10
10
|
* @param componentAttachedRootElement
|
|
11
|
-
* @param child
|
|
12
11
|
* @param parentController
|
|
13
12
|
*/
|
|
14
|
-
export function spa_delivery(protoTypeComponent, componentAttachedRootElement,
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
*
|
|
19
|
-
* @param protoTypeComponent
|
|
20
|
-
*/
|
|
21
|
-
export function direct_delivery(protoTypeComponent) {
|
|
22
|
-
var context = new ContextController({
|
|
23
|
-
boxMode: true
|
|
24
|
-
});
|
|
25
|
-
set_context_controller(context);
|
|
26
|
-
var webview = document.querySelector("webview");
|
|
27
|
-
raw_renderer(protoTypeComponent, webview.parentNode, webview, context);
|
|
13
|
+
export function spa_delivery(protoTypeComponent, componentAttachedRootElement, parentController) {
|
|
14
|
+
page_renderer(protoTypeComponent, componentAttachedRootElement, parentController);
|
|
28
15
|
}
|
|
29
16
|
/**
|
|
30
17
|
*
|
|
@@ -30,9 +30,9 @@ export function parse_directive_if(elements, data) {
|
|
|
30
30
|
}
|
|
31
31
|
//v-if渲染失败,寻找到是否匹配的v-else
|
|
32
32
|
for (var j = 0; j < elements.length; j++) {
|
|
33
|
-
var result = elements[j].hasAttribute("
|
|
33
|
+
var result = elements[j].hasAttribute("@else");
|
|
34
34
|
if (result) {
|
|
35
|
-
elements[j].removeAttribute("
|
|
35
|
+
elements[j].removeAttribute("@else");
|
|
36
36
|
if (tag) {
|
|
37
37
|
// @ts-ignore
|
|
38
38
|
elements[j].style.display = "none";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ContextController } from "../../../system/generic/controller/prototype/ContextController";
|
|
2
|
+
/**
|
|
3
|
+
* 此函数用于解析自定义元素salt
|
|
4
|
+
* @param tagTemplate
|
|
5
|
+
* @param controller
|
|
6
|
+
*/
|
|
7
|
+
export declare function parse_directive_salt_collect(tagTemplate: ChildNode, controller: ContextController): void;
|
|
8
|
+
/**
|
|
9
|
+
* 此函数用于展开salt
|
|
10
|
+
* @param elements
|
|
11
|
+
* @param controller
|
|
12
|
+
*/
|
|
13
|
+
export declare function parse_directive_salt_extract(elements: HTMLCollection, controller: ContextController): void;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 此函数用于解析自定义元素salt
|
|
3
|
+
* @param tagTemplate
|
|
4
|
+
* @param controller
|
|
5
|
+
*/
|
|
6
|
+
export function parse_directive_salt_collect(tagTemplate, controller) {
|
|
7
|
+
if (tagTemplate.hasChildNodes()) {
|
|
8
|
+
// @ts-ignore
|
|
9
|
+
var list = tagTemplate.querySelectorAll("slot");
|
|
10
|
+
if (list.length !== 0) {
|
|
11
|
+
list.forEach(function (value) {
|
|
12
|
+
if (value.hasAttribute("name"))
|
|
13
|
+
controller.salt.set(value.getAttribute("name"), value.innerHTML);
|
|
14
|
+
else
|
|
15
|
+
controller.salt.set("default", value.innerHTML);
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
controller.salt.set("default", tagTemplate.innerHTML);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 此函数用于展开salt
|
|
26
|
+
* @param elements
|
|
27
|
+
* @param controller
|
|
28
|
+
*/
|
|
29
|
+
export function parse_directive_salt_extract(elements, controller) {
|
|
30
|
+
for (var i = 0; i < elements.length; i++) {
|
|
31
|
+
var result = elements[i].hasAttribute("@slot");
|
|
32
|
+
if (result) {
|
|
33
|
+
var dataName = elements[i].getAttribute("@slot");
|
|
34
|
+
elements[i].removeAttribute("@slot");
|
|
35
|
+
if (!dataName) {
|
|
36
|
+
elements[i].innerHTML = controller.salt.get("default");
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
// @ts-ignore
|
|
40
|
+
elements[i].innerHTML = controller.solt.get(dataName);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
//深度解析
|
|
44
|
+
parse_directive_salt_extract(elements[i].children, controller);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ContextController } from "../../system/prototype/ContextController";
|
|
2
|
-
import {
|
|
1
|
+
import { ContextController } from "../../system/generic/controller/prototype/ContextController";
|
|
2
|
+
import { AdjustComponent, ControlComponent } from "../../index";
|
|
3
3
|
/**
|
|
4
4
|
* 该函数用于处理需要更更新时候,需要从父组件提取数据状态的渲染操作
|
|
5
5
|
* @param protoType
|
|
@@ -7,4 +7,4 @@ import { Component } from "../../index";
|
|
|
7
7
|
* @param child
|
|
8
8
|
* @param parentController
|
|
9
9
|
*/
|
|
10
|
-
export declare function init_renderer(protoType:
|
|
10
|
+
export declare function init_renderer(protoType: AdjustComponent | ControlComponent, parent: ParentNode, child: ChildNode, parentController: ContextController): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContextController } from "../../system/prototype/ContextController";
|
|
1
|
+
import { ContextController } from "../../system/generic/controller/prototype/ContextController";
|
|
2
2
|
import { directive_parse_collection_for_after, directive_parse_collection_for_before } from "../../system/utility/directive/cmdUtility";
|
|
3
3
|
import { archive_mount, extract_mount } from "../../system/lifecycle/mount";
|
|
4
4
|
import { inject_$commit_to_data, inject_$getter_to_data, inject_$http_to_data, inject_$name_to_data, inject_$pathVariable_to_data, inject_$plugins_to_data, inject_$props_to_data, inject_$publish_to_data, inject_$refs_to_data, inject_$setter_to_data, inject_computed_to_controller, inject_method_to_data, inject_watcher_to_controller, } from "../../system/injection/injector";
|
|
@@ -9,7 +9,8 @@ import { loader_tag_style } from "../../system/utility/style/styleUtility";
|
|
|
9
9
|
import { get_style_library } from "../../system/recorder/table0/system_func_0";
|
|
10
10
|
import { get_proxy_for_computed, get_proxy_for_method, get_proxy_for_watcher } from "../proxyer/getProxy";
|
|
11
11
|
import { get_commit_method, get_getter_method, get_publish_method, get_setter_method } from "../../system/injection/injection";
|
|
12
|
-
import {
|
|
12
|
+
import { AdjustComponent } from "../../index";
|
|
13
|
+
import { parse_directive_salt_collect } from "../directive/slot/v-slot";
|
|
13
14
|
/**
|
|
14
15
|
* 该函数用于处理需要更更新时候,需要从父组件提取数据状态的渲染操作
|
|
15
16
|
* @param protoType
|
|
@@ -28,7 +29,7 @@ export function init_renderer(protoType, parent, child, parentController) {
|
|
|
28
29
|
/* initiate to controller */
|
|
29
30
|
currentController.parentController = parentController;
|
|
30
31
|
currentController.prototypeOfComponent = protoType;
|
|
31
|
-
currentController.componentConfig.boxMode = protoType
|
|
32
|
+
currentController.componentConfig.boxMode = protoType instanceof AdjustComponent;
|
|
32
33
|
// @ts-ignore
|
|
33
34
|
currentController.originalData = parentController.lazyComponent.get(child.getAttribute("name"));
|
|
34
35
|
currentController.dataForMethod = get_proxy_for_method(currentController.originalData, currentController);
|
|
@@ -61,7 +62,7 @@ export function init_renderer(protoType, parent, child, parentController) {
|
|
|
61
62
|
after_process_for_init(currentController, child, parentController);
|
|
62
63
|
/* find the next element to render */
|
|
63
64
|
findComponent(currentController.componentAttachedRootElement.children, currentController);
|
|
64
|
-
if (
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
if (protoType instanceof AdjustComponent) { }
|
|
66
|
+
/* extract mount */
|
|
67
|
+
extract_mount(currentController);
|
|
67
68
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ContextController } from "../../system/generic/controller/prototype/ContextController";
|
|
2
|
+
import { AdjustComponent, ControlComponent } from "../../index";
|
|
3
|
+
/**
|
|
4
|
+
* 该函数用于处理需要更更新时候,需要从父组件提取数据状态的渲染操作
|
|
5
|
+
* @param protoType
|
|
6
|
+
* @param parent
|
|
7
|
+
* @param parentController
|
|
8
|
+
*/
|
|
9
|
+
export declare function page_renderer(protoType: AdjustComponent | ControlComponent, parent: Element, parentController: ContextController): void;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ContextController } from "../../system/generic/controller/prototype/ContextController";
|
|
2
|
+
import { directive_parse_collection_for_after, directive_parse_collection_for_before } from "../../system/utility/directive/cmdUtility";
|
|
3
|
+
import { inject_$commit_to_data, inject_$getter_to_data, inject_$http_to_data, inject_$name_to_data, inject_$pathVariable_to_data, inject_$plugins_to_data, inject_$publish_to_data, inject_$refs_to_data, inject_$setter_to_data, inject_computed_to_controller, inject_method_to_data, inject_watcher_to_controller, } from "../../system/injection/injector";
|
|
4
|
+
import { after_process_for_post } from "../../system/lifecycle/lifeCycle";
|
|
5
|
+
import { findComponent } from "../delivery/delivery";
|
|
6
|
+
import { get_proxy_for_computed, get_proxy_for_method, get_proxy_for_watcher } from "../proxyer/getProxy";
|
|
7
|
+
import { dataInject } from "../../system/utility/data/dataUtility";
|
|
8
|
+
import { get_commit_method, get_getter_method, get_publish_method, get_setter_method } from "../../system/injection/injection";
|
|
9
|
+
import { AdjustComponent } from "../../index";
|
|
10
|
+
/**
|
|
11
|
+
* 该函数用于处理需要更更新时候,需要从父组件提取数据状态的渲染操作
|
|
12
|
+
* @param protoType
|
|
13
|
+
* @param parent
|
|
14
|
+
* @param parentController
|
|
15
|
+
*/
|
|
16
|
+
export function page_renderer(protoType, parent, parentController) {
|
|
17
|
+
/* initiate the rang vars */
|
|
18
|
+
parent.innerHTML = protoType.getTemplate();
|
|
19
|
+
var currentController = new ContextController({ boxMode: true });
|
|
20
|
+
/* initiate to controller */
|
|
21
|
+
currentController.parentController = parentController;
|
|
22
|
+
currentController.prototypeOfComponent = protoType;
|
|
23
|
+
currentController.componentConfig.boxMode = (protoType instanceof AdjustComponent);
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
currentController.originalData = dataInject(protoType.getData());
|
|
26
|
+
currentController.dataForMethod = get_proxy_for_method(currentController.originalData, currentController);
|
|
27
|
+
currentController.dataForComputed = get_proxy_for_computed(currentController.originalData);
|
|
28
|
+
currentController.dataForWatcher = get_proxy_for_watcher(currentController.originalData);
|
|
29
|
+
/* inject to original data source */
|
|
30
|
+
inject_$name_to_data(protoType.getName(), currentController.originalData);
|
|
31
|
+
inject_$refs_to_data(document.body, currentController.originalData);
|
|
32
|
+
inject_$plugins_to_data(currentController.originalData);
|
|
33
|
+
inject_$http_to_data(currentController.originalData);
|
|
34
|
+
inject_$pathVariable_to_data(currentController.originalData);
|
|
35
|
+
inject_$commit_to_data(currentController.originalData, get_commit_method(currentController));
|
|
36
|
+
inject_$publish_to_data(currentController.originalData, get_publish_method(currentController));
|
|
37
|
+
inject_$setter_to_data(currentController.originalData, get_setter_method(currentController));
|
|
38
|
+
inject_$getter_to_data(currentController.originalData, get_getter_method(currentController));
|
|
39
|
+
/* initiate method, computed, watcher */
|
|
40
|
+
inject_method_to_data(currentController, protoType);
|
|
41
|
+
inject_computed_to_controller(currentController, protoType);
|
|
42
|
+
inject_watcher_to_controller(currentController, protoType);
|
|
43
|
+
protoType.getBeforeRender().apply(currentController.originalData, null);
|
|
44
|
+
/* directive parse before */
|
|
45
|
+
directive_parse_collection_for_before(document.body, protoType, currentController);
|
|
46
|
+
/* directive parse after */
|
|
47
|
+
directive_parse_collection_for_after(currentController.componentAttachedRootElement, currentController);
|
|
48
|
+
protoType.getAfterRender().apply(currentController.dataForMethod, null);
|
|
49
|
+
/* after process for render */
|
|
50
|
+
after_process_for_post(currentController, parentController);
|
|
51
|
+
/* find the next element to render */
|
|
52
|
+
findComponent(currentController.componentAttachedRootElement.children, currentController);
|
|
53
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ContextController } from "../../system/prototype/ContextController";
|
|
2
|
-
import {
|
|
1
|
+
import { ContextController } from "../../system/generic/controller/prototype/ContextController";
|
|
2
|
+
import { AdjustComponent, ControlComponent } from "../../index";
|
|
3
3
|
/**
|
|
4
4
|
* 该函数用于处理需要更更新时候,需要从父组件提取数据状态的渲染操作
|
|
5
5
|
* @param protoType
|
|
@@ -7,4 +7,4 @@ import { Component } from "../../index";
|
|
|
7
7
|
* @param child
|
|
8
8
|
* @param parentController
|
|
9
9
|
*/
|
|
10
|
-
export declare function post_renderer(protoType:
|
|
10
|
+
export declare function post_renderer(protoType: AdjustComponent | ControlComponent, parent: ParentNode, child: ChildNode, parentController: ContextController): void;
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { ContextController } from "../../system/prototype/ContextController";
|
|
1
|
+
import { ContextController } from "../../system/generic/controller/prototype/ContextController";
|
|
2
2
|
import { directive_parse_collection_for_after, directive_parse_collection_for_before } from "../../system/utility/directive/cmdUtility";
|
|
3
3
|
import { archive_mount, extract_mount } from "../../system/lifecycle/mount";
|
|
4
4
|
import { inject_$commit_to_data, inject_$getter_to_data, inject_$http_to_data, inject_$name_to_data, inject_$pathVariable_to_data, inject_$plugins_to_data, inject_$props_to_data, inject_$publish_to_data, inject_$refs_to_data, inject_$setter_to_data, inject_computed_to_controller, inject_method_to_data, inject_watcher_to_controller, } from "../../system/injection/injector";
|
|
5
5
|
import { after_process_for_post } from "../../system/lifecycle/lifeCycle";
|
|
6
6
|
import { findComponent } from "../delivery/delivery";
|
|
7
|
-
import { parse_directive_salt_collect } from "../directive/
|
|
7
|
+
import { parse_directive_salt_collect } from "../directive/slot/v-slot";
|
|
8
8
|
import { getTemplate } from "../../system/utility/initiate/templateUtility";
|
|
9
9
|
import { loader_tag_style } from "../../system/utility/style/styleUtility";
|
|
10
10
|
import { get_style_library } from "../../system/recorder/table0/system_func_0";
|
|
11
11
|
import { get_proxy_for_computed, get_proxy_for_method, get_proxy_for_watcher } from "../proxyer/getProxy";
|
|
12
12
|
import { dataInject } from "../../system/utility/data/dataUtility";
|
|
13
13
|
import { get_commit_method, get_getter_method, get_publish_method, get_setter_method } from "../../system/injection/injection";
|
|
14
|
+
import { AdjustComponent } from "../../index";
|
|
14
15
|
/**
|
|
15
16
|
* 该函数用于处理需要更更新时候,需要从父组件提取数据状态的渲染操作
|
|
16
17
|
* @param protoType
|
|
@@ -29,7 +30,7 @@ export function post_renderer(protoType, parent, child, parentController) {
|
|
|
29
30
|
/* initiate to controller */
|
|
30
31
|
currentController.parentController = parentController;
|
|
31
32
|
currentController.prototypeOfComponent = protoType;
|
|
32
|
-
currentController.componentConfig.boxMode = protoType
|
|
33
|
+
currentController.componentConfig.boxMode = protoType instanceof AdjustComponent;
|
|
33
34
|
// @ts-ignore
|
|
34
35
|
currentController.originalData = dataInject(protoType.getData());
|
|
35
36
|
currentController.dataForMethod = get_proxy_for_method(currentController.originalData, currentController);
|
|
@@ -62,7 +63,7 @@ export function post_renderer(protoType, parent, child, parentController) {
|
|
|
62
63
|
after_process_for_post(currentController, parentController);
|
|
63
64
|
/* find the next element to render */
|
|
64
65
|
findComponent(currentController.componentAttachedRootElement.children, currentController);
|
|
65
|
-
if (
|
|
66
|
+
if (protoType instanceof AdjustComponent)
|
|
66
67
|
/* extract mount */
|
|
67
68
|
extract_mount(currentController);
|
|
68
69
|
}
|