dom-render 1.0.73 → 1.0.76

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 (159) hide show
  1. package/Config.d.ts +38 -36
  2. package/Config.js +2 -2
  3. package/DomRender.d.ts +28 -4
  4. package/DomRender.js +90 -39
  5. package/DomRenderProxy.d.ts +29 -29
  6. package/DomRenderProxy.js +338 -327
  7. package/README.MD +638 -511
  8. package/RawSet.d.ts +140 -117
  9. package/RawSet.js +765 -882
  10. package/components/ComponentSet.d.ts +7 -0
  11. package/components/ComponentSet.js +14 -0
  12. package/dist/bundle.js +3796 -3133
  13. package/events/EventManager.d.ts +47 -47
  14. package/events/EventManager.js +499 -499
  15. package/iterators/Range.d.ts +22 -22
  16. package/iterators/Range.js +65 -65
  17. package/lifecycle/OnBeforeReturnGet.d.ts +3 -3
  18. package/lifecycle/OnBeforeReturnGet.js +2 -2
  19. package/lifecycle/OnBeforeReturnSet.d.ts +3 -3
  20. package/lifecycle/OnBeforeReturnSet.js +2 -2
  21. package/lifecycle/OnCreateRender.d.ts +3 -3
  22. package/lifecycle/OnCreateRender.js +2 -2
  23. package/lifecycle/OnDestroyRender.d.ts +4 -0
  24. package/lifecycle/OnDestroyRender.js +2 -0
  25. package/lifecycle/OnInitRender.d.ts +7 -7
  26. package/lifecycle/OnInitRender.js +2 -2
  27. package/lifecycle/OnProxyDomRender.d.ts +4 -0
  28. package/lifecycle/OnProxyDomRender.js +2 -0
  29. package/managers/RenderManager.d.ts +3 -3
  30. package/managers/RenderManager.js +18 -18
  31. package/messenger/DefaultMessenger.d.ts +3 -0
  32. package/messenger/DefaultMessenger.js +27 -0
  33. package/messenger/Messenger.d.ts +78 -0
  34. package/messenger/Messenger.js +201 -0
  35. package/operators/Appender.d.ts +7 -12
  36. package/operators/Appender.js +32 -39
  37. package/operators/AttrExpresion.d.ts +4 -0
  38. package/operators/AttrExpresion.js +68 -0
  39. package/operators/Dr.d.ts +4 -0
  40. package/operators/Dr.js +62 -0
  41. package/operators/DrAppender.d.ts +4 -0
  42. package/operators/DrAppender.js +65 -0
  43. package/operators/DrFor.d.ts +4 -0
  44. package/operators/DrFor.js +62 -0
  45. package/operators/DrForOf.d.ts +4 -0
  46. package/operators/DrForOf.js +65 -0
  47. package/operators/DrForm.d.ts +4 -0
  48. package/operators/DrForm.js +100 -0
  49. package/operators/DrIf.d.ts +4 -0
  50. package/operators/DrIf.js +72 -0
  51. package/operators/DrInnerHTML.d.ts +4 -0
  52. package/operators/DrInnerHTML.js +60 -0
  53. package/operators/DrInnerText.d.ts +4 -0
  54. package/operators/DrInnerText.js +58 -0
  55. package/operators/DrPre.d.ts +4 -0
  56. package/operators/DrPre.js +30 -0
  57. package/operators/DrRepeat.d.ts +4 -0
  58. package/operators/DrRepeat.js +63 -0
  59. package/operators/DrTargetAttr.d.ts +4 -0
  60. package/operators/DrTargetAttr.js +55 -0
  61. package/operators/DrTargetElement.d.ts +4 -0
  62. package/operators/DrTargetElement.js +65 -0
  63. package/operators/DrThis.d.ts +4 -0
  64. package/operators/DrThis.js +59 -0
  65. package/operators/OperatorRender.d.ts +41 -0
  66. package/operators/OperatorRender.js +21 -0
  67. package/package.json +94 -94
  68. package/routers/HashRouter.d.ts +9 -9
  69. package/routers/HashRouter.js +53 -53
  70. package/routers/PathRouter.d.ts +9 -9
  71. package/routers/PathRouter.js +52 -52
  72. package/routers/Router.d.ts +25 -22
  73. package/routers/Router.js +116 -94
  74. package/types/Types.d.ts +14 -14
  75. package/types/Types.js +36 -36
  76. package/utils/clipboard/ClipBoardUtils.d.ts +6 -6
  77. package/utils/clipboard/ClipBoardUtils.js +25 -25
  78. package/utils/dom/DomUtils.d.ts +13 -13
  79. package/utils/dom/DomUtils.js +47 -47
  80. package/utils/location/LocationUtils.d.ts +16 -16
  81. package/utils/location/LocationUtils.js +57 -57
  82. package/utils/node/NodeUtils.d.ts +10 -10
  83. package/utils/node/NodeUtils.js +27 -27
  84. package/utils/random/RandomUtils.d.ts +7 -7
  85. package/utils/random/RandomUtils.js +47 -47
  86. package/utils/script/ScriptUtils.d.ts +14 -14
  87. package/utils/script/ScriptUtils.js +89 -89
  88. package/utils/storage/StorageUtils.d.ts +9 -9
  89. package/utils/storage/StorageUtils.js +48 -48
  90. package/utils/string/StringUtils.d.ts +5 -5
  91. package/utils/string/StringUtils.js +41 -41
  92. package/utils/valid/ValidUtils.d.ts +10 -10
  93. package/utils/valid/ValidUtils.js +78 -78
  94. package/validators/AllCheckedValidatorArray.d.ts +6 -6
  95. package/validators/AllCheckedValidatorArray.js +32 -32
  96. package/validators/AllUnCheckedValidatorArray.d.ts +6 -6
  97. package/validators/AllUnCheckedValidatorArray.js +32 -32
  98. package/validators/CheckedValidator.d.ts +5 -5
  99. package/validators/CheckedValidator.js +32 -32
  100. package/validators/CountEqualsCheckedValidatorArray.d.ts +7 -7
  101. package/validators/CountEqualsCheckedValidatorArray.js +34 -34
  102. package/validators/CountEqualsUnCheckedValidatorArray.d.ts +7 -7
  103. package/validators/CountEqualsUnCheckedValidatorArray.js +34 -34
  104. package/validators/CountGreaterThanCheckedValidatorArray.d.ts +7 -7
  105. package/validators/CountGreaterThanCheckedValidatorArray.js +34 -34
  106. package/validators/CountGreaterThanEqualsCheckedValidatorArray.d.ts +7 -7
  107. package/validators/CountGreaterThanEqualsCheckedValidatorArray.js +34 -34
  108. package/validators/CountGreaterThanEqualsUnCheckedValidatorArray.d.ts +7 -7
  109. package/validators/CountGreaterThanEqualsUnCheckedValidatorArray.js +34 -34
  110. package/validators/CountGreaterThanUnCheckedValidatorArray.d.ts +7 -7
  111. package/validators/CountGreaterThanUnCheckedValidatorArray.js +34 -34
  112. package/validators/CountLessThanCheckedValidatorArray.d.ts +7 -7
  113. package/validators/CountLessThanCheckedValidatorArray.js +34 -34
  114. package/validators/CountLessThanEqualsCheckedValidatorArray.d.ts +7 -7
  115. package/validators/CountLessThanEqualsCheckedValidatorArray.js +34 -34
  116. package/validators/CountLessThanEqualsUnCheckedValidatorArray.d.ts +7 -7
  117. package/validators/CountLessThanEqualsUnCheckedValidatorArray.js +34 -34
  118. package/validators/CountLessThanUnCheckedValidatorArray.d.ts +7 -7
  119. package/validators/CountLessThanUnCheckedValidatorArray.js +34 -34
  120. package/validators/CountUnCheckedValidatorArray.d.ts +7 -7
  121. package/validators/CountUnCheckedValidatorArray.js +34 -34
  122. package/validators/EmptyValidator.d.ts +5 -5
  123. package/validators/EmptyValidator.js +33 -33
  124. package/validators/ExcludeCheckedValidatorArray.d.ts +8 -8
  125. package/validators/ExcludeCheckedValidatorArray.js +41 -41
  126. package/validators/FormValidator.d.ts +7 -7
  127. package/validators/FormValidator.js +37 -37
  128. package/validators/IncludeCheckedValidatorArray.d.ts +8 -8
  129. package/validators/IncludeCheckedValidatorArray.js +41 -41
  130. package/validators/MultipleValidator.d.ts +8 -8
  131. package/validators/MultipleValidator.js +48 -48
  132. package/validators/NonPassValidator.d.ts +5 -5
  133. package/validators/NonPassValidator.js +31 -31
  134. package/validators/NotEmptyValidator.d.ts +5 -5
  135. package/validators/NotEmptyValidator.js +34 -34
  136. package/validators/NotRegExpTestValidator.d.ts +6 -6
  137. package/validators/NotRegExpTestValidator.js +42 -42
  138. package/validators/PassValidator.d.ts +5 -5
  139. package/validators/PassValidator.js +31 -31
  140. package/validators/RegExpTestValidator.d.ts +6 -6
  141. package/validators/RegExpTestValidator.js +43 -43
  142. package/validators/RequiredValidator.d.ts +5 -5
  143. package/validators/RequiredValidator.js +33 -33
  144. package/validators/UnCheckedValidator.d.ts +5 -5
  145. package/validators/UnCheckedValidator.js +32 -32
  146. package/validators/ValidMultipleValidator.d.ts +9 -9
  147. package/validators/ValidMultipleValidator.js +34 -34
  148. package/validators/ValidValidator.d.ts +6 -6
  149. package/validators/ValidValidator.js +33 -33
  150. package/validators/ValidValidatorArray.d.ts +7 -7
  151. package/validators/ValidValidatorArray.js +33 -33
  152. package/validators/Validator.d.ts +57 -57
  153. package/validators/Validator.js +242 -242
  154. package/validators/ValidatorArray.d.ts +17 -17
  155. package/validators/ValidatorArray.js +99 -99
  156. package/validators/ValueEqualsValidator.d.ts +6 -6
  157. package/validators/ValueEqualsValidator.js +33 -33
  158. package/validators/ValueNotEqualsValidator.d.ts +6 -6
  159. package/validators/ValueNotEqualsValidator.js +33 -33
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __assign = (this && this.__assign) || function () {
18
+ __assign = Object.assign || function(t) {
19
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
20
+ s = arguments[i];
21
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
+ t[p] = s[p];
23
+ }
24
+ return t;
25
+ };
26
+ return __assign.apply(this, arguments);
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.DrInnerHTML = void 0;
30
+ var OperatorRender_1 = require("./OperatorRender");
31
+ var ScriptUtils_1 = require("../utils/script/ScriptUtils");
32
+ var RawSet_1 = require("../RawSet");
33
+ var DrInnerHTML = /** @class */ (function (_super) {
34
+ __extends(DrInnerHTML, _super);
35
+ function DrInnerHTML() {
36
+ return _super !== null && _super.apply(this, arguments) || this;
37
+ }
38
+ DrInnerHTML.prototype.execRender = function () {
39
+ var _a;
40
+ var _b, _c, _d;
41
+ if (this.elementSource.attrs.drInnerHTML) {
42
+ var newTemp = this.source.config.window.document.createElement('temp');
43
+ ScriptUtils_1.ScriptUtils.eval("\n ".concat(this.render.bindScript, "\n const n = $element.cloneNode(true);\n ").concat((_b = this.elementSource.attrs.drBeforeOption) !== null && _b !== void 0 ? _b : '', "\n n.innerHTML = ").concat(this.elementSource.attrs.drInnerHTML, ";\n if (this.__render.drStripOption === 'true') {\n Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));\n } else {\n this.__render.fag.append(n);\n }\n ").concat((_c = this.elementSource.attrs.drAfterOption) !== null && _c !== void 0 ? _c : '', "\n "), Object.assign(this.source.obj, {
44
+ __render: Object.freeze(__assign({ drStripOption: this.elementSource.attrs.drStripOption, fag: newTemp }, this.render
45
+ // eslint-disable-next-line no-use-before-define
46
+ ))
47
+ }));
48
+ var tempalte = this.source.config.window.document.createElement('template');
49
+ tempalte.innerHTML = newTemp.innerHTML;
50
+ this.returnContainer.fag.append(tempalte.content);
51
+ var rr = RawSet_1.RawSet.checkPointCreates(this.returnContainer.fag, this.source.config);
52
+ (_d = this.elementSource.element.parentNode) === null || _d === void 0 ? void 0 : _d.replaceChild(this.returnContainer.fag, this.elementSource.element);
53
+ (_a = this.returnContainer.raws).push.apply(_a, rr);
54
+ return OperatorRender_1.ExecuteState.EXECUTE;
55
+ }
56
+ return OperatorRender_1.ExecuteState.NO_EXECUTE;
57
+ };
58
+ return DrInnerHTML;
59
+ }(OperatorRender_1.OperatorRender));
60
+ exports.DrInnerHTML = DrInnerHTML;
@@ -0,0 +1,4 @@
1
+ import { ExecuteState, OperatorRender } from './OperatorRender';
2
+ export declare class DrInnerText extends OperatorRender {
3
+ execRender(): ExecuteState;
4
+ }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __assign = (this && this.__assign) || function () {
18
+ __assign = Object.assign || function(t) {
19
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
20
+ s = arguments[i];
21
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
+ t[p] = s[p];
23
+ }
24
+ return t;
25
+ };
26
+ return __assign.apply(this, arguments);
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.DrInnerText = void 0;
30
+ var OperatorRender_1 = require("./OperatorRender");
31
+ var ScriptUtils_1 = require("../utils/script/ScriptUtils");
32
+ var RawSet_1 = require("../RawSet");
33
+ var DrInnerText = /** @class */ (function (_super) {
34
+ __extends(DrInnerText, _super);
35
+ function DrInnerText() {
36
+ return _super !== null && _super.apply(this, arguments) || this;
37
+ }
38
+ DrInnerText.prototype.execRender = function () {
39
+ var _a;
40
+ var _b, _c, _d;
41
+ if (this.elementSource.attrs.drInnerText) {
42
+ var newTemp = this.source.config.window.document.createElement('temp');
43
+ ScriptUtils_1.ScriptUtils.eval(" \n ".concat(this.render.bindScript, "\n const n = $element.cloneNode(true); \n ").concat((_b = this.elementSource.attrs.drBeforeOption) !== null && _b !== void 0 ? _b : '', "\n n.innerText = ").concat(this.elementSource.attrs.drInnerText, ";\n if (this.__render.drStripOption === 'true') {\n Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));\n } else {\n this.__render.fag.append(n);\n }\n ").concat((_c = this.elementSource.attrs.drAfterOption) !== null && _c !== void 0 ? _c : '', "\n "), Object.assign(this.source.obj, {
44
+ __render: Object.freeze(__assign({ drStripOption: this.elementSource.attrs.drStripOption, fag: newTemp }, this.render))
45
+ }));
46
+ var tempalte = this.source.config.window.document.createElement('template');
47
+ tempalte.innerHTML = newTemp.innerHTML;
48
+ this.returnContainer.fag.append(tempalte.content);
49
+ var rr = RawSet_1.RawSet.checkPointCreates(this.returnContainer.fag, this.source.config);
50
+ (_d = this.elementSource.element.parentNode) === null || _d === void 0 ? void 0 : _d.replaceChild(this.returnContainer.fag, this.elementSource.element);
51
+ (_a = this.returnContainer.raws).push.apply(_a, rr);
52
+ return OperatorRender_1.ExecuteState.EXECUTE;
53
+ }
54
+ return OperatorRender_1.ExecuteState.NO_EXECUTE;
55
+ };
56
+ return DrInnerText;
57
+ }(OperatorRender_1.OperatorRender));
58
+ exports.DrInnerText = DrInnerText;
@@ -0,0 +1,4 @@
1
+ import { ExecuteState, OperatorRender } from './OperatorRender';
2
+ export declare class DrPre extends OperatorRender {
3
+ execRender(): ExecuteState;
4
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.DrPre = void 0;
19
+ var OperatorRender_1 = require("./OperatorRender");
20
+ var DrPre = /** @class */ (function (_super) {
21
+ __extends(DrPre, _super);
22
+ function DrPre() {
23
+ return _super !== null && _super.apply(this, arguments) || this;
24
+ }
25
+ DrPre.prototype.execRender = function () {
26
+ return (this.elementSource.attrs.drPre != null) ? OperatorRender_1.ExecuteState.EXECUTE : OperatorRender_1.ExecuteState.NO_EXECUTE;
27
+ };
28
+ return DrPre;
29
+ }(OperatorRender_1.OperatorRender));
30
+ exports.DrPre = DrPre;
@@ -0,0 +1,4 @@
1
+ import { ExecuteState, OperatorRender } from './OperatorRender';
2
+ export declare class DrRepeat extends OperatorRender {
3
+ execRender(): ExecuteState;
4
+ }
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __assign = (this && this.__assign) || function () {
18
+ __assign = Object.assign || function(t) {
19
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
20
+ s = arguments[i];
21
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
+ t[p] = s[p];
23
+ }
24
+ return t;
25
+ };
26
+ return __assign.apply(this, arguments);
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.DrRepeat = void 0;
30
+ var OperatorRender_1 = require("./OperatorRender");
31
+ var ScriptUtils_1 = require("../utils/script/ScriptUtils");
32
+ var RawSet_1 = require("../RawSet");
33
+ var EventManager_1 = require("../events/EventManager");
34
+ var DrRepeat = /** @class */ (function (_super) {
35
+ __extends(DrRepeat, _super);
36
+ function DrRepeat() {
37
+ return _super !== null && _super.apply(this, arguments) || this;
38
+ }
39
+ DrRepeat.prototype.execRender = function () {
40
+ var _a;
41
+ var _b, _c, _d, _e;
42
+ if (this.elementSource.attrs.drRepeat) {
43
+ var itRandom = RawSet_1.RawSet.drItOtherEncoding(this.elementSource.element);
44
+ var vars = RawSet_1.RawSet.drVarEncoding(this.elementSource.element, (_b = this.elementSource.attrs.drVarOption) !== null && _b !== void 0 ? _b : '');
45
+ var newTemp = this.source.config.window.document.createElement('temp');
46
+ 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 repeat = ").concat(this.elementSource.attrs.drRepeat, ";\n const repeatStr = `").concat(this.elementSource.attrs.drRepeat, "`;\n let range = repeat;\n if (typeof repeat === 'number') {\n range = ").concat(EventManager_1.EventManager.RANGE_VARNAME, "(repeat);\n } \n for(const it of range) {\n var destIt = it;\n if (range.isRange) {\n destIt = it;\n } else {\n destIt = repeatStr + '[' + i +']'\n }\n const n = this.__render.element.cloneNode(true);\n n.getAttributeNames().forEach(it => n.setAttribute(it, n.getAttribute(it).replace(/\\#it\\#/g, destIt).replace(/\\#nearRangeIt\\#/g, destIt).replace(/\\#nearRangeIndex\\#/g, destIt)))\n n.innerHTML = n.innerHTML.replace(/\\#it\\#/g, destIt).replace(/\\#index\\#/g, destIt);\n \n if (this.__render.drStripOption === 'true') {\n Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));\n } else {\n this.__render.fag.append(n);\n }\n i++;\n }\n ").concat((_d = this.elementSource.attrs.drAfterOption) !== null && _d !== void 0 ? _d : '', "\n "), Object.assign(this.source.obj, {
47
+ __render: Object.freeze(__assign({ fag: newTemp, drStripOption: this.elementSource.attrs.drStripOption }, this.render))
48
+ }));
49
+ RawSet_1.RawSet.drVarDecoding(newTemp, vars);
50
+ RawSet_1.RawSet.drItOtherDecoding(newTemp, itRandom);
51
+ var tempalte = this.source.config.window.document.createElement('template');
52
+ tempalte.innerHTML = newTemp.innerHTML;
53
+ this.returnContainer.fag.append(tempalte.content);
54
+ var rr = RawSet_1.RawSet.checkPointCreates(this.returnContainer.fag, this.source.config);
55
+ (_e = this.elementSource.element.parentNode) === null || _e === void 0 ? void 0 : _e.replaceChild(this.returnContainer.fag, this.elementSource.element);
56
+ (_a = this.returnContainer.raws).push.apply(_a, rr);
57
+ return OperatorRender_1.ExecuteState.EXECUTE;
58
+ }
59
+ return OperatorRender_1.ExecuteState.NO_EXECUTE;
60
+ };
61
+ return DrRepeat;
62
+ }(OperatorRender_1.OperatorRender));
63
+ exports.DrRepeat = DrRepeat;
@@ -0,0 +1,4 @@
1
+ import { ExecuteState, OperatorRender } from './OperatorRender';
2
+ export declare class DrTargetAttr extends OperatorRender {
3
+ execRender(): ExecuteState;
4
+ }
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.DrTargetAttr = void 0;
19
+ var OperatorRender_1 = require("./OperatorRender");
20
+ var RawSet_1 = require("../RawSet");
21
+ var DrTargetAttr = /** @class */ (function (_super) {
22
+ __extends(DrTargetAttr, _super);
23
+ function DrTargetAttr() {
24
+ return _super !== null && _super.apply(this, arguments) || this;
25
+ }
26
+ DrTargetAttr.prototype.execRender = function () {
27
+ var _a;
28
+ var _b, _c, _d, _e;
29
+ var attributeNames = this.elementSource.element.getAttributeNames();
30
+ // const targetAttr = config?.targetAttrs?.find(it => (!drAttr.drForOf && !drAttr.drFor && !drAttr.drRepeat) && attributeNames.includes(it.name));
31
+ var targetAttr = (_c = (_b = this.source.config) === null || _b === void 0 ? void 0 : _b.targetAttrs) === null || _c === void 0 ? void 0 : _c.find(function (it) { return attributeNames.includes(it.name); });
32
+ if (targetAttr) {
33
+ var attrName = targetAttr.name;
34
+ var attrValue = this.rawSet.getAttributeAndDelete(this.elementSource.element, attrName);
35
+ if (attrValue && attrName && (!this.elementSource.attrs.drForOf && !this.elementSource.attrs.drFor && !this.elementSource.attrs.drRepeat)) {
36
+ var documentFragment = targetAttr.callBack(this.elementSource.element, attrValue, this.source.obj, this.rawSet);
37
+ if (documentFragment) {
38
+ var rr = RawSet_1.RawSet.checkPointCreates(documentFragment, this.source.config);
39
+ (_d = this.elementSource.element.parentNode) === null || _d === void 0 ? void 0 : _d.replaceChild(documentFragment, this.elementSource.element);
40
+ (_a = this.returnContainer.raws).push.apply(_a, rr);
41
+ this.afterCallBack.onAttrInitCallBacks.push({
42
+ attrName: attrName,
43
+ attrValue: attrValue,
44
+ obj: this.source.obj
45
+ });
46
+ (_e = targetAttr === null || targetAttr === void 0 ? void 0 : targetAttr.complete) === null || _e === void 0 ? void 0 : _e.call(targetAttr, this.elementSource.element, attrValue, this.source.obj, this.rawSet);
47
+ }
48
+ }
49
+ return OperatorRender_1.ExecuteState.EXECUTE;
50
+ }
51
+ return OperatorRender_1.ExecuteState.NO_EXECUTE;
52
+ };
53
+ return DrTargetAttr;
54
+ }(OperatorRender_1.OperatorRender));
55
+ exports.DrTargetAttr = DrTargetAttr;
@@ -0,0 +1,4 @@
1
+ import { ExecuteState, OperatorRender } from './OperatorRender';
2
+ export declare class DrTargetElement extends OperatorRender {
3
+ execRender(): ExecuteState;
4
+ }
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.DrTargetElement = void 0;
19
+ var OperatorRender_1 = require("./OperatorRender");
20
+ var ScriptUtils_1 = require("../utils/script/ScriptUtils");
21
+ var RawSet_1 = require("../RawSet");
22
+ var DrTargetElement = /** @class */ (function (_super) {
23
+ __extends(DrTargetElement, _super);
24
+ function DrTargetElement() {
25
+ return _super !== null && _super.apply(this, arguments) || this;
26
+ }
27
+ DrTargetElement.prototype.execRender = function () {
28
+ var _a;
29
+ var _this = this;
30
+ var _b, _c, _d, _e;
31
+ var targetElement = (_c = (_b = this.source.config) === null || _b === void 0 ? void 0 : _b.targetElements) === null || _c === void 0 ? void 0 : _c.find(function (it) { return it.name.toLowerCase() === _this.elementSource.element.tagName.toLowerCase(); });
32
+ if (targetElement) {
33
+ var documentFragment = targetElement.callBack(this.elementSource.element, this.source.obj, this.rawSet, this.elementSource.attrs);
34
+ if (documentFragment) {
35
+ var detectAction_1 = this.elementSource.element.getAttribute(RawSet_1.RawSet.DR_DETECT_NAME);
36
+ var render_1 = documentFragment.render;
37
+ if (detectAction_1 && render_1) {
38
+ this.rawSet.detect = {
39
+ action: function () {
40
+ 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, " ");
41
+ ScriptUtils_1.ScriptUtils.eval(script, Object.assign(_this.source.obj, {
42
+ __render: render_1
43
+ }));
44
+ }
45
+ };
46
+ }
47
+ // fag.append(documentFragment)
48
+ var rr = RawSet_1.RawSet.checkPointCreates(documentFragment, this.source.config);
49
+ (_d = this.elementSource.element.parentNode) === null || _d === void 0 ? void 0 : _d.replaceChild(documentFragment, this.elementSource.element);
50
+ (_a = this.returnContainer.raws).push.apply(_a, rr);
51
+ this.afterCallBack.onElementInitCallBacks.push({
52
+ name: targetElement.name.toLowerCase(),
53
+ obj: this.source.obj,
54
+ targetElement: targetElement,
55
+ creatorMetaData: targetElement.__creatorMetaData
56
+ });
57
+ (_e = targetElement === null || targetElement === void 0 ? void 0 : targetElement.complete) === null || _e === void 0 ? void 0 : _e.call(targetElement, this.elementSource.element, this.source.obj, this.rawSet);
58
+ }
59
+ return OperatorRender_1.ExecuteState.EXECUTE;
60
+ }
61
+ return OperatorRender_1.ExecuteState.NO_EXECUTE;
62
+ };
63
+ return DrTargetElement;
64
+ }(OperatorRender_1.OperatorRender));
65
+ exports.DrTargetElement = DrTargetElement;
@@ -0,0 +1,4 @@
1
+ import { ExecuteState, OperatorRender } from './OperatorRender';
2
+ export declare class DrThis extends OperatorRender {
3
+ execRender(): ExecuteState;
4
+ }
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.DrThis = void 0;
19
+ var OperatorRender_1 = require("./OperatorRender");
20
+ var ScriptUtils_1 = require("../utils/script/ScriptUtils");
21
+ var RawSet_1 = require("../RawSet");
22
+ var ComponentSet_1 = require("../components/ComponentSet");
23
+ var DrThis = /** @class */ (function (_super) {
24
+ __extends(DrThis, _super);
25
+ function DrThis() {
26
+ return _super !== null && _super.apply(this, arguments) || this;
27
+ }
28
+ DrThis.prototype.execRender = function () {
29
+ var _a;
30
+ var _b, _c, _d, _e, _f;
31
+ if (this.elementSource.attrs.drThis) {
32
+ var r = ScriptUtils_1.ScriptUtils.evalReturn(this.elementSource.attrs.drThis, this.source.obj);
33
+ if (r) {
34
+ if (r instanceof ComponentSet_1.ComponentSet) {
35
+ if (this.rawSet.data) {
36
+ var destroyOptions = (_c = (_b = this.elementSource.attrs.drDestroyOption) === null || _b === void 0 ? void 0 : _b.split(',')) !== null && _c !== void 0 ? _c : [];
37
+ RawSet_1.RawSet.destroy(this.rawSet.data.obj, [], this.source.config, destroyOptions);
38
+ }
39
+ this.rawSet.data = r;
40
+ this.returnContainer.fag.append(RawSet_1.RawSet.drThisCreate(this.elementSource.element, "".concat(this.elementSource.attrs.drThis, ".obj"), (_d = this.elementSource.attrs.drVarOption) !== null && _d !== void 0 ? _d : '', this.elementSource.attrs.drStripOption, this.source.obj, this.source.config, r));
41
+ this.afterCallBack.onThisComponentSetCallBacks.push(r);
42
+ }
43
+ else {
44
+ this.returnContainer.fag.append(RawSet_1.RawSet.drThisCreate(this.elementSource.element, this.elementSource.attrs.drThis, (_e = this.elementSource.attrs.drVarOption) !== null && _e !== void 0 ? _e : '', this.elementSource.attrs.drStripOption, this.source.obj, this.source.config));
45
+ }
46
+ var rr = RawSet_1.RawSet.checkPointCreates(this.returnContainer.fag, this.source.config);
47
+ (_f = this.elementSource.element.parentNode) === null || _f === void 0 ? void 0 : _f.replaceChild(this.returnContainer.fag, this.elementSource.element);
48
+ (_a = this.returnContainer.raws).push.apply(_a, rr);
49
+ }
50
+ else {
51
+ this.elementSource.element.remove();
52
+ }
53
+ return OperatorRender_1.ExecuteState.EXECUTE;
54
+ }
55
+ return OperatorRender_1.ExecuteState.NO_EXECUTE;
56
+ };
57
+ return DrThis;
58
+ }(OperatorRender_1.OperatorRender));
59
+ exports.DrThis = DrThis;
@@ -0,0 +1,41 @@
1
+ import { AttrInitCallBack, Attrs, ElementInitCallBack, RawSet, Render } from '../RawSet';
2
+ import { ComponentSet } from '../components/ComponentSet';
3
+ import { Config } from '../Config';
4
+ export declare enum ExecuteState {
5
+ EXECUTE = 0,
6
+ NO_EXECUTE = 1,
7
+ STOP = 2
8
+ }
9
+ export declare type AfterCallBack = {
10
+ onAttrInitCallBacks: AttrInitCallBack[];
11
+ onElementInitCallBacks: ElementInitCallBack[];
12
+ onThisComponentSetCallBacks: ComponentSet[];
13
+ };
14
+ export declare abstract class OperatorRender {
15
+ rawSet: RawSet;
16
+ render: Render;
17
+ returnContainer: {
18
+ raws: RawSet[];
19
+ fag: DocumentFragment;
20
+ };
21
+ elementSource: {
22
+ element: Element;
23
+ attrs: Attrs;
24
+ };
25
+ source: {
26
+ config: Config;
27
+ obj: any;
28
+ };
29
+ afterCallBack: AfterCallBack;
30
+ constructor(rawSet: RawSet, render: Render, returnContainer: {
31
+ raws: RawSet[];
32
+ fag: DocumentFragment;
33
+ }, elementSource: {
34
+ element: Element;
35
+ attrs: Attrs;
36
+ }, source: {
37
+ config: Config;
38
+ obj: any;
39
+ }, afterCallBack: AfterCallBack);
40
+ abstract execRender(): ExecuteState;
41
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OperatorRender = exports.ExecuteState = void 0;
4
+ var ExecuteState;
5
+ (function (ExecuteState) {
6
+ ExecuteState[ExecuteState["EXECUTE"] = 0] = "EXECUTE";
7
+ ExecuteState[ExecuteState["NO_EXECUTE"] = 1] = "NO_EXECUTE";
8
+ ExecuteState[ExecuteState["STOP"] = 2] = "STOP";
9
+ })(ExecuteState = exports.ExecuteState || (exports.ExecuteState = {}));
10
+ var OperatorRender = /** @class */ (function () {
11
+ function OperatorRender(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
12
+ this.rawSet = rawSet;
13
+ this.render = render;
14
+ this.returnContainer = returnContainer;
15
+ this.elementSource = elementSource;
16
+ this.source = source;
17
+ this.afterCallBack = afterCallBack;
18
+ }
19
+ return OperatorRender;
20
+ }());
21
+ exports.OperatorRender = OperatorRender;