dom-render 1.0.91 → 1.0.93
Sign up to get free protection for your applications and to get access to all the features.
- package/DomRender.js +5 -1
- package/DomRenderProxy.d.ts +1 -1
- package/DomRenderProxy.js +126 -68
- package/README.MD +14 -2
- package/components/ComponentSet.d.ts +1 -1
- package/configs/Config.d.ts +4 -1
- package/configs/TargetAttr.d.ts +1 -1
- package/configs/TargetElement.d.ts +2 -2
- package/dist/bundle.js +1226 -941
- package/events/EventManager.d.ts +1 -0
- package/events/EventManager.js +43 -54
- package/messenger/Messenger.d.ts +4 -4
- package/operators/Dr.d.ts +1 -1
- package/operators/Dr.js +58 -17
- package/operators/DrAppender.d.ts +1 -1
- package/operators/DrAppender.js +62 -24
- package/operators/DrFor.d.ts +1 -1
- package/operators/DrFor.js +59 -20
- package/operators/DrForOf.d.ts +1 -1
- package/operators/DrForOf.js +62 -23
- package/operators/DrForm.d.ts +1 -1
- package/operators/DrForm.js +87 -46
- package/operators/DrIf.d.ts +1 -1
- package/operators/DrIf.js +63 -26
- package/operators/DrInnerHTML.d.ts +1 -1
- package/operators/DrInnerHTML.js +56 -15
- package/operators/DrInnerText.d.ts +1 -1
- package/operators/DrInnerText.js +54 -13
- package/operators/DrPre.d.ts +1 -1
- package/operators/DrPre.js +42 -4
- package/operators/DrRepeat.d.ts +1 -1
- package/operators/DrRepeat.js +59 -20
- package/operators/DrTargetAttr.d.ts +1 -1
- package/operators/DrTargetAttr.js +65 -26
- package/operators/DrTargetElement.d.ts +1 -1
- package/operators/DrTargetElement.js +79 -37
- package/operators/DrThis.d.ts +1 -1
- package/operators/DrThis.js +73 -23
- package/operators/OperatorExecuter.d.ts +8 -7
- package/operators/OperatorExecuter.js +60 -14
- package/operators/OperatorExecuterAttrRequire.d.ts +2 -2
- package/operators/OperatorExecuterAttrRequire.js +48 -24
- package/package.json +1 -1
- package/rawsets/AttrInitCallBack.d.ts +1 -1
- package/rawsets/Attrs.d.ts +1 -1
- package/rawsets/CreatorMetaData.d.ts +1 -1
- package/rawsets/ElementInitCallBack.d.ts +1 -1
- package/rawsets/RawSet.d.ts +3 -3
- package/rawsets/RawSet.js +458 -315
- package/rawsets/Render.d.ts +1 -1
- package/routers/HashRouter.js +1 -1
- package/routers/PathRouter.js +1 -1
- package/routers/Router.d.ts +4 -1
- package/routers/Router.js +10 -0
- package/utils/dom/DomUtils.d.ts +1 -1
- package/utils/node/NodeUtils.d.ts +1 -1
- package/validators/EmptyValidator.js +2 -2
- package/validators/NotEmptyValidator.js +2 -2
- package/validators/ValidMultipleValidator.d.ts +1 -1
- package/validators/Validator.d.ts +2 -2
- package/validators/ValidatorArray.d.ts +1 -1
package/rawsets/Render.d.ts
CHANGED
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
@@ -1,4 +1,4 @@
|
|
1
|
-
export
|
1
|
+
export type RouteData = {
|
2
2
|
path: string;
|
3
3
|
url: string;
|
4
4
|
data?: any;
|
@@ -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);
|
package/utils/dom/DomUtils.d.ts
CHANGED
@@ -24,9 +24,9 @@ var EmptyValidator = /** @class */ (function (_super) {
|
|
24
24
|
return _super.call(this, value, target, event, autoValid) || this;
|
25
25
|
}
|
26
26
|
EmptyValidator.prototype.valid = function () {
|
27
|
-
var _a
|
27
|
+
var _a;
|
28
28
|
var value = this.value;
|
29
|
-
return value === undefined || value === null || ((
|
29
|
+
return value === undefined || value === null || ((_a = value === null || value === void 0 ? void 0 : value.length) !== null && _a !== void 0 ? _a : 0) <= 0;
|
30
30
|
};
|
31
31
|
return EmptyValidator;
|
32
32
|
}(Validator_1.Validator));
|
@@ -24,10 +24,10 @@ var NotEmptyValidator = /** @class */ (function (_super) {
|
|
24
24
|
return _super.call(this, value, target, event, autoValid) || this;
|
25
25
|
}
|
26
26
|
NotEmptyValidator.prototype.valid = function () {
|
27
|
-
var _a
|
27
|
+
var _a;
|
28
28
|
var value = this.value;
|
29
29
|
// console.log('NotEmptyValidator', value, value !== undefined && value !== null && ((value as any)?.length ?? 0) > 0)
|
30
|
-
return value !== undefined && value !== null && ((
|
30
|
+
return value !== undefined && value !== null && ((_a = value === null || value === void 0 ? void 0 : value.length) !== null && _a !== void 0 ? _a : 0) > 0;
|
31
31
|
};
|
32
32
|
return NotEmptyValidator;
|
33
33
|
}(Validator_1.Validator));
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { Validator } from './Validator';
|
2
2
|
import { MultipleValidator } from './MultipleValidator';
|
3
|
-
export
|
3
|
+
export type ValidMulltiple<T = any, E = Element> = (validators: Validator<T, E>[], value?: T, target?: E, event?: Event) => boolean;
|
4
4
|
export declare class ValidMultipleValidator<T = any, E = Element> extends MultipleValidator<T, E> {
|
5
5
|
validMultipleCallback: ValidMulltiple<T, E>;
|
6
6
|
validators: Validator<T, E>[];
|
@@ -1,5 +1,5 @@
|
|
1
|
-
export
|
2
|
-
export
|
1
|
+
export type Valid<T = any, E = Element> = (value?: T, target?: E, event?: Event) => boolean;
|
2
|
+
export type ValidAction<T = any, E = Element> = (valid: boolean, value?: T, target?: E, event?: Event) => void;
|
3
3
|
export declare abstract class Validator<T = any, E = Element> {
|
4
4
|
protected _value?: T | undefined;
|
5
5
|
private _target?;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Validator } from './Validator';
|
2
|
-
export
|
2
|
+
export type MakeValidator<T = any, E = Element> = (value: T, target: E, event?: Event) => Validator<T, E>;
|
3
3
|
export declare abstract class ValidatorArray<T = any, E = Element> extends Validator<Validator<T, E>[], E> {
|
4
4
|
private _makeValidatorFactory;
|
5
5
|
constructor(value?: Validator<T, E>[], target?: E, event?: Event, autoValid?: boolean);
|