dom-render 1.0.97 → 1.0.98
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.d.ts +1 -1
- package/DomRender.js +3 -3
- package/DomRenderProxy.js +19 -14
- package/README.MD +39 -39
- package/components/ComponentSet.d.ts +1 -1
- package/configs/Config.d.ts +1 -1
- package/configs/TargetAttr.d.ts +1 -1
- package/configs/TargetElement.d.ts +1 -1
- package/css/stringify/compiler.d.ts +1 -1
- package/dist/bundle.js +408 -459
- package/events/EventManager.js +27 -27
- package/messenger/Messenger.d.ts +4 -4
- package/operators/Dr.js +2 -2
- package/operators/DrAppender.js +3 -5
- package/operators/DrFor.js +3 -5
- package/operators/DrForOf.js +3 -5
- package/operators/DrForm.js +12 -12
- package/operators/DrIf.js +3 -5
- package/operators/DrInnerHTML.js +2 -2
- package/operators/DrInnerText.js +2 -2
- package/operators/DrPre.js +2 -4
- package/operators/DrRepeat.js +3 -5
- package/operators/DrTargetAttr.js +2 -4
- package/operators/DrTargetElement.js +3 -5
- package/operators/DrThis.js +2 -2
- package/operators/DrThisProperty.js +4 -6
- package/operators/OperatorExecuter.d.ts +6 -6
- package/operators/OperatorExecuter.js +2 -2
- package/operators/OperatorExecuterAttrRequire.js +1 -1
- 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.js +59 -58
- package/rawsets/Render.d.ts +1 -1
- package/routers/Router.d.ts +1 -1
- package/routers/Router.js +1 -1
- package/utils/dom/DomUtils.d.ts +1 -1
- package/utils/node/NodeUtils.d.ts +1 -1
- package/utils/script/ScriptUtils.js +2 -2
- 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/routers/Router.js
CHANGED
@@ -27,7 +27,7 @@ var Router = /** @class */ (function () {
|
|
27
27
|
var _this = this;
|
28
28
|
var proxy = this.rootObj._DomRender_proxy;
|
29
29
|
if (proxy) {
|
30
|
-
var key = "___"
|
30
|
+
var key = "___".concat(EventManager_1.EventManager.ROUTER_VARNAME);
|
31
31
|
proxy.render(key);
|
32
32
|
}
|
33
33
|
this.attachCallbacks.forEach(function (it) {
|
package/utils/dom/DomUtils.d.ts
CHANGED
@@ -33,7 +33,7 @@ var ScriptUtils = /** @class */ (function () {
|
|
33
33
|
}, new GetDetectProxy());
|
34
34
|
try {
|
35
35
|
// eslint-disable-next-line no-new-func,no-unused-expressions
|
36
|
-
Function("\"use strict\"; "
|
36
|
+
Function("\"use strict\"; ".concat(script, "; ")).bind(destUser)();
|
37
37
|
}
|
38
38
|
catch (e) {
|
39
39
|
console.error(e);
|
@@ -49,7 +49,7 @@ var ScriptUtils = /** @class */ (function () {
|
|
49
49
|
};
|
50
50
|
ScriptUtils.eval = function (script, thisTarget) {
|
51
51
|
// eslint-disable-next-line no-new-func,no-unused-expressions
|
52
|
-
return Function("\"use strict\"; "
|
52
|
+
return Function("\"use strict\"; ".concat(script, " ")).bind(thisTarget)();
|
53
53
|
};
|
54
54
|
ScriptUtils.loadElement = function (name, attribute, document) {
|
55
55
|
return new Promise(function (resolve, reject) {
|
@@ -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);
|