dom-render 1.0.90 → 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.
- package/DomRender.js +5 -1
- package/DomRenderProxy.d.ts +1 -1
- package/DomRenderProxy.js +121 -63
- package/README.MD +15 -3
- package/components/ComponentSet.d.ts +5 -2
- package/components/ComponentSet.js +2 -3
- package/configs/Config.d.ts +5 -0
- package/configs/TargetElement.d.ts +1 -1
- package/dist/bundle.js +1337 -968
- package/events/EventManager.js +1 -0
- package/operators/Dr.d.ts +7 -3
- package/operators/Dr.js +64 -25
- package/operators/DrAppender.d.ts +7 -3
- package/operators/DrAppender.js +70 -28
- package/operators/DrFor.d.ts +7 -3
- package/operators/DrFor.js +67 -25
- package/operators/DrForOf.d.ts +7 -3
- package/operators/DrForOf.js +70 -28
- package/operators/DrForm.d.ts +7 -3
- package/operators/DrForm.js +93 -55
- package/operators/DrIf.d.ts +7 -3
- package/operators/DrIf.js +71 -35
- package/operators/DrInnerHTML.d.ts +7 -3
- package/operators/DrInnerHTML.js +62 -23
- package/operators/DrInnerText.d.ts +7 -3
- package/operators/DrInnerText.js +60 -21
- package/operators/DrPre.d.ts +6 -3
- package/operators/DrPre.js +49 -6
- package/operators/DrRepeat.d.ts +7 -3
- package/operators/DrRepeat.js +67 -25
- package/operators/DrTargetAttr.d.ts +6 -3
- package/operators/DrTargetAttr.js +72 -29
- package/operators/DrTargetElement.d.ts +6 -3
- package/operators/DrTargetElement.js +86 -64
- package/operators/DrThis.d.ts +4 -3
- package/operators/DrThis.js +77 -33
- package/operators/OperatorExecuter.d.ts +49 -0
- package/operators/OperatorExecuter.js +89 -0
- package/operators/OperatorExecuterAttrRequire.d.ts +8 -0
- package/operators/OperatorExecuterAttrRequire.js +79 -0
- package/package.json +1 -1
- package/rawsets/RawSet.d.ts +4 -4
- package/rawsets/RawSet.js +460 -317
- package/routers/HashRouter.js +1 -1
- package/routers/PathRouter.js +1 -1
- package/routers/Router.d.ts +3 -0
- package/routers/Router.js +10 -0
- package/operators/OperatorRender.d.ts +0 -45
- package/operators/OperatorRender.js +0 -21
package/routers/HashRouter.js
CHANGED
|
@@ -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
|
-
|
|
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) || '/';
|
package/routers/PathRouter.js
CHANGED
|
@@ -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
|
-
|
|
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);
|
package/routers/Router.d.ts
CHANGED
|
@@ -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);
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { RawSet } from '../rawsets/RawSet';
|
|
2
|
-
import { ComponentSet } from '../components/ComponentSet';
|
|
3
|
-
import { Config } from '../configs/Config';
|
|
4
|
-
import { Attrs } from '../rawsets/Attrs';
|
|
5
|
-
import { AttrInitCallBack } from '../rawsets/AttrInitCallBack';
|
|
6
|
-
import { ElementInitCallBack } from '../rawsets/ElementInitCallBack';
|
|
7
|
-
import { Render } from '../rawsets/Render';
|
|
8
|
-
export declare enum ExecuteState {
|
|
9
|
-
EXECUTE = 0,
|
|
10
|
-
NO_EXECUTE = 1,
|
|
11
|
-
STOP = 2
|
|
12
|
-
}
|
|
13
|
-
export declare type AfterCallBack = {
|
|
14
|
-
onAttrInitCallBacks: AttrInitCallBack[];
|
|
15
|
-
onElementInitCallBacks: ElementInitCallBack[];
|
|
16
|
-
onThisComponentSetCallBacks: ComponentSet[];
|
|
17
|
-
};
|
|
18
|
-
export declare abstract class OperatorRender {
|
|
19
|
-
rawSet: RawSet;
|
|
20
|
-
render: Render;
|
|
21
|
-
returnContainer: {
|
|
22
|
-
raws: RawSet[];
|
|
23
|
-
fag: DocumentFragment;
|
|
24
|
-
};
|
|
25
|
-
elementSource: {
|
|
26
|
-
element: Element;
|
|
27
|
-
attrs: Attrs;
|
|
28
|
-
};
|
|
29
|
-
source: {
|
|
30
|
-
config: Config;
|
|
31
|
-
obj: any;
|
|
32
|
-
};
|
|
33
|
-
afterCallBack: AfterCallBack;
|
|
34
|
-
constructor(rawSet: RawSet, render: Render, returnContainer: {
|
|
35
|
-
raws: RawSet[];
|
|
36
|
-
fag: DocumentFragment;
|
|
37
|
-
}, elementSource: {
|
|
38
|
-
element: Element;
|
|
39
|
-
attrs: Attrs;
|
|
40
|
-
}, source: {
|
|
41
|
-
config: Config;
|
|
42
|
-
obj: any;
|
|
43
|
-
}, afterCallBack: AfterCallBack);
|
|
44
|
-
abstract execRender(): ExecuteState;
|
|
45
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OperatorRender = exports.ExecuteState = void 0;
|
|
4
|
-
var ExecuteState;
|
|
5
|
-
(function (ExecuteState) {
|
|
6
|
-
ExecuteState[ExecuteState["EXECUTE"] = 0] = "EXECUTE";
|
|
7
|
-
ExecuteState[ExecuteState["NO_EXECUTE"] = 1] = "NO_EXECUTE";
|
|
8
|
-
ExecuteState[ExecuteState["STOP"] = 2] = "STOP";
|
|
9
|
-
})(ExecuteState = exports.ExecuteState || (exports.ExecuteState = {}));
|
|
10
|
-
var OperatorRender = /** @class */ (function () {
|
|
11
|
-
function OperatorRender(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
|
12
|
-
this.rawSet = rawSet;
|
|
13
|
-
this.render = render;
|
|
14
|
-
this.returnContainer = returnContainer;
|
|
15
|
-
this.elementSource = elementSource;
|
|
16
|
-
this.source = source;
|
|
17
|
-
this.afterCallBack = afterCallBack;
|
|
18
|
-
}
|
|
19
|
-
return OperatorRender;
|
|
20
|
-
}());
|
|
21
|
-
exports.OperatorRender = OperatorRender;
|