@dooboostore/dom-render 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 (230) hide show
  1. package/DomRender.d.ts +24 -0
  2. package/DomRender.js +115 -0
  3. package/DomRenderProxy.d.ts +38 -0
  4. package/DomRenderProxy.js +586 -0
  5. package/README.MD +938 -0
  6. package/components/ComponentBase.d.ts +41 -0
  7. package/components/ComponentBase.js +210 -0
  8. package/components/ComponentSet.d.ts +22 -0
  9. package/components/ComponentSet.js +23 -0
  10. package/components/appender/Appender.d.ts +23 -0
  11. package/components/appender/Appender.js +59 -0
  12. package/components/checkbox/CheckBox.d.ts +47 -0
  13. package/components/checkbox/CheckBox.js +118 -0
  14. package/components/choose/Choose.d.ts +39 -0
  15. package/components/choose/Choose.js +110 -0
  16. package/components/details/Details.d.ts +57 -0
  17. package/components/details/Details.js +199 -0
  18. package/components/dialog/Dialog.d.ts +1 -0
  19. package/components/dialog/Dialog.js +85 -0
  20. package/components/dialog/example/ImageEditorDialog.d.ts +1 -0
  21. package/components/dialog/example/ImageEditorDialog.js +116 -0
  22. package/components/forOf/ForOf.d.ts +18 -0
  23. package/components/forOf/ForOf.js +32 -0
  24. package/components/if/If.d.ts +21 -0
  25. package/components/if/If.js +40 -0
  26. package/components/index.d.ts +27 -0
  27. package/components/index.js +13 -0
  28. package/components/input/Input.d.ts +34 -0
  29. package/components/input/Input.js +86 -0
  30. package/components/promise/PromiseSwitch.d.ts +55 -0
  31. package/components/promise/PromiseSwitch.js +181 -0
  32. package/components/radio/Radio.d.ts +45 -0
  33. package/components/radio/Radio.js +123 -0
  34. package/components/select/Select.d.ts +23 -0
  35. package/components/select/Select.js +52 -0
  36. package/components/this/This.d.ts +24 -0
  37. package/components/this/This.js +62 -0
  38. package/components/timer/Timer.d.ts +26 -0
  39. package/components/timer/Timer.js +102 -0
  40. package/configs/Config.d.ts +34 -0
  41. package/configs/Config.js +2 -0
  42. package/configs/TargetAttr.d.ts +7 -0
  43. package/configs/TargetAttr.js +2 -0
  44. package/configs/TargetElement.d.ts +16 -0
  45. package/configs/TargetElement.js +2 -0
  46. package/css/parse/index.d.ts +49 -0
  47. package/css/parse/index.js +498 -0
  48. package/css/stringify/compiler.d.ts +34 -0
  49. package/css/stringify/compiler.js +36 -0
  50. package/css/stringify/compress.d.ts +104 -0
  51. package/css/stringify/compress.js +147 -0
  52. package/css/stringify/identity.d.ts +109 -0
  53. package/css/stringify/identity.js +183 -0
  54. package/css/stringify/index.d.ts +24 -0
  55. package/css/stringify/index.js +27 -0
  56. package/css/stringify/types.d.ts +15 -0
  57. package/css/stringify/types.js +2 -0
  58. package/css/types.d.ts +10 -0
  59. package/css/types.js +2 -0
  60. package/decorators/DomRenderNoProxy.d.ts +4 -0
  61. package/decorators/DomRenderNoProxy.js +15 -0
  62. package/events/EventManager.d.ts +68 -0
  63. package/events/EventManager.js +477 -0
  64. package/index.d.ts +2 -0
  65. package/index.js +2 -0
  66. package/iterators/Range.d.ts +24 -0
  67. package/iterators/Range.js +70 -0
  68. package/lifecycle/OnBeforeReturnGet.d.ts +4 -0
  69. package/lifecycle/OnBeforeReturnGet.js +2 -0
  70. package/lifecycle/OnBeforeReturnSet.d.ts +5 -0
  71. package/lifecycle/OnBeforeReturnSet.js +4 -0
  72. package/lifecycle/OnChangeAttrRender.d.ts +9 -0
  73. package/lifecycle/OnChangeAttrRender.js +4 -0
  74. package/lifecycle/OnChildRenderedByProperty.d.ts +5 -0
  75. package/lifecycle/OnChildRenderedByProperty.js +4 -0
  76. package/lifecycle/OnCreateRender.d.ts +5 -0
  77. package/lifecycle/OnCreateRender.js +4 -0
  78. package/lifecycle/OnCreateRenderData.d.ts +10 -0
  79. package/lifecycle/OnCreateRenderData.js +4 -0
  80. package/lifecycle/OnCreateRendered.d.ts +8 -0
  81. package/lifecycle/OnCreateRendered.js +4 -0
  82. package/lifecycle/OnCreatedThisChild.d.ts +6 -0
  83. package/lifecycle/OnCreatedThisChild.js +4 -0
  84. package/lifecycle/OnDestroyRender.d.ts +9 -0
  85. package/lifecycle/OnDestroyRender.js +4 -0
  86. package/lifecycle/OnInitRender.d.ts +6 -0
  87. package/lifecycle/OnInitRender.js +4 -0
  88. package/lifecycle/OnProxyDomRender.d.ts +5 -0
  89. package/lifecycle/OnProxyDomRender.js +2 -0
  90. package/lifecycle/dr-this/OnDrThisBind.d.ts +5 -0
  91. package/lifecycle/dr-this/OnDrThisBind.js +4 -0
  92. package/lifecycle/dr-this/OnDrThisUnBind.d.ts +5 -0
  93. package/lifecycle/dr-this/OnDrThisUnBind.js +4 -0
  94. package/managers/RenderManager.d.ts +2 -0
  95. package/managers/RenderManager.js +12 -0
  96. package/messenger/DefaultMessenger.d.ts +4 -0
  97. package/messenger/DefaultMessenger.js +4 -0
  98. package/messenger/Messenger.d.ts +79 -0
  99. package/messenger/Messenger.js +185 -0
  100. package/operators/Appender.d.ts +15 -0
  101. package/operators/Appender.js +90 -0
  102. package/operators/Dr.d.ts +9 -0
  103. package/operators/Dr.js +53 -0
  104. package/operators/DrAppender.d.ts +9 -0
  105. package/operators/DrAppender.js +69 -0
  106. package/operators/DrFor.d.ts +9 -0
  107. package/operators/DrFor.js +58 -0
  108. package/operators/DrForOf.d.ts +9 -0
  109. package/operators/DrForOf.js +120 -0
  110. package/operators/DrForm.d.ts +9 -0
  111. package/operators/DrForm.js +79 -0
  112. package/operators/DrIf.d.ts +9 -0
  113. package/operators/DrIf.js +70 -0
  114. package/operators/DrInnerHTML.d.ts +9 -0
  115. package/operators/DrInnerHTML.js +48 -0
  116. package/operators/DrInnerText.d.ts +9 -0
  117. package/operators/DrInnerText.js +46 -0
  118. package/operators/DrPre.d.ts +8 -0
  119. package/operators/DrPre.js +22 -0
  120. package/operators/DrRepeat.d.ts +9 -0
  121. package/operators/DrRepeat.js +70 -0
  122. package/operators/DrStripElement.d.ts +9 -0
  123. package/operators/DrStripElement.js +50 -0
  124. package/operators/DrTargetAttr.d.ts +8 -0
  125. package/operators/DrTargetAttr.js +45 -0
  126. package/operators/DrTargetElement.d.ts +13 -0
  127. package/operators/DrTargetElement.js +91 -0
  128. package/operators/DrTargetElementIsElement.d.ts +13 -0
  129. package/operators/DrTargetElementIsElement.js +79 -0
  130. package/operators/DrThis.d.ts +7 -0
  131. package/operators/DrThis.js +72 -0
  132. package/operators/DrThisProperty.d.ts +11 -0
  133. package/operators/DrThisProperty.js +93 -0
  134. package/operators/OperatorExecuter.d.ts +50 -0
  135. package/operators/OperatorExecuter.js +50 -0
  136. package/operators/OperatorExecuterAttrRequire.d.ts +9 -0
  137. package/operators/OperatorExecuterAttrRequire.js +25 -0
  138. package/package.json +70 -0
  139. package/rawsets/AttrInitCallBack.d.ts +6 -0
  140. package/rawsets/AttrInitCallBack.js +2 -0
  141. package/rawsets/Attrs.d.ts +27 -0
  142. package/rawsets/Attrs.js +2 -0
  143. package/rawsets/CreatorMetaData.d.ts +20 -0
  144. package/rawsets/CreatorMetaData.js +2 -0
  145. package/rawsets/DestroyOptionType.d.ts +5 -0
  146. package/rawsets/DestroyOptionType.js +6 -0
  147. package/rawsets/ElementInitCallBack.d.ts +9 -0
  148. package/rawsets/ElementInitCallBack.js +2 -0
  149. package/rawsets/RawSet.d.ts +180 -0
  150. package/rawsets/RawSet.js +1450 -0
  151. package/rawsets/RawSetOperatorType.d.ts +4 -0
  152. package/rawsets/RawSetOperatorType.js +5 -0
  153. package/rawsets/RawSetType.d.ts +8 -0
  154. package/rawsets/RawSetType.js +9 -0
  155. package/rawsets/Render.d.ts +27 -0
  156. package/rawsets/Render.js +2 -0
  157. package/routers/HashRouter.d.ts +24 -0
  158. package/routers/HashRouter.js +86 -0
  159. package/routers/PathRouter.d.ts +23 -0
  160. package/routers/PathRouter.js +73 -0
  161. package/routers/Router.d.ts +68 -0
  162. package/routers/Router.js +132 -0
  163. package/types/Types.d.ts +12 -0
  164. package/types/Types.js +26 -0
  165. package/validators/AllCheckedValidatorArray.d.ts +7 -0
  166. package/validators/AllCheckedValidatorArray.js +11 -0
  167. package/validators/AllUnCheckedValidatorArray.d.ts +7 -0
  168. package/validators/AllUnCheckedValidatorArray.js +11 -0
  169. package/validators/CheckedValidator.d.ts +6 -0
  170. package/validators/CheckedValidator.js +11 -0
  171. package/validators/CountEqualsCheckedValidatorArray.d.ts +8 -0
  172. package/validators/CountEqualsCheckedValidatorArray.js +12 -0
  173. package/validators/CountEqualsUnCheckedValidatorArray.d.ts +8 -0
  174. package/validators/CountEqualsUnCheckedValidatorArray.js +12 -0
  175. package/validators/CountGreaterThanCheckedValidatorArray.d.ts +8 -0
  176. package/validators/CountGreaterThanCheckedValidatorArray.js +12 -0
  177. package/validators/CountGreaterThanEqualsCheckedValidatorArray.d.ts +8 -0
  178. package/validators/CountGreaterThanEqualsCheckedValidatorArray.js +12 -0
  179. package/validators/CountGreaterThanEqualsUnCheckedValidatorArray.d.ts +8 -0
  180. package/validators/CountGreaterThanEqualsUnCheckedValidatorArray.js +12 -0
  181. package/validators/CountGreaterThanUnCheckedValidatorArray.d.ts +8 -0
  182. package/validators/CountGreaterThanUnCheckedValidatorArray.js +12 -0
  183. package/validators/CountLessThanCheckedValidatorArray.d.ts +8 -0
  184. package/validators/CountLessThanCheckedValidatorArray.js +12 -0
  185. package/validators/CountLessThanEqualsCheckedValidatorArray.d.ts +8 -0
  186. package/validators/CountLessThanEqualsCheckedValidatorArray.js +12 -0
  187. package/validators/CountLessThanEqualsUnCheckedValidatorArray.d.ts +8 -0
  188. package/validators/CountLessThanEqualsUnCheckedValidatorArray.js +12 -0
  189. package/validators/CountLessThanUnCheckedValidatorArray.d.ts +8 -0
  190. package/validators/CountLessThanUnCheckedValidatorArray.js +12 -0
  191. package/validators/CountUnCheckedValidatorArray.d.ts +8 -0
  192. package/validators/CountUnCheckedValidatorArray.js +12 -0
  193. package/validators/EmptyValidator.d.ts +6 -0
  194. package/validators/EmptyValidator.js +12 -0
  195. package/validators/ExcludeCheckedValidatorArray.d.ts +9 -0
  196. package/validators/ExcludeCheckedValidatorArray.js +17 -0
  197. package/validators/FormValidator.d.ts +8 -0
  198. package/validators/FormValidator.js +16 -0
  199. package/validators/IncludeCheckedValidatorArray.d.ts +9 -0
  200. package/validators/IncludeCheckedValidatorArray.js +17 -0
  201. package/validators/MultipleValidator.d.ts +9 -0
  202. package/validators/MultipleValidator.js +25 -0
  203. package/validators/NonPassValidator.d.ts +6 -0
  204. package/validators/NonPassValidator.js +10 -0
  205. package/validators/NotEmptyValidator.d.ts +6 -0
  206. package/validators/NotEmptyValidator.js +13 -0
  207. package/validators/NotRegExpTestValidator.d.ts +7 -0
  208. package/validators/NotRegExpTestValidator.js +20 -0
  209. package/validators/PassValidator.d.ts +6 -0
  210. package/validators/PassValidator.js +10 -0
  211. package/validators/RegExpTestValidator.d.ts +7 -0
  212. package/validators/RegExpTestValidator.js +21 -0
  213. package/validators/RequiredValidator.d.ts +6 -0
  214. package/validators/RequiredValidator.js +12 -0
  215. package/validators/UnCheckedValidator.d.ts +6 -0
  216. package/validators/UnCheckedValidator.js +11 -0
  217. package/validators/ValidMultipleValidator.d.ts +10 -0
  218. package/validators/ValidMultipleValidator.js +12 -0
  219. package/validators/ValidValidator.d.ts +7 -0
  220. package/validators/ValidValidator.js +11 -0
  221. package/validators/ValidValidatorArray.d.ts +8 -0
  222. package/validators/ValidValidatorArray.js +11 -0
  223. package/validators/Validator.d.ts +58 -0
  224. package/validators/Validator.js +203 -0
  225. package/validators/ValidatorArray.d.ts +18 -0
  226. package/validators/ValidatorArray.js +77 -0
  227. package/validators/ValueEqualsValidator.d.ts +7 -0
  228. package/validators/ValueEqualsValidator.js +11 -0
  229. package/validators/ValueNotEqualsValidator.d.ts +7 -0
  230. package/validators/ValueNotEqualsValidator.js +11 -0
@@ -0,0 +1,58 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { OperatorExecuterAttrRequire } from './OperatorExecuterAttrRequire';
11
+ import { ScriptUtils } from '@dooboostore/core-web/script/ScriptUtils';
12
+ import { RawSet } from '../rawsets/RawSet';
13
+ import { ExecuteState } from './OperatorExecuter';
14
+ export class DrFor extends OperatorExecuterAttrRequire {
15
+ constructor(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
16
+ source.operatorAround = undefined;
17
+ super(rawSet, render, returnContainer, elementSource, source, afterCallBack, false);
18
+ }
19
+ executeAttrRequire(attr) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ var _a, _b, _c, _d;
22
+ const itRandom = RawSet.drItOtherEncoding(this.elementSource.element);
23
+ const vars = RawSet.drVarEncoding(this.elementSource.element, (_a = this.elementSource.attrs.drVarOption) !== null && _a !== void 0 ? _a : '');
24
+ const newTemp = this.source.config.window.document.createElement('temp');
25
+ // console.log('-----asdad',attr , this.elementSource.attrs.drItOption);
26
+ ScriptUtils.eval(`
27
+ ${this.render.bindScript}
28
+ ${(_b = this.elementSource.attrs.drBeforeOption) !== null && _b !== void 0 ? _b : ''}
29
+ for(${attr}) {
30
+ const n = this.__render.element.cloneNode(true);
31
+ var destIt = ${this.elementSource.attrs.drItOption};
32
+ if (destIt !== undefined) {
33
+ n.getAttributeNames().forEach(it => n.setAttribute(it, n.getAttribute(it).replace(/\\#it\\#/g, destIt).replace(/\\#nearForIt\\#/g, destIt).replace(/\\#nearForIndex\\#/g, destIt)))
34
+ n.innerHTML = n.innerHTML.replace(/\\#it\\#/g, destIt).replace(/\\#index\\#/g, destIt);
35
+ }
36
+ if (this.__render.drStripOption === 'true') {
37
+ Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));
38
+ } else {
39
+ this.__render.fag.append(n);
40
+ }
41
+ }
42
+ ${(_c = this.elementSource.attrs.drAfterOption) !== null && _c !== void 0 ? _c : ''}
43
+ `, Object.assign(this.source.obj, {
44
+ __render: Object.freeze(Object.assign({ fag: newTemp, drStripOption: this.elementSource.attrs.drStripOption }, this.render))
45
+ }));
46
+ RawSet.drVarDecoding(newTemp, vars);
47
+ RawSet.drItOtherDecoding(newTemp, itRandom);
48
+ const tempalte = this.source.config.window.document.createElement('template');
49
+ tempalte.innerHTML = newTemp.innerHTML;
50
+ this.returnContainer.fag.append(tempalte.content);
51
+ const rr = RawSet.checkPointCreates(this.returnContainer.fag, this.source.obj, this.source.config);
52
+ (_d = this.elementSource.element.parentNode) === null || _d === void 0 ? void 0 : _d.replaceChild(this.returnContainer.fag, this.elementSource.element);
53
+ this.returnContainer.raws.push(...rr);
54
+ return ExecuteState.EXECUTE;
55
+ });
56
+ }
57
+ }
58
+ //# sourceMappingURL=DrFor.js.map
@@ -0,0 +1,9 @@
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 DrForOf extends OperatorExecuterAttrRequire<string> {
6
+ constructor(rawSet: RawSet, render: Render, returnContainer: ReturnContainer, elementSource: ElementSource, source: Source, afterCallBack: AfterCallBack);
7
+ executeAttrRequire(attr: string): Promise<ExecuteState>;
8
+ }
9
+ //# sourceMappingURL=DrForOf.d.ts.map
@@ -0,0 +1,120 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { OperatorExecuterAttrRequire } from './OperatorExecuterAttrRequire';
11
+ import { ScriptUtils } from '@dooboostore/core-web/script/ScriptUtils';
12
+ import { RawSet } from '../rawsets/RawSet';
13
+ import { ExecuteState } from './OperatorExecuter';
14
+ export class DrForOf extends OperatorExecuterAttrRequire {
15
+ constructor(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
16
+ source.operatorAround = undefined;
17
+ super(rawSet, render, returnContainer, elementSource, source, afterCallBack, false);
18
+ }
19
+ executeAttrRequire(attr) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ var _a, _b, _c, _d;
22
+ // console.log('타지도않냐?')
23
+ const itRandom = RawSet.drItOtherEncoding(this.elementSource.element, 'DrForOf');
24
+ const vars = RawSet.drVarEncoding(this.elementSource.element, (_a = this.elementSource.attrs.drVarOption) !== null && _a !== void 0 ? _a : '');
25
+ const newTemp = this.source.config.window.document.createElement('temp');
26
+ // console.log('----!', this.elementSource.attrs)
27
+ // ScriptUtils.evalReturn()
28
+ ScriptUtils.eval(`
29
+ ${this.render.bindScript}
30
+ ${(_b = this.elementSource.attrs.drBeforeOption) !== null && _b !== void 0 ? _b : ''}
31
+ var i = -1;
32
+ const forOf = ${attr};
33
+ const forOfStr = \`${attr}\`.trim();
34
+ // console.log('forOf---',forOf);
35
+ if (forOf) {
36
+ for(const it of forOf) {
37
+ i++;
38
+ var destIt = it;
39
+ if (/\\[(.*,?)\\],/g.test(forOfStr)) {
40
+ if (typeof it === 'string') {
41
+ destIt = it;
42
+ } else {
43
+ destIt = forOfStr.substring(1, forOfStr.length-1).split(',')[i];
44
+ }
45
+ } else if (forOf.isRange) {
46
+ destIt = it;
47
+ } else {
48
+ destIt = forOfStr + '[' + i +']'
49
+ }
50
+ const n = this.__render.element.cloneNode(true);
51
+ // console.log('zzzzzzzzzzz', n.getAttribute('${RawSet.DR_DETECT_ATTR_OPTIONNAME}'));
52
+ Object.entries(this.__render.drAttr).filter(([k,v]) => k !== 'drForOf' && k !== 'drNextOption' && v).forEach(([k, v]) => n.setAttribute(this.__render.drAttrsOriginName[k], v));
53
+ // console.log('---------'+destIt,n, Array.from(n.getAttributeNames()).map(it=>({name:it,attr: n.getAttribute(it)})));
54
+ // console.log('---------destItdestIt',destIt);
55
+ n.getAttributeNames().forEach(it => n.setAttribute(it, n.getAttribute(it).replace(/\\#it\\#/g, destIt).replace(/\\#nearForOfIt\\#/g, destIt).replace(/\\#it\\#/g, destIt).replace(/\\#nearForOfIndex\\#/g, i)))
56
+ const drOptionAttr = n.getAttribute('${RawSet.DR_DETECT_ATTR_OPTIONNAME}');
57
+ if (drOptionAttr) {
58
+ const drOptionAttrResult = $scriptUtils.evalReturn(drOptionAttr, this);
59
+ Array.from(Object.entries(drOptionAttrResult??{})).forEach(([k,v])=>{
60
+ if (v === null) {
61
+ n.removeAttribute(k);
62
+ } else {
63
+ n.setAttribute(k,v);
64
+ }
65
+ })
66
+ }
67
+
68
+ const drOptionFilter = n.getAttribute('${RawSet.DR_DETECT_FILTER_OPTIONNAME}');
69
+ if (drOptionFilter) {
70
+ const drOptionFilterResult = $scriptUtils.evalReturn(drOptionFilter, this);
71
+ // console.log('---drforof----', drOptionFilter, drOptionFilterResult)
72
+ if (!drOptionFilterResult) {
73
+ continue;
74
+ }
75
+ }
76
+
77
+ n.innerHTML = n.innerHTML.replace(/\\#it\\#/g, destIt).replace(/\\#index\\#/g, i);
78
+ // console.log('!@@@@', n.innerHTML);
79
+ // DR_THIS_OPTIONNAME 는 제거한다 꼬인다. strip 할때 막 꼬여버린다.
80
+ // const drOptionThis = n.getAttribute('${RawSet.DR_THIS_OPTIONNAME}');
81
+ // if (drOptionThis) {
82
+ // n.setAttribute('${RawSet.DR_THIS_NAME}', drOptionThis)
83
+ // }
84
+ if (this.__render.drStripOption === 'true') {
85
+ Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));
86
+ } else {
87
+ this.__render.fag.append(n);
88
+ }
89
+
90
+ }
91
+
92
+ if('${this.elementSource.attrs.drNextOption}' !== 'null') {
93
+ const n = this.__render.element.cloneNode(true);
94
+ Object.entries(this.__render.drAttr).filter(([k,v]) => k !== 'drForOf' && k !== 'drNextOption' && v).forEach(([k, v]) => n.setAttribute(this.__render.drAttrsOriginName[k], v));
95
+ const [name, idx] = '${this.elementSource.attrs.drNextOption}'.split(',');
96
+ n.setAttribute('${RawSet.DR_FOR_OF_NAME}', name + '[' + idx + ']');
97
+ n.setAttribute('${RawSet.DR_NEXT_OPTIONNAME}', name + ',' + (Number(idx) + 1));
98
+ this.__render.fag.append(n);
99
+ }
100
+ }
101
+ ${(_c = this.elementSource.attrs.drAfterOption) !== null && _c !== void 0 ? _c : ''}
102
+ `, Object.assign(this.source.obj, {
103
+ __render: Object.freeze(Object.assign({ drStripOption: this.elementSource.attrs.drStripOption, drAttr: this.elementSource.attrs, drAttrsOriginName: RawSet.drAttrsOriginName, fag: newTemp }, this.render
104
+ // eslint-disable-next-line no-use-before-define
105
+ ))
106
+ }));
107
+ RawSet.drVarDecoding(newTemp, vars);
108
+ RawSet.drItOtherDecoding(newTemp, itRandom);
109
+ const tempalte = this.source.config.window.document.createElement('template');
110
+ tempalte.innerHTML = newTemp.innerHTML;
111
+ this.returnContainer.fag.append(tempalte.content);
112
+ const rr = RawSet.checkPointCreates(this.returnContainer.fag, this.source.obj, this.source.config);
113
+ (_d = this.elementSource.element.parentNode) === null || _d === void 0 ? void 0 : _d.replaceChild(this.returnContainer.fag, this.elementSource.element);
114
+ // const rrr = rr.flatMap(it => it.render(obj, config));// .flat();
115
+ this.returnContainer.raws.push(...rr);
116
+ return ExecuteState.EXECUTE;
117
+ });
118
+ }
119
+ }
120
+ //# sourceMappingURL=DrForOf.js.map
@@ -0,0 +1,9 @@
1
+ import { RawSet } from '../rawsets/RawSet';
2
+ import { Render } from '../rawsets/Render';
3
+ import { OperatorExecuterAttrRequire } from './OperatorExecuterAttrRequire';
4
+ import { AfterCallBack, ElementSource, ExecuteState, ReturnContainer, Source } from './OperatorExecuter';
5
+ export declare class DrForm extends OperatorExecuterAttrRequire<string> {
6
+ constructor(rawSet: RawSet, render: Render, returnContainer: ReturnContainer, elementSource: ElementSource, source: Source, afterCallBack: AfterCallBack);
7
+ executeAttrRequire(attr: string): Promise<ExecuteState>;
8
+ }
9
+ //# sourceMappingURL=DrForm.d.ts.map
@@ -0,0 +1,79 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { ScriptUtils } from '@dooboostore/core-web/script/ScriptUtils';
11
+ import { RawSet } from '../rawsets/RawSet';
12
+ import { Validator } from '../validators/Validator';
13
+ import { EventManager } from '../events/EventManager';
14
+ import { ValidatorArray } from '../validators/ValidatorArray';
15
+ import { OperatorExecuterAttrRequire } from './OperatorExecuterAttrRequire';
16
+ import { ExecuteState } from './OperatorExecuter';
17
+ export class DrForm extends OperatorExecuterAttrRequire {
18
+ constructor(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
19
+ super(rawSet, render, returnContainer, elementSource, source, afterCallBack, false);
20
+ }
21
+ executeAttrRequire(attr) {
22
+ return __awaiter(this, void 0, void 0, function* () {
23
+ var _a;
24
+ RawSet.drFormOtherMoveAttr(this.elementSource.element, 'name', 'temp-name', this.source.config);
25
+ const data = ScriptUtils.evalReturn(`${attr}`, this.source.obj);
26
+ const childs = Array.from(this.elementSource.element.querySelectorAll('[name]'));
27
+ const fromName = ScriptUtils.evalReturn((_a = this.elementSource.element.getAttribute(`${RawSet.DR_FORM_NAME}:name`)) !== null && _a !== void 0 ? _a : '', this.source.obj);
28
+ const thisName = fromName !== null && fromName !== void 0 ? fromName : this.elementSource.element.getAttribute('name');
29
+ // // 자기자신이 Input 대상일때
30
+ if (childs.length <= 0 && thisName) {
31
+ childs.push(this.elementSource.element);
32
+ }
33
+ else {
34
+ if (data instanceof Validator) {
35
+ data.setTarget(this.elementSource.element);
36
+ }
37
+ }
38
+ childs.forEach(it => {
39
+ var _a, _b, _c, _d, _e;
40
+ const eventName = (_a = it.getAttribute(`${RawSet.DR_FORM_NAME}:event`)) !== null && _a !== void 0 ? _a : 'change';
41
+ const validatorName = it.getAttribute(`${RawSet.DR_FORM_NAME}:validator`);
42
+ const attrEventName = EventManager.attrPrefix + 'event-' + eventName;
43
+ let varpath = (_c = ScriptUtils.evalReturn((_b = this.elementSource.element.getAttribute(`${RawSet.DR_FORM_NAME}:name`)) !== null && _b !== void 0 ? _b : '', this.source.obj)) !== null && _c !== void 0 ? _c : it.getAttribute('name');
44
+ if (varpath != null) {
45
+ if (validatorName) {
46
+ ScriptUtils.eval(`
47
+ ${this.render.bindScript}
48
+ const validator = typeof ${validatorName} ==='function' ? new ${validatorName}() : ${validatorName};
49
+ ${attr}['${varpath}'] = validator;
50
+ `, Object.assign(this.source.obj, {
51
+ __render: Object.freeze(Object.assign({ drStripOption: this.elementSource.attrs.drStripOption }, this.render))
52
+ }));
53
+ }
54
+ varpath = `${attr}['${varpath}']`;
55
+ const data = ScriptUtils.evalReturn(`${varpath}`, this.source.obj);
56
+ if (data instanceof ValidatorArray) {
57
+ it.setAttribute(attrEventName, `${varpath}.setArrayValue($target, $target.value, $event); ${(_d = it.getAttribute(attrEventName)) !== null && _d !== void 0 ? _d : ''};`);
58
+ data.addValidator(it.value, it);
59
+ }
60
+ else if (data instanceof Validator) {
61
+ // varpath += (varpath ? '.value' : 'value');
62
+ // varpath = drAttr.drForm + '.' + varpath;
63
+ // it.setAttribute(attrEventName, `${varpath} = $target.value; ${target}=$target; ${event}=$event;`);
64
+ it.setAttribute(attrEventName, `${varpath}.set($target.value, $target, $event); ${(_e = it.getAttribute(attrEventName)) !== null && _e !== void 0 ? _e : ''};`);
65
+ data.setTarget(it);
66
+ data.value = it.value;
67
+ }
68
+ else {
69
+ it.setAttribute(attrEventName, `${varpath} = $target.value;`);
70
+ }
71
+ }
72
+ });
73
+ RawSet.drFormOtherMoveAttr(this.elementSource.element, 'temp-name', 'name', this.source.config);
74
+ this.returnContainer.raws.push(...RawSet.checkPointCreates(this.elementSource.element, this.source.obj, this.source.config));
75
+ return ExecuteState.EXECUTE;
76
+ });
77
+ }
78
+ }
79
+ //# sourceMappingURL=DrForm.js.map
@@ -0,0 +1,9 @@
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 DrIf extends OperatorExecuterAttrRequire<string> {
6
+ constructor(rawSet: RawSet, render: Render, returnContainer: ReturnContainer, elementSource: ElementSource, source: Source, afterCallBack: AfterCallBack);
7
+ executeAttrRequire(attr: string): Promise<ExecuteState>;
8
+ }
9
+ //# sourceMappingURL=DrIf.d.ts.map
@@ -0,0 +1,70 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { OperatorExecuterAttrRequire } from './OperatorExecuterAttrRequire';
11
+ import { ScriptUtils } from '@dooboostore/core-web/script/ScriptUtils';
12
+ import { RawSet } from '../rawsets/RawSet';
13
+ import { ExecuteState } from './OperatorExecuter';
14
+ export class DrIf extends OperatorExecuterAttrRequire {
15
+ constructor(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
16
+ source.operatorAround = undefined;
17
+ super(rawSet, render, returnContainer, elementSource, source, afterCallBack, false);
18
+ }
19
+ executeAttrRequire(attr) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ var _a, _b, _c, _d;
22
+ const itRandom = RawSet.drItOtherEncoding(this.elementSource.element, 'DrIf');
23
+ const vars = RawSet.drVarEncoding(this.elementSource.element, (_a = this.elementSource.attrs.drVarOption) !== null && _a !== void 0 ? _a : '');
24
+ const newTemp = this.source.config.window.document.createElement('temp');
25
+ // Object.entries(this.__render.drAttr).filter(([k,v]) => k !== 'drIf' && v).forEach(([k, v]) => n.setAttribute(this.__render.drAttrsOriginName[k], v)); <-- 이부분은 다른 attr에도 적용을 할지말지 생각해야됨 엘리먼트 존재유무에 따라서 적용을 할지말지 결정해야됨
26
+ const keepgoing = ScriptUtils.eval(`
27
+ ${this.render.bindScript}
28
+ ${(_b = this.elementSource.attrs.drBeforeOption) !== null && _b !== void 0 ? _b : ''}
29
+ if ($rawSet.data === (${attr})) {
30
+ return false;
31
+ }
32
+ $rawSet.data = ${attr};
33
+ if($rawSet.data) {
34
+ const n = $element.cloneNode(true);
35
+ Object.entries(this.__render.drAttr).filter(([k,v]) => k !== 'drIf' && v).forEach(([k, v]) => n.setAttribute(this.__render.drAttrsOriginName[k], v));
36
+ var destIt = ${this.elementSource.attrs.drItOption};
37
+ if (destIt !== undefined) {
38
+ // 여기가 ..아주 헛갈리는데...
39
+ Array.from(n.getAttributeNames()).forEach(it => n.setAttribute(it, n.getAttribute(it).replace(/\\#DrIFIt\\#/g, destIt)))
40
+ n.innerHTML = n.innerHTML.replace(/\\#DrIFIt\\#/g, destIt);
41
+ }
42
+ if (this.__render.drStripOption === 'true') {
43
+ Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));
44
+ } else {
45
+ this.__render.fag.append(n);
46
+ }
47
+ }
48
+ ${(_c = this.elementSource.attrs.drAfterOption) !== null && _c !== void 0 ? _c : ''};
49
+ return true;
50
+ `, Object.assign(this.source.obj, {
51
+ __render: Object.freeze(Object.assign({ fag: newTemp, drAttr: this.elementSource.attrs, drAttrsOriginName: RawSet.drAttrsOriginName, drStripOption: this.elementSource.attrs.drStripOption }, this.render))
52
+ }));
53
+ // TODO: 뭐지?? 지워야되는거 아닌가?
54
+ if (keepgoing === false) {
55
+ return ExecuteState.STOP;
56
+ }
57
+ RawSet.drVarDecoding(newTemp, vars);
58
+ RawSet.drItOtherDecoding(newTemp, itRandom);
59
+ // const bypass = (newTemp.innerHTML ?? '').trim().length <= 0;
60
+ const tempalte = this.source.config.window.document.createElement('template');
61
+ tempalte.innerHTML = newTemp.innerHTML;
62
+ this.returnContainer.fag.append(tempalte.content);
63
+ const rr = RawSet.checkPointCreates(this.returnContainer.fag, this.source.obj, this.source.config);
64
+ (_d = this.elementSource.element.parentNode) === null || _d === void 0 ? void 0 : _d.replaceChild(this.returnContainer.fag, this.elementSource.element);
65
+ this.returnContainer.raws.push(...rr);
66
+ return ExecuteState.EXECUTE;
67
+ });
68
+ }
69
+ }
70
+ //# sourceMappingURL=DrIf.js.map
@@ -0,0 +1,9 @@
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
+ }
9
+ //# sourceMappingURL=DrInnerHTML.d.ts.map
@@ -0,0 +1,48 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { OperatorExecuterAttrRequire } from './OperatorExecuterAttrRequire';
11
+ import { ScriptUtils } from '@dooboostore/core-web/script/ScriptUtils';
12
+ import { RawSet } from '../rawsets/RawSet';
13
+ import { ExecuteState } from './OperatorExecuter';
14
+ export class DrInnerHTML extends OperatorExecuterAttrRequire {
15
+ constructor(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
16
+ super(rawSet, render, returnContainer, elementSource, source, afterCallBack, false);
17
+ }
18
+ executeAttrRequire(attr) {
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ var _a, _b, _c;
21
+ const newTemp = this.source.config.window.document.createElement('temp');
22
+ ScriptUtils.eval(`
23
+ ${this.render.bindScript}
24
+ const n = $element.cloneNode(true);
25
+ ${(_a = this.elementSource.attrs.drBeforeOption) !== null && _a !== void 0 ? _a : ''}
26
+ n.innerHTML = ${attr};
27
+ if (this.__render.drStripOption === 'true') {
28
+ Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));
29
+ } else {
30
+ this.__render.fag.append(n);
31
+ }
32
+ ${(_b = this.elementSource.attrs.drAfterOption) !== null && _b !== void 0 ? _b : ''}
33
+ `, Object.assign(this.source.obj, {
34
+ __render: Object.freeze(Object.assign({ drStripOption: this.elementSource.attrs.drStripOption, fag: newTemp }, this.render
35
+ // eslint-disable-next-line no-use-before-define
36
+ ))
37
+ }));
38
+ const tempalte = this.source.config.window.document.createElement('template');
39
+ tempalte.innerHTML = newTemp.innerHTML;
40
+ this.returnContainer.fag.append(tempalte.content);
41
+ const rr = RawSet.checkPointCreates(this.returnContainer.fag, this.source.obj, this.source.config);
42
+ (_c = this.elementSource.element.parentNode) === null || _c === void 0 ? void 0 : _c.replaceChild(this.returnContainer.fag, this.elementSource.element);
43
+ this.returnContainer.raws.push(...rr);
44
+ return ExecuteState.EXECUTE;
45
+ });
46
+ }
47
+ }
48
+ //# sourceMappingURL=DrInnerHTML.js.map
@@ -0,0 +1,9 @@
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
+ }
9
+ //# sourceMappingURL=DrInnerText.d.ts.map
@@ -0,0 +1,46 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { OperatorExecuterAttrRequire } from './OperatorExecuterAttrRequire';
11
+ import { ScriptUtils } from '@dooboostore/core-web/script/ScriptUtils';
12
+ import { RawSet } from '../rawsets/RawSet';
13
+ import { ExecuteState } from './OperatorExecuter';
14
+ export class DrInnerText extends OperatorExecuterAttrRequire {
15
+ constructor(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
16
+ super(rawSet, render, returnContainer, elementSource, source, afterCallBack, false);
17
+ }
18
+ executeAttrRequire(attr) {
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ var _a, _b, _c;
21
+ const newTemp = this.source.config.window.document.createElement('temp');
22
+ ScriptUtils.eval(`
23
+ ${this.render.bindScript}
24
+ const n = $element.cloneNode(true);
25
+ ${(_a = this.elementSource.attrs.drBeforeOption) !== null && _a !== void 0 ? _a : ''}
26
+ n.innerText = ${attr};
27
+ if (this.__render.drStripOption === 'true') {
28
+ Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));
29
+ } else {
30
+ this.__render.fag.append(n);
31
+ }
32
+ ${(_b = this.elementSource.attrs.drAfterOption) !== null && _b !== void 0 ? _b : ''}
33
+ `, Object.assign(this.source.obj, {
34
+ __render: Object.freeze(Object.assign({ drStripOption: this.elementSource.attrs.drStripOption, fag: newTemp }, this.render))
35
+ }));
36
+ const tempalte = this.source.config.window.document.createElement('template');
37
+ tempalte.innerHTML = newTemp.innerHTML;
38
+ this.returnContainer.fag.append(tempalte.content);
39
+ const rr = RawSet.checkPointCreates(this.returnContainer.fag, this.source.obj, this.source.config);
40
+ (_c = this.elementSource.element.parentNode) === null || _c === void 0 ? void 0 : _c.replaceChild(this.returnContainer.fag, this.elementSource.element);
41
+ this.returnContainer.raws.push(...rr);
42
+ return ExecuteState.EXECUTE;
43
+ });
44
+ }
45
+ }
46
+ //# sourceMappingURL=DrInnerText.js.map
@@ -0,0 +1,8 @@
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
+ }
8
+ //# sourceMappingURL=DrPre.d.ts.map
@@ -0,0 +1,22 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { ExecuteState, OperatorExecuter } from './OperatorExecuter';
11
+ export class DrPre extends OperatorExecuter {
12
+ constructor(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
13
+ source.operatorAround = undefined;
14
+ super(rawSet, render, returnContainer, elementSource, source, afterCallBack);
15
+ }
16
+ execute(value) {
17
+ return __awaiter(this, void 0, void 0, function* () {
18
+ return (value != null) ? ExecuteState.EXECUTE : ExecuteState.NO_EXECUTE;
19
+ });
20
+ }
21
+ }
22
+ //# sourceMappingURL=DrPre.js.map
@@ -0,0 +1,9 @@
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
+ }
9
+ //# sourceMappingURL=DrRepeat.d.ts.map
@@ -0,0 +1,70 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { OperatorExecuterAttrRequire } from './OperatorExecuterAttrRequire';
11
+ import { ScriptUtils } from '@dooboostore/core-web/script/ScriptUtils';
12
+ import { RawSet } from '../rawsets/RawSet';
13
+ import { EventManager } from '../events/EventManager';
14
+ import { ExecuteState } from './OperatorExecuter';
15
+ export class DrRepeat extends OperatorExecuterAttrRequire {
16
+ constructor(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
17
+ source.operatorAround = undefined;
18
+ super(rawSet, render, returnContainer, elementSource, source, afterCallBack, false);
19
+ }
20
+ executeAttrRequire(attr) {
21
+ return __awaiter(this, void 0, void 0, function* () {
22
+ var _a, _b, _c, _d;
23
+ const itRandom = RawSet.drItOtherEncoding(this.elementSource.element);
24
+ const vars = RawSet.drVarEncoding(this.elementSource.element, (_a = this.elementSource.attrs.drVarOption) !== null && _a !== void 0 ? _a : '');
25
+ const newTemp = this.source.config.window.document.createElement('temp');
26
+ ScriptUtils.eval(`
27
+ ${this.render.bindScript}
28
+ ${(_b = this.elementSource.attrs.drBeforeOption) !== null && _b !== void 0 ? _b : ''}
29
+ var i = 0;
30
+ const repeat = ${attr};
31
+ const repeatStr = \`${attr}\`;
32
+ let range = repeat;
33
+ if (typeof repeat === 'number') {
34
+ range = ${EventManager.RANGE_VARNAME}(repeat);
35
+ }
36
+ for(const it of range) {
37
+ var destIt = it;
38
+ if (range.isRange) {
39
+ destIt = it;
40
+ } else {
41
+ destIt = repeatStr + '[' + i +']'
42
+ }
43
+ const n = this.__render.element.cloneNode(true);
44
+ n.getAttributeNames().forEach(it => n.setAttribute(it, n.getAttribute(it).replace(/\\#it\\#/g, destIt).replace(/\\#nearRangeIt\\#/g, destIt).replace(/\\#nearRangeIndex\\#/g, destIt)))
45
+ n.innerHTML = n.innerHTML.replace(/\\#it\\#/g, destIt).replace(/\\#index\\#/g, destIt);
46
+
47
+ if (this.__render.drStripOption === 'true') {
48
+ Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));
49
+ } else {
50
+ this.__render.fag.append(n);
51
+ }
52
+ i++;
53
+ }
54
+ ${(_c = this.elementSource.attrs.drAfterOption) !== null && _c !== void 0 ? _c : ''}
55
+ `, Object.assign(this.source.obj, {
56
+ __render: Object.freeze(Object.assign({ fag: newTemp, drStripOption: this.elementSource.attrs.drStripOption }, this.render))
57
+ }));
58
+ RawSet.drVarDecoding(newTemp, vars);
59
+ RawSet.drItOtherDecoding(newTemp, itRandom);
60
+ const tempalte = this.source.config.window.document.createElement('template');
61
+ tempalte.innerHTML = newTemp.innerHTML;
62
+ this.returnContainer.fag.append(tempalte.content);
63
+ const rr = RawSet.checkPointCreates(this.returnContainer.fag, this.source.obj, this.source.config);
64
+ (_d = this.elementSource.element.parentNode) === null || _d === void 0 ? void 0 : _d.replaceChild(this.returnContainer.fag, this.elementSource.element);
65
+ this.returnContainer.raws.push(...rr);
66
+ return ExecuteState.EXECUTE;
67
+ });
68
+ }
69
+ }
70
+ //# sourceMappingURL=DrRepeat.js.map
@@ -0,0 +1,9 @@
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 DrStripElement extends OperatorExecuterAttrRequire<string> {
6
+ constructor(rawSet: RawSet, render: Render, returnContainer: ReturnContainer, elementSource: ElementSource, source: Source, afterCallBack: AfterCallBack);
7
+ executeAttrRequire(attr: string): Promise<ExecuteState>;
8
+ }
9
+ //# sourceMappingURL=DrStripElement.d.ts.map