dom-render 1.0.67 → 1.0.68

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 (55) hide show
  1. package/DomRender.js +2 -1
  2. package/DomRenderProxy.d.ts +3 -2
  3. package/DomRenderProxy.js +74 -9
  4. package/RawSet.js +128 -84
  5. package/dist/bundle.js +2268 -3056
  6. package/events/EventManager.d.ts +1 -1
  7. package/events/EventManager.js +69 -95
  8. package/iterators/Range.d.ts +0 -1
  9. package/iterators/Range.js +7 -33
  10. package/managers/RenderManager.js +1 -1
  11. package/package.json +9 -9
  12. package/types/Types.js +2 -2
  13. package/utils/clipboard/ClipBoardUtils.js +1 -1
  14. package/utils/dom/DomUtils.js +1 -1
  15. package/utils/location/LocationUtils.js +1 -1
  16. package/utils/node/NodeUtils.js +3 -1
  17. package/utils/random/RandomUtils.js +2 -1
  18. package/utils/script/ScriptUtils.js +24 -43
  19. package/utils/storage/StorageUtils.js +1 -1
  20. package/utils/string/StringUtils.js +18 -1
  21. package/utils/valid/ValidUtils.js +6 -1
  22. package/validators/AllCheckedValidatorArray.js +1 -1
  23. package/validators/AllUnCheckedValidatorArray.js +1 -1
  24. package/validators/CheckedValidator.js +1 -1
  25. package/validators/CountEqualsCheckedValidatorArray.js +1 -1
  26. package/validators/CountEqualsUnCheckedValidatorArray.js +1 -1
  27. package/validators/CountGreaterThanCheckedValidatorArray.js +1 -1
  28. package/validators/CountGreaterThanEqualsCheckedValidatorArray.js +1 -1
  29. package/validators/CountGreaterThanEqualsUnCheckedValidatorArray.js +1 -1
  30. package/validators/CountGreaterThanUnCheckedValidatorArray.js +1 -1
  31. package/validators/CountLessThanCheckedValidatorArray.js +1 -1
  32. package/validators/CountLessThanEqualsCheckedValidatorArray.js +1 -1
  33. package/validators/CountLessThanEqualsUnCheckedValidatorArray.js +1 -1
  34. package/validators/CountLessThanUnCheckedValidatorArray.js +1 -1
  35. package/validators/CountUnCheckedValidatorArray.js +1 -1
  36. package/validators/EmptyValidator.js +1 -1
  37. package/validators/ExcludeCheckedValidatorArray.js +1 -1
  38. package/validators/FormValidator.js +1 -1
  39. package/validators/IncludeCheckedValidatorArray.js +1 -1
  40. package/validators/MultipleValidator.js +2 -1
  41. package/validators/NonPassValidator.js +1 -1
  42. package/validators/NotEmptyValidator.js +2 -1
  43. package/validators/NotRegExpTestValidator.js +1 -1
  44. package/validators/PassValidator.js +1 -1
  45. package/validators/RegExpTestValidator.js +2 -1
  46. package/validators/RequiredValidator.js +2 -1
  47. package/validators/UnCheckedValidator.js +1 -1
  48. package/validators/ValidMultipleValidator.js +1 -1
  49. package/validators/ValidValidator.js +1 -1
  50. package/validators/ValidValidatorArray.js +1 -1
  51. package/validators/Validator.js +12 -24
  52. package/validators/ValidatorArray.js +1 -1
  53. package/validators/ValueEqualsValidator.js +1 -1
  54. package/validators/ValueNotEqualsValidator.js +1 -1
  55. package/dist/bundle.js.map +0 -1
@@ -23,7 +23,7 @@ export declare class EventManager {
23
23
  changeVar(obj: any, elements: Set<Element> | Set<ChildNode>, varName?: string): void;
24
24
  addDrEvents(obj: any, eventName: string, elements: Set<Element> | Set<ChildNode>, config?: Config): void;
25
25
  addDrEventPram(obj: any, attr: string, elements: Set<ChildNode> | Set<Element>, config?: Config): void;
26
- procAttr<T extends Element = Element>(elements: Set<ChildNode> | Set<Element> | undefined, attrName: string, callBack: (h: T, value: string, attributes: any) => void): void;
26
+ procAttr<T extends Element = Element>(elements: Set<Element> | Set<ChildNode> | undefined, attrName: string, callBack: (h: T, value: string, attributes: any) => void): void;
27
27
  getValue<T = any>(obj: any, name: string, bindObj?: any): T;
28
28
  setValue(obj: any, name: string, value?: any): void;
29
29
  isUsingThisVar(raws: string | null | undefined, varName: string | null | undefined): boolean;
@@ -1,38 +1,11 @@
1
1
  "use strict";
2
- var __read = (this && this.__read) || function (o, n) {
3
- var m = typeof Symbol === "function" && o[Symbol.iterator];
4
- if (!m) return o;
5
- var i = m.call(o), r, ar = [], e;
6
- try {
7
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
8
- }
9
- catch (error) { e = { error: error }; }
10
- finally {
11
- try {
12
- if (r && !r.done && (m = i["return"])) m.call(i);
13
- }
14
- finally { if (e) throw e.error; }
15
- }
16
- return ar;
17
- };
18
- var __values = (this && this.__values) || function(o) {
19
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
20
- if (m) return m.call(o);
21
- if (o && typeof o.length === "number") return {
22
- next: function () {
23
- if (o && i >= o.length) o = void 0;
24
- return { value: o && o[i++], done: !o };
25
- }
26
- };
27
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
28
- };
29
2
  Object.defineProperty(exports, "__esModule", { value: true });
30
3
  exports.eventManager = exports.EventManager = void 0;
31
4
  var ScriptUtils_1 = require("../utils/script/ScriptUtils");
32
5
  var DomUtils_1 = require("../utils/dom/DomUtils");
33
6
  var Range_1 = require("../iterators/Range");
34
7
  var Types_1 = require("../types/Types");
35
- var EventManager = (function () {
8
+ var EventManager = /** @class */ (function () {
36
9
  function EventManager() {
37
10
  var _this = this;
38
11
  this.attrPrefix = 'dr-';
@@ -82,8 +55,14 @@ var EventManager = (function () {
82
55
  });
83
56
  }
84
57
  }
58
+ // // 순환참조때문에 우선 여기에 뺴놓는다.
59
+ // public DomrenderProxyFinal(obj: any) {
60
+ // (obj as any)._DomRender_isFinal = true;
61
+ // return obj;
62
+ // }
85
63
  EventManager.prototype.findAttrElements = function (fragment, config) {
86
64
  var _a, _b;
65
+ // const datas: {name: string, value: string | null, element: Element}[] = [];
87
66
  var elements = new Set();
88
67
  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 : [];
89
68
  addAttributes.concat(this.attrNames).forEach(function (attrName) {
@@ -93,12 +72,22 @@ var EventManager = (function () {
93
72
  });
94
73
  return elements;
95
74
  };
75
+ // eslint-disable-next-line no-undef
96
76
  EventManager.prototype.applyEvent = function (obj, childNodes, config) {
97
77
  var _this = this;
78
+ // console.log('eventManager applyEvent==>', obj, childNodes, config)
79
+ // Node.ELEMENT_NODE = 1
80
+ // event
81
+ // childNodes.forEach(it => {
82
+ // if (it instanceof Element) {
83
+ // it.setAttribute('dr-thieVariableName', 'this')
84
+ // }
85
+ // })
98
86
  this.eventNames.forEach(function (it) {
99
87
  _this.addDrEvents(obj, it, childNodes, config);
100
88
  });
101
89
  this.addDrEventPram(obj, this.eventParam, childNodes, config);
90
+ // value
102
91
  this.procAttr(childNodes, this.attrPrefix + 'value', function (it, attribute) {
103
92
  var script = attribute;
104
93
  if (script) {
@@ -108,11 +97,13 @@ var EventManager = (function () {
108
97
  }
109
98
  }
110
99
  });
100
+ // window event
111
101
  EventManager.WINDOW_EVENTS.forEach(function (it) {
112
102
  _this.procAttr(childNodes, _this.attrPrefix + 'window-event-' + it, function (it, attribute) {
113
103
  it.obj = obj;
114
104
  });
115
105
  });
106
+ // on-init event
116
107
  this.procAttr(childNodes, this.attrPrefix + 'on-init', function (it, attribute) {
117
108
  var script = attribute;
118
109
  if (script) {
@@ -124,8 +115,15 @@ var EventManager = (function () {
124
115
  element: it
125
116
  })
126
117
  }));
118
+ // console.log('onInit--->', obj, varName, it)
119
+ // if (typeof this.getValue(obj, varName) === 'function') {
120
+ // this.getValue(obj, varName)(it);
121
+ // } else {
122
+ // this.setValue(obj, varName, it);
123
+ // }
127
124
  }
128
125
  });
126
+ // value-link event
129
127
  this.procAttr(childNodes, this.attrPrefix + 'value-link', function (it, varName) {
130
128
  if (varName) {
131
129
  var ownerVariablePathName = it.getAttribute(EventManager.ownerVariablePathAttrName);
@@ -156,14 +154,18 @@ var EventManager = (function () {
156
154
  }
157
155
  });
158
156
  this.changeVar(obj, childNodes, undefined);
157
+ // console.log('eventManager-applyEvent-->', config?.applyEvents)
159
158
  var elements = Array.from(childNodes).filter(function (it) { return it.nodeType === 1; }).map(function (it) { return it; });
160
159
  elements.forEach(function (it) {
161
160
  var _a;
162
161
  (_a = config === null || config === void 0 ? void 0 : config.applyEvents) === null || _a === void 0 ? void 0 : _a.filter(function (ta) { return it.getAttribute(ta.attrName); }).forEach(function (ta) { return ta.callBack(it, it.getAttribute(ta.attrName), obj); });
163
162
  });
164
163
  };
164
+ // eslint-disable-next-line no-undef
165
165
  EventManager.prototype.changeVar = function (obj, elements, varName) {
166
166
  var _this = this;
167
+ // console.log('-changeVar-->', obj, elements, varName)
168
+ // value-link event
167
169
  this.procAttr(elements, this.attrPrefix + 'value-link', function (it, attribute) {
168
170
  var ownerVariablePathName = it.getAttribute(EventManager.ownerVariablePathAttrName);
169
171
  var bindObj = obj;
@@ -182,8 +184,8 @@ var EventManager = (function () {
182
184
  }
183
185
  }
184
186
  });
187
+ // attribute
185
188
  this.procAttr(elements, this.attrPrefix + 'attr', function (it, attribute) {
186
- var e_1, _a;
187
189
  var script = attribute;
188
190
  if (script) {
189
191
  script = 'return ' + script;
@@ -196,7 +198,7 @@ var EventManager = (function () {
196
198
  }));
197
199
  if (typeof data === 'string') {
198
200
  data.split(',').forEach(function (sit) {
199
- var _a = __read(sit.split('='), 2), key = _a[0], value = _a[1];
201
+ var _a = sit.split('='), key = _a[0], value = _a[1];
200
202
  var s = value.trim();
201
203
  var k = key.trim();
202
204
  if (s === 'null') {
@@ -209,7 +211,7 @@ var EventManager = (function () {
209
211
  }
210
212
  else if (Array.isArray(data)) {
211
213
  data.forEach(function (sit) {
212
- var _a = __read(sit.split('='), 2), key = _a[0], value = _a[1];
214
+ var _a = sit.split('='), key = _a[0], value = _a[1];
213
215
  var s = value.trim();
214
216
  var k = key.trim();
215
217
  if (s === 'null') {
@@ -221,29 +223,20 @@ var EventManager = (function () {
221
223
  });
222
224
  }
223
225
  else {
224
- try {
225
- for (var _b = __values(Object.entries(data)), _c = _b.next(); !_c.done; _c = _b.next()) {
226
- var _d = __read(_c.value, 2), key = _d[0], value = _d[1];
227
- if (value === null) {
228
- it.removeAttribute(key);
229
- }
230
- else {
231
- it.setAttribute(key, String(value));
232
- }
226
+ for (var _i = 0, _a = Object.entries(data); _i < _a.length; _i++) {
227
+ var _b = _a[_i], key = _b[0], value = _b[1];
228
+ if (value === null) {
229
+ it.removeAttribute(key);
233
230
  }
234
- }
235
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
236
- finally {
237
- try {
238
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
231
+ else {
232
+ it.setAttribute(key, String(value));
239
233
  }
240
- finally { if (e_1) throw e_1.error; }
241
234
  }
242
235
  }
243
236
  }
244
237
  });
238
+ // style
245
239
  this.procAttr(elements, this.attrPrefix + 'style', function (it, attribute) {
246
- var e_2, _a;
247
240
  var script = attribute;
248
241
  if (script) {
249
242
  script = 'return ' + script;
@@ -261,26 +254,17 @@ var EventManager = (function () {
261
254
  it.setAttribute('style', data.join(';'));
262
255
  }
263
256
  else {
264
- try {
265
- for (var _b = __values(Object.entries(data)), _c = _b.next(); !_c.done; _c = _b.next()) {
266
- var _d = __read(_c.value, 2), key = _d[0], value = _d[1];
267
- if (it instanceof HTMLElement) {
268
- it.style[key] = String(value);
269
- }
270
- }
271
- }
272
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
273
- finally {
274
- try {
275
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
257
+ for (var _i = 0, _a = Object.entries(data); _i < _a.length; _i++) {
258
+ var _b = _a[_i], key = _b[0], value = _b[1];
259
+ if (it instanceof HTMLElement) {
260
+ it.style[key] = String(value);
276
261
  }
277
- finally { if (e_2) throw e_2.error; }
278
262
  }
279
263
  }
280
264
  }
281
265
  });
266
+ // class
282
267
  this.procAttr(elements, this.attrPrefix + 'class', function (it, attribute) {
283
- var e_3, _a;
284
268
  var script = attribute;
285
269
  if (script) {
286
270
  script = 'return ' + script;
@@ -298,30 +282,22 @@ var EventManager = (function () {
298
282
  it.setAttribute('class', data.join(' '));
299
283
  }
300
284
  else {
301
- try {
302
- for (var _b = __values(Object.entries(data)), _c = _b.next(); !_c.done; _c = _b.next()) {
303
- var _d = __read(_c.value, 2), key = _d[0], value = _d[1];
304
- if (it instanceof HTMLElement) {
305
- if (value) {
306
- it.classList.add(key);
307
- }
308
- else {
309
- it.classList.remove(key);
310
- }
285
+ for (var _i = 0, _a = Object.entries(data); _i < _a.length; _i++) {
286
+ var _b = _a[_i], key = _b[0], value = _b[1];
287
+ if (it instanceof HTMLElement) {
288
+ if (value) {
289
+ it.classList.add(key);
290
+ }
291
+ else {
292
+ it.classList.remove(key);
311
293
  }
312
294
  }
313
295
  }
314
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
315
- finally {
316
- try {
317
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
318
- }
319
- finally { if (e_3) throw e_3.error; }
320
- }
321
296
  }
322
297
  }
323
298
  });
324
299
  };
300
+ // eslint-disable-next-line no-undef
325
301
  EventManager.prototype.addDrEvents = function (obj, eventName, elements, config) {
326
302
  var _this = this;
327
303
  var attr = this.attrPrefix + 'event-' + eventName;
@@ -357,10 +333,10 @@ var EventManager = (function () {
357
333
  var params_1 = {};
358
334
  var prefix_1 = attr + ':';
359
335
  Object.entries(attributes).filter(function (_a) {
360
- var _b = __read(_a, 2), k = _b[0], v = _b[1];
336
+ var k = _a[0], v = _a[1];
361
337
  return k.startsWith(prefix_1);
362
338
  }).forEach(function (_a) {
363
- var _b = __read(_a, 2), k = _b[0], v = _b[1];
339
+ var k = _a[0], v = _a[1];
364
340
  params_1[k.slice(prefix_1.length)] = v;
365
341
  });
366
342
  bind.split(',').forEach(function (eventName) {
@@ -380,13 +356,16 @@ var EventManager = (function () {
380
356
  }
381
357
  });
382
358
  };
359
+ // eslint-disable-next-line no-undef
383
360
  EventManager.prototype.procAttr = function (elements, attrName, callBack) {
384
361
  if (elements === void 0) { elements = new Set(); }
385
362
  var sets = new Set();
386
363
  elements.forEach(function (it) {
364
+ // console.log('--->type', it, it.nodeType)
387
365
  if (!it) {
388
366
  return;
389
367
  }
368
+ // Node.ELEMENT_NODE = 1
390
369
  if (it.nodeType === 1) {
391
370
  var e = it;
392
371
  sets.add(e);
@@ -404,6 +383,7 @@ var EventManager = (function () {
404
383
  });
405
384
  };
406
385
  EventManager.prototype.getValue = function (obj, name, bindObj) {
386
+ // let r = obj[name];
407
387
  var r = ScriptUtils_1.ScriptUtils.evalReturn(name, obj);
408
388
  if (typeof r === 'function') {
409
389
  r = r.bind(bindObj !== null && bindObj !== void 0 ? bindObj : obj);
@@ -412,17 +392,20 @@ var EventManager = (function () {
412
392
  };
413
393
  EventManager.prototype.setValue = function (obj, name, value) {
414
394
  name = name.replaceAll('this.', 'this.this.');
415
- ScriptUtils_1.ScriptUtils.eval("".concat(name, " = this.value"), {
395
+ ScriptUtils_1.ScriptUtils.eval("".concat(name, " = this.value;"), {
416
396
  this: obj,
417
397
  value: value
418
398
  });
419
399
  };
420
400
  EventManager.prototype.isUsingThisVar = function (raws, varName) {
401
+ // console.log('isUsingV', raws)
402
+ // console.log('isUsingV', raws, varName, ScriptUtils.getVariablePaths(raws ?? ''))
421
403
  if (varName && raws) {
422
404
  if (varName.startsWith('this.')) {
423
405
  varName = varName.replace(/this\./, '');
424
406
  }
425
407
  EventManager.VARNAMES.forEach(function (it) {
408
+ // raws = raws!.replace(RegExp(it.replace('$', '\\$'), 'g'), `this?.___${it}`);
426
409
  raws = raws.replace(RegExp(it.replace('$', '\\$'), 'g'), "this.___".concat(it));
427
410
  });
428
411
  var variablePaths = ScriptUtils_1.ScriptUtils.getVariablePaths(raws !== null && raws !== void 0 ? raws : '');
@@ -431,23 +414,14 @@ var EventManager = (function () {
431
414
  return false;
432
415
  };
433
416
  EventManager.setBindProperty = function (scripts, obj) {
434
- var e_4, _a;
435
417
  if (scripts) {
418
+ // const newScripts = Object.assign({}, scripts)
436
419
  var newScripts = Object.assign({}, scripts);
437
- try {
438
- for (var _b = __values(Object.entries(newScripts)), _c = _b.next(); !_c.done; _c = _b.next()) {
439
- var _d = __read(_c.value, 2), key = _d[0], value = _d[1];
440
- if (typeof value === 'function') {
441
- newScripts[key] = value.bind(obj);
442
- }
443
- }
444
- }
445
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
446
- finally {
447
- try {
448
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
420
+ for (var _i = 0, _a = Object.entries(newScripts); _i < _a.length; _i++) {
421
+ var _b = _a[_i], key = _b[0], value = _b[1];
422
+ if (typeof value === 'function') {
423
+ newScripts[key] = value.bind(obj);
449
424
  }
450
- finally { if (e_4) throw e_4.error; }
451
425
  }
452
426
  return newScripts;
453
427
  }
@@ -19,5 +19,4 @@ export declare class Range implements Iterable<number> {
19
19
  constructor(first: number, last: number, step?: number);
20
20
  [Symbol.iterator](): Iterator<number>;
21
21
  static range(first: number | string, last?: number, step?: number): Range;
22
- toArray(): number[];
23
22
  }
@@ -1,32 +1,9 @@
1
1
  "use strict";
2
- var __read = (this && this.__read) || function (o, n) {
3
- var m = typeof Symbol === "function" && o[Symbol.iterator];
4
- if (!m) return o;
5
- var i = m.call(o), r, ar = [], e;
6
- try {
7
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
8
- }
9
- catch (error) { e = { error: error }; }
10
- finally {
11
- try {
12
- if (r && !r.done && (m = i["return"])) m.call(i);
13
- }
14
- finally { if (e) throw e.error; }
15
- }
16
- return ar;
17
- };
18
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
19
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
20
- if (ar || !(i in from)) {
21
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
22
- ar[i] = from[i];
23
- }
24
- }
25
- return to.concat(ar || Array.prototype.slice.call(from));
26
- };
27
2
  Object.defineProperty(exports, "__esModule", { value: true });
28
3
  exports.Range = exports.RangeIterator = exports.RangeResult = void 0;
29
- var RangeResult = (function () {
4
+ // within rangeResult.ts
5
+ // @ts-ignore
6
+ var RangeResult = /** @class */ (function () {
30
7
  function RangeResult(value, done) {
31
8
  this.done = done;
32
9
  this.value = value !== null && value !== void 0 ? value : 0;
@@ -34,7 +11,7 @@ var RangeResult = (function () {
34
11
  return RangeResult;
35
12
  }());
36
13
  exports.RangeResult = RangeResult;
37
- var RangeIterator = (function () {
14
+ var RangeIterator = /** @class */ (function () {
38
15
  function RangeIterator(first, last, step) {
39
16
  this._current = this._first = first;
40
17
  this._last = last;
@@ -58,7 +35,7 @@ var RangeIterator = (function () {
58
35
  return RangeIterator;
59
36
  }());
60
37
  exports.RangeIterator = RangeIterator;
61
- var Range = (function () {
38
+ var Range = /** @class */ (function () {
62
39
  function Range(first, last, step) {
63
40
  if (step === void 0) { step = 1; }
64
41
  this.first = first;
@@ -75,17 +52,14 @@ var Range = (function () {
75
52
  return new Range(0, first, step);
76
53
  }
77
54
  else if (typeof first === 'string') {
78
- var _a = __read(first.split('..'), 2), _first = _a[0], _b = _a[1], _last = _b === void 0 ? '0' : _b;
79
- var _c = __read(_last.split(','), 2), __last = _c[0], _d = _c[1], _step = _d === void 0 ? '1' : _d;
55
+ var _a = first.split('..'), _first = _a[0], _b = _a[1], _last = _b === void 0 ? '0' : _b;
56
+ var _c = _last.split(','), __last = _c[0], _d = _c[1], _step = _d === void 0 ? '1' : _d;
80
57
  return new Range(Number(_first.trim()), Number(__last.trim()), Number(_step.trim()));
81
58
  }
82
59
  else {
83
60
  return new Range(first, last !== null && last !== void 0 ? last : 0, step);
84
61
  }
85
62
  };
86
- Range.prototype.toArray = function () {
87
- return __spreadArray([], __read(this), false);
88
- };
89
63
  return Range;
90
64
  }());
91
65
  exports.Range = Range;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RenderManager = void 0;
4
- var RenderManager = (function () {
4
+ var RenderManager = /** @class */ (function () {
5
5
  function RenderManager() {
6
6
  }
7
7
  RenderManager.render = function (obj, target) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dom-render",
3
- "version": "1.0.67",
3
+ "version": "1.0.68",
4
4
  "main": "DomRender.js",
5
5
  "license": "MIT",
6
6
  "description": "dom-render",
@@ -54,7 +54,7 @@
54
54
  "bundle:watch": "rollup -c -w",
55
55
  "dev:start": "npm run start --workspace=dev",
56
56
  "dev:serve": "npm run serve --workspace=dev",
57
- "npm-build": "npm run build && cp package.json dist && cp .npmignore dist && cp README.MD dist",
57
+ "npm-build": "npm run build && cp package.json dist && cp .npmignore dist && cp README.MD dist && rm -rf dist/dist/bundle.js.map",
58
58
  "npm-publish": "npm run npm-build && npm publish ./dist",
59
59
  "tsc": "tsc",
60
60
  "setting:root-dist": "rm -rf ../dist-dom-render && mkdirp ../dist-dom-render && cp package-root-dist.json ../dist-dom-render/package.json",
@@ -65,28 +65,28 @@
65
65
  },
66
66
  "devDependencies": {
67
67
  "@rollup/plugin-babel": "^5.3.0",
68
+ "@rollup/plugin-commonjs": "^21.0.1",
69
+ "@rollup/plugin-json": "^4.1.0",
68
70
  "@rollup/plugin-node-resolve": "^13.0.5",
69
71
  "@rollup/plugin-replace": "^2.4.2",
72
+ "@rollup/plugin-typescript": "^8.3.0",
70
73
  "@types/jest": "^26.0.22",
71
74
  "@typescript-eslint/eslint-plugin": "^4.16.1",
72
75
  "@typescript-eslint/parser": "^4.16.1",
73
- "eslint": "^7.21.0",
74
- "eslint-config-standard": "^16.0.2",
75
- "eslint-plugin-import": "^2.22.1",
76
+ "eslint": "^7.32.0",
77
+ "eslint-config-standard": "^16.0.3",
78
+ "eslint-plugin-import": "^2.25.3",
76
79
  "eslint-plugin-node": "^11.1.0",
77
80
  "eslint-plugin-promise": "^4.3.1",
78
81
  "jest": "^26.6.3",
79
82
  "mkdirp": "^1.0.4",
80
- "rollup": "^2.52.8",
81
- "rollup-plugin-babel": "^4.4.0",
82
- "rollup-plugin-commonjs": "^10.1.0",
83
+ "rollup": "^2.60.1",
83
84
  "rollup-plugin-copy": "^3.4.0",
84
85
  "rollup-plugin-delete": "^2.0.0",
85
86
  "rollup-plugin-html": "^0.2.1",
86
87
  "rollup-plugin-import-css": "^3.0.2",
87
88
  "rollup-plugin-node-resolve": "^5.2.0",
88
89
  "rollup-plugin-sourcemaps": "^0.6.3",
89
- "rollup-plugin-typescript2": "^0.30.0",
90
90
  "rollup-watch": "^3.2.2",
91
91
  "supertest": "^6.1.3",
92
92
  "ts-jest": "^26.5.4",
package/types/Types.js CHANGED
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DomRenderFinalProxy = exports.Shield = void 0;
4
- var Shield = (function () {
4
+ var Shield = /** @class */ (function () {
5
5
  function Shield() {
6
6
  }
7
7
  return Shield;
8
8
  }());
9
9
  exports.Shield = Shield;
10
- var DomRenderFinalProxy = (function () {
10
+ var DomRenderFinalProxy = /** @class */ (function () {
11
11
  function DomRenderFinalProxy() {
12
12
  }
13
13
  DomRenderFinalProxy.prototype.set = function (target, p, value, receiver) {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ClipBoardUtils = void 0;
4
- var ClipBoardUtils = (function () {
4
+ var ClipBoardUtils = /** @class */ (function () {
5
5
  function ClipBoardUtils() {
6
6
  }
7
7
  ClipBoardUtils.readText = function (clipboard) {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DomUtils = void 0;
4
- var DomUtils = (function () {
4
+ var DomUtils = /** @class */ (function () {
5
5
  function DomUtils() {
6
6
  }
7
7
  DomUtils.selectorElements = function (selector, element) {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LocationUtils = void 0;
4
- var LocationUtils = (function () {
4
+ var LocationUtils = /** @class */ (function () {
5
5
  function LocationUtils() {
6
6
  }
7
7
  LocationUtils.hash = function (window) {
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NodeUtils = void 0;
4
- var NodeUtils = (function () {
4
+ var NodeUtils = /** @class */ (function () {
5
5
  function NodeUtils() {
6
6
  }
7
+ // https://stackoverflow.com/questions/3955229/remove-all-child-elements-of-a-dom-node-in-javascript
7
8
  NodeUtils.removeAllChildNode = function (node) {
8
9
  while (node === null || node === void 0 ? void 0 : node.firstChild) {
9
10
  node.firstChild.remove();
@@ -14,6 +15,7 @@ var NodeUtils = (function () {
14
15
  };
15
16
  NodeUtils.replaceNode = function (targetNode, newNode) {
16
17
  var _a;
18
+ // console.log('repalceNode', targetNode, newNode, targetNode.parentNode)
17
19
  return (_a = targetNode.parentNode) === null || _a === void 0 ? void 0 : _a.replaceChild(newNode, targetNode);
18
20
  };
19
21
  NodeUtils.addNode = function (targetNode, newNode) {
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RandomUtils = void 0;
4
4
  var ValidUtils_1 = require("../valid/ValidUtils");
5
- var RandomUtils = (function () {
5
+ var RandomUtils = /** @class */ (function () {
6
6
  function RandomUtils() {
7
7
  }
8
8
  RandomUtils.random = function (min, max) {
@@ -32,6 +32,7 @@ var RandomUtils = (function () {
32
32
  }
33
33
  return color;
34
34
  };
35
+ // (Math.random().toString(36)+'00000000000000000').slice(2, 10) + Date.now()
35
36
  RandomUtils.getRandomString = function (len) {
36
37
  var letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');
37
38
  var color = '';