dom-render 1.0.97 → 1.0.99

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 (202) hide show
  1. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  2. package/.idea/dom-render.iml +9 -0
  3. package/.idea/inspectionProfiles/Project_Default.xml +6 -0
  4. package/.idea/jpa-buddy.xml +6 -0
  5. package/.idea/misc.xml +8 -0
  6. package/.idea/modules.xml +8 -0
  7. package/.idea/vcs.xml +6 -0
  8. package/README.MD +6 -793
  9. package/package.json +1 -1
  10. package/DomRender.d.ts +0 -13
  11. package/DomRender.js +0 -72
  12. package/DomRenderProxy.d.ts +0 -30
  13. package/DomRenderProxy.js +0 -510
  14. package/components/ComponentSet.d.ts +0 -10
  15. package/components/ComponentSet.js +0 -13
  16. package/configs/Config.d.ts +0 -34
  17. package/configs/Config.js +0 -2
  18. package/configs/TargetAttr.d.ts +0 -6
  19. package/configs/TargetAttr.js +0 -2
  20. package/configs/TargetElement.d.ts +0 -14
  21. package/configs/TargetElement.js +0 -2
  22. package/css/parse/index.d.ts +0 -1
  23. package/css/parse/index.js +0 -512
  24. package/css/stringify/compiler.d.ts +0 -32
  25. package/css/stringify/compiler.js +0 -40
  26. package/css/stringify/compress.d.ts +0 -75
  27. package/css/stringify/compress.js +0 -156
  28. package/css/stringify/identity.d.ts +0 -85
  29. package/css/stringify/identity.js +0 -194
  30. package/css/stringify/index.d.ts +0 -14
  31. package/css/stringify/index.js +0 -44
  32. package/dist/bundle.js +0 -5493
  33. package/events/EventManager.d.ts +0 -49
  34. package/events/EventManager.js +0 -529
  35. package/iterators/Range.d.ts +0 -23
  36. package/iterators/Range.js +0 -80
  37. package/lifecycle/OnBeforeReturnGet.d.ts +0 -3
  38. package/lifecycle/OnBeforeReturnGet.js +0 -2
  39. package/lifecycle/OnBeforeReturnSet.d.ts +0 -3
  40. package/lifecycle/OnBeforeReturnSet.js +0 -2
  41. package/lifecycle/OnChangeAttrRender.d.ts +0 -3
  42. package/lifecycle/OnChangeAttrRender.js +0 -2
  43. package/lifecycle/OnCreateRender.d.ts +0 -3
  44. package/lifecycle/OnCreateRender.js +0 -2
  45. package/lifecycle/OnDestroyRender.d.ts +0 -4
  46. package/lifecycle/OnDestroyRender.js +0 -2
  47. package/lifecycle/OnInitRender.d.ts +0 -3
  48. package/lifecycle/OnInitRender.js +0 -2
  49. package/lifecycle/OnProxyDomRender.d.ts +0 -4
  50. package/lifecycle/OnProxyDomRender.js +0 -2
  51. package/managers/RenderManager.d.ts +0 -3
  52. package/managers/RenderManager.js +0 -18
  53. package/messenger/DefaultMessenger.d.ts +0 -3
  54. package/messenger/DefaultMessenger.js +0 -27
  55. package/messenger/Messenger.d.ts +0 -78
  56. package/messenger/Messenger.js +0 -201
  57. package/operators/Appender.d.ts +0 -10
  58. package/operators/Appender.js +0 -64
  59. package/operators/AttrExpresion.d.ts +0 -0
  60. package/operators/AttrExpresion.js +0 -44
  61. package/operators/Dr.d.ts +0 -8
  62. package/operators/Dr.js +0 -101
  63. package/operators/DrAppender.d.ts +0 -8
  64. package/operators/DrAppender.js +0 -107
  65. package/operators/DrFor.d.ts +0 -8
  66. package/operators/DrFor.js +0 -104
  67. package/operators/DrForOf.d.ts +0 -8
  68. package/operators/DrForOf.js +0 -107
  69. package/operators/DrForm.d.ts +0 -8
  70. package/operators/DrForm.js +0 -138
  71. package/operators/DrIf.d.ts +0 -8
  72. package/operators/DrIf.js +0 -108
  73. package/operators/DrInnerHTML.d.ts +0 -8
  74. package/operators/DrInnerHTML.js +0 -99
  75. package/operators/DrInnerText.d.ts +0 -8
  76. package/operators/DrInnerText.js +0 -97
  77. package/operators/DrPre.d.ts +0 -7
  78. package/operators/DrPre.js +0 -73
  79. package/operators/DrRepeat.d.ts +0 -8
  80. package/operators/DrRepeat.js +0 -105
  81. package/operators/DrTargetAttr.d.ts +0 -7
  82. package/operators/DrTargetAttr.js +0 -98
  83. package/operators/DrTargetElement.d.ts +0 -7
  84. package/operators/DrTargetElement.js +0 -114
  85. package/operators/DrThis.d.ts +0 -5
  86. package/operators/DrThis.js +0 -108
  87. package/operators/DrThisProperty.d.ts +0 -10
  88. package/operators/DrThisProperty.js +0 -143
  89. package/operators/OperatorExecuter.d.ts +0 -49
  90. package/operators/OperatorExecuter.js +0 -89
  91. package/operators/OperatorExecuterAttrRequire.d.ts +0 -8
  92. package/operators/OperatorExecuterAttrRequire.js +0 -79
  93. package/rawsets/AttrInitCallBack.d.ts +0 -5
  94. package/rawsets/AttrInitCallBack.js +0 -2
  95. package/rawsets/Attrs.d.ts +0 -24
  96. package/rawsets/Attrs.js +0 -2
  97. package/rawsets/CreatorMetaData.d.ts +0 -18
  98. package/rawsets/CreatorMetaData.js +0 -2
  99. package/rawsets/DestroyOptionType.d.ts +0 -4
  100. package/rawsets/DestroyOptionType.js +0 -8
  101. package/rawsets/ElementInitCallBack.d.ts +0 -8
  102. package/rawsets/ElementInitCallBack.js +0 -2
  103. package/rawsets/RawSet.d.ts +0 -118
  104. package/rawsets/RawSet.js +0 -1141
  105. package/rawsets/RawSetOperatorType.d.ts +0 -3
  106. package/rawsets/RawSetOperatorType.js +0 -7
  107. package/rawsets/RawSetType.d.ts +0 -7
  108. package/rawsets/RawSetType.js +0 -11
  109. package/rawsets/Render.d.ts +0 -17
  110. package/rawsets/Render.js +0 -2
  111. package/routers/HashRouter.d.ts +0 -9
  112. package/routers/HashRouter.js +0 -53
  113. package/routers/PathRouter.d.ts +0 -9
  114. package/routers/PathRouter.js +0 -52
  115. package/routers/Router.d.ts +0 -28
  116. package/routers/Router.js +0 -126
  117. package/types/Types.d.ts +0 -14
  118. package/types/Types.js +0 -36
  119. package/utils/clipboard/ClipBoardUtils.d.ts +0 -6
  120. package/utils/clipboard/ClipBoardUtils.js +0 -25
  121. package/utils/dom/DomUtils.d.ts +0 -13
  122. package/utils/dom/DomUtils.js +0 -47
  123. package/utils/location/LocationUtils.d.ts +0 -16
  124. package/utils/location/LocationUtils.js +0 -63
  125. package/utils/node/NodeUtils.d.ts +0 -10
  126. package/utils/node/NodeUtils.js +0 -27
  127. package/utils/random/RandomUtils.d.ts +0 -7
  128. package/utils/random/RandomUtils.js +0 -47
  129. package/utils/script/ScriptUtils.d.ts +0 -14
  130. package/utils/script/ScriptUtils.js +0 -89
  131. package/utils/storage/StorageUtils.d.ts +0 -16
  132. package/utils/storage/StorageUtils.js +0 -87
  133. package/utils/string/StringUtils.d.ts +0 -6
  134. package/utils/string/StringUtils.js +0 -58
  135. package/utils/valid/ValidUtils.d.ts +0 -10
  136. package/utils/valid/ValidUtils.js +0 -78
  137. package/validators/AllCheckedValidatorArray.d.ts +0 -6
  138. package/validators/AllCheckedValidatorArray.js +0 -32
  139. package/validators/AllUnCheckedValidatorArray.d.ts +0 -6
  140. package/validators/AllUnCheckedValidatorArray.js +0 -32
  141. package/validators/CheckedValidator.d.ts +0 -5
  142. package/validators/CheckedValidator.js +0 -32
  143. package/validators/CountEqualsCheckedValidatorArray.d.ts +0 -7
  144. package/validators/CountEqualsCheckedValidatorArray.js +0 -34
  145. package/validators/CountEqualsUnCheckedValidatorArray.d.ts +0 -7
  146. package/validators/CountEqualsUnCheckedValidatorArray.js +0 -34
  147. package/validators/CountGreaterThanCheckedValidatorArray.d.ts +0 -7
  148. package/validators/CountGreaterThanCheckedValidatorArray.js +0 -34
  149. package/validators/CountGreaterThanEqualsCheckedValidatorArray.d.ts +0 -7
  150. package/validators/CountGreaterThanEqualsCheckedValidatorArray.js +0 -34
  151. package/validators/CountGreaterThanEqualsUnCheckedValidatorArray.d.ts +0 -7
  152. package/validators/CountGreaterThanEqualsUnCheckedValidatorArray.js +0 -34
  153. package/validators/CountGreaterThanUnCheckedValidatorArray.d.ts +0 -7
  154. package/validators/CountGreaterThanUnCheckedValidatorArray.js +0 -34
  155. package/validators/CountLessThanCheckedValidatorArray.d.ts +0 -7
  156. package/validators/CountLessThanCheckedValidatorArray.js +0 -34
  157. package/validators/CountLessThanEqualsCheckedValidatorArray.d.ts +0 -7
  158. package/validators/CountLessThanEqualsCheckedValidatorArray.js +0 -34
  159. package/validators/CountLessThanEqualsUnCheckedValidatorArray.d.ts +0 -7
  160. package/validators/CountLessThanEqualsUnCheckedValidatorArray.js +0 -34
  161. package/validators/CountLessThanUnCheckedValidatorArray.d.ts +0 -7
  162. package/validators/CountLessThanUnCheckedValidatorArray.js +0 -34
  163. package/validators/CountUnCheckedValidatorArray.d.ts +0 -7
  164. package/validators/CountUnCheckedValidatorArray.js +0 -34
  165. package/validators/EmptyValidator.d.ts +0 -5
  166. package/validators/EmptyValidator.js +0 -33
  167. package/validators/ExcludeCheckedValidatorArray.d.ts +0 -8
  168. package/validators/ExcludeCheckedValidatorArray.js +0 -41
  169. package/validators/FormValidator.d.ts +0 -7
  170. package/validators/FormValidator.js +0 -37
  171. package/validators/IncludeCheckedValidatorArray.d.ts +0 -8
  172. package/validators/IncludeCheckedValidatorArray.js +0 -41
  173. package/validators/MultipleValidator.d.ts +0 -8
  174. package/validators/MultipleValidator.js +0 -48
  175. package/validators/NonPassValidator.d.ts +0 -5
  176. package/validators/NonPassValidator.js +0 -31
  177. package/validators/NotEmptyValidator.d.ts +0 -5
  178. package/validators/NotEmptyValidator.js +0 -34
  179. package/validators/NotRegExpTestValidator.d.ts +0 -6
  180. package/validators/NotRegExpTestValidator.js +0 -42
  181. package/validators/PassValidator.d.ts +0 -5
  182. package/validators/PassValidator.js +0 -31
  183. package/validators/RegExpTestValidator.d.ts +0 -6
  184. package/validators/RegExpTestValidator.js +0 -43
  185. package/validators/RequiredValidator.d.ts +0 -5
  186. package/validators/RequiredValidator.js +0 -33
  187. package/validators/UnCheckedValidator.d.ts +0 -5
  188. package/validators/UnCheckedValidator.js +0 -32
  189. package/validators/ValidMultipleValidator.d.ts +0 -9
  190. package/validators/ValidMultipleValidator.js +0 -34
  191. package/validators/ValidValidator.d.ts +0 -6
  192. package/validators/ValidValidator.js +0 -33
  193. package/validators/ValidValidatorArray.d.ts +0 -7
  194. package/validators/ValidValidatorArray.js +0 -33
  195. package/validators/Validator.d.ts +0 -57
  196. package/validators/Validator.js +0 -242
  197. package/validators/ValidatorArray.d.ts +0 -17
  198. package/validators/ValidatorArray.js +0 -99
  199. package/validators/ValueEqualsValidator.d.ts +0 -6
  200. package/validators/ValueEqualsValidator.js +0 -33
  201. package/validators/ValueNotEqualsValidator.d.ts +0 -6
  202. package/validators/ValueNotEqualsValidator.js +0 -33
package/operators/DrIf.js DELETED
@@ -1,108 +0,0 @@
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
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
29
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
30
- return new (P || (P = Promise))(function (resolve, reject) {
31
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
32
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
33
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
34
- step((generator = generator.apply(thisArg, _arguments || [])).next());
35
- });
36
- };
37
- var __generator = (this && this.__generator) || function (thisArg, body) {
38
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
39
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
40
- function verb(n) { return function (v) { return step([n, v]); }; }
41
- function step(op) {
42
- if (f) throw new TypeError("Generator is already executing.");
43
- while (_) try {
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
- if (y = 0, t) op = [op[0] & 2, t.value];
46
- switch (op[0]) {
47
- case 0: case 1: t = op; break;
48
- case 4: _.label++; return { value: op[1], done: false };
49
- case 5: _.label++; y = op[1]; op = [0]; continue;
50
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
51
- default:
52
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
53
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
54
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
55
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
56
- if (t[2]) _.ops.pop();
57
- _.trys.pop(); continue;
58
- }
59
- op = body.call(thisArg, _);
60
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
61
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
62
- }
63
- };
64
- Object.defineProperty(exports, "__esModule", { value: true });
65
- exports.DrIf = void 0;
66
- var OperatorExecuterAttrRequire_1 = require("./OperatorExecuterAttrRequire");
67
- var ScriptUtils_1 = require("../utils/script/ScriptUtils");
68
- var RawSet_1 = require("../rawsets/RawSet");
69
- var OperatorExecuter_1 = require("./OperatorExecuter");
70
- var DrIf = /** @class */ (function (_super) {
71
- __extends(DrIf, _super);
72
- function DrIf(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
73
- var _this = this;
74
- source.operatorAround = undefined;
75
- _this = _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
76
- return _this;
77
- }
78
- DrIf.prototype.executeAttrRequire = function (attr) {
79
- var _a, _b, _c, _d;
80
- return __awaiter(this, void 0, void 0, function () {
81
- var itRandom, vars, newTemp, keepgoing, tempalte, rr;
82
- var _e;
83
- return __generator(this, function (_f) {
84
- itRandom = RawSet_1.RawSet.drItOtherEncoding(this.elementSource.element);
85
- vars = RawSet_1.RawSet.drVarEncoding(this.elementSource.element, (_a = this.elementSource.attrs.drVarOption) !== null && _a !== void 0 ? _a : '');
86
- newTemp = this.source.config.window.document.createElement('temp');
87
- keepgoing = ScriptUtils_1.ScriptUtils.eval("\n " + this.render.bindScript + "\n " + ((_b = this.elementSource.attrs.drBeforeOption) !== null && _b !== void 0 ? _b : '') + "\n if ($rawset.data === (" + attr + ")) {\n return false;\n }\n $rawset.data = " + attr + ";\n if($rawset.data) {\n const n = $element.cloneNode(true);\n Object.entries(this.__render.drAttr).filter(([k,v]) => k !== 'drIf' && v).forEach(([k, v]) => n.setAttribute(this.__render.drAttrsOriginName[k], v));\n var destIt = " + this.elementSource.attrs.drItOption + ";\n if (destIt !== undefined) {\n n.getAttributeNames().forEach(it => n.setAttribute(it, n.getAttribute(it).replace(/\\#it\\#/g, destIt)))\n n.innerHTML = n.innerHTML.replace(/\\#it\\#/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 }\n " + ((_c = this.elementSource.attrs.drAfterOption) !== null && _c !== void 0 ? _c : '') + ";\n return true;\n ", Object.assign(this.source.obj, {
88
- __render: Object.freeze(__assign({ fag: newTemp, drAttr: this.elementSource.attrs, drAttrsOriginName: RawSet_1.RawSet.drAttrsOriginName, drStripOption: this.elementSource.attrs.drStripOption }, this.render))
89
- }));
90
- // TODO: 뭐지?? 지워야되는거 아닌가?
91
- if (keepgoing === false) {
92
- return [2 /*return*/, OperatorExecuter_1.ExecuteState.STOP];
93
- }
94
- RawSet_1.RawSet.drVarDecoding(newTemp, vars);
95
- RawSet_1.RawSet.drItOtherDecoding(newTemp, itRandom);
96
- tempalte = this.source.config.window.document.createElement('template');
97
- tempalte.innerHTML = newTemp.innerHTML;
98
- this.returnContainer.fag.append(tempalte.content);
99
- rr = RawSet_1.RawSet.checkPointCreates(this.returnContainer.fag, this.source.obj, this.source.config);
100
- (_d = this.elementSource.element.parentNode) === null || _d === void 0 ? void 0 : _d.replaceChild(this.returnContainer.fag, this.elementSource.element);
101
- (_e = this.returnContainer.raws).push.apply(_e, rr);
102
- return [2 /*return*/, OperatorExecuter_1.ExecuteState.EXECUTE];
103
- });
104
- });
105
- };
106
- return DrIf;
107
- }(OperatorExecuterAttrRequire_1.OperatorExecuterAttrRequire));
108
- exports.DrIf = DrIf;
@@ -1,8 +0,0 @@
1
- import { OperatorExecuterAttrRequire } from './OperatorExecuterAttrRequire';
2
- import { RawSet } from '../rawsets/RawSet';
3
- import { Render } from '../rawsets/Render';
4
- import { AfterCallBack, ElementSource, ExecuteState, ReturnContainer, Source } from './OperatorExecuter';
5
- export declare class DrInnerHTML extends OperatorExecuterAttrRequire<string> {
6
- constructor(rawSet: RawSet, render: Render, returnContainer: ReturnContainer, elementSource: ElementSource, source: Source, afterCallBack: AfterCallBack);
7
- executeAttrRequire(attr: string): Promise<ExecuteState>;
8
- }
@@ -1,99 +0,0 @@
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
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
29
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
30
- return new (P || (P = Promise))(function (resolve, reject) {
31
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
32
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
33
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
34
- step((generator = generator.apply(thisArg, _arguments || [])).next());
35
- });
36
- };
37
- var __generator = (this && this.__generator) || function (thisArg, body) {
38
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
39
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
40
- function verb(n) { return function (v) { return step([n, v]); }; }
41
- function step(op) {
42
- if (f) throw new TypeError("Generator is already executing.");
43
- while (_) try {
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
- if (y = 0, t) op = [op[0] & 2, t.value];
46
- switch (op[0]) {
47
- case 0: case 1: t = op; break;
48
- case 4: _.label++; return { value: op[1], done: false };
49
- case 5: _.label++; y = op[1]; op = [0]; continue;
50
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
51
- default:
52
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
53
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
54
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
55
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
56
- if (t[2]) _.ops.pop();
57
- _.trys.pop(); continue;
58
- }
59
- op = body.call(thisArg, _);
60
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
61
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
62
- }
63
- };
64
- Object.defineProperty(exports, "__esModule", { value: true });
65
- exports.DrInnerHTML = void 0;
66
- var OperatorExecuterAttrRequire_1 = require("./OperatorExecuterAttrRequire");
67
- var ScriptUtils_1 = require("../utils/script/ScriptUtils");
68
- var RawSet_1 = require("../rawsets/RawSet");
69
- var OperatorExecuter_1 = require("./OperatorExecuter");
70
- var DrInnerHTML = /** @class */ (function (_super) {
71
- __extends(DrInnerHTML, _super);
72
- function DrInnerHTML(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
73
- return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
74
- }
75
- DrInnerHTML.prototype.executeAttrRequire = function (attr) {
76
- var _a, _b, _c;
77
- return __awaiter(this, void 0, void 0, function () {
78
- var newTemp, tempalte, rr;
79
- var _d;
80
- return __generator(this, function (_e) {
81
- newTemp = this.source.config.window.document.createElement('temp');
82
- ScriptUtils_1.ScriptUtils.eval("\n " + this.render.bindScript + "\n const n = $element.cloneNode(true);\n " + ((_a = this.elementSource.attrs.drBeforeOption) !== null && _a !== void 0 ? _a : '') + "\n n.innerHTML = " + attr + ";\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 " + ((_b = this.elementSource.attrs.drAfterOption) !== null && _b !== void 0 ? _b : '') + "\n ", Object.assign(this.source.obj, {
83
- __render: Object.freeze(__assign({ drStripOption: this.elementSource.attrs.drStripOption, fag: newTemp }, this.render
84
- // eslint-disable-next-line no-use-before-define
85
- ))
86
- }));
87
- tempalte = this.source.config.window.document.createElement('template');
88
- tempalte.innerHTML = newTemp.innerHTML;
89
- this.returnContainer.fag.append(tempalte.content);
90
- rr = RawSet_1.RawSet.checkPointCreates(this.returnContainer.fag, this.source.obj, this.source.config);
91
- (_c = this.elementSource.element.parentNode) === null || _c === void 0 ? void 0 : _c.replaceChild(this.returnContainer.fag, this.elementSource.element);
92
- (_d = this.returnContainer.raws).push.apply(_d, rr);
93
- return [2 /*return*/, OperatorExecuter_1.ExecuteState.EXECUTE];
94
- });
95
- });
96
- };
97
- return DrInnerHTML;
98
- }(OperatorExecuterAttrRequire_1.OperatorExecuterAttrRequire));
99
- exports.DrInnerHTML = DrInnerHTML;
@@ -1,8 +0,0 @@
1
- import { OperatorExecuterAttrRequire } from './OperatorExecuterAttrRequire';
2
- import { RawSet } from '../rawsets/RawSet';
3
- import { Render } from '../rawsets/Render';
4
- import { AfterCallBack, ElementSource, ExecuteState, ReturnContainer, Source } from './OperatorExecuter';
5
- export declare class DrInnerText extends OperatorExecuterAttrRequire<string> {
6
- constructor(rawSet: RawSet, render: Render, returnContainer: ReturnContainer, elementSource: ElementSource, source: Source, afterCallBack: AfterCallBack);
7
- executeAttrRequire(attr: string): Promise<ExecuteState>;
8
- }
@@ -1,97 +0,0 @@
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
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
29
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
30
- return new (P || (P = Promise))(function (resolve, reject) {
31
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
32
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
33
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
34
- step((generator = generator.apply(thisArg, _arguments || [])).next());
35
- });
36
- };
37
- var __generator = (this && this.__generator) || function (thisArg, body) {
38
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
39
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
40
- function verb(n) { return function (v) { return step([n, v]); }; }
41
- function step(op) {
42
- if (f) throw new TypeError("Generator is already executing.");
43
- while (_) try {
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
- if (y = 0, t) op = [op[0] & 2, t.value];
46
- switch (op[0]) {
47
- case 0: case 1: t = op; break;
48
- case 4: _.label++; return { value: op[1], done: false };
49
- case 5: _.label++; y = op[1]; op = [0]; continue;
50
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
51
- default:
52
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
53
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
54
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
55
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
56
- if (t[2]) _.ops.pop();
57
- _.trys.pop(); continue;
58
- }
59
- op = body.call(thisArg, _);
60
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
61
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
62
- }
63
- };
64
- Object.defineProperty(exports, "__esModule", { value: true });
65
- exports.DrInnerText = void 0;
66
- var OperatorExecuterAttrRequire_1 = require("./OperatorExecuterAttrRequire");
67
- var ScriptUtils_1 = require("../utils/script/ScriptUtils");
68
- var RawSet_1 = require("../rawsets/RawSet");
69
- var OperatorExecuter_1 = require("./OperatorExecuter");
70
- var DrInnerText = /** @class */ (function (_super) {
71
- __extends(DrInnerText, _super);
72
- function DrInnerText(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
73
- return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
74
- }
75
- DrInnerText.prototype.executeAttrRequire = function (attr) {
76
- var _a, _b, _c;
77
- return __awaiter(this, void 0, void 0, function () {
78
- var newTemp, tempalte, rr;
79
- var _d;
80
- return __generator(this, function (_e) {
81
- newTemp = this.source.config.window.document.createElement('temp');
82
- ScriptUtils_1.ScriptUtils.eval(" \n " + this.render.bindScript + "\n const n = $element.cloneNode(true); \n " + ((_a = this.elementSource.attrs.drBeforeOption) !== null && _a !== void 0 ? _a : '') + "\n n.innerText = " + attr + ";\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 " + ((_b = this.elementSource.attrs.drAfterOption) !== null && _b !== void 0 ? _b : '') + "\n ", Object.assign(this.source.obj, {
83
- __render: Object.freeze(__assign({ drStripOption: this.elementSource.attrs.drStripOption, fag: newTemp }, this.render))
84
- }));
85
- tempalte = this.source.config.window.document.createElement('template');
86
- tempalte.innerHTML = newTemp.innerHTML;
87
- this.returnContainer.fag.append(tempalte.content);
88
- rr = RawSet_1.RawSet.checkPointCreates(this.returnContainer.fag, this.source.obj, this.source.config);
89
- (_c = this.elementSource.element.parentNode) === null || _c === void 0 ? void 0 : _c.replaceChild(this.returnContainer.fag, this.elementSource.element);
90
- (_d = this.returnContainer.raws).push.apply(_d, rr);
91
- return [2 /*return*/, OperatorExecuter_1.ExecuteState.EXECUTE];
92
- });
93
- });
94
- };
95
- return DrInnerText;
96
- }(OperatorExecuterAttrRequire_1.OperatorExecuterAttrRequire));
97
- exports.DrInnerText = DrInnerText;
@@ -1,7 +0,0 @@
1
- import { AfterCallBack, ElementSource, ExecuteState, OperatorExecuter, ReturnContainer, Source } from './OperatorExecuter';
2
- import { RawSet } from '../rawsets/RawSet';
3
- import { Render } from '../rawsets/Render';
4
- export declare class DrPre extends OperatorExecuter<null> {
5
- constructor(rawSet: RawSet, render: Render, returnContainer: ReturnContainer, elementSource: ElementSource, source: Source, afterCallBack: AfterCallBack);
6
- execute(value: null): Promise<ExecuteState>;
7
- }
@@ -1,73 +0,0 @@
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
- return new (P || (P = Promise))(function (resolve, reject) {
20
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
- step((generator = generator.apply(thisArg, _arguments || [])).next());
24
- });
25
- };
26
- var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
- function verb(n) { return function (v) { return step([n, v]); }; }
30
- function step(op) {
31
- if (f) throw new TypeError("Generator is already executing.");
32
- while (_) try {
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
- if (y = 0, t) op = [op[0] & 2, t.value];
35
- switch (op[0]) {
36
- case 0: case 1: t = op; break;
37
- case 4: _.label++; return { value: op[1], done: false };
38
- case 5: _.label++; y = op[1]; op = [0]; continue;
39
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
- default:
41
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
- if (t[2]) _.ops.pop();
46
- _.trys.pop(); continue;
47
- }
48
- op = body.call(thisArg, _);
49
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
- }
52
- };
53
- Object.defineProperty(exports, "__esModule", { value: true });
54
- exports.DrPre = void 0;
55
- var OperatorExecuter_1 = require("./OperatorExecuter");
56
- var DrPre = /** @class */ (function (_super) {
57
- __extends(DrPre, _super);
58
- function DrPre(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
59
- var _this = this;
60
- source.operatorAround = undefined;
61
- _this = _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack) || this;
62
- return _this;
63
- }
64
- DrPre.prototype.execute = function (value) {
65
- return __awaiter(this, void 0, void 0, function () {
66
- return __generator(this, function (_a) {
67
- return [2 /*return*/, (value != null) ? OperatorExecuter_1.ExecuteState.EXECUTE : OperatorExecuter_1.ExecuteState.NO_EXECUTE];
68
- });
69
- });
70
- };
71
- return DrPre;
72
- }(OperatorExecuter_1.OperatorExecuter));
73
- exports.DrPre = DrPre;
@@ -1,8 +0,0 @@
1
- import { OperatorExecuterAttrRequire } from './OperatorExecuterAttrRequire';
2
- import { RawSet } from '../rawsets/RawSet';
3
- import { Render } from '../rawsets/Render';
4
- import { AfterCallBack, ElementSource, ExecuteState, ReturnContainer, Source } from './OperatorExecuter';
5
- export declare class DrRepeat extends OperatorExecuterAttrRequire<string> {
6
- constructor(rawSet: RawSet, render: Render, returnContainer: ReturnContainer, elementSource: ElementSource, source: Source, afterCallBack: AfterCallBack);
7
- executeAttrRequire(attr: string): Promise<ExecuteState>;
8
- }
@@ -1,105 +0,0 @@
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
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
29
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
30
- return new (P || (P = Promise))(function (resolve, reject) {
31
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
32
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
33
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
34
- step((generator = generator.apply(thisArg, _arguments || [])).next());
35
- });
36
- };
37
- var __generator = (this && this.__generator) || function (thisArg, body) {
38
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
39
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
40
- function verb(n) { return function (v) { return step([n, v]); }; }
41
- function step(op) {
42
- if (f) throw new TypeError("Generator is already executing.");
43
- while (_) try {
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
- if (y = 0, t) op = [op[0] & 2, t.value];
46
- switch (op[0]) {
47
- case 0: case 1: t = op; break;
48
- case 4: _.label++; return { value: op[1], done: false };
49
- case 5: _.label++; y = op[1]; op = [0]; continue;
50
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
51
- default:
52
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
53
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
54
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
55
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
56
- if (t[2]) _.ops.pop();
57
- _.trys.pop(); continue;
58
- }
59
- op = body.call(thisArg, _);
60
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
61
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
62
- }
63
- };
64
- Object.defineProperty(exports, "__esModule", { value: true });
65
- exports.DrRepeat = void 0;
66
- var OperatorExecuterAttrRequire_1 = require("./OperatorExecuterAttrRequire");
67
- var ScriptUtils_1 = require("../utils/script/ScriptUtils");
68
- var RawSet_1 = require("../rawsets/RawSet");
69
- var EventManager_1 = require("../events/EventManager");
70
- var OperatorExecuter_1 = require("./OperatorExecuter");
71
- var DrRepeat = /** @class */ (function (_super) {
72
- __extends(DrRepeat, _super);
73
- function DrRepeat(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
74
- var _this = this;
75
- source.operatorAround = undefined;
76
- _this = _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
77
- return _this;
78
- }
79
- DrRepeat.prototype.executeAttrRequire = function (attr) {
80
- var _a, _b, _c, _d;
81
- return __awaiter(this, void 0, void 0, function () {
82
- var itRandom, vars, newTemp, tempalte, rr;
83
- var _e;
84
- return __generator(this, function (_f) {
85
- itRandom = RawSet_1.RawSet.drItOtherEncoding(this.elementSource.element);
86
- vars = RawSet_1.RawSet.drVarEncoding(this.elementSource.element, (_a = this.elementSource.attrs.drVarOption) !== null && _a !== void 0 ? _a : '');
87
- newTemp = this.source.config.window.document.createElement('temp');
88
- ScriptUtils_1.ScriptUtils.eval("\n " + this.render.bindScript + "\n " + ((_b = this.elementSource.attrs.drBeforeOption) !== null && _b !== void 0 ? _b : '') + "\n var i = 0; \n const repeat = " + attr + ";\n const repeatStr = `" + attr + "`;\n let range = repeat;\n if (typeof repeat === 'number') {\n range = " + 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 " + ((_c = this.elementSource.attrs.drAfterOption) !== null && _c !== void 0 ? _c : '') + "\n ", Object.assign(this.source.obj, {
89
- __render: Object.freeze(__assign({ fag: newTemp, drStripOption: this.elementSource.attrs.drStripOption }, this.render))
90
- }));
91
- RawSet_1.RawSet.drVarDecoding(newTemp, vars);
92
- RawSet_1.RawSet.drItOtherDecoding(newTemp, itRandom);
93
- tempalte = this.source.config.window.document.createElement('template');
94
- tempalte.innerHTML = newTemp.innerHTML;
95
- this.returnContainer.fag.append(tempalte.content);
96
- rr = RawSet_1.RawSet.checkPointCreates(this.returnContainer.fag, this.source.obj, this.source.config);
97
- (_d = this.elementSource.element.parentNode) === null || _d === void 0 ? void 0 : _d.replaceChild(this.returnContainer.fag, this.elementSource.element);
98
- (_e = this.returnContainer.raws).push.apply(_e, rr);
99
- return [2 /*return*/, OperatorExecuter_1.ExecuteState.EXECUTE];
100
- });
101
- });
102
- };
103
- return DrRepeat;
104
- }(OperatorExecuterAttrRequire_1.OperatorExecuterAttrRequire));
105
- exports.DrRepeat = DrRepeat;
@@ -1,7 +0,0 @@
1
- import { RawSet } from '../rawsets/RawSet';
2
- import { AfterCallBack, ElementSource, ExecuteState, OperatorExecuter, ReturnContainer, Source } from './OperatorExecuter';
3
- import { Render } from '../rawsets/Render';
4
- export declare class DrTargetAttr extends OperatorExecuter<void> {
5
- constructor(rawSet: RawSet, render: Render, returnContainer: ReturnContainer, elementSource: ElementSource, source: Source, afterCallBack: AfterCallBack);
6
- execute(): Promise<ExecuteState>;
7
- }
@@ -1,98 +0,0 @@
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
18
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
19
- return new (P || (P = Promise))(function (resolve, reject) {
20
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
21
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
22
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
23
- step((generator = generator.apply(thisArg, _arguments || [])).next());
24
- });
25
- };
26
- var __generator = (this && this.__generator) || function (thisArg, body) {
27
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
28
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
29
- function verb(n) { return function (v) { return step([n, v]); }; }
30
- function step(op) {
31
- if (f) throw new TypeError("Generator is already executing.");
32
- while (_) try {
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
- if (y = 0, t) op = [op[0] & 2, t.value];
35
- switch (op[0]) {
36
- case 0: case 1: t = op; break;
37
- case 4: _.label++; return { value: op[1], done: false };
38
- case 5: _.label++; y = op[1]; op = [0]; continue;
39
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
40
- default:
41
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
42
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
43
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
44
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
45
- if (t[2]) _.ops.pop();
46
- _.trys.pop(); continue;
47
- }
48
- op = body.call(thisArg, _);
49
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
50
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
51
- }
52
- };
53
- Object.defineProperty(exports, "__esModule", { value: true });
54
- exports.DrTargetAttr = void 0;
55
- var RawSet_1 = require("../rawsets/RawSet");
56
- var OperatorExecuter_1 = require("./OperatorExecuter");
57
- var DrTargetAttr = /** @class */ (function (_super) {
58
- __extends(DrTargetAttr, _super);
59
- function DrTargetAttr(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
60
- var _this = this;
61
- source.operatorAround = undefined;
62
- _this = _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
63
- return _this;
64
- }
65
- DrTargetAttr.prototype.execute = function () {
66
- var _a, _b, _c, _d;
67
- return __awaiter(this, void 0, void 0, function () {
68
- var attributeNames, targetAttr, attrName, attrValue, documentFragment, rr;
69
- var _e;
70
- return __generator(this, function (_f) {
71
- attributeNames = this.elementSource.element.getAttributeNames();
72
- targetAttr = (_b = (_a = this.source.config) === null || _a === void 0 ? void 0 : _a.targetAttrs) === null || _b === void 0 ? void 0 : _b.find(function (it) { return attributeNames.includes(it.name); });
73
- if (targetAttr) {
74
- attrName = targetAttr.name;
75
- attrValue = this.rawSet.getAttributeAndDelete(this.elementSource.element, attrName);
76
- if (attrValue && attrName && (!this.elementSource.attrs.drForOf && !this.elementSource.attrs.drFor && !this.elementSource.attrs.drRepeat)) {
77
- documentFragment = targetAttr.callBack(this.elementSource.element, attrValue, this.source.obj, this.rawSet);
78
- if (documentFragment) {
79
- rr = RawSet_1.RawSet.checkPointCreates(documentFragment, this.source.obj, this.source.config);
80
- (_c = this.elementSource.element.parentNode) === null || _c === void 0 ? void 0 : _c.replaceChild(documentFragment, this.elementSource.element);
81
- (_e = this.returnContainer.raws).push.apply(_e, rr);
82
- this.afterCallBack.onAttrInitCallBacks.push({
83
- attrName: attrName,
84
- attrValue: attrValue,
85
- obj: this.source.obj
86
- });
87
- (_d = targetAttr === null || targetAttr === void 0 ? void 0 : targetAttr.complete) === null || _d === void 0 ? void 0 : _d.call(targetAttr, this.elementSource.element, attrValue, this.source.obj, this.rawSet);
88
- }
89
- }
90
- return [2 /*return*/, OperatorExecuter_1.ExecuteState.EXECUTE];
91
- }
92
- return [2 /*return*/, OperatorExecuter_1.ExecuteState.NO_EXECUTE];
93
- });
94
- });
95
- };
96
- return DrTargetAttr;
97
- }(OperatorExecuter_1.OperatorExecuter));
98
- exports.DrTargetAttr = DrTargetAttr;