dom-render 1.0.92 → 1.0.93

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. package/DomRenderProxy.js +7 -7
  2. package/components/ComponentSet.d.ts +1 -1
  3. package/configs/Config.d.ts +4 -1
  4. package/configs/TargetAttr.d.ts +1 -1
  5. package/configs/TargetElement.d.ts +1 -1
  6. package/dist/bundle.js +224 -293
  7. package/events/EventManager.d.ts +1 -0
  8. package/events/EventManager.js +42 -54
  9. package/messenger/Messenger.d.ts +4 -4
  10. package/operators/Dr.js +1 -1
  11. package/operators/DrAppender.js +2 -4
  12. package/operators/DrFor.js +2 -4
  13. package/operators/DrForOf.js +2 -4
  14. package/operators/DrForm.js +1 -1
  15. package/operators/DrIf.js +2 -4
  16. package/operators/DrInnerHTML.js +1 -1
  17. package/operators/DrInnerText.js +1 -1
  18. package/operators/DrPre.js +2 -4
  19. package/operators/DrRepeat.js +2 -4
  20. package/operators/DrTargetAttr.js +2 -4
  21. package/operators/DrTargetElement.js +2 -4
  22. package/operators/DrThis.js +1 -1
  23. package/operators/OperatorExecuter.d.ts +5 -5
  24. package/operators/OperatorExecuter.js +1 -1
  25. package/operators/OperatorExecuterAttrRequire.js +1 -1
  26. package/package.json +1 -1
  27. package/rawsets/AttrInitCallBack.d.ts +1 -1
  28. package/rawsets/Attrs.d.ts +1 -1
  29. package/rawsets/CreatorMetaData.d.ts +1 -1
  30. package/rawsets/ElementInitCallBack.d.ts +1 -1
  31. package/rawsets/RawSet.js +1 -1
  32. package/rawsets/Render.d.ts +1 -1
  33. package/routers/Router.d.ts +1 -1
  34. package/utils/dom/DomUtils.d.ts +1 -1
  35. package/utils/node/NodeUtils.d.ts +1 -1
  36. package/validators/EmptyValidator.js +2 -2
  37. package/validators/NotEmptyValidator.js +2 -2
  38. package/validators/ValidMultipleValidator.d.ts +1 -1
  39. package/validators/Validator.d.ts +2 -2
  40. package/validators/ValidatorArray.d.ts +1 -1
package/DomRenderProxy.js CHANGED
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -74,9 +74,9 @@ var DomRenderProxy = /** @class */ (function () {
74
74
  };
75
75
  DomRenderProxy.prototype.run = function (objProxy) {
76
76
  var _this = this;
77
- var _a, _b;
77
+ var _a;
78
78
  this._domRender_proxy = objProxy;
79
- (_b = (_a = objProxy) === null || _a === void 0 ? void 0 : _a.onProxyDomRender) === null || _b === void 0 ? void 0 : _b.call(_a, this.config);
79
+ (_a = objProxy === null || objProxy === void 0 ? void 0 : objProxy.onProxyDomRender) === null || _a === void 0 ? void 0 : _a.call(objProxy, this.config);
80
80
  var obj = objProxy._DomRender_origin;
81
81
  if (obj) {
82
82
  Object.keys(obj).forEach(function (it) {
@@ -296,7 +296,7 @@ var DomRenderProxy = /** @class */ (function () {
296
296
  return fullPaths;
297
297
  };
298
298
  DomRenderProxy.prototype.set = function (target, p, value, receiver) {
299
- var _a, _b, _c;
299
+ var _a, _b;
300
300
  if (typeof p === 'string' && p !== '__domrender_components' && excludeGetSetPropertys.includes(p)) {
301
301
  target[p] = value;
302
302
  return true;
@@ -317,12 +317,12 @@ var DomRenderProxy = /** @class */ (function () {
317
317
  }
318
318
  // console.log('full path:', fullPath);
319
319
  if (('onBeforeReturnSet' in receiver) && typeof p === 'string' && !((_a = this.config.proxyExcludeOnBeforeReturnSets) !== null && _a !== void 0 ? _a : []).concat(excludeGetSetPropertys).includes(p)) {
320
- (_c = (_b = receiver) === null || _b === void 0 ? void 0 : _b.onBeforeReturnSet) === null || _c === void 0 ? void 0 : _c.call(_b, p, value, fullPath);
320
+ (_b = receiver === null || receiver === void 0 ? void 0 : receiver.onBeforeReturnSet) === null || _b === void 0 ? void 0 : _b.call(receiver, p, value, fullPath);
321
321
  }
322
322
  return true;
323
323
  };
324
324
  DomRenderProxy.prototype.get = function (target, p, receiver) {
325
- var _a, _b, _c;
325
+ var _a, _b;
326
326
  // console.log('get-->', target, p, receiver);
327
327
  if (p === '_DomRender_origin') {
328
328
  return this._domRender_origin;
@@ -353,7 +353,7 @@ var DomRenderProxy = /** @class */ (function () {
353
353
  it_2 = it_2._DomRender_origin;
354
354
  }
355
355
  if (('onBeforeReturnGet' in receiver) && typeof p === 'string' && !((_a = this.config.proxyExcludeOnBeforeReturnGets) !== null && _a !== void 0 ? _a : []).concat(excludeGetSetPropertys).includes(p)) {
356
- (_c = (_b = receiver) === null || _b === void 0 ? void 0 : _b.onBeforeReturnGet) === null || _c === void 0 ? void 0 : _c.call(_b, p, it_2, this.root([p], it_2, false));
356
+ (_b = receiver === null || receiver === void 0 ? void 0 : receiver.onBeforeReturnGet) === null || _b === void 0 ? void 0 : _b.call(receiver, p, it_2, this.root([p], it_2, false));
357
357
  }
358
358
  return it_2;
359
359
  }
@@ -1,4 +1,4 @@
1
- export declare type ComponentSetConfig = {
1
+ export type ComponentSetConfig = {
2
2
  objPath?: string | null;
3
3
  };
4
4
  export declare class ComponentSet {
@@ -6,7 +6,7 @@ import { TargetElement } from './TargetElement';
6
6
  import { TargetAttr } from './TargetAttr';
7
7
  import { Attrs } from '../rawsets/Attrs';
8
8
  import { OperatorAround } from '../operators/OperatorExecuter';
9
- export declare type Config = {
9
+ export type Config = {
10
10
  window: Window;
11
11
  targetElements?: TargetElement[];
12
12
  targetAttrs?: TargetAttr[];
@@ -24,6 +24,9 @@ export declare type Config = {
24
24
  routerType?: 'hash' | 'path' | 'none';
25
25
  router?: Router;
26
26
  messenger?: Messenger;
27
+ eventVariables?: {
28
+ [n: string]: any;
29
+ };
27
30
  applyEvents?: {
28
31
  attrName: string;
29
32
  callBack: (elements: Element, attrValue: string, obj: any) => void;
@@ -1,5 +1,5 @@
1
1
  import { RawSet } from '../rawsets/RawSet';
2
- export declare type TargetAttr = {
2
+ export type TargetAttr = {
3
3
  name: string;
4
4
  callBack: (target: Element, attrValue: string, obj: any, rawSet: RawSet) => DocumentFragment;
5
5
  complete?: (target: Element, attrValue: string, obj: any, rawSet: RawSet) => void;
@@ -3,7 +3,7 @@ import { Config } from './Config';
3
3
  import { Attrs } from '../rawsets/Attrs';
4
4
  import { CreatorMetaData } from '../rawsets/CreatorMetaData';
5
5
  import { Render } from '../rawsets/Render';
6
- export declare type TargetElement = {
6
+ export type TargetElement = {
7
7
  name: string;
8
8
  template?: string;
9
9
  styles?: string[];