dom-render 1.0.91 → 1.0.92

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 (44) hide show
  1. package/DomRender.js +5 -1
  2. package/DomRenderProxy.d.ts +1 -1
  3. package/DomRenderProxy.js +121 -63
  4. package/README.MD +14 -2
  5. package/configs/TargetElement.d.ts +1 -1
  6. package/dist/bundle.js +1189 -835
  7. package/events/EventManager.js +1 -0
  8. package/operators/Dr.d.ts +1 -1
  9. package/operators/Dr.js +58 -17
  10. package/operators/DrAppender.d.ts +1 -1
  11. package/operators/DrAppender.js +61 -21
  12. package/operators/DrFor.d.ts +1 -1
  13. package/operators/DrFor.js +58 -17
  14. package/operators/DrForOf.d.ts +1 -1
  15. package/operators/DrForOf.js +61 -20
  16. package/operators/DrForm.d.ts +1 -1
  17. package/operators/DrForm.js +87 -46
  18. package/operators/DrIf.d.ts +1 -1
  19. package/operators/DrIf.js +62 -23
  20. package/operators/DrInnerHTML.d.ts +1 -1
  21. package/operators/DrInnerHTML.js +56 -15
  22. package/operators/DrInnerText.d.ts +1 -1
  23. package/operators/DrInnerText.js +54 -13
  24. package/operators/DrPre.d.ts +1 -1
  25. package/operators/DrPre.js +41 -1
  26. package/operators/DrRepeat.d.ts +1 -1
  27. package/operators/DrRepeat.js +58 -17
  28. package/operators/DrTargetAttr.d.ts +1 -1
  29. package/operators/DrTargetAttr.js +64 -23
  30. package/operators/DrTargetElement.d.ts +1 -1
  31. package/operators/DrTargetElement.js +78 -34
  32. package/operators/DrThis.d.ts +1 -1
  33. package/operators/DrThis.js +73 -23
  34. package/operators/OperatorExecuter.d.ts +3 -2
  35. package/operators/OperatorExecuter.js +60 -14
  36. package/operators/OperatorExecuterAttrRequire.d.ts +2 -2
  37. package/operators/OperatorExecuterAttrRequire.js +48 -24
  38. package/package.json +1 -1
  39. package/rawsets/RawSet.d.ts +3 -3
  40. package/rawsets/RawSet.js +458 -315
  41. package/routers/HashRouter.js +1 -1
  42. package/routers/PathRouter.js +1 -1
  43. package/routers/Router.d.ts +3 -0
  44. package/routers/Router.js +10 -0
@@ -40,7 +40,7 @@ var HashRouter = /** @class */ (function (_super) {
40
40
  HashRouter.prototype.set = function (path, data, title) {
41
41
  if (title === void 0) { title = ''; }
42
42
  path = '#' + path;
43
- this.window.history.pushState(data, title, path);
43
+ _super.prototype.pushState.call(this, data, title, path);
44
44
  };
45
45
  HashRouter.prototype.getUrl = function () {
46
46
  return LocationUtils_1.LocationUtils.hash(this.window) || '/';
@@ -38,7 +38,7 @@ var PathRouter = /** @class */ (function (_super) {
38
38
  };
39
39
  PathRouter.prototype.set = function (path, data, title) {
40
40
  if (title === void 0) { title = ''; }
41
- this.window.history.pushState(data, title, path);
41
+ _super.prototype.pushState.call(this, data, title, path);
42
42
  };
43
43
  PathRouter.prototype.getUrl = function () {
44
44
  var url = new URL(this.window.document.location.href);
@@ -17,6 +17,9 @@ export declare abstract class Router {
17
17
  abstract set(path: string, data?: any, title?: string): void;
18
18
  getRouteData(urlExpression?: string): RouteData;
19
19
  go(path: string, data?: any, title?: string): void;
20
+ pushState(data: any, title: string, path: string): void;
21
+ dispatchPopStateEvent(): void;
22
+ reload(): void;
20
23
  abstract getSearchParams(): URLSearchParams;
21
24
  abstract getData(): any;
22
25
  getPathData(urlExpression: string, currentUrl?: string): any;
package/routers/Router.js CHANGED
@@ -71,6 +71,16 @@ var Router = /** @class */ (function () {
71
71
  this.set(path, urlExpressionOrData, dataOrTitle !== null && dataOrTitle !== void 0 ? dataOrTitle : '');
72
72
  }
73
73
  this.attach();
74
+ this.dispatchPopStateEvent();
75
+ };
76
+ Router.prototype.pushState = function (data, title, path) {
77
+ this.window.history.pushState(data, title, path);
78
+ };
79
+ Router.prototype.dispatchPopStateEvent = function () {
80
+ this.window.dispatchEvent(new Event('popstate'));
81
+ };
82
+ Router.prototype.reload = function () {
83
+ this.window.dispatchEvent(new Event('popstate'));
74
84
  };
75
85
  Router.prototype.getPathData = function (urlExpression, currentUrl) {
76
86
  // console.log('getPathData-->', urlExpression, currentUrl);