render-core 1.3.64 → 1.3.66

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.
Files changed (47) hide show
  1. package/core/cmd/data/v-el.d.ts +1 -1
  2. package/core/cmd/data/v-html.d.ts +1 -1
  3. package/core/cmd/data/v-txt.d.ts +1 -1
  4. package/core/cmd/solt/v-solt.d.ts +2 -2
  5. package/core/inject/inject.d.ts +2 -2
  6. package/core/lifecycle/afterMethods.d.ts +2 -2
  7. package/core/lifecycle/controllerCycle.d.ts +3 -3
  8. package/core/lifecycle/mount.d.ts +2 -2
  9. package/core/proxy/getProxy.d.ts +1 -1
  10. package/core/render/PostRender.d.ts +3 -3
  11. package/core/render/PostRender.js +1 -1
  12. package/core/render/delivery.d.ts +3 -3
  13. package/core/render/initRender.d.ts +3 -3
  14. package/core/render/initRender.js +1 -1
  15. package/core/render/rawRender.d.ts +3 -3
  16. package/core/render/rawRender.js +1 -1
  17. package/core/render/updateRender.d.ts +1 -1
  18. package/core/resolver/props.js +3 -0
  19. package/core/utility/cmdUtility.d.ts +2 -2
  20. package/core/utility/injectUtility.d.ts +2 -2
  21. package/core/utility/inputType.d.ts +1 -1
  22. package/core/utility/sectionUtility.d.ts +1 -1
  23. package/core/utility/styleUtility.d.ts +1 -1
  24. package/core/utility/templateUtility.d.ts +1 -1
  25. package/http/{redirect/redirect.d.ts → Http.d.ts} +1 -1
  26. package/http/{redirect/redirect.js → Http.js} +1 -1
  27. package/http/generic/HttpGeneric.d.ts +0 -0
  28. package/http/generic/HttpGeneric.js +0 -0
  29. package/index.d.ts +11 -15
  30. package/index.js +34 -26
  31. package/lib/generic/RenderGeneric.d.ts +5 -0
  32. package/{class/controller/appController.d.ts → lib/proto/controller/AppController.d.ts} +2 -2
  33. package/{class/controller/appController.js → lib/proto/controller/AppController.js} +4 -4
  34. package/{class/component/componentController.d.ts → lib/proto/controller/ComponentController.d.ts} +1 -1
  35. package/{class/controller/pageController.d.ts → lib/proto/controller/PageController.d.ts} +1 -1
  36. package/package.json +26 -16
  37. package/runtime/runtime.d.ts +1 -1
  38. package/runtime/tools.d.ts +2 -2
  39. package/runtime/tools.js +2 -2
  40. package/class/component/component.d.ts +0 -41
  41. package/class/component/component.js +0 -111
  42. package/class/tips/componentTip.d.ts +0 -13
  43. package/class/tips/renderTip.d.ts +0 -4
  44. package/class/tips/renderTip.js +0 -1
  45. /package/{class/tips/componentTip.js → lib/generic/RenderGeneric.js} +0 -0
  46. /package/{class/component/componentController.js → lib/proto/controller/ComponentController.js} +0 -0
  47. /package/{class/controller/pageController.js → lib/proto/controller/PageController.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { ComponentController } from "../../../class/component/componentController";
1
+ import { ComponentController } from "../../../lib/proto/controller/ComponentController";
2
2
  /**
3
3
  *
4
4
  * @param node
@@ -1,4 +1,4 @@
1
- import { ComponentController } from "../../../class/component/componentController";
1
+ import { ComponentController } from "../../../lib/proto/controller/ComponentController";
2
2
  /**
3
3
  *
4
4
  * @param elements
@@ -1,4 +1,4 @@
1
- import { ComponentController } from "../../../class/component/componentController";
1
+ import { ComponentController } from "../../../lib/proto/controller/ComponentController";
2
2
  /**
3
3
  *
4
4
  * @param elements
@@ -1,5 +1,5 @@
1
- import { ComponentController } from "../../../class/component/componentController";
2
- import { PageController } from "../../../class/controller/pageController";
1
+ import { ComponentController } from "../../../lib/proto/controller/ComponentController";
2
+ import { PageController } from "../../../lib/proto/controller/PageController";
3
3
  /**
4
4
  * 此函数用于解析自定义元素solt
5
5
  * @param tagTemplate
@@ -1,5 +1,5 @@
1
- import { ComponentController } from "../../class/component/componentController";
2
- import { Component } from "../../class/component/component";
1
+ import { ComponentController } from "../../lib/proto/controller/ComponentController";
2
+ import { Component } from "render-refer";
3
3
  /**
4
4
  * 向raw_data中注入props和Query
5
5
  * @param controller
@@ -1,5 +1,5 @@
1
- import { ComponentController } from "../../class/component/componentController";
2
- import { PageController } from "../../class/controller/pageController";
1
+ import { ComponentController } from "../../lib/proto/controller/ComponentController";
2
+ import { PageController } from "../../lib/proto/controller/PageController";
3
3
  /**
4
4
  * 该函数用于处理渲染后操作
5
5
  * @param controller
@@ -1,6 +1,6 @@
1
- import { ComponentController } from "../../class/component/componentController";
2
- import { Component } from "../../class/component/component";
3
- import { PageController } from "../../class/controller/pageController";
1
+ import { ComponentController } from "../../lib/proto/controller/ComponentController";
2
+ import { Component } from "../../lib/proto/component";
3
+ import { PageController } from "../../lib/proto/controller/PageController";
4
4
  /**
5
5
  * This function is used to initiate the component controller object.
6
6
  * @param controller
@@ -1,5 +1,5 @@
1
- import { ComponentController } from "../../class/component/componentController";
2
- import { Component } from "../../class/component/component";
1
+ import { ComponentController } from "../../lib/proto/controller/ComponentController";
2
+ import { Component } from "../../lib/proto/component";
3
3
  /**
4
4
  * This function is used to mount the dom to the html document.
5
5
  * @param controller
@@ -1,4 +1,4 @@
1
- import { ComponentController } from "../../class/component/componentController";
1
+ import { ComponentController } from "../../lib/proto/controller/ComponentController";
2
2
  /**
3
3
  * 获取data对象的代理对象
4
4
  * @param obj
@@ -1,6 +1,6 @@
1
- import { Component } from "../../class/component/component";
2
- import { ComponentController } from "../../class/component/componentController";
3
- import { PageController } from "../../class/controller/pageController";
1
+ import { Component } from "../../lib/proto/component";
2
+ import { ComponentController } from "../../lib/proto/controller/ComponentController";
3
+ import { PageController } from "../../lib/proto/controller/PageController";
4
4
  /**
5
5
  * 该函数用于初次渲染需要记录状态的组件
6
6
  * @param proto
@@ -1,4 +1,4 @@
1
- import { ComponentController } from "../../class/component/componentController";
1
+ import { ComponentController } from "../../lib/proto/controller/ComponentController";
2
2
  import { controllerCycleTypeTwo } from "../lifecycle/controllerCycle";
3
3
  import { afterCmd, cmdUtility } from "../utility/cmdUtility";
4
4
  import { mount, unBox } from "../lifecycle/mount";
@@ -1,5 +1,5 @@
1
- import { ComponentController } from "../../class/component/componentController";
2
- import { Component } from "../../class/component/component";
3
- import { PageController } from "../../class/controller/pageController";
1
+ import { ComponentController } from "../../lib/proto/controller/ComponentController";
2
+ import { Component } from "../../lib/proto/component";
3
+ import { PageController } from "../../lib/proto/controller/PageController";
4
4
  export declare function Render(proto: Component, parent: ParentNode, child: Element, link: ComponentController | PageController): void;
5
5
  export declare function findComponent(collection: HTMLCollection, link: ComponentController | PageController): void;
@@ -1,6 +1,6 @@
1
- import { Component } from "../../class/component/component";
2
- import { ComponentController } from "../../class/component/componentController";
3
- import { PageController } from "../../class/controller/pageController";
1
+ import { Component } from "../../lib/proto/component";
2
+ import { ComponentController } from "../../lib/proto/controller/ComponentController";
3
+ import { PageController } from "../../lib/proto/controller/PageController";
4
4
  /**
5
5
  * 该函数用于处理需要更更新时候,需要从父组件提取数据状态的渲染操作
6
6
  * @param proto
@@ -1,4 +1,4 @@
1
- import { ComponentController } from "../../class/component/componentController";
1
+ import { ComponentController } from "../../lib/proto/controller/ComponentController";
2
2
  import { controllerCycleTypeOne } from "../lifecycle/controllerCycle";
3
3
  import { afterCmd, cmdUtility } from "../utility/cmdUtility";
4
4
  import { mount, unBox } from "../lifecycle/mount";
@@ -1,6 +1,6 @@
1
- import { Component } from "../../class/component/component";
2
- import { ComponentController } from "../../class/component/componentController";
3
- import { PageController } from "../../class/controller/pageController";
1
+ import { Component } from "../../lib/proto/component";
2
+ import { ComponentController } from "../../lib/proto/controller/ComponentController";
3
+ import { PageController } from "../../lib/proto/controller/PageController";
4
4
  /**
5
5
  * 该函数用于渲染不需要记录状态的组件
6
6
  * @param proto
@@ -1,4 +1,4 @@
1
- import { ComponentController } from "../../class/component/componentController";
1
+ import { ComponentController } from "../../lib/proto/controller/ComponentController";
2
2
  import { controllerCycleTypeTwo } from "../lifecycle/controllerCycle";
3
3
  import { afterCmd, cmdUtility } from "../utility/cmdUtility";
4
4
  import { mount, unBox } from "../lifecycle/mount";
@@ -1,4 +1,4 @@
1
- import { ComponentController } from "../../class/component/componentController";
1
+ import { ComponentController } from "../../lib/proto/controller/ComponentController";
2
2
  /**
3
3
  * 更新渲染方法
4
4
  * @param controller
@@ -48,6 +48,9 @@ export function getAllPropsByObject(node, object) {
48
48
  case "string":
49
49
  props.set(objectKey, node.getAttribute(objectKey));
50
50
  break;
51
+ case "json":
52
+ props.set(objectKey, JSON.parse(node.getAttribute(objectKey)));
53
+ break;
51
54
  default:
52
55
  props.set(objectKey, node.getAttribute(objectKey));
53
56
  break;
@@ -1,5 +1,5 @@
1
- import { Component } from "../../class/component/component";
2
- import { ComponentController } from "../../class/component/componentController";
1
+ import { Component } from "../../lib/proto/component";
2
+ import { ComponentController } from "../../lib/proto/controller/ComponentController";
3
3
  /**
4
4
  * This function is used to resolver those commands which should be executed before mount.
5
5
  * @param tagTemplate
@@ -1,5 +1,5 @@
1
- import { ComponentController } from "../../class/component/componentController";
2
- import { PageController } from "../../class/controller/pageController";
1
+ import { ComponentController } from "../../lib/proto/controller/ComponentController";
2
+ import { PageController } from "../../lib/proto/controller/PageController";
3
3
  export declare function getCodeSpaceForProps(data: {}, $props: Map<string, object>): void;
4
4
  export declare function getCodeSpaceForQuery(data: {}, $query: Map<string, any>): void;
5
5
  export declare function getCodeSpaceForRef(data: {}, $ref: Map<string, Element>): void;
@@ -1,4 +1,4 @@
1
- import { ComponentController } from "../../class/component/componentController";
1
+ import { ComponentController } from "../../lib/proto/controller/ComponentController";
2
2
  export declare function textType(target: any, doc: any, controller: ComponentController): void;
3
3
  export declare function assignType(target: any, doc: any, controller: ComponentController): void;
4
4
  export declare function fileType(target: any, doc: any, controller: ComponentController): void;
@@ -1,4 +1,4 @@
1
- import { ComponentController } from "../../class/component/componentController";
1
+ import { ComponentController } from "../../lib/proto/controller/ComponentController";
2
2
  /**
3
3
  *
4
4
  * @param controller
@@ -1,4 +1,4 @@
1
- import { Component } from "../../class/component/component";
1
+ import { Component } from "../../lib/proto/component";
2
2
  /**
3
3
  *
4
4
  * @param tag
@@ -1,4 +1,4 @@
1
- import { Component } from "../../class/component/component";
1
+ import { Component } from "../../lib/proto/component";
2
2
  /**
3
3
  *
4
4
  * @param proto
@@ -8,4 +8,4 @@ export declare function redirect(url: string, parameters: {}): void;
8
8
  * locate the position
9
9
  * @param position
10
10
  */
11
- export declare function locate(position: string): void;
11
+ export declare function relocate(position: string): void;
@@ -31,6 +31,6 @@ export function redirect(url, parameters) {
31
31
  * locate the position
32
32
  * @param position
33
33
  */
34
- export function locate(position) {
34
+ export function relocate(position) {
35
35
  location.hash = position;
36
36
  }
File without changes
File without changes
package/index.d.ts CHANGED
@@ -1,10 +1,11 @@
1
- import { Component } from "./class/component/component";
2
- import { PageController } from "./class/controller/pageController";
3
- import { RenderTip } from "./class/tips/renderTip";
1
+ import { PageController } from "./lib/proto/controller/PageController";
2
+ import { AbstractRenderJS, Component } from "render-refer";
3
+ import { PluginGeneric } from "render-refer/generic/PluginGeneric";
4
+ import { RenderGeneric } from "./lib/generic/RenderGeneric";
4
5
  /**
5
- * This class is the application class.
6
+ * This proto is the application proto.
6
7
  */
7
- export declare class RenderJS implements RenderTip {
8
+ export declare class RenderJS extends AbstractRenderJS implements RenderGeneric {
8
9
  readonly tagLib: Map<string, Component>;
9
10
  readonly styleLib: Map<string, Map<string, string>>;
10
11
  private readonly application;
@@ -12,9 +13,8 @@ export declare class RenderJS implements RenderTip {
12
13
  constructor();
13
14
  /**
14
15
  * This func is the plugin entry to third vendor
15
- * @param callable
16
16
  */
17
- use(callable: (render: RenderJS) => void): void;
17
+ use(plugin: PluginGeneric): void;
18
18
  /**
19
19
  * You can use the method to register your single component or an array of components.
20
20
  * @param component
@@ -22,22 +22,18 @@ export declare class RenderJS implements RenderTip {
22
22
  addTag(component: Component | Component[]): void;
23
23
  /**
24
24
  * mount some base object
25
+ * @return void
25
26
  */
26
27
  private mount;
27
28
  /**
28
29
  * This method is the booster method of the render.
30
+ * @return void
29
31
  */
30
32
  run(): void;
31
- /**
32
- * Use the func to register some tool-functions to the windows object.
33
- * @param name
34
- * @param func
35
- */
36
- registerElements(name: string, func: any): void;
37
33
  }
38
34
  /**
39
- * Use the func to register some tool-functions to the windows object.
35
+ * Inject element to the window environment.
40
36
  * @param name
41
37
  * @param func
42
38
  */
43
- export declare function registerElements(name: string, func: any): void;
39
+ export declare function registerElement(name: string, func: any): void;
package/index.js CHANGED
@@ -1,27 +1,45 @@
1
- import { PageController } from "./class/controller/pageController";
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ import { PageController } from "./lib/proto/controller/PageController";
2
17
  import { registerTagLib, render } from "./runtime/tools";
3
- import { AppController } from "./class/controller/appController";
4
18
  import { changeStyle, changeTheme } from "./core/utility/styleUtility";
19
+ import { AppController } from "./lib/proto/controller/AppController";
20
+ import { AbstractRenderJS } from "render-refer";
5
21
  /**
6
- * This class is the application class.
22
+ * This proto is the application proto.
7
23
  */
8
- var RenderJS = /** @class */ (function () {
24
+ var RenderJS = /** @class */ (function (_super) {
25
+ __extends(RenderJS, _super);
9
26
  function RenderJS() {
27
+ var _this = _super.call(this) || this;
10
28
  //initiate the tagLib object
11
- this.tagLib = new Map();
29
+ _this.tagLib = new Map();
12
30
  //initiate the styleLib object
13
- this.styleLib = new Map();
31
+ _this.styleLib = new Map();
14
32
  //initiate the application controller
15
- this.application = new AppController();
33
+ _this.application = new AppController();
16
34
  //initiate the page controller
17
- this.page = new PageController();
35
+ _this.page = new PageController();
36
+ return _this;
18
37
  }
19
38
  /**
20
39
  * This func is the plugin entry to third vendor
21
- * @param callable
22
40
  */
23
- RenderJS.prototype.use = function (callable) {
24
- callable(this);
41
+ RenderJS.prototype.use = function (plugin) {
42
+ plugin.plugin(this);
25
43
  };
26
44
  /**
27
45
  * You can use the method to register your single component or an array of components.
@@ -32,6 +50,7 @@ var RenderJS = /** @class */ (function () {
32
50
  };
33
51
  /**
34
52
  * mount some base object
53
+ * @return void
35
54
  */
36
55
  RenderJS.prototype.mount = function () {
37
56
  Reflect.set(window, "tagLib", this.tagLib);
@@ -41,6 +60,7 @@ var RenderJS = /** @class */ (function () {
41
60
  };
42
61
  /**
43
62
  * This method is the booster method of the render.
63
+ * @return void
44
64
  */
45
65
  RenderJS.prototype.run = function () {
46
66
  //挂载对象
@@ -49,29 +69,17 @@ var RenderJS = /** @class */ (function () {
49
69
  this.registerElements("changeStyle", changeStyle);
50
70
  //注册函数
51
71
  this.registerElements("changeTheme", changeTheme);
52
- //plugin
53
- this.use(function (render) {
54
- sessionStorage.setItem("theme_style", "default");
55
- });
56
72
  //execute
57
73
  render(this);
58
74
  };
59
- /**
60
- * Use the func to register some tool-functions to the windows object.
61
- * @param name
62
- * @param func
63
- */
64
- RenderJS.prototype.registerElements = function (name, func) {
65
- Reflect.set(window, name, func);
66
- };
67
75
  return RenderJS;
68
- }());
76
+ }(AbstractRenderJS));
69
77
  export { RenderJS };
70
78
  /**
71
- * Use the func to register some tool-functions to the windows object.
79
+ * Inject element to the window environment.
72
80
  * @param name
73
81
  * @param func
74
82
  */
75
- export function registerElements(name, func) {
83
+ export function registerElement(name, func) {
76
84
  Reflect.set(window, name, func);
77
85
  }
@@ -0,0 +1,5 @@
1
+ import { AbstractPlugin } from "render-refer";
2
+ export interface RenderGeneric {
3
+ use(plugin: AbstractPlugin): void;
4
+ run(): void;
5
+ }
@@ -1,6 +1,6 @@
1
1
  /**
2
- * This class is associated with localStorage.
3
- */
2
+ * This proto is associated with localStorage.
3
+ */
4
4
  export declare class AppController {
5
5
  /**
6
6
  * 资源定向
@@ -1,7 +1,7 @@
1
- import { locate, redirect } from "../../http/redirect/redirect";
1
+ import { relocate, redirect } from "../../../http/Http";
2
2
  /**
3
- * This class is associated with localStorage.
4
- */
3
+ * This proto is associated with localStorage.
4
+ */
5
5
  var AppController = /** @class */ (function () {
6
6
  function AppController() {
7
7
  }
@@ -18,7 +18,7 @@ var AppController = /** @class */ (function () {
18
18
  * @param position
19
19
  */
20
20
  AppController.prototype.locate = function (position) {
21
- locate(position);
21
+ relocate(position);
22
22
  };
23
23
  return AppController;
24
24
  }());
@@ -1,4 +1,4 @@
1
- import { Component } from "./component";
1
+ import { Component } from "render-refer";
2
2
  export declare class ComponentController {
3
3
  root: ParentNode;
4
4
  proto: Component;
@@ -1,4 +1,4 @@
1
- import { ComponentController } from "../component/componentController";
1
+ import { ComponentController } from "./ComponentController";
2
2
  export declare class PageController {
3
3
  private methods;
4
4
  private currentTag;
package/package.json CHANGED
@@ -1,16 +1,26 @@
1
- {
2
- "name": "render-core",
3
- "version": "1.3.64",
4
- "description": "The extendable javascript web framework",
5
- "main": "index.js",
6
- "types": "index.d.ts",
7
- "repository": {
8
- "type": "git",
9
- "url": "https://github.com//render-js/render-core.git"
10
- },
11
- "author": {
12
- "name": "mutian",
13
- "email": "mutian-xiangcai@outlook.com"
14
- },
15
- "license": "MIT"
16
- }
1
+ {
2
+ "name": "render-core",
3
+ "version": "1.3.66",
4
+ "description": "The extendable javascript web framework",
5
+ "main": "index.js",
6
+ "types": "index.d.ts",
7
+ "type": "module",
8
+ "scripts": {
9
+ "build": "tsc"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com//render-js/render-core.git"
14
+ },
15
+ "author": {
16
+ "name": "mutian-xiangcai",
17
+ "email": "mutian_xiangcai@outlook.com"
18
+ },
19
+ "license": "MIT",
20
+ "dependencies": {
21
+ "render-refer": "0.0.7"
22
+ },
23
+ "devDependencies": {
24
+ "typescript": "^5.8.3"
25
+ }
26
+ }
@@ -1,4 +1,4 @@
1
- import { PageController } from "../class/controller/pageController";
1
+ import { PageController } from "../lib/proto/controller/PageController";
2
2
  /**
3
3
  *
4
4
  * @param collection
@@ -1,7 +1,7 @@
1
- import { Component } from "../class/component/component";
2
1
  import { RenderJS } from "../index";
2
+ import { Component } from "render-refer";
3
3
  /**
4
- * This function is used to save the prototype component class in the window object.
4
+ * This function is used to save the prototype component proto in the window object.
5
5
  * So, you can hava a tip that we custom a property named 'tagLib' in the window object.
6
6
  * @param application
7
7
  * @param component
package/runtime/tools.js CHANGED
@@ -1,8 +1,8 @@
1
- import { Component } from "../class/component/component";
2
1
  import { themeStyle } from "../core/utility/styleUtility";
3
2
  import { renderHtml } from "./runtime";
3
+ import { Component } from "render-refer";
4
4
  /**
5
- * This function is used to save the prototype component class in the window object.
5
+ * This function is used to save the prototype component proto in the window object.
6
6
  * So, you can hava a tip that we custom a property named 'tagLib' in the window object.
7
7
  * @param application
8
8
  * @param component
@@ -1,41 +0,0 @@
1
- import { RenderBase } from "../tips/componentTip";
2
- /**
3
- * This is the component class.
4
- */
5
- export declare class Component implements RenderBase {
6
- private readonly name;
7
- private readonly template;
8
- private readonly mode;
9
- private readonly boxStyle?;
10
- private readonly props?;
11
- private readonly data?;
12
- private readonly methods?;
13
- private readonly computed?;
14
- private readonly watcher?;
15
- private readonly beforeRender?;
16
- private readonly afterRender?;
17
- constructor(config: {
18
- name: string;
19
- template: string;
20
- mode?: string;
21
- boxStyle?: string;
22
- props?: {} | string[];
23
- data?: {};
24
- computed?: {};
25
- methods?: {};
26
- watcher?: {};
27
- beforeRender?: () => void;
28
- afterRender?: () => void;
29
- });
30
- getName(): string;
31
- getTemplate(): string;
32
- getMode(): string;
33
- getBoxStyle(): string;
34
- getProps(): {};
35
- getData(): {};
36
- getMethods(): {};
37
- getComputed(): {};
38
- getWatcher(): {};
39
- getBeforeRender(): () => void;
40
- getAfterRender(): () => void;
41
- }
@@ -1,111 +0,0 @@
1
- /**
2
- * This is the component class.
3
- */
4
- var Component = /** @class */ (function () {
5
- function Component(config) {
6
- //标签名称
7
- this.name = config.name;
8
- //标签模板样式
9
- this.template = config.template;
10
- //添加box样式
11
- if (typeof config.mode === "undefined") {
12
- this.mode = "box";
13
- }
14
- else {
15
- this.mode = config.mode;
16
- }
17
- //添加box样式
18
- if (typeof config.boxStyle === "undefined") {
19
- this.boxStyle = "";
20
- }
21
- else {
22
- this.boxStyle = config.boxStyle.replace(/^{/, "");
23
- this.boxStyle = this.boxStyle.replace(/}$/, "");
24
- this.boxStyle = this.boxStyle.replace(/\n/, "");
25
- this.boxStyle = this.boxStyle.trim();
26
- }
27
- //props validate
28
- if (typeof config.props === "undefined") {
29
- this.props = [];
30
- }
31
- else {
32
- this.props = config.props;
33
- }
34
- //添加数据
35
- if (typeof config.data === "undefined") {
36
- this.data = {};
37
- }
38
- else {
39
- this.data = config.data;
40
- }
41
- //添加计算属性
42
- if (typeof config.computed === "undefined") {
43
- this.computed = {};
44
- }
45
- else {
46
- this.computed = config.computed;
47
- }
48
- //添加方法属性
49
- if (typeof config.methods === "undefined") {
50
- this.methods = {};
51
- }
52
- else {
53
- this.methods = config.methods;
54
- }
55
- //添加监控属性
56
- if (typeof config.watcher === "undefined") {
57
- this.watcher = {};
58
- }
59
- else {
60
- this.watcher = config.watcher;
61
- }
62
- //生命周期函数
63
- if (typeof config.beforeRender === "undefined") {
64
- this.beforeRender = function () { };
65
- }
66
- else {
67
- this.beforeRender = config.beforeRender;
68
- }
69
- if (typeof config.afterRender === "undefined") {
70
- this.afterRender = function () { };
71
- }
72
- else {
73
- this.afterRender = config.afterRender;
74
- }
75
- }
76
- Component.prototype.getName = function () {
77
- return this.name;
78
- };
79
- Component.prototype.getTemplate = function () {
80
- return this.template;
81
- };
82
- Component.prototype.getMode = function () {
83
- return this.mode;
84
- };
85
- Component.prototype.getBoxStyle = function () {
86
- return this.boxStyle;
87
- };
88
- Component.prototype.getProps = function () {
89
- return this.props;
90
- };
91
- Component.prototype.getData = function () {
92
- return this.data;
93
- };
94
- Component.prototype.getMethods = function () {
95
- return this.methods;
96
- };
97
- Component.prototype.getComputed = function () {
98
- return this.computed;
99
- };
100
- Component.prototype.getWatcher = function () {
101
- return this.watcher;
102
- };
103
- Component.prototype.getBeforeRender = function () {
104
- return this.beforeRender;
105
- };
106
- Component.prototype.getAfterRender = function () {
107
- return this.afterRender;
108
- };
109
- return Component;
110
- }());
111
- export { Component };
@@ -1,13 +0,0 @@
1
- export interface RenderBase {
2
- getName(): string;
3
- getTemplate(): string;
4
- getMode(): string;
5
- getBoxStyle(): string;
6
- getProps(): {};
7
- getData(): {};
8
- getComputed(): {};
9
- getMethods(): {};
10
- getWatcher(): {};
11
- getBeforeRender(): () => void;
12
- getAfterRender(): () => void;
13
- }
@@ -1,4 +0,0 @@
1
- import { RenderJS } from "../../index";
2
- export interface RenderTip {
3
- use(callable: (render: RenderJS) => void): void;
4
- }
@@ -1 +0,0 @@
1
- export {};