render-core 1.0.104 → 1.0.106
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.
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { AppTip } from "../tips/appTip";
|
|
2
|
+
import { ContextController } from "./contextController";
|
|
2
3
|
export declare class AppController implements AppTip {
|
|
3
4
|
private fileds;
|
|
4
5
|
constructor();
|
|
5
6
|
saveFileds(fileds: {}): void;
|
|
6
|
-
loadFileds(): void;
|
|
7
|
+
loadFileds(context: ContextController): void;
|
|
7
8
|
setFiled(filed: string, value: any): void;
|
|
8
9
|
getFiled(filed: string): any;
|
|
9
10
|
}
|
|
@@ -24,7 +24,7 @@ var AppController = /** @class */ (function () {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
|
-
AppController.prototype.loadFileds = function () {
|
|
27
|
+
AppController.prototype.loadFileds = function (context) {
|
|
28
28
|
for (var filedsKey in this.fileds) {
|
|
29
29
|
if (this.fileds[filedsKey].react) {
|
|
30
30
|
if (status_read({
|
|
@@ -38,7 +38,7 @@ var AppController = /** @class */ (function () {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
// @ts-ignore
|
|
41
|
-
this.fileds[filedsKey].callback(this.fileds[filedsKey],
|
|
41
|
+
this.fileds[filedsKey].callback(this.fileds[filedsKey], context);
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
AppController.prototype.setFiled = function (filed, value) {
|
|
@@ -48,7 +48,8 @@ var AppController = /** @class */ (function () {
|
|
|
48
48
|
theme: JSON.stringify(value)
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
|
-
|
|
51
|
+
// @ts-ignore
|
|
52
|
+
this.loadFileds(window.context);
|
|
52
53
|
// @ts-ignore
|
|
53
54
|
this.fileds[filed].callback(value, window.context);
|
|
54
55
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { AppController } from "./appController";
|
|
1
2
|
export declare class ContextController {
|
|
2
3
|
private fileds;
|
|
3
4
|
private mixinData;
|
|
4
5
|
constructor();
|
|
5
6
|
saveFileds(fileds: {}): void;
|
|
6
|
-
loadFileds(): void;
|
|
7
|
+
loadFileds(appSite: AppController): void;
|
|
7
8
|
setFiled(filed: string, value: any): void;
|
|
8
9
|
getFiled(filed: string): any;
|
|
9
10
|
mixin(mix: {}): void;
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
// @ts-ignore
|
|
2
2
|
import { status_read, status_write } from "render-status";
|
|
3
|
-
import { reloadStyle } from "../../core/utility/styleUtility";
|
|
4
3
|
var ContextController = /** @class */ (function () {
|
|
5
4
|
function ContextController() {
|
|
6
5
|
this.mixinData = {};
|
|
7
6
|
this.fileds = {
|
|
8
7
|
them: {
|
|
9
8
|
data: "default",
|
|
10
|
-
react: true
|
|
11
|
-
callback: function (value, context) {
|
|
12
|
-
reloadStyle(value);
|
|
13
|
-
}
|
|
9
|
+
react: true
|
|
14
10
|
}
|
|
15
11
|
};
|
|
16
12
|
}
|
|
@@ -24,7 +20,7 @@ var ContextController = /** @class */ (function () {
|
|
|
24
20
|
}
|
|
25
21
|
}
|
|
26
22
|
};
|
|
27
|
-
ContextController.prototype.loadFileds = function () {
|
|
23
|
+
ContextController.prototype.loadFileds = function (appSite) {
|
|
28
24
|
for (var filedsKey in this.fileds) {
|
|
29
25
|
if (this.fileds[filedsKey].react) {
|
|
30
26
|
if (status_read({
|
|
@@ -38,7 +34,7 @@ var ContextController = /** @class */ (function () {
|
|
|
38
34
|
}
|
|
39
35
|
}
|
|
40
36
|
// @ts-ignore
|
|
41
|
-
this.fileds[filedsKey].callback(this.fileds[filedsKey],
|
|
37
|
+
this.fileds[filedsKey].callback(this.fileds[filedsKey], appSite);
|
|
42
38
|
}
|
|
43
39
|
};
|
|
44
40
|
ContextController.prototype.setFiled = function (filed, value) {
|
|
@@ -48,9 +44,10 @@ var ContextController = /** @class */ (function () {
|
|
|
48
44
|
theme: JSON.stringify(value)
|
|
49
45
|
}
|
|
50
46
|
});
|
|
51
|
-
this.loadFileds();
|
|
52
47
|
// @ts-ignore
|
|
53
|
-
this.
|
|
48
|
+
this.loadFileds(window.appSite);
|
|
49
|
+
// @ts-ignore
|
|
50
|
+
this.fileds[filed].callback(value, window.appSite);
|
|
54
51
|
};
|
|
55
52
|
ContextController.prototype.getFiled = function (filed) {
|
|
56
53
|
if (this.fileds[filed]) {
|
package/index.js
CHANGED
|
@@ -26,7 +26,7 @@ var RenderJS = /** @class */ (function () {
|
|
|
26
26
|
*/
|
|
27
27
|
RenderJS.prototype.configApp = function (config) {
|
|
28
28
|
this.application.saveFileds(config);
|
|
29
|
-
this.application.loadFileds();
|
|
29
|
+
this.application.loadFileds(this.context);
|
|
30
30
|
};
|
|
31
31
|
/**
|
|
32
32
|
*
|
|
@@ -34,7 +34,7 @@ var RenderJS = /** @class */ (function () {
|
|
|
34
34
|
*/
|
|
35
35
|
RenderJS.prototype.configContext = function (cinfig) {
|
|
36
36
|
this.context.saveFileds(cinfig);
|
|
37
|
-
this.context.loadFileds();
|
|
37
|
+
this.context.loadFileds(this.application);
|
|
38
38
|
};
|
|
39
39
|
/**
|
|
40
40
|
*
|