dom-render 1.0.96 → 1.0.97

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. package/DomRender.d.ts +1 -1
  2. package/DomRender.js +3 -3
  3. package/DomRenderProxy.js +12 -14
  4. package/README.MD +41 -0
  5. package/components/ComponentSet.d.ts +1 -1
  6. package/configs/Config.d.ts +1 -1
  7. package/configs/TargetAttr.d.ts +1 -1
  8. package/configs/TargetElement.d.ts +1 -1
  9. package/css/parse/index.d.ts +1 -0
  10. package/css/parse/index.js +512 -0
  11. package/css/stringify/compiler.d.ts +32 -0
  12. package/css/stringify/compiler.js +40 -0
  13. package/css/stringify/compress.d.ts +75 -0
  14. package/css/stringify/compress.js +156 -0
  15. package/css/stringify/identity.d.ts +85 -0
  16. package/css/stringify/identity.js +194 -0
  17. package/css/stringify/index.d.ts +14 -0
  18. package/css/stringify/index.js +44 -0
  19. package/dist/bundle.js +1075 -328
  20. package/events/EventManager.js +27 -27
  21. package/iterators/Range.d.ts +1 -0
  22. package/iterators/Range.js +15 -0
  23. package/messenger/Messenger.d.ts +4 -4
  24. package/operators/Dr.js +2 -2
  25. package/operators/DrAppender.js +5 -3
  26. package/operators/DrFor.js +5 -3
  27. package/operators/DrForOf.js +5 -3
  28. package/operators/DrForm.js +12 -12
  29. package/operators/DrIf.js +5 -3
  30. package/operators/DrInnerHTML.js +2 -2
  31. package/operators/DrInnerText.js +2 -2
  32. package/operators/DrPre.js +4 -2
  33. package/operators/DrRepeat.js +5 -3
  34. package/operators/DrTargetAttr.js +4 -2
  35. package/operators/DrTargetElement.js +5 -3
  36. package/operators/DrThis.js +2 -2
  37. package/operators/DrThisProperty.js +6 -4
  38. package/operators/OperatorExecuter.d.ts +5 -5
  39. package/operators/OperatorExecuter.js +2 -2
  40. package/operators/OperatorExecuterAttrRequire.js +1 -1
  41. package/package.json +3 -3
  42. package/rawsets/AttrInitCallBack.d.ts +1 -1
  43. package/rawsets/Attrs.d.ts +1 -1
  44. package/rawsets/CreatorMetaData.d.ts +1 -1
  45. package/rawsets/ElementInitCallBack.d.ts +1 -1
  46. package/rawsets/RawSet.d.ts +6 -2
  47. package/rawsets/RawSet.js +93 -54
  48. package/rawsets/Render.d.ts +1 -1
  49. package/routers/Router.d.ts +1 -1
  50. package/routers/Router.js +1 -1
  51. package/utils/dom/DomUtils.d.ts +1 -1
  52. package/utils/node/NodeUtils.d.ts +1 -1
  53. package/utils/script/ScriptUtils.js +2 -2
  54. package/utils/storage/StorageUtils.d.ts +7 -0
  55. package/utils/storage/StorageUtils.js +39 -0
  56. package/utils/string/StringUtils.d.ts +1 -0
  57. package/utils/string/StringUtils.js +17 -0
  58. package/validators/EmptyValidator.js +2 -2
  59. package/validators/NotEmptyValidator.js +2 -2
  60. package/validators/ValidMultipleValidator.d.ts +1 -1
  61. package/validators/Validator.d.ts +2 -2
  62. package/validators/ValidatorArray.d.ts +1 -1
@@ -37,21 +37,21 @@ var EventManager = /** @class */ (function () {
37
37
  EventManager.onInitAttrName,
38
38
  this.eventParam
39
39
  ];
40
- this.bindScript = "\n const ".concat(EventManager.VALUE_VARNAME, " = this.__render.value;\n const ").concat(EventManager.SCRIPTS_VARNAME, " = this.__render.scripts;\n const ").concat(EventManager.RANGE_VARNAME, " = this.__render.range;\n const ").concat(EventManager.ROUTER_VARNAME, " = this.__render.router;\n const ").concat(EventManager.ATTRIBUTE_VARNAME, " = this.__render.attribute;\n const ").concat(EventManager.ELEMENT_VARNAME, " = this.__render.element;\n const ").concat(EventManager.TARGET_VARNAME, " = this.__render.target;\n const ").concat(EventManager.EVENT_VARNAME, " = this.__render.event;\n ");
40
+ this.bindScript = "\n const " + EventManager.VALUE_VARNAME + " = this.__render.value;\n const " + EventManager.SCRIPTS_VARNAME + " = this.__render.scripts;\n const " + EventManager.RANGE_VARNAME + " = this.__render.range;\n const " + EventManager.ROUTER_VARNAME + " = this.__render.router;\n const " + EventManager.ATTRIBUTE_VARNAME + " = this.__render.attribute;\n const " + EventManager.ELEMENT_VARNAME + " = this.__render.element;\n const " + EventManager.TARGET_VARNAME + " = this.__render.target;\n const " + EventManager.EVENT_VARNAME + " = this.__render.event;\n ";
41
41
  this.eventNames.forEach(function (it) {
42
42
  _this.attrNames.push(EventManager.attrPrefix + 'event-' + it);
43
43
  });
44
44
  if (typeof window !== 'undefined') {
45
45
  EventManager.WINDOW_EVENTS.forEach(function (eventName) {
46
46
  window === null || window === void 0 ? void 0 : window.addEventListener(eventName, function (event) {
47
- var targetAttr = "dr-window-event-".concat(eventName);
48
- document.querySelectorAll("[".concat(targetAttr, "]")).forEach(function (it) {
47
+ var targetAttr = "dr-window-event-" + eventName;
48
+ document.querySelectorAll("[" + targetAttr + "]").forEach(function (it) {
49
49
  var _a;
50
50
  var script = it.getAttribute(targetAttr);
51
51
  if (script) {
52
52
  var obj = it.obj;
53
53
  var config = (_a = obj === null || obj === void 0 ? void 0 : obj._DomRender_proxy) === null || _a === void 0 ? void 0 : _a.config;
54
- ScriptUtils_1.ScriptUtils.eval("".concat(_this.bindScript, " ").concat(script, " "), Object.assign(obj, {
54
+ ScriptUtils_1.ScriptUtils.eval(_this.bindScript + " " + script + " ", Object.assign(obj, {
55
55
  __render: Object.freeze({
56
56
  target: Types_1.DomRenderFinalProxy.final(event.target),
57
57
  element: it,
@@ -79,7 +79,7 @@ var EventManager = /** @class */ (function () {
79
79
  var elements = new Set();
80
80
  var addAttributes = (_b = (_a = config === null || config === void 0 ? void 0 : config.applyEvents) === null || _a === void 0 ? void 0 : _a.map(function (it) { return it.attrName; })) !== null && _b !== void 0 ? _b : [];
81
81
  addAttributes.concat(this.attrNames).forEach(function (attrName) {
82
- fragment === null || fragment === void 0 ? void 0 : fragment.querySelectorAll("[".concat(attrName, "]")).forEach(function (it) {
82
+ fragment === null || fragment === void 0 ? void 0 : fragment.querySelectorAll("[" + attrName + "]").forEach(function (it) {
83
83
  elements.add(it);
84
84
  });
85
85
  });
@@ -115,7 +115,7 @@ var EventManager = /** @class */ (function () {
115
115
  this.procAttr(childNodes, EventManager.normalAttrMapAttrName, function (it, attribute) {
116
116
  var map = new Map(JSON.parse(attribute));
117
117
  map.forEach(function (v, k) {
118
- var data = ScriptUtils_1.ScriptUtils.eval("const $element = this.element; return ".concat(v, " "), Object.assign(obj, {
118
+ var data = ScriptUtils_1.ScriptUtils.eval("const $element = this.element; return " + v + " ", Object.assign(obj, {
119
119
  __render: Object.freeze({
120
120
  element: it,
121
121
  attribute: DomUtils_1.DomUtils.getAttributeToObject(it)
@@ -134,7 +134,7 @@ var EventManager = /** @class */ (function () {
134
134
  this.procAttr(childNodes, EventManager.valueLinkAttrName, function (it, varName) {
135
135
  if (varName) {
136
136
  var ownerVariablePathName = it.getAttribute(EventManager.ownerVariablePathAttrName);
137
- var mapScript_1 = it.getAttribute("".concat(EventManager.valueLinkAttrName, ":map"));
137
+ var mapScript_1 = it.getAttribute(EventManager.valueLinkAttrName + ":map");
138
138
  // const inMapScript = it.getAttribute(`${valueLinkAttrName}:in-map`);
139
139
  var bindObj_1 = obj;
140
140
  if (ownerVariablePathName) {
@@ -145,7 +145,7 @@ var EventManager = /** @class */ (function () {
145
145
  if (typeof getValue === 'function' && getValue) {
146
146
  var setValue = it.value;
147
147
  if (mapScript_1) {
148
- setValue = ScriptUtils_1.ScriptUtils.eval("".concat(_this.getBindScript(config), " return ").concat(mapScript_1), Object.assign(bindObj_1, { __render: Object.freeze(__assign({ element: it, target: bindObj_1, range: Range_1.Range.range, value: setValue, scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj) }, config === null || config === void 0 ? void 0 : config.eventVariables)) }));
148
+ setValue = ScriptUtils_1.ScriptUtils.eval(_this.getBindScript(config) + " return " + mapScript_1, Object.assign(bindObj_1, { __render: Object.freeze(__assign({ element: it, target: bindObj_1, range: Range_1.Range.range, value: setValue, scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj) }, config === null || config === void 0 ? void 0 : config.eventVariables)) }));
149
149
  }
150
150
  getValue(setValue);
151
151
  // 여기서 value가 먼저냐 value-link가 먼저냐 선을 정해야되는거네...
@@ -153,14 +153,14 @@ var EventManager = /** @class */ (function () {
153
153
  else if (getValue) {
154
154
  var setValue = getValue;
155
155
  if (mapScript_1) {
156
- setValue = ScriptUtils_1.ScriptUtils.eval("".concat(_this.getBindScript(config), " return ").concat(mapScript_1), Object.assign(bindObj_1, { __render: Object.freeze(__assign({ element: it, target: bindObj_1, range: Range_1.Range.range, value: setValue, scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj) }, config === null || config === void 0 ? void 0 : config.eventVariables)) }));
156
+ setValue = ScriptUtils_1.ScriptUtils.eval(_this.getBindScript(config) + " return " + mapScript_1, Object.assign(bindObj_1, { __render: Object.freeze(__assign({ element: it, target: bindObj_1, range: Range_1.Range.range, value: setValue, scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj) }, config === null || config === void 0 ? void 0 : config.eventVariables)) }));
157
157
  }
158
158
  it.value = setValue;
159
159
  }
160
160
  it.addEventListener('input', function (event) {
161
161
  var value = it.value;
162
162
  if (mapScript_1) {
163
- value = ScriptUtils_1.ScriptUtils.eval("".concat(_this.getBindScript(config), " return ").concat(mapScript_1), Object.assign(bindObj_1, {
163
+ value = ScriptUtils_1.ScriptUtils.eval(_this.getBindScript(config) + " return " + mapScript_1, Object.assign(bindObj_1, {
164
164
  __render: Object.freeze(__assign({ event: event, element: it, attribute: DomUtils_1.DomUtils.getAttributeToObject(it), target: event.target, range: Range_1.Range.range, scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj) }, config === null || config === void 0 ? void 0 : config.eventVariables))
165
165
  }));
166
166
  }
@@ -180,7 +180,7 @@ var EventManager = /** @class */ (function () {
180
180
  script = 'return ' + script;
181
181
  }
182
182
  if (script) {
183
- ScriptUtils_1.ScriptUtils.eval("".concat(_this.getBindScript(config), "; ").concat(script, " "), Object.assign(obj, {
183
+ ScriptUtils_1.ScriptUtils.eval(_this.getBindScript(config) + "; " + script + " ", Object.assign(obj, {
184
184
  __render: Object.freeze(__assign({ element: it, attribute: DomUtils_1.DomUtils.getAttributeToObject(it) }, config === null || config === void 0 ? void 0 : config.eventVariables))
185
185
  }));
186
186
  // console.log('onInit--->', obj, varName, it)
@@ -211,20 +211,20 @@ var EventManager = /** @class */ (function () {
211
211
  if (ownerVariablePathName) {
212
212
  bindObj = ScriptUtils_1.ScriptUtils.evalReturn(ownerVariablePathName, obj);
213
213
  }
214
- var mapScript = it.getAttribute("".concat(EventManager.valueLinkAttrName, ":map"));
214
+ var mapScript = it.getAttribute(EventManager.valueLinkAttrName + ":map");
215
215
  if (attribute && attribute === varName) {
216
216
  var getValue = _this.getValue(obj, attribute, bindObj);
217
217
  if (typeof getValue === 'function' && getValue) {
218
218
  var setValue = it.value;
219
219
  if (mapScript) {
220
- setValue = ScriptUtils_1.ScriptUtils.eval("".concat(_this.getBindScript(config), " return ").concat(mapScript), Object.assign(bindObj, { __render: Object.freeze(__assign({ element: it, target: bindObj, range: Range_1.Range.range, value: setValue, scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj) }, config === null || config === void 0 ? void 0 : config.eventVariables)) }));
220
+ setValue = ScriptUtils_1.ScriptUtils.eval(_this.getBindScript(config) + " return " + mapScript, Object.assign(bindObj, { __render: Object.freeze(__assign({ element: it, target: bindObj, range: Range_1.Range.range, value: setValue, scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj) }, config === null || config === void 0 ? void 0 : config.eventVariables)) }));
221
221
  }
222
222
  getValue(setValue);
223
223
  }
224
224
  else { // if (getValue !== undefined && getValue !== null)
225
225
  var setValue = getValue;
226
226
  if (mapScript) {
227
- setValue = ScriptUtils_1.ScriptUtils.eval("".concat(_this.getBindScript(config), " return ").concat(mapScript), Object.assign(bindObj, { __render: Object.freeze(__assign({ element: it, target: bindObj, range: Range_1.Range.range, value: setValue, scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj) }, config === null || config === void 0 ? void 0 : config.eventVariables)) }));
227
+ setValue = ScriptUtils_1.ScriptUtils.eval(_this.getBindScript(config) + " return " + mapScript, Object.assign(bindObj, { __render: Object.freeze(__assign({ element: it, target: bindObj, range: Range_1.Range.range, value: setValue, scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj) }, config === null || config === void 0 ? void 0 : config.eventVariables)) }));
228
228
  }
229
229
  it.value = setValue;
230
230
  }
@@ -237,7 +237,7 @@ var EventManager = /** @class */ (function () {
237
237
  script = 'return ' + script;
238
238
  }
239
239
  if (EventManager.isUsingThisVar(script, varName) || varName === undefined) {
240
- var data = ScriptUtils_1.ScriptUtils.eval("const $element = this.__render.element; ".concat(script, " "), Object.assign(obj, {
240
+ var data = ScriptUtils_1.ScriptUtils.eval("const $element = this.__render.element; " + script + " ", Object.assign(obj, {
241
241
  __render: Object.freeze({
242
242
  element: it,
243
243
  attribute: DomUtils_1.DomUtils.getAttributeToObject(it)
@@ -289,7 +289,7 @@ var EventManager = /** @class */ (function () {
289
289
  script = 'return ' + script;
290
290
  }
291
291
  if (EventManager.isUsingThisVar(script, varName) || varName === undefined) {
292
- var data = ScriptUtils_1.ScriptUtils.eval("const $element = this.__render.element; ".concat(script, " "), Object.assign(obj, {
292
+ var data = ScriptUtils_1.ScriptUtils.eval("const $element = this.__render.element; " + script + " ", Object.assign(obj, {
293
293
  __render: Object.freeze({
294
294
  element: it,
295
295
  attribute: DomUtils_1.DomUtils.getAttributeToObject(it)
@@ -318,7 +318,7 @@ var EventManager = /** @class */ (function () {
318
318
  script = 'return ' + script;
319
319
  }
320
320
  if (EventManager.isUsingThisVar(script, varName) || varName === undefined) {
321
- var data = ScriptUtils_1.ScriptUtils.eval("const $element = this.element; ".concat(script, " "), Object.assign(obj, {
321
+ var data = ScriptUtils_1.ScriptUtils.eval("const $element = this.element; " + script + " ", Object.assign(obj, {
322
322
  __render: Object.freeze({
323
323
  element: it,
324
324
  attribute: DomUtils_1.DomUtils.getAttributeToObject(it)
@@ -353,7 +353,7 @@ var EventManager = /** @class */ (function () {
353
353
  var isUsing = EventManager.isUsingThisVar(v, varName);
354
354
  // console.log('---isUsing--> varName:', varName, 'k:', k, 'v:', v, 'isUsing:', isUsing);
355
355
  if (isUsing) {
356
- var data = ScriptUtils_1.ScriptUtils.eval("const $element = this.element; return ".concat(v, " "), Object.assign(obj, {
356
+ var data = ScriptUtils_1.ScriptUtils.eval("const $element = this.element; return " + v + " ", Object.assign(obj, {
357
357
  __render: Object.freeze({
358
358
  element: it,
359
359
  attribute: DomUtils_1.DomUtils.getAttributeToObject(it)
@@ -373,15 +373,15 @@ var EventManager = /** @class */ (function () {
373
373
  var script = attribute;
374
374
  it.addEventListener(eventName, function (event) {
375
375
  var filter = true;
376
- var filterScript = it.getAttribute("".concat(attr, ":filter"));
376
+ var filterScript = it.getAttribute(attr + ":filter");
377
377
  var thisTarget = Object.assign(obj, {
378
378
  __render: Object.freeze(__assign({ event: event, element: it, target: event.target, range: Range_1.Range.range, attribute: DomUtils_1.DomUtils.getAttributeToObject(it), router: config === null || config === void 0 ? void 0 : config.router, scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj) }, config === null || config === void 0 ? void 0 : config.eventVariables))
379
379
  });
380
380
  if (filterScript) {
381
- filter = ScriptUtils_1.ScriptUtils.eval("".concat(_this.getBindScript(config), " return ").concat(filterScript), thisTarget);
381
+ filter = ScriptUtils_1.ScriptUtils.eval(_this.getBindScript(config) + " return " + filterScript, thisTarget);
382
382
  }
383
383
  if (filter) {
384
- ScriptUtils_1.ScriptUtils.eval("".concat(_this.getBindScript(config), " ").concat(script, " "), thisTarget);
384
+ ScriptUtils_1.ScriptUtils.eval(_this.getBindScript(config) + " " + script + " ", thisTarget);
385
385
  }
386
386
  });
387
387
  });
@@ -404,7 +404,7 @@ var EventManager = /** @class */ (function () {
404
404
  });
405
405
  bind.split(',').forEach(function (eventName) {
406
406
  it.addEventListener(eventName.trim(), function (event) {
407
- ScriptUtils_1.ScriptUtils.eval("const $params = this.__render.params; ".concat(_this.getBindScript(config), " ").concat(script_1, " "), Object.assign(obj, {
407
+ ScriptUtils_1.ScriptUtils.eval("const $params = this.__render.params; " + _this.getBindScript(config) + " " + script_1 + " ", Object.assign(obj, {
408
408
  __render: Object.freeze(__assign({ event: event, element: it, attribute: DomUtils_1.DomUtils.getAttributeToObject(it), target: event.target, range: Range_1.Range.range, scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj), params: params_1 }, config === null || config === void 0 ? void 0 : config.eventVariables))
409
409
  }));
410
410
  });
@@ -425,7 +425,7 @@ var EventManager = /** @class */ (function () {
425
425
  if (it.nodeType === 1) {
426
426
  var e = it;
427
427
  sets.add(e);
428
- e.querySelectorAll("[".concat(attrName, "]")).forEach(function (it) {
428
+ e.querySelectorAll("[" + attrName + "]").forEach(function (it) {
429
429
  sets.add(it);
430
430
  });
431
431
  }
@@ -448,7 +448,7 @@ var EventManager = /** @class */ (function () {
448
448
  };
449
449
  EventManager.prototype.setValue = function (obj, name, value) {
450
450
  name = name.replaceAll('this.', 'this.this.');
451
- ScriptUtils_1.ScriptUtils.eval("".concat(name, " = this.value;"), {
451
+ ScriptUtils_1.ScriptUtils.eval(name + " = this.value;", {
452
452
  this: obj,
453
453
  value: value
454
454
  });
@@ -462,7 +462,7 @@ var EventManager = /** @class */ (function () {
462
462
  }
463
463
  EventManager.VARNAMES.forEach(function (it) {
464
464
  // raws = raws!.replace(RegExp(it.replace('$', '\\$'), 'g'), `this?.___${it}`);
465
- raws = raws.replace(RegExp(it.replace('$', '\\$'), 'g'), "this.___".concat(it));
465
+ raws = raws.replace(RegExp(it.replace('$', '\\$'), 'g'), "this.___" + it);
466
466
  });
467
467
  var variablePaths = ScriptUtils_1.ScriptUtils.getVariablePaths(raws !== null && raws !== void 0 ? raws : '');
468
468
  return variablePaths.has(varName);
@@ -487,10 +487,10 @@ var EventManager = /** @class */ (function () {
487
487
  if (config === null || config === void 0 ? void 0 : config.eventVariables) {
488
488
  var bindScript = Object.entries(config.eventVariables).filter(function (_a) {
489
489
  var key = _a[0], value = _a[1];
490
- return !_this.bindScript.includes("const ".concat(key));
490
+ return !_this.bindScript.includes("const " + key);
491
491
  }).map(function (_a) {
492
492
  var key = _a[0], value = _a[1];
493
- return "const ".concat(key, " = this.__render.").concat(key, ";");
493
+ return "const " + key + " = this.__render." + key + ";";
494
494
  }).join(';');
495
495
  return this.bindScript + '' + bindScript;
496
496
  }
@@ -18,5 +18,6 @@ export declare class Range implements Iterable<number> {
18
18
  readonly isRange = true;
19
19
  constructor(first: number, last: number, step?: number);
20
20
  [Symbol.iterator](): Iterator<number>;
21
+ map<U>(callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[];
21
22
  static range(first: number | string, last?: number, step?: number): Range;
22
23
  }
@@ -23,10 +23,22 @@ var RangeIterator = /** @class */ (function () {
23
23
  r = new RangeResult(this._current, false);
24
24
  this._current += this._step;
25
25
  }
26
+ else if (this._first < this._last && this._current === this._last) {
27
+ r = new RangeResult(this._current, false);
28
+ this._current += this._step;
29
+ }
26
30
  else if (this._first > this._last && this._current > this._last) {
27
31
  r = new RangeResult(this._current, false);
28
32
  this._current -= this._step;
29
33
  }
34
+ else if (this._first > this._last && this._current === this._last) {
35
+ r = new RangeResult(this._current, false);
36
+ this._current -= this._step;
37
+ }
38
+ else if (this._current === this._last) {
39
+ r = new RangeResult(this._current, false);
40
+ this._current -= this._step;
41
+ }
30
42
  else {
31
43
  r = new RangeResult(undefined, true);
32
44
  }
@@ -46,6 +58,9 @@ var Range = /** @class */ (function () {
46
58
  Range.prototype[Symbol.iterator] = function () {
47
59
  return new RangeIterator(this.first, this.last, this.step);
48
60
  };
61
+ Range.prototype.map = function (callbackfn, thisArg) {
62
+ return Array.from(this).map(callbackfn);
63
+ };
49
64
  Range.range = function (first, last, step) {
50
65
  if (step === void 0) { step = 1; }
51
66
  if (typeof first === 'number' && last === undefined) {
@@ -5,11 +5,11 @@ declare enum CallBackType {
5
5
  MAP = 1,
6
6
  SUBSCRIBE = 2
7
7
  }
8
- export type ChannelData = {
8
+ export declare type ChannelData = {
9
9
  channel: Channel;
10
10
  data?: (any | undefined);
11
11
  };
12
- export type ChannelMetaData = {
12
+ export declare type ChannelMetaData = {
13
13
  channel?: Channel;
14
14
  action?: string;
15
15
  };
@@ -47,13 +47,13 @@ export declare class Channel {
47
47
  subscribe<D = any>(subscribeCallback: (data: D, meta: ChannelMetaData) => any | void | undefined): ChannelSubscription;
48
48
  deleteChannel(): void;
49
49
  }
50
- type MessengerEventDetail = {
50
+ declare type MessengerEventDetail = {
51
51
  key: string | object | ConstructorType<any>;
52
52
  data?: any;
53
53
  action?: string;
54
54
  result?: (c: ChannelData[]) => void;
55
55
  };
56
- type MessengerSubscribeEventDetail = {
56
+ declare type MessengerSubscribeEventDetail = {
57
57
  obj: any;
58
58
  key?: string | object | ConstructorType<any>;
59
59
  init: (channel: Channel, subscription: ChannelSubscription) => void;
package/operators/Dr.js CHANGED
@@ -40,7 +40,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
40
40
  function verb(n) { return function (v) { return step([n, v]); }; }
41
41
  function step(op) {
42
42
  if (f) throw new TypeError("Generator is already executing.");
43
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
43
+ while (_) try {
44
44
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
45
45
  if (y = 0, t) op = [op[0] & 2, t.value];
46
46
  switch (op[0]) {
@@ -81,7 +81,7 @@ var Dr = /** @class */ (function (_super) {
81
81
  itRandom = RawSet_1.RawSet.drItOtherEncoding(this.elementSource.element);
82
82
  vars = RawSet_1.RawSet.drVarEncoding(this.elementSource.element, (_a = this.elementSource.attrs.drVarOption) !== null && _a !== void 0 ? _a : '');
83
83
  newTemp = this.source.config.window.document.createElement('temp');
84
- ScriptUtils_1.ScriptUtils.eval("\n ".concat(this.render.bindScript, "\n const n = $element.cloneNode(true);\n var destIt = ").concat(this.elementSource.attrs.drItOption, ";\n if (destIt !== undefined) {\n n.getAttributeNames().forEach(it => n.setAttribute(it, n.getAttribute(it).replace(/\\#it\\#/g, destIt)))\n // console.log('----', n.innerHTML);\n n.innerHTML = n.innerHTML.replace(/\\#it\\#/g, destIt);\n // console.log('----', n.innerHTML);\n }\n if (this.__render.drStripOption === 'true') {\n Array.from(n.childNodes).forEach(it => this.__fag.append(it));\n } else {\n this.__render.fag.append(n);\n }"), Object.assign(this.source.obj, {
84
+ ScriptUtils_1.ScriptUtils.eval("\n " + this.render.bindScript + "\n const n = $element.cloneNode(true);\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 // console.log('----', n.innerHTML);\n n.innerHTML = n.innerHTML.replace(/\\#it\\#/g, destIt);\n // console.log('----', n.innerHTML);\n }\n if (this.__render.drStripOption === 'true') {\n Array.from(n.childNodes).forEach(it => this.__fag.append(it));\n } else {\n this.__render.fag.append(n);\n }", Object.assign(this.source.obj, {
85
85
  __render: Object.freeze(__assign({ fag: newTemp, drStripOption: this.elementSource.attrs.drStripOption }, this.render))
86
86
  }));
87
87
  RawSet_1.RawSet.drVarDecoding(newTemp, vars);
@@ -40,7 +40,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
40
40
  function verb(n) { return function (v) { return step([n, v]); }; }
41
41
  function step(op) {
42
42
  if (f) throw new TypeError("Generator is already executing.");
43
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
43
+ while (_) try {
44
44
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
45
45
  if (y = 0, t) op = [op[0] & 2, t.value];
46
46
  switch (op[0]) {
@@ -70,8 +70,10 @@ var OperatorExecuter_1 = require("./OperatorExecuter");
70
70
  var DrAppender = /** @class */ (function (_super) {
71
71
  __extends(DrAppender, _super);
72
72
  function DrAppender(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
73
+ var _this = this;
73
74
  source.operatorAround = undefined;
74
- return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
75
+ _this = _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
76
+ return _this;
75
77
  }
76
78
  DrAppender.prototype.executeAttrRequire = function (attr) {
77
79
  var _a, _b, _c, _d;
@@ -82,7 +84,7 @@ var DrAppender = /** @class */ (function (_super) {
82
84
  itRandom = RawSet_1.RawSet.drItOtherEncoding(this.elementSource.element);
83
85
  vars = RawSet_1.RawSet.drVarEncoding(this.elementSource.element, (_a = this.elementSource.attrs.drVarOption) !== null && _a !== void 0 ? _a : '');
84
86
  newTemp = this.source.config.window.document.createElement('temp');
85
- ScriptUtils_1.ScriptUtils.eval("\n try{\n ".concat(this.render.bindScript, "\n ").concat((_b = this.elementSource.attrs.drBeforeOption) !== null && _b !== void 0 ? _b : '', "\n const ifWrap = document.createElement('div');\n ifWrap.setAttribute('dr-strip', 'true');\n ifWrap.setAttribute('dr-if', '").concat(this.elementSource.attrs.drAppender, " && ").concat(this.elementSource.attrs.drAppender, ".length > 0');\n const n = this.__render.element.cloneNode(true);\n Object.entries(this.__render.drAttr).filter(([k,v]) => k !== 'drAppender' && v).forEach(([k, v]) => n.setAttribute(this.__render.drAttrsOriginName[k], v));\n n.setAttribute('dr-for-of', '").concat(this.elementSource.attrs.drAppender, "[' + (").concat(this.elementSource.attrs.drAppender, ".length-1) + ']');\n n.setAttribute('dr-next', '").concat(this.elementSource.attrs.drAppender, ",' + ").concat(this.elementSource.attrs.drAppender, ".length);\n ifWrap.append(n);\n this.__render.fag.append(ifWrap);\n ").concat((_c = this.elementSource.attrs.drAfterOption) !== null && _c !== void 0 ? _c : '', "\n }catch(e){}\n "), Object.assign(this.source.obj, {
87
+ ScriptUtils_1.ScriptUtils.eval("\n try{\n " + this.render.bindScript + "\n " + ((_b = this.elementSource.attrs.drBeforeOption) !== null && _b !== void 0 ? _b : '') + "\n const ifWrap = document.createElement('div');\n ifWrap.setAttribute('dr-strip', 'true');\n ifWrap.setAttribute('dr-if', '" + this.elementSource.attrs.drAppender + " && " + this.elementSource.attrs.drAppender + ".length > 0');\n const n = this.__render.element.cloneNode(true);\n Object.entries(this.__render.drAttr).filter(([k,v]) => k !== 'drAppender' && v).forEach(([k, v]) => n.setAttribute(this.__render.drAttrsOriginName[k], v));\n n.setAttribute('dr-for-of', '" + this.elementSource.attrs.drAppender + "[' + (" + this.elementSource.attrs.drAppender + ".length-1) + ']');\n n.setAttribute('dr-next', '" + this.elementSource.attrs.drAppender + ",' + " + this.elementSource.attrs.drAppender + ".length);\n ifWrap.append(n);\n this.__render.fag.append(ifWrap);\n " + ((_c = this.elementSource.attrs.drAfterOption) !== null && _c !== void 0 ? _c : '') + "\n }catch(e){}\n ", Object.assign(this.source.obj, {
86
88
  __render: Object.freeze(__assign({ drStripOption: this.elementSource.attrs.drStripOption, drAttr: this.elementSource.attrs, drAttrsOriginName: RawSet_1.RawSet.drAttrsOriginName, fag: newTemp }, this.render
87
89
  // eslint-disable-next-line no-use-before-define
88
90
  ))
@@ -40,7 +40,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
40
40
  function verb(n) { return function (v) { return step([n, v]); }; }
41
41
  function step(op) {
42
42
  if (f) throw new TypeError("Generator is already executing.");
43
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
43
+ while (_) try {
44
44
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
45
45
  if (y = 0, t) op = [op[0] & 2, t.value];
46
46
  switch (op[0]) {
@@ -70,8 +70,10 @@ var OperatorExecuter_1 = require("./OperatorExecuter");
70
70
  var DrFor = /** @class */ (function (_super) {
71
71
  __extends(DrFor, _super);
72
72
  function DrFor(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
73
+ var _this = this;
73
74
  source.operatorAround = undefined;
74
- return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
75
+ _this = _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
76
+ return _this;
75
77
  }
76
78
  DrFor.prototype.executeAttrRequire = function (attr) {
77
79
  var _a, _b, _c, _d;
@@ -82,7 +84,7 @@ var DrFor = /** @class */ (function (_super) {
82
84
  itRandom = RawSet_1.RawSet.drItOtherEncoding(this.elementSource.element);
83
85
  vars = RawSet_1.RawSet.drVarEncoding(this.elementSource.element, (_a = this.elementSource.attrs.drVarOption) !== null && _a !== void 0 ? _a : '');
84
86
  newTemp = this.source.config.window.document.createElement('temp');
85
- ScriptUtils_1.ScriptUtils.eval("\n ".concat(this.render.bindScript, "\n ").concat((_b = this.elementSource.attrs.drBeforeOption) !== null && _b !== void 0 ? _b : '', "\n for(").concat(attr, ") {\n const n = this.__render.element.cloneNode(true);\n var destIt = ").concat(this.elementSource.attrs.drItOption, ";\n if (destIt !== undefined) {\n n.getAttributeNames().forEach(it => n.setAttribute(it, n.getAttribute(it).replace(/\\#it\\#/g, destIt).replace(/\\#nearForIt\\#/g, destIt).replace(/\\#nearForIndex\\#/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 }\n ").concat((_c = this.elementSource.attrs.drAfterOption) !== null && _c !== void 0 ? _c : '', "\n "), Object.assign(this.source.obj, {
87
+ ScriptUtils_1.ScriptUtils.eval("\n " + this.render.bindScript + "\n " + ((_b = this.elementSource.attrs.drBeforeOption) !== null && _b !== void 0 ? _b : '') + "\n for(" + attr + ") {\n const n = this.__render.element.cloneNode(true);\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).replace(/\\#nearForIt\\#/g, destIt).replace(/\\#nearForIndex\\#/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 }\n " + ((_c = this.elementSource.attrs.drAfterOption) !== null && _c !== void 0 ? _c : '') + "\n ", Object.assign(this.source.obj, {
86
88
  __render: Object.freeze(__assign({ fag: newTemp, drStripOption: this.elementSource.attrs.drStripOption }, this.render))
87
89
  }));
88
90
  RawSet_1.RawSet.drVarDecoding(newTemp, vars);
@@ -40,7 +40,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
40
40
  function verb(n) { return function (v) { return step([n, v]); }; }
41
41
  function step(op) {
42
42
  if (f) throw new TypeError("Generator is already executing.");
43
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
43
+ while (_) try {
44
44
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
45
45
  if (y = 0, t) op = [op[0] & 2, t.value];
46
46
  switch (op[0]) {
@@ -70,8 +70,10 @@ var OperatorExecuter_1 = require("./OperatorExecuter");
70
70
  var DrForOf = /** @class */ (function (_super) {
71
71
  __extends(DrForOf, _super);
72
72
  function DrForOf(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
73
+ var _this = this;
73
74
  source.operatorAround = undefined;
74
- return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
75
+ _this = _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
76
+ return _this;
75
77
  }
76
78
  DrForOf.prototype.executeAttrRequire = function (attr) {
77
79
  var _a, _b, _c, _d;
@@ -82,7 +84,7 @@ var DrForOf = /** @class */ (function (_super) {
82
84
  itRandom = RawSet_1.RawSet.drItOtherEncoding(this.elementSource.element);
83
85
  vars = RawSet_1.RawSet.drVarEncoding(this.elementSource.element, (_a = this.elementSource.attrs.drVarOption) !== null && _a !== void 0 ? _a : '');
84
86
  newTemp = this.source.config.window.document.createElement('temp');
85
- ScriptUtils_1.ScriptUtils.eval("\n ".concat(this.render.bindScript, "\n ").concat((_b = this.elementSource.attrs.drBeforeOption) !== null && _b !== void 0 ? _b : '', "\n var i = 0; \n const forOf = ").concat(attr, ";\n const forOfStr = `").concat(attr, "`.trim();\n if (forOf) {\n for(const it of forOf) {\n var destIt = it;\n if (/\\[(.*,?)\\],/g.test(forOfStr)) {\n if (typeof it === 'string') {\n destIt = it;\n } else {\n destIt = forOfStr.substring(1, forOfStr.length-1).split(',')[i];\n }\n } else if (forOf.isRange) {\n destIt = it;\n } else {\n destIt = forOfStr + '[' + i +']'\n }\n const n = this.__render.element.cloneNode(true);\n Object.entries(this.__render.drAttr).filter(([k,v]) => k !== 'drForOf' && k !== 'drNextOption' && v).forEach(([k, v]) => n.setAttribute(this.__render.drAttrsOriginName[k], v));\n 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)))\n n.innerHTML = n.innerHTML.replace(/\\#it\\#/g, destIt).replace(/\\#index\\#/g, i);\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 \n if('").concat(this.elementSource.attrs.drNextOption, "' !== 'null') {\n const n = this.__render.element.cloneNode(true);\n Object.entries(this.__render.drAttr).filter(([k,v]) => k !== 'drForOf' && k !== 'drNextOption' && v).forEach(([k, v]) => n.setAttribute(this.__render.drAttrsOriginName[k], v));\n const [name, idx] = '").concat(this.elementSource.attrs.drNextOption, "'.split(',');\n n.setAttribute('dr-for-of', name + '[' + idx + ']');\n n.setAttribute('dr-next', name + ',' + (Number(idx) + 1));\n this.__render.fag.append(n);\n }\n }\n ").concat((_c = this.elementSource.attrs.drAfterOption) !== null && _c !== void 0 ? _c : '', "\n "), Object.assign(this.source.obj, {
87
+ 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 forOf = " + attr + ";\n const forOfStr = `" + attr + "`.trim();\n if (forOf) {\n for(const it of forOf) {\n var destIt = it;\n if (/\\[(.*,?)\\],/g.test(forOfStr)) {\n if (typeof it === 'string') {\n destIt = it;\n } else {\n destIt = forOfStr.substring(1, forOfStr.length-1).split(',')[i];\n }\n } else if (forOf.isRange) {\n destIt = it;\n } else {\n destIt = forOfStr + '[' + i +']'\n }\n const n = this.__render.element.cloneNode(true);\n Object.entries(this.__render.drAttr).filter(([k,v]) => k !== 'drForOf' && k !== 'drNextOption' && v).forEach(([k, v]) => n.setAttribute(this.__render.drAttrsOriginName[k], v));\n 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)))\n n.innerHTML = n.innerHTML.replace(/\\#it\\#/g, destIt).replace(/\\#index\\#/g, i);\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 \n if('" + this.elementSource.attrs.drNextOption + "' !== 'null') {\n const n = this.__render.element.cloneNode(true);\n Object.entries(this.__render.drAttr).filter(([k,v]) => k !== 'drForOf' && k !== 'drNextOption' && v).forEach(([k, v]) => n.setAttribute(this.__render.drAttrsOriginName[k], v));\n const [name, idx] = '" + this.elementSource.attrs.drNextOption + "'.split(',');\n n.setAttribute('dr-for-of', name + '[' + idx + ']');\n n.setAttribute('dr-next', name + ',' + (Number(idx) + 1));\n this.__render.fag.append(n);\n }\n }\n " + ((_c = this.elementSource.attrs.drAfterOption) !== null && _c !== void 0 ? _c : '') + "\n ", Object.assign(this.source.obj, {
86
88
  __render: Object.freeze(__assign({ drStripOption: this.elementSource.attrs.drStripOption, drAttr: this.elementSource.attrs, drAttrsOriginName: RawSet_1.RawSet.drAttrsOriginName, fag: newTemp }, this.render
87
89
  // eslint-disable-next-line no-use-before-define
88
90
  ))
@@ -40,7 +40,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
40
40
  function verb(n) { return function (v) { return step([n, v]); }; }
41
41
  function step(op) {
42
42
  if (f) throw new TypeError("Generator is already executing.");
43
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
43
+ while (_) try {
44
44
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
45
45
  if (y = 0, t) op = [op[0] & 2, t.value];
46
46
  switch (op[0]) {
@@ -83,9 +83,9 @@ var DrForm = /** @class */ (function (_super) {
83
83
  var _this = this;
84
84
  return __generator(this, function (_c) {
85
85
  RawSet_1.RawSet.drFormOtherMoveAttr(this.elementSource.element, 'name', 'temp-name', this.source.config);
86
- data = ScriptUtils_1.ScriptUtils.evalReturn("".concat(attr), this.source.obj);
86
+ data = ScriptUtils_1.ScriptUtils.evalReturn("" + attr, this.source.obj);
87
87
  childs = Array.from(this.elementSource.element.querySelectorAll('[name]'));
88
- fromName = ScriptUtils_1.ScriptUtils.evalReturn((_a = this.elementSource.element.getAttribute("".concat(RawSet_1.RawSet.DR_FORM_NAME, ":name"))) !== null && _a !== void 0 ? _a : '', this.source.obj);
88
+ fromName = ScriptUtils_1.ScriptUtils.evalReturn((_a = this.elementSource.element.getAttribute(RawSet_1.RawSet.DR_FORM_NAME + ":name")) !== null && _a !== void 0 ? _a : '', this.source.obj);
89
89
  thisName = fromName !== null && fromName !== void 0 ? fromName : this.elementSource.element.getAttribute('name');
90
90
  // // 자기자신이 Input 대상일때
91
91
  if (childs.length <= 0 && thisName) {
@@ -98,32 +98,32 @@ var DrForm = /** @class */ (function (_super) {
98
98
  }
99
99
  childs.forEach(function (it) {
100
100
  var _a, _b, _c, _d, _e;
101
- var eventName = (_a = it.getAttribute("".concat(RawSet_1.RawSet.DR_FORM_NAME, ":event"))) !== null && _a !== void 0 ? _a : 'change';
102
- var validatorName = it.getAttribute("".concat(RawSet_1.RawSet.DR_FORM_NAME, ":validator"));
101
+ var eventName = (_a = it.getAttribute(RawSet_1.RawSet.DR_FORM_NAME + ":event")) !== null && _a !== void 0 ? _a : 'change';
102
+ var validatorName = it.getAttribute(RawSet_1.RawSet.DR_FORM_NAME + ":validator");
103
103
  var attrEventName = EventManager_1.EventManager.attrPrefix + 'event-' + eventName;
104
- var varpath = (_c = ScriptUtils_1.ScriptUtils.evalReturn((_b = _this.elementSource.element.getAttribute("".concat(RawSet_1.RawSet.DR_FORM_NAME, ":name"))) !== null && _b !== void 0 ? _b : '', _this.source.obj)) !== null && _c !== void 0 ? _c : it.getAttribute('name');
104
+ var varpath = (_c = ScriptUtils_1.ScriptUtils.evalReturn((_b = _this.elementSource.element.getAttribute(RawSet_1.RawSet.DR_FORM_NAME + ":name")) !== null && _b !== void 0 ? _b : '', _this.source.obj)) !== null && _c !== void 0 ? _c : it.getAttribute('name');
105
105
  if (varpath != null) {
106
106
  if (validatorName) {
107
- ScriptUtils_1.ScriptUtils.eval("\n ".concat(_this.render.bindScript, "\n const validator = typeof ").concat(validatorName, " ==='function' ? new ").concat(validatorName, "() : ").concat(validatorName, ";\n ").concat(attr, "['").concat(varpath, "'] = validator;\n "), Object.assign(_this.source.obj, {
107
+ ScriptUtils_1.ScriptUtils.eval("\n " + _this.render.bindScript + "\n const validator = typeof " + validatorName + " ==='function' ? new " + validatorName + "() : " + validatorName + ";\n " + attr + "['" + varpath + "'] = validator;\n ", Object.assign(_this.source.obj, {
108
108
  __render: Object.freeze(__assign({ drStripOption: _this.elementSource.attrs.drStripOption }, _this.render))
109
109
  }));
110
110
  }
111
- varpath = "".concat(attr, "['").concat(varpath, "']");
112
- var data_1 = ScriptUtils_1.ScriptUtils.evalReturn("".concat(varpath), _this.source.obj);
111
+ varpath = attr + "['" + varpath + "']";
112
+ var data_1 = ScriptUtils_1.ScriptUtils.evalReturn("" + varpath, _this.source.obj);
113
113
  if (data_1 instanceof ValidatorArray_1.ValidatorArray) {
114
- it.setAttribute(attrEventName, "".concat(varpath, ".setArrayValue($target, $target.value, $event); ").concat((_d = it.getAttribute(attrEventName)) !== null && _d !== void 0 ? _d : '', ";"));
114
+ it.setAttribute(attrEventName, varpath + ".setArrayValue($target, $target.value, $event); " + ((_d = it.getAttribute(attrEventName)) !== null && _d !== void 0 ? _d : '') + ";");
115
115
  data_1.addValidator(it.value, it);
116
116
  }
117
117
  else if (data_1 instanceof Validator_1.Validator) {
118
118
  // varpath += (varpath ? '.value' : 'value');
119
119
  // varpath = drAttr.drForm + '.' + varpath;
120
120
  // it.setAttribute(attrEventName, `${varpath} = $target.value; ${target}=$target; ${event}=$event;`);
121
- it.setAttribute(attrEventName, "".concat(varpath, ".set($target.value, $target, $event); ").concat((_e = it.getAttribute(attrEventName)) !== null && _e !== void 0 ? _e : '', ";"));
121
+ it.setAttribute(attrEventName, varpath + ".set($target.value, $target, $event); " + ((_e = it.getAttribute(attrEventName)) !== null && _e !== void 0 ? _e : '') + ";");
122
122
  data_1.setTarget(it);
123
123
  data_1.value = it.value;
124
124
  }
125
125
  else {
126
- it.setAttribute(attrEventName, "".concat(varpath, " = $target.value;"));
126
+ it.setAttribute(attrEventName, varpath + " = $target.value;");
127
127
  }
128
128
  }
129
129
  });
package/operators/DrIf.js CHANGED
@@ -40,7 +40,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
40
40
  function verb(n) { return function (v) { return step([n, v]); }; }
41
41
  function step(op) {
42
42
  if (f) throw new TypeError("Generator is already executing.");
43
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
43
+ while (_) try {
44
44
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
45
45
  if (y = 0, t) op = [op[0] & 2, t.value];
46
46
  switch (op[0]) {
@@ -70,8 +70,10 @@ var OperatorExecuter_1 = require("./OperatorExecuter");
70
70
  var DrIf = /** @class */ (function (_super) {
71
71
  __extends(DrIf, _super);
72
72
  function DrIf(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
73
+ var _this = this;
73
74
  source.operatorAround = undefined;
74
- return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
75
+ _this = _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
76
+ return _this;
75
77
  }
76
78
  DrIf.prototype.executeAttrRequire = function (attr) {
77
79
  var _a, _b, _c, _d;
@@ -82,7 +84,7 @@ var DrIf = /** @class */ (function (_super) {
82
84
  itRandom = RawSet_1.RawSet.drItOtherEncoding(this.elementSource.element);
83
85
  vars = RawSet_1.RawSet.drVarEncoding(this.elementSource.element, (_a = this.elementSource.attrs.drVarOption) !== null && _a !== void 0 ? _a : '');
84
86
  newTemp = this.source.config.window.document.createElement('temp');
85
- keepgoing = ScriptUtils_1.ScriptUtils.eval("\n ".concat(this.render.bindScript, "\n ").concat((_b = this.elementSource.attrs.drBeforeOption) !== null && _b !== void 0 ? _b : '', "\n if ($rawset.data === (").concat(attr, ")) {\n return false;\n }\n $rawset.data = ").concat(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 = ").concat(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 ").concat((_c = this.elementSource.attrs.drAfterOption) !== null && _c !== void 0 ? _c : '', ";\n return true;\n "), Object.assign(this.source.obj, {
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, {
86
88
  __render: Object.freeze(__assign({ fag: newTemp, drAttr: this.elementSource.attrs, drAttrsOriginName: RawSet_1.RawSet.drAttrsOriginName, drStripOption: this.elementSource.attrs.drStripOption }, this.render))
87
89
  }));
88
90
  // TODO: 뭐지?? 지워야되는거 아닌가?
@@ -40,7 +40,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
40
40
  function verb(n) { return function (v) { return step([n, v]); }; }
41
41
  function step(op) {
42
42
  if (f) throw new TypeError("Generator is already executing.");
43
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
43
+ while (_) try {
44
44
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
45
45
  if (y = 0, t) op = [op[0] & 2, t.value];
46
46
  switch (op[0]) {
@@ -79,7 +79,7 @@ var DrInnerHTML = /** @class */ (function (_super) {
79
79
  var _d;
80
80
  return __generator(this, function (_e) {
81
81
  newTemp = this.source.config.window.document.createElement('temp');
82
- ScriptUtils_1.ScriptUtils.eval("\n ".concat(this.render.bindScript, "\n const n = $element.cloneNode(true);\n ").concat((_a = this.elementSource.attrs.drBeforeOption) !== null && _a !== void 0 ? _a : '', "\n n.innerHTML = ").concat(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 ").concat((_b = this.elementSource.attrs.drAfterOption) !== null && _b !== void 0 ? _b : '', "\n "), Object.assign(this.source.obj, {
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
83
  __render: Object.freeze(__assign({ drStripOption: this.elementSource.attrs.drStripOption, fag: newTemp }, this.render
84
84
  // eslint-disable-next-line no-use-before-define
85
85
  ))
@@ -40,7 +40,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
40
40
  function verb(n) { return function (v) { return step([n, v]); }; }
41
41
  function step(op) {
42
42
  if (f) throw new TypeError("Generator is already executing.");
43
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
43
+ while (_) try {
44
44
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
45
45
  if (y = 0, t) op = [op[0] & 2, t.value];
46
46
  switch (op[0]) {
@@ -79,7 +79,7 @@ var DrInnerText = /** @class */ (function (_super) {
79
79
  var _d;
80
80
  return __generator(this, function (_e) {
81
81
  newTemp = this.source.config.window.document.createElement('temp');
82
- ScriptUtils_1.ScriptUtils.eval(" \n ".concat(this.render.bindScript, "\n const n = $element.cloneNode(true); \n ").concat((_a = this.elementSource.attrs.drBeforeOption) !== null && _a !== void 0 ? _a : '', "\n n.innerText = ").concat(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 ").concat((_b = this.elementSource.attrs.drAfterOption) !== null && _b !== void 0 ? _b : '', "\n "), Object.assign(this.source.obj, {
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
83
  __render: Object.freeze(__assign({ drStripOption: this.elementSource.attrs.drStripOption, fag: newTemp }, this.render))
84
84
  }));
85
85
  tempalte = this.source.config.window.document.createElement('template');
@@ -29,7 +29,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
29
29
  function verb(n) { return function (v) { return step([n, v]); }; }
30
30
  function step(op) {
31
31
  if (f) throw new TypeError("Generator is already executing.");
32
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
32
+ while (_) try {
33
33
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
34
34
  if (y = 0, t) op = [op[0] & 2, t.value];
35
35
  switch (op[0]) {
@@ -56,8 +56,10 @@ var OperatorExecuter_1 = require("./OperatorExecuter");
56
56
  var DrPre = /** @class */ (function (_super) {
57
57
  __extends(DrPre, _super);
58
58
  function DrPre(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
59
+ var _this = this;
59
60
  source.operatorAround = undefined;
60
- return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack) || this;
61
+ _this = _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack) || this;
62
+ return _this;
61
63
  }
62
64
  DrPre.prototype.execute = function (value) {
63
65
  return __awaiter(this, void 0, void 0, function () {