dom-render 1.0.97 → 1.0.98

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 (46) hide show
  1. package/DomRender.d.ts +1 -1
  2. package/DomRender.js +3 -3
  3. package/DomRenderProxy.js +19 -14
  4. package/README.MD +39 -39
  5. package/components/ComponentSet.d.ts +1 -1
  6. package/configs/Config.d.ts +1 -1
  7. package/configs/TargetAttr.d.ts +1 -1
  8. package/configs/TargetElement.d.ts +1 -1
  9. package/css/stringify/compiler.d.ts +1 -1
  10. package/dist/bundle.js +408 -459
  11. package/events/EventManager.js +27 -27
  12. package/messenger/Messenger.d.ts +4 -4
  13. package/operators/Dr.js +2 -2
  14. package/operators/DrAppender.js +3 -5
  15. package/operators/DrFor.js +3 -5
  16. package/operators/DrForOf.js +3 -5
  17. package/operators/DrForm.js +12 -12
  18. package/operators/DrIf.js +3 -5
  19. package/operators/DrInnerHTML.js +2 -2
  20. package/operators/DrInnerText.js +2 -2
  21. package/operators/DrPre.js +2 -4
  22. package/operators/DrRepeat.js +3 -5
  23. package/operators/DrTargetAttr.js +2 -4
  24. package/operators/DrTargetElement.js +3 -5
  25. package/operators/DrThis.js +2 -2
  26. package/operators/DrThisProperty.js +4 -6
  27. package/operators/OperatorExecuter.d.ts +6 -6
  28. package/operators/OperatorExecuter.js +2 -2
  29. package/operators/OperatorExecuterAttrRequire.js +1 -1
  30. package/package.json +1 -1
  31. package/rawsets/AttrInitCallBack.d.ts +1 -1
  32. package/rawsets/Attrs.d.ts +1 -1
  33. package/rawsets/CreatorMetaData.d.ts +1 -1
  34. package/rawsets/ElementInitCallBack.d.ts +1 -1
  35. package/rawsets/RawSet.js +59 -58
  36. package/rawsets/Render.d.ts +1 -1
  37. package/routers/Router.d.ts +1 -1
  38. package/routers/Router.js +1 -1
  39. package/utils/dom/DomUtils.d.ts +1 -1
  40. package/utils/node/NodeUtils.d.ts +1 -1
  41. package/utils/script/ScriptUtils.js +2 -2
  42. package/validators/EmptyValidator.js +2 -2
  43. package/validators/NotEmptyValidator.js +2 -2
  44. package/validators/ValidMultipleValidator.d.ts +1 -1
  45. package/validators/Validator.d.ts +2 -2
  46. package/validators/ValidatorArray.d.ts +1 -1
@@ -29,7 +29,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
29
29
  function verb(n) { return function (v) { return step([n, v]); }; }
30
30
  function step(op) {
31
31
  if (f) throw new TypeError("Generator is already executing.");
32
- while (_) try {
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
33
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
34
  if (y = 0, t) op = [op[0] & 2, t.value];
35
35
  switch (op[0]) {
@@ -57,10 +57,8 @@ var OperatorExecuter_1 = require("./OperatorExecuter");
57
57
  var DrTargetAttr = /** @class */ (function (_super) {
58
58
  __extends(DrTargetAttr, _super);
59
59
  function DrTargetAttr(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
60
- var _this = this;
61
60
  source.operatorAround = undefined;
62
- _this = _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
63
- return _this;
61
+ return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
64
62
  }
65
63
  DrTargetAttr.prototype.execute = function () {
66
64
  var _a, _b, _c, _d;
@@ -29,7 +29,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
29
29
  function verb(n) { return function (v) { return step([n, v]); }; }
30
30
  function step(op) {
31
31
  if (f) throw new TypeError("Generator is already executing.");
32
- while (_) try {
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
33
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
34
  if (y = 0, t) op = [op[0] & 2, t.value];
35
35
  switch (op[0]) {
@@ -58,10 +58,8 @@ var OperatorExecuter_1 = require("./OperatorExecuter");
58
58
  var DrTargetElement = /** @class */ (function (_super) {
59
59
  __extends(DrTargetElement, _super);
60
60
  function DrTargetElement(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
61
- var _this = this;
62
61
  source.operatorAround = undefined;
63
- _this = _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
64
- return _this;
62
+ return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
65
63
  }
66
64
  DrTargetElement.prototype.execute = function () {
67
65
  var _a, _b, _c, _d;
@@ -85,7 +83,7 @@ var DrTargetElement = /** @class */ (function (_super) {
85
83
  if (detectAction_1 && render_1) {
86
84
  this.rawSet.detect = {
87
85
  action: function () {
88
- var script = "var $component = this.__render.component; var $element = this.__render.element; var $innerHTML = this.__render.innerHTML; var $attribute = this.__render.attribute; " + detectAction_1 + " ";
86
+ var script = "var $component = this.__render.component; var $element = this.__render.element; var $innerHTML = this.__render.innerHTML; var $attribute = this.__render.attribute; ".concat(detectAction_1, " ");
89
87
  ScriptUtils_1.ScriptUtils.eval(script, Object.assign(_this.source.obj, {
90
88
  __render: render_1
91
89
  }));
@@ -29,7 +29,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
29
29
  function verb(n) { return function (v) { return step([n, v]); }; }
30
30
  function step(op) {
31
31
  if (f) throw new TypeError("Generator is already executing.");
32
- while (_) try {
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
33
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
34
  if (y = 0, t) op = [op[0] & 2, t.value];
35
35
  switch (op[0]) {
@@ -76,7 +76,7 @@ var DrThis = /** @class */ (function (_super) {
76
76
  RawSet_1.RawSet.destroy(this.rawSet.data.obj, [], this.source.config, destroyOptions);
77
77
  }
78
78
  this.rawSet.data = attr;
79
- return [4 /*yield*/, RawSet_1.RawSet.drThisCreate(this.rawSet, this.elementSource.element, "" + this.elementSource.attrs.drThis + (attr.config.objPath ? ('.' + attr.config.objPath) : ''), (_c = this.elementSource.attrs.drVarOption) !== null && _c !== void 0 ? _c : '', this.elementSource.attrs.drStripOption, this.source.obj, this.source.config, attr)];
79
+ return [4 /*yield*/, RawSet_1.RawSet.drThisCreate(this.rawSet, this.elementSource.element, "".concat(this.elementSource.attrs.drThis).concat(attr.config.objPath ? ('.' + attr.config.objPath) : ''), (_c = this.elementSource.attrs.drVarOption) !== null && _c !== void 0 ? _c : '', this.elementSource.attrs.drStripOption, this.source.obj, this.source.config, attr)];
80
80
  case 1:
81
81
  componentBody = _j.sent();
82
82
  this.returnContainer.fag.append(componentBody);
@@ -40,7 +40,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
40
40
  function verb(n) { return function (v) { return step([n, v]); }; }
41
41
  function step(op) {
42
42
  if (f) throw new TypeError("Generator is already executing.");
43
- while (_) try {
43
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
44
44
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
45
45
  if (y = 0, t) op = [op[0] & 2, t.value];
46
46
  switch (op[0]) {
@@ -70,10 +70,8 @@ var OperatorExecuter_1 = require("./OperatorExecuter");
70
70
  var DrThisProperty = /** @class */ (function (_super) {
71
71
  __extends(DrThisProperty, _super);
72
72
  function DrThisProperty(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
73
- var _this = this;
74
73
  source.operatorAround = undefined;
75
- _this = _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
76
- return _this;
74
+ return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
77
75
  }
78
76
  DrThisProperty.prototype.executeAttrRequire = function (attr) {
79
77
  var _a, _b, _c, _d, _e;
@@ -92,7 +90,7 @@ var DrThisProperty = /** @class */ (function (_super) {
92
90
  // }
93
91
  // await new Promise(resolve => setTimeout(resolve, 1000));
94
92
  // console.log('!!!!!!!!!!!!!!', this.rawSet);
95
- ScriptUtils_1.ScriptUtils.eval("\n " + this.render.bindScript + "\n " + ((_c = this.elementSource.attrs.drBeforeOption) !== null && _c !== void 0 ? _c : '') + "\n var i = 0; \n const dictionary = " + attr + ";\n const dictionaryKey = '" + dictionaryKey + "';\n const dictionaryStr = `" + attr + "`.trim();\n // console.log('----@#!@#@!#', this.__render.oldChild);\n if (dictionary) {\n for(const it in dictionary) {\n var destIt = dictionaryStr + '[\"' + it + '\"]';\n const n = this.__render.element.cloneNode(true);\n n.setAttribute('dr-this', destIt);\n n.setAttribute('dr-key', it);\n // n.setAttribute('dr-dictionary-key', it);\n this.__render.fag.append(n);\n i++;\n }\n this.__render.rawset.point.start.setAttribute('dr-has-keys',Object.keys(dictionary).join(','));\n }\n " + ((_d = this.elementSource.attrs.drAfterOption) !== null && _d !== void 0 ? _d : '') + "\n ", Object.assign(this.source.obj, {
93
+ ScriptUtils_1.ScriptUtils.eval("\n ".concat(this.render.bindScript, "\n ").concat((_c = this.elementSource.attrs.drBeforeOption) !== null && _c !== void 0 ? _c : '', "\n var i = 0; \n const dictionary = ").concat(attr, ";\n const dictionaryKey = '").concat(dictionaryKey, "';\n const dictionaryStr = `").concat(attr, "`.trim();\n // console.log('----@#!@#@!#', this.__render.oldChild);\n if (dictionary) {\n for(const it in dictionary) {\n var destIt = dictionaryStr + '[\"' + it + '\"]';\n const n = this.__render.element.cloneNode(true);\n n.setAttribute('dr-this', destIt);\n n.setAttribute('dr-key', it);\n // n.setAttribute('dr-dictionary-key', it);\n this.__render.fag.append(n);\n i++;\n }\n this.__render.rawset.point.start.setAttribute('dr-has-keys',Object.keys(dictionary).join(','));\n }\n ").concat((_d = this.elementSource.attrs.drAfterOption) !== null && _d !== void 0 ? _d : '', "\n "), Object.assign(this.source.obj, {
96
94
  __render: Object.freeze(__assign({ drStripOption: this.elementSource.attrs.drStripOption, drAttr: this.elementSource.attrs, drAttrsOriginName: RawSet_1.RawSet.drAttrsOriginName, fag: newTemp }, this.render))
97
95
  }));
98
96
  RawSet_1.RawSet.drVarDecoding(newTemp, vars);
@@ -118,7 +116,7 @@ var DrThisProperty = /** @class */ (function (_super) {
118
116
  var cNode = _c[_i];
119
117
  var element = cNode.cloneNode(true);
120
118
  element.removeAttribute(RawSet_1.RawSet.DR_THIS_PROPERTY_NAME);
121
- element.setAttribute(RawSet_1.RawSet.DR_THIS_NAME, "this." + fullPath);
119
+ element.setAttribute(RawSet_1.RawSet.DR_THIS_NAME, "this.".concat(fullPath));
122
120
  element.setAttribute(RawSet_1.RawSet.DR_KEY_OPTIONNAME, key);
123
121
  // rawSet.point.end.after(element);
124
122
  var fg = config.window.document.createDocumentFragment();
@@ -5,32 +5,32 @@ import { RawSet } from '../rawsets/RawSet';
5
5
  import { Render } from '../rawsets/Render';
6
6
  import { Attrs } from '../rawsets/Attrs';
7
7
  import { Config } from '../configs/Config';
8
- export declare type OperatorAround = {
8
+ export interface OperatorAround {
9
9
  beforeAttr?: (value: string | null | undefined, opratorExecutor: OperatorExecuter) => string | null | undefined;
10
10
  before?: (data: any, opratorExecutor: OperatorExecuter) => any;
11
11
  after?: (data: any, opratorExecutor: OperatorExecuter) => void;
12
- };
12
+ }
13
13
  export declare enum ExecuteState {
14
14
  EXECUTE = 0,
15
15
  NO_EXECUTE = 1,
16
16
  STOP = 2
17
17
  }
18
- export declare type AfterCallBack = {
18
+ export type AfterCallBack = {
19
19
  onAttrInitCallBacks: AttrInitCallBack[];
20
20
  onElementInitCallBacks: ElementInitCallBack[];
21
21
  onThisComponentSetCallBacks: ComponentSet[];
22
22
  };
23
- export declare type ReturnContainer = {
23
+ export type ReturnContainer = {
24
24
  raws: RawSet[];
25
25
  fag: DocumentFragment;
26
26
  };
27
- export declare type ElementSource = {
27
+ export type ElementSource = {
28
28
  element: Element;
29
29
  attrs: Attrs;
30
30
  attr?: string | null;
31
31
  attrName?: string | undefined;
32
32
  };
33
- export declare type Source = {
33
+ export type Source = {
34
34
  config: Config;
35
35
  operatorAround?: OperatorAround;
36
36
  obj: any;
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -69,7 +69,7 @@ var OperatorExecuter = /** @class */ (function () {
69
69
  }
70
70
  r = attrValue;
71
71
  if (r && this.startingExecute) {
72
- r = ScriptUtils_1.ScriptUtils.eval(" " + this.render.bindScript + "; return " + attrValue, Object.assign(this.source.obj, { __render: this.render }));
72
+ r = ScriptUtils_1.ScriptUtils.eval(" ".concat(this.render.bindScript, "; return ").concat(attrValue), Object.assign(this.source.obj, { __render: this.render }));
73
73
  }
74
74
  if ((_c = this.source.operatorAround) === null || _c === void 0 ? void 0 : _c.before) {
75
75
  r = (_d = this.source.operatorAround) === null || _d === void 0 ? void 0 : _d.before(r, this);
@@ -29,7 +29,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
29
29
  function verb(n) { return function (v) { return step([n, v]); }; }
30
30
  function step(op) {
31
31
  if (f) throw new TypeError("Generator is already executing.");
32
- while (_) try {
32
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
33
33
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
34
  if (y = 0, t) op = [op[0] & 2, t.value];
35
35
  switch (op[0]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dom-render",
3
- "version": "1.0.97",
3
+ "version": "1.0.98",
4
4
  "main": "DomRender.js",
5
5
  "license": "MIT",
6
6
  "description": "html view template engine",
@@ -1,4 +1,4 @@
1
- export declare type AttrInitCallBack = {
1
+ export type AttrInitCallBack = {
2
2
  attrName: string;
3
3
  attrValue: string;
4
4
  obj: any;
@@ -1,4 +1,4 @@
1
- export declare type Attrs = {
1
+ export type Attrs = {
2
2
  dr: string | null;
3
3
  drIf: string | null;
4
4
  drAppender: string | null;
@@ -1,7 +1,7 @@
1
1
  import { Router } from '../routers/Router';
2
2
  import { Attrs } from './Attrs';
3
3
  import { RawSet } from './RawSet';
4
- export declare type CreatorMetaData = {
4
+ export type CreatorMetaData = {
5
5
  thisVariableName?: string | null;
6
6
  thisFullVariableName?: string | null;
7
7
  componentKey?: string | null;
@@ -1,6 +1,6 @@
1
1
  import { TargetElement } from '../configs/TargetElement';
2
2
  import { CreatorMetaData } from './CreatorMetaData';
3
- export declare type ElementInitCallBack = {
3
+ export type ElementInitCallBack = {
4
4
  name: string;
5
5
  obj: any;
6
6
  targetElement: TargetElement;
package/rawsets/RawSet.js CHANGED
@@ -25,7 +25,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
28
- while (_) try {
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
29
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
30
  if (y = 0, t) op = [op[0] & 2, t.value];
31
31
  switch (op[0]) {
@@ -112,7 +112,7 @@ var RawSet = /** @class */ (function () {
112
112
  var _a, _b, _c;
113
113
  var script = '';
114
114
  if (cNode.nodeType === Node.TEXT_NODE) {
115
- script = "`" + ((_a = cNode.textContent) !== null && _a !== void 0 ? _a : '') + "`";
115
+ script = "`".concat((_a = cNode.textContent) !== null && _a !== void 0 ? _a : '', "`");
116
116
  // console.log('???????', script)
117
117
  }
118
118
  else if (cNode.nodeType === Node.ELEMENT_NODE) {
@@ -141,11 +141,11 @@ var RawSet = /** @class */ (function () {
141
141
  EventManager_1.EventManager.VARNAMES.forEach(function (it) {
142
142
  // script = script.replace(RegExp(it.replace('$', '\\$'), 'g'), `this?.___${it}`);
143
143
  // script = script.replace(RegExp(it.replace('$', '\\$'), 'g'), `this.___${it}`);
144
- script = script.replace(RegExp(it.replace('$', '\\$'), 'g'), "this.___" + it);
144
+ script = script.replace(RegExp(it.replace('$', '\\$'), 'g'), "this.___".concat(it));
145
145
  // console.log('scripts-->', script)
146
146
  });
147
147
  // console.log('----------', script);
148
- Array.from(ScriptUtils_1.ScriptUtils.getVariablePaths(script)).filter(function (it) { return !it.startsWith("___" + EventManager_1.EventManager.SCRIPTS_VARNAME); }).forEach(function (it) { return usingTriggerVariables.add(it); });
148
+ Array.from(ScriptUtils_1.ScriptUtils.getVariablePaths(script)).filter(function (it) { return !it.startsWith("___".concat(EventManager_1.EventManager.SCRIPTS_VARNAME)); }).forEach(function (it) { return usingTriggerVariables.add(it); });
149
149
  }
150
150
  });
151
151
  // console.log('usingTriggerVariable----------->', usingTriggerVariables)
@@ -182,7 +182,7 @@ var RawSet = /** @class */ (function () {
182
182
  range: Range_1.Range.range,
183
183
  element: cNode,
184
184
  attribute: attribute,
185
- bindScript: "\n const " + EventManager_1.EventManager.SCRIPTS_VARNAME + " = this.__render.scripts;\n const " + EventManager_1.EventManager.RAWSET_VARNAME + " = this.__render.rawset;\n const " + EventManager_1.EventManager.ELEMENT_VARNAME + " = this.__render.element;\n const " + EventManager_1.EventManager.ATTRIBUTE_VARNAME + " = this.__render.attribute;\n const " + EventManager_1.EventManager.RANGE_VARNAME + " = this.__render.range;\n const " + EventManager_1.EventManager.ROUTER_VARNAME + " = this.__render.router;\n "
185
+ bindScript: "\n const ".concat(EventManager_1.EventManager.SCRIPTS_VARNAME, " = this.__render.scripts;\n const ").concat(EventManager_1.EventManager.RAWSET_VARNAME, " = this.__render.rawset;\n const ").concat(EventManager_1.EventManager.ELEMENT_VARNAME, " = this.__render.element;\n const ").concat(EventManager_1.EventManager.ATTRIBUTE_VARNAME, " = this.__render.attribute;\n const ").concat(EventManager_1.EventManager.RANGE_VARNAME, " = this.__render.range;\n const ").concat(EventManager_1.EventManager.ROUTER_VARNAME, " = this.__render.router;\n ")
186
186
  // eslint-disable-next-line no-use-before-define
187
187
  });
188
188
  fag = config.window.document.createDocumentFragment();
@@ -191,13 +191,13 @@ var RawSet = /** @class */ (function () {
191
191
  runText = RawSet.exporesionGrouops(textContent)[0][1];
192
192
  newNode = void 0;
193
193
  if (textContent === null || textContent === void 0 ? void 0 : textContent.startsWith('#')) {
194
- r = ScriptUtils_1.ScriptUtils.eval(__render.bindScript + " return " + runText, Object.assign(obj, { __render: __render }));
194
+ r = ScriptUtils_1.ScriptUtils.eval("".concat(__render.bindScript, " return ").concat(runText), Object.assign(obj, { __render: __render }));
195
195
  template = config.window.document.createElement('template');
196
196
  template.innerHTML = r;
197
197
  newNode = template.content;
198
198
  }
199
199
  else {
200
- r = ScriptUtils_1.ScriptUtils.eval(__render.bindScript + " return " + runText, Object.assign(obj, { __render: __render }));
200
+ r = ScriptUtils_1.ScriptUtils.eval("".concat(__render.bindScript, " return ").concat(runText), Object.assign(obj, { __render: __render }));
201
201
  newNode = config.window.document.createTextNode(r);
202
202
  }
203
203
  (_a = cNode.parentNode) === null || _a === void 0 ? void 0 : _a.replaceChild(newNode, cNode);
@@ -282,7 +282,7 @@ var RawSet = /** @class */ (function () {
282
282
  fag: genNode,
283
283
  scripts: EventManager_1.EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj)
284
284
  });
285
- ScriptUtils_1.ScriptUtils.eval("\n const " + EventManager_1.EventManager.FAG_VARNAME + " = this.__render.fag;\n const " + EventManager_1.EventManager.SCRIPTS_VARNAME + " = this.__render.scripts;\n const " + EventManager_1.EventManager.RAWSET_VARNAME + " = this.__render.rawset;\n " + it.drCompleteOption, Object.assign(obj, { __render: render }));
285
+ ScriptUtils_1.ScriptUtils.eval("\n const ".concat(EventManager_1.EventManager.FAG_VARNAME, " = this.__render.fag;\n const ").concat(EventManager_1.EventManager.SCRIPTS_VARNAME, " = this.__render.scripts;\n const ").concat(EventManager_1.EventManager.RAWSET_VARNAME, " = this.__render.rawset;\n ").concat(it.drCompleteOption), Object.assign(obj, { __render: render }));
286
286
  }
287
287
  });
288
288
  // 중요 style isolation 나중에 :scope로 대체 가능할듯.
@@ -298,7 +298,7 @@ var RawSet = /** @class */ (function () {
298
298
  oninit = it_2.targetElement.__render.element.getAttribute(RawSet.DR_ON_INIT_ARGUMENTS_OPTIONNAME);
299
299
  param = [];
300
300
  if (oninit) {
301
- script = it_2.targetElement.__render.renderScript + " return " + oninit + " ";
301
+ script = "".concat(it_2.targetElement.__render.renderScript, " return ").concat(oninit, " ");
302
302
  param = ScriptUtils_1.ScriptUtils.eval(script, Object.assign(obj, {
303
303
  __render: it_2.targetElement.__render
304
304
  }));
@@ -360,8 +360,8 @@ var RawSet = /** @class */ (function () {
360
360
  };
361
361
  RawSet.generateCSS = function (id, cssRule) {
362
362
  var _this = this;
363
- var start = "#" + id + "-start";
364
- var end = "#" + id + "-end";
363
+ var start = "#".concat(id, "-start");
364
+ var end = "#".concat(id, "-end");
365
365
  if (cssRule.constructor.name === 'CSSStyleRule') {
366
366
  var rule = cssRule;
367
367
  // rule.selectorText = `${start} ~ *:not(${start} ~ ${end} ~ *) ${rule.selectorText}`;
@@ -370,14 +370,14 @@ var RawSet = /** @class */ (function () {
370
370
  if (!rule.selectorText.startsWith(':root')) {
371
371
  // rule.selectorText = `${start} ~ ${rule.selectorText}:not(${start} ~ ${end} ~ *)`;
372
372
  // rule.selectorText = `${start} ~ ${rule.selectorText}:not(${start} ~ ${end} ~ *)`;
373
- var selectorText = ":is(" + start + " ~ *:not(" + start + " ~ " + end + " ~ *))";
373
+ var selectorText = ":is(".concat(start, " ~ *:not(").concat(start, " ~ ").concat(end, " ~ *))");
374
374
  if (rule.selectorText.startsWith('.')) {
375
- rule.selectorText = "" + selectorText + rule.selectorText + ", " + selectorText + " " + rule.selectorText;
375
+ rule.selectorText = "".concat(selectorText).concat(rule.selectorText, ", ").concat(selectorText, " ").concat(rule.selectorText);
376
376
  // rule.selectorText = `${start} ~ *:not(${start} ~ ${end} ~ *)${rule.selectorText}`;
377
377
  }
378
378
  else {
379
- var divText = start + " ~ " + rule.selectorText + ":not(" + start + " ~ " + end + " ~ *)";
380
- rule.selectorText = selectorText + " " + rule.selectorText + ", " + divText;
379
+ var divText = "".concat(start, " ~ ").concat(rule.selectorText, ":not(").concat(start, " ~ ").concat(end, " ~ *)");
380
+ rule.selectorText = "".concat(selectorText, " ").concat(rule.selectorText, ", ").concat(divText);
381
381
  // rule.selectorText = `${selectorText} ${rule.selectorText}`;
382
382
  // rule.selectorText = `${rule.selectorText} ~ ${start} ~ *:not(${start} ~ ${end} ~ *)`;
383
383
  }
@@ -398,10 +398,10 @@ var RawSet = /** @class */ (function () {
398
398
  if (Array.isArray(styleBody)) {
399
399
  styleBody = styleBody.join('\n');
400
400
  }
401
- var start = "#" + componentKey + "-start";
402
- var end = "#" + componentKey + "-end";
401
+ var start = "#".concat(componentKey, "-start");
402
+ var end = "#".concat(componentKey, "-end");
403
403
  var before = StringUtils_1.StringUtils.regexExecArrayReplace(styleBody, /(\$\{.*?\}\$)/g, function (data) {
404
- return "var(--domrender-" + data[0] + ")";
404
+ return "var(--domrender-".concat(data[0], ")");
405
405
  });
406
406
  var cssobject = (0, parse_1.default)(before);
407
407
  (_a = cssobject.stylesheet) === null || _a === void 0 ? void 0 : _a.rules.forEach(function (rule) {
@@ -409,13 +409,13 @@ var RawSet = /** @class */ (function () {
409
409
  var isRoot = (_a = rule.selectors) === null || _a === void 0 ? void 0 : _a.find(function (it) { return it.startsWith(':root'); });
410
410
  if (rule.type === 'rule' && !isRoot) { // && !!isRoot
411
411
  rule.selectors = (_b = rule.selectors) === null || _b === void 0 ? void 0 : _b.map(function (sit) {
412
- var selectorText = ":is(" + start + " ~ *:not(" + start + " ~ " + end + " ~ *))";
412
+ var selectorText = ":is(".concat(start, " ~ *:not(").concat(start, " ~ ").concat(end, " ~ *))");
413
413
  if (sit.startsWith('.')) {
414
- return "" + selectorText + sit + ", " + selectorText + " " + sit;
414
+ return "".concat(selectorText).concat(sit, ", ").concat(selectorText, " ").concat(sit);
415
415
  }
416
416
  else {
417
- var divText = start + " ~ " + sit + ":not(" + start + " ~ " + end + " ~ *)";
418
- return selectorText + " " + sit + ", " + divText;
417
+ var divText = "".concat(start, " ~ ").concat(sit, ":not(").concat(start, " ~ ").concat(end, " ~ *)");
418
+ return "".concat(selectorText, " ").concat(sit, ", ").concat(divText);
419
419
  }
420
420
  });
421
421
  }
@@ -425,7 +425,7 @@ var RawSet = /** @class */ (function () {
425
425
  return data[2];
426
426
  });
427
427
  if (styleTagWrap) {
428
- styleBody = "<style id='" + componentKey + "-style' domstyle>" + after + "</style>";
428
+ styleBody = "<style id='".concat(componentKey, "-style' domstyle>").concat(after, "</style>");
429
429
  }
430
430
  return styleBody;
431
431
  };
@@ -446,13 +446,13 @@ var RawSet = /** @class */ (function () {
446
446
  var data = element.getAttribute(RawSet.DR_APPENDER_NAME);
447
447
  // if (data && !/\[[0-9]+\]/g.test(data)) {
448
448
  if (data && !/\[.+\]/g.test(data)) {
449
- var currentIndex = ScriptUtils_1.ScriptUtils.evalReturn(data + "?.length -1", obj);
449
+ var currentIndex = ScriptUtils_1.ScriptUtils.evalReturn("".concat(data, "?.length -1"), obj);
450
450
  // console.log('------?', currentIndex)
451
451
  // if (currentIndex === undefined || isNaN(currentIndex)) {
452
452
  // return undefined;
453
453
  // }
454
454
  // const currentIndex = ScriptUtils.evalReturn(`${data}.length`, obj);
455
- data = data + "[" + currentIndex + "]";
455
+ data = "".concat(data, "[").concat(currentIndex, "]");
456
456
  element.setAttribute(RawSet.DR_APPENDER_NAME, data);
457
457
  // element.setAttribute(RawSet.DR_IF_NAME, data);
458
458
  // element.setAttribute('dr-id', data);
@@ -596,7 +596,7 @@ var RawSet = /** @class */ (function () {
596
596
  var element = node;
597
597
  var start = config.window.document.createElement('meta');
598
598
  var end = config.window.document.createElement('meta');
599
- start.setAttribute('id', id + "-start");
599
+ start.setAttribute('id', "".concat(id, "-start"));
600
600
  var keys = element.getAttribute(RawSet.DR_KEY_OPTIONNAME);
601
601
  var thisPropertyType = element.getAttribute(RawSet.DR_THIS_PROPERTY_NAME);
602
602
  if (thisPropertyType) {
@@ -606,19 +606,19 @@ var RawSet = /** @class */ (function () {
606
606
  element.removeAttribute(RawSet.DR_KEY_OPTIONNAME);
607
607
  start.setAttribute(RawSet.DR_KEY_OPTIONNAME, keys);
608
608
  }
609
- end.setAttribute('id', id + "-end");
609
+ end.setAttribute('id', "".concat(id, "-end"));
610
610
  return { start: start, end: end };
611
611
  }
612
612
  else if (type === RawSetType_1.RawSetType.STYLE_TEXT) {
613
613
  return {
614
- start: config.window.document.createTextNode("/*start text " + id + "*/"),
615
- end: config.window.document.createTextNode("/*end text " + id + "*/")
614
+ start: config.window.document.createTextNode("/*start text ".concat(id, "*/")),
615
+ end: config.window.document.createTextNode("/*end text ".concat(id, "*/"))
616
616
  };
617
617
  }
618
618
  else { // text
619
619
  return {
620
- start: config.window.document.createComment("start text " + id),
621
- end: config.window.document.createComment("end text " + id)
620
+ start: config.window.document.createComment("start text ".concat(id)),
621
+ end: config.window.document.createComment("end text ".concat(id))
622
622
  };
623
623
  }
624
624
  };
@@ -665,13 +665,13 @@ var RawSet = /** @class */ (function () {
665
665
  RawSet.drItOtherEncoding = function (element) {
666
666
  var random = RandomUtils_1.RandomUtils.uuid();
667
667
  var regex = /#it#/g;
668
- element.querySelectorAll("[" + RawSet.DR_IT_OPTIONNAME + "], [" + RawSet.DR_FOR_OF_NAME + "], [" + RawSet.DR_REPEAT_NAME + "]").forEach(function (it) {
668
+ element.querySelectorAll("[".concat(RawSet.DR_IT_OPTIONNAME, "], [").concat(RawSet.DR_FOR_OF_NAME, "], [").concat(RawSet.DR_REPEAT_NAME, "]")).forEach(function (it) {
669
669
  it.innerHTML = it.innerHTML.replace(regex, random);
670
670
  });
671
671
  return random;
672
672
  };
673
673
  RawSet.drItOtherDecoding = function (element, random) {
674
- element.querySelectorAll("[" + RawSet.DR_IT_OPTIONNAME + "], [" + RawSet.DR_FOR_OF_NAME + "], [" + RawSet.DR_REPEAT_NAME + "]").forEach(function (it) {
674
+ element.querySelectorAll("[".concat(RawSet.DR_IT_OPTIONNAME, "], [").concat(RawSet.DR_FOR_OF_NAME, "], [").concat(RawSet.DR_REPEAT_NAME, "]")).forEach(function (it) {
675
675
  it.innerHTML = it.innerHTML.replace(RegExp(random, 'g'), '#it#');
676
676
  });
677
677
  };
@@ -684,35 +684,36 @@ var RawSet = /** @class */ (function () {
684
684
  // element.querySelectorAll(`[${RawSet.DR_PRE_NAME}]`).forEach(it => {
685
685
  // let message = it.innerHTML;
686
686
  // })
687
- element.querySelectorAll("[" + RawSet.DR_PRE_NAME + "]").forEach(function (it) {
688
- it.innerHTML = it.innerHTML.replace(/this/g, thisRandom);
687
+ element.querySelectorAll("[".concat(RawSet.DR_PRE_NAME, "]")).forEach(function (it) {
688
+ it.innerHTML = it.innerHTML.replace(/@this@/g, thisRandom);
689
689
  });
690
- element.querySelectorAll("[" + RawSet.DR_THIS_NAME + "]").forEach(function (it) {
690
+ element.querySelectorAll("[".concat(RawSet.DR_THIS_NAME, "]")).forEach(function (it) {
691
691
  var message = it.innerHTML;
692
- StringUtils_1.StringUtils.regexExec(/([^(dr\-)])?this(?=.?)/g, message).reverse().forEach(function (it) {
692
+ // StringUtils.regexExec(/([^(dr\-)])?this(?=.?)/g, message).reverse().forEach(it => {
693
+ StringUtils_1.StringUtils.regexExec(/@this@/g, message).reverse().forEach(function (it) {
693
694
  var _a;
694
- message = message.substr(0, it.index) + message.substr(it.index).replace(it[0], "" + ((_a = it[1]) !== null && _a !== void 0 ? _a : '') + drThis);
695
+ message = message.substr(0, it.index) + message.substr(it.index).replace(it[0], "".concat((_a = it[1]) !== null && _a !== void 0 ? _a : '').concat(drThis));
695
696
  });
696
697
  it.innerHTML = message;
697
698
  });
698
699
  var message = element.innerHTML;
699
- StringUtils_1.StringUtils.regexExec(/([^(dr\-)])?this(?=.?)/g, message).reverse().forEach(function (it) {
700
+ StringUtils_1.StringUtils.regexExec(/@this@/g, message).reverse().forEach(function (it) {
700
701
  var _a;
701
- message = message.substr(0, it.index) + message.substr(it.index).replace(it[0], "" + ((_a = it[1]) !== null && _a !== void 0 ? _a : '') + drThis);
702
+ message = message.substr(0, it.index) + message.substr(it.index).replace(it[0], "".concat((_a = it[1]) !== null && _a !== void 0 ? _a : '').concat(drThis));
702
703
  });
703
704
  element.innerHTML = message;
704
705
  return thisRandom;
705
706
  };
706
707
  RawSet.drThisDecoding = function (element, thisRandom) {
707
- element.querySelectorAll("[" + RawSet.DR_PRE_NAME + "]").forEach(function (it) {
708
- it.innerHTML = it.innerHTML.replace(RegExp(thisRandom, 'g'), 'this');
708
+ element.querySelectorAll("[".concat(RawSet.DR_PRE_NAME, "]")).forEach(function (it) {
709
+ it.innerHTML = it.innerHTML.replace(RegExp(thisRandom, 'g'), '@this@');
709
710
  });
710
- element.querySelectorAll("[" + RawSet.DR_THIS_NAME + "]").forEach(function (it) {
711
- it.innerHTML = it.innerHTML.replace(RegExp(thisRandom, 'g'), 'this');
711
+ element.querySelectorAll("[".concat(RawSet.DR_THIS_NAME, "]")).forEach(function (it) {
712
+ it.innerHTML = it.innerHTML.replace(RegExp(thisRandom, 'g'), '@this@');
712
713
  });
713
714
  };
714
715
  RawSet.drFormOtherMoveAttr = function (element, as, to, config) {
715
- element.querySelectorAll("[" + RawSet.DR_FORM_NAME + "]").forEach(function (subElement) {
716
+ element.querySelectorAll("[".concat(RawSet.DR_FORM_NAME, "]")).forEach(function (subElement) {
716
717
  var _a;
717
718
  var nodeIterator = config.window.document.createNodeIterator(subElement, NodeFilter.SHOW_ELEMENT, {
718
719
  acceptNode: function (node) {
@@ -750,7 +751,7 @@ var RawSet = /** @class */ (function () {
750
751
  };
751
752
  });
752
753
  // element.querySelectorAll(`[${RawSet.DR_THIS_NAME}]`).forEach(it => {
753
- element.querySelectorAll("[" + RawSet.DR_VAR_OPTIONNAME + "]").forEach(function (it) {
754
+ element.querySelectorAll("[".concat(RawSet.DR_VAR_OPTIONNAME, "]")).forEach(function (it) {
754
755
  vars.filter(function (vit) { return vit.value && vit.name; }).forEach(function (vit) {
755
756
  it.innerHTML = it.innerHTML.replace(vit.regex, vit.random);
756
757
  });
@@ -761,7 +762,7 @@ var RawSet = /** @class */ (function () {
761
762
  return vars;
762
763
  };
763
764
  RawSet.drVarDecoding = function (element, vars) {
764
- element.querySelectorAll("[" + RawSet.DR_THIS_NAME + "]").forEach(function (it) {
765
+ element.querySelectorAll("[".concat(RawSet.DR_THIS_NAME, "]")).forEach(function (it) {
765
766
  vars.filter(function (vit) { return vit.value && vit.name; }).forEach(function (vit) {
766
767
  it.innerHTML = it.innerHTML.replace(RegExp(vit.random, 'g'), vit.value);
767
768
  });
@@ -823,7 +824,7 @@ var RawSet = /** @class */ (function () {
823
824
  renderScript = '';
824
825
  createParam = [];
825
826
  if (onCreate) {
826
- script = renderScript + " return " + onCreate + " ";
827
+ script = "".concat(renderScript, " return ").concat(onCreate, " ");
827
828
  createParam = ScriptUtils_1.ScriptUtils.eval(script, obj);
828
829
  if (!Array.isArray(createParam)) {
829
830
  createParam = [createParam];
@@ -832,12 +833,12 @@ var RawSet = /** @class */ (function () {
832
833
  (_e = (_d = set.obj) === null || _d === void 0 ? void 0 : _d.onCreateRender) === null || _e === void 0 ? void 0 : _e.call.apply(_e, __spreadArray([_d], createParam, false));
833
834
  oninit = element.getAttribute(RawSet.DR_ON_CREATED_CALLBACK_OPTIONNAME);
834
835
  if (oninit) {
835
- script = renderScript + " " + oninit + " ";
836
+ script = "".concat(renderScript, " ").concat(oninit, " ");
836
837
  ScriptUtils_1.ScriptUtils.eval(script, obj);
837
838
  }
838
839
  _m.label = 12;
839
840
  case 12:
840
- n.querySelectorAll(EventManager_1.eventManager.attrNames.map(function (it) { return "[" + it + "]"; }).join(',')).forEach(function (it) {
841
+ n.querySelectorAll(EventManager_1.eventManager.attrNames.map(function (it) { return "[".concat(it, "]"); }).join(',')).forEach(function (it) {
841
842
  it.setAttribute(EventManager_1.EventManager.ownerVariablePathAttrName, 'this');
842
843
  });
843
844
  // attribute
@@ -965,7 +966,7 @@ var RawSet = /** @class */ (function () {
965
966
  constructorParam = [];
966
967
  // dr-constructor
967
968
  if (constructor) {
968
- script = renderScript + " return " + constructor + " ";
969
+ script = "".concat(renderScript, " return ").concat(constructor, " ");
969
970
  param = (_b = ScriptUtils_1.ScriptUtils.eval(script, Object.assign(obj, { __render: render }))) !== null && _b !== void 0 ? _b : [];
970
971
  if (!Array.isArray(param)) {
971
972
  param = [param];
@@ -977,7 +978,7 @@ var RawSet = /** @class */ (function () {
977
978
  instance = domrenderComponents[componentKey];
978
979
  i = instance.__domrender_component_new = ((_c = instance.__domrender_component_new) !== null && _c !== void 0 ? _c : new Proxy({}, new Types_1.DomRenderFinalProxy()));
979
980
  i.thisVariableName = rawSet.point.thisVariableName;
980
- i.thisFullVariableName = "this.__domrender_components." + componentKey;
981
+ i.thisFullVariableName = "this.__domrender_components.".concat(componentKey);
981
982
  i.componentKey = componentKey;
982
983
  i.rawSet = rawSet;
983
984
  i.attribute = attribute;
@@ -992,7 +993,7 @@ var RawSet = /** @class */ (function () {
992
993
  normalAttrMap = element.getAttribute(EventManager_1.EventManager.normalAttrMapAttrName);
993
994
  if (instance.onChangeAttrRender && normalAttrMap) {
994
995
  new Map(JSON.parse(normalAttrMap)).forEach(function (value, key) {
995
- var script = renderScript + " return " + value + " ";
996
+ var script = "".concat(renderScript, " return ").concat(value, " ");
996
997
  var cval = ScriptUtils_1.ScriptUtils.eval(script, Object.assign(obj, { __render: render }));
997
998
  // element.setAttribute(key, cval);
998
999
  instance.onChangeAttrRender(key, cval);
@@ -1002,7 +1003,7 @@ var RawSet = /** @class */ (function () {
1002
1003
  this.__render = render;
1003
1004
  createParam = [];
1004
1005
  if (onCreate) {
1005
- script = renderScript + " return " + onCreate + " ";
1006
+ script = "".concat(renderScript, " return ").concat(onCreate, " ");
1006
1007
  createParam = ScriptUtils_1.ScriptUtils.eval(script, Object.assign(obj, { __render: render }));
1007
1008
  if (!Array.isArray(createParam)) {
1008
1009
  createParam = [createParam];
@@ -1018,20 +1019,20 @@ var RawSet = /** @class */ (function () {
1018
1019
  innerHTMLThisRandom = RandomUtils_1.RandomUtils.uuid();
1019
1020
  applayTemplate = applayTemplate.replace(/this\./g, innerHTMLThisRandom);
1020
1021
  // }
1021
- applayTemplate = applayTemplate.replace(RegExp("#" + componentName + "#", 'g'), 'this');
1022
+ applayTemplate = applayTemplate.replace(RegExp("#".concat(componentName, "#"), 'g'), 'this');
1022
1023
  }
1023
1024
  // applayTemplate = template.replace(RegExp(`#${innerHTMLName}#`, 'g'), applayTemplate);
1024
- applayTemplate = ((_g = this.template) !== null && _g !== void 0 ? _g : '').replace(RegExp("#" + innerHTMLName + "#", 'g'), applayTemplate);
1025
+ applayTemplate = ((_g = this.template) !== null && _g !== void 0 ? _g : '').replace(RegExp("#".concat(innerHTMLName, "#"), 'g'), applayTemplate);
1025
1026
  oninit = element.getAttribute(RawSet.DR_ON_CREATED_CALLBACK_OPTIONNAME);
1026
1027
  if (oninit) {
1027
- script = renderScript + " " + oninit + " ";
1028
+ script = "".concat(renderScript, " ").concat(oninit, " ");
1028
1029
  ScriptUtils_1.ScriptUtils.eval(script, Object.assign(obj, {
1029
1030
  __render: render
1030
1031
  }));
1031
1032
  }
1032
1033
  style = RawSet.generateStyleTransform(this.styles, componentKey, true);
1033
1034
  element.innerHTML = style + (applayTemplate !== null && applayTemplate !== void 0 ? applayTemplate : '');
1034
- return [4 /*yield*/, RawSet.drThisCreate(rawSet, element, "this.__domrender_components." + componentKey, '', true, obj, config)];
1035
+ return [4 /*yield*/, RawSet.drThisCreate(rawSet, element, "this.__domrender_components.".concat(componentKey), '', true, obj, config)];
1035
1036
  case 12:
1036
1037
  data = _p.sent();
1037
1038
  // 넘어온 innerHTML에 this가 있는걸 다시 복호화해서 제대로 작동하도록한다.
@@ -1,7 +1,7 @@
1
1
  import { CreatorMetaData } from './CreatorMetaData';
2
2
  import { Router } from '../routers/Router';
3
3
  import { RawSet } from './RawSet';
4
- export declare type Render = {
4
+ export type Render = {
5
5
  rawset?: RawSet;
6
6
  scripts?: {
7
7
  [n: string]: any;
@@ -1,4 +1,4 @@
1
- export declare type RouteData = {
1
+ export type RouteData = {
2
2
  path: string;
3
3
  url: string;
4
4
  data?: any;