dom-render 1.0.87 → 1.0.88
Sign up to get free protection for your applications and to get access to all the features.
- package/DomRender.d.ts +1 -1
- package/DomRender.js +1 -1
- package/DomRenderProxy.d.ts +1 -1
- package/DomRenderProxy.js +3 -2
- package/README.MD +39 -9
- package/configs/Config.d.ts +1 -1
- package/configs/TargetAttr.d.ts +1 -1
- package/configs/TargetElement.d.ts +4 -1
- package/dist/bundle.js +217 -211
- package/lifecycle/OnDestroyRender.d.ts +1 -1
- package/lifecycle/OnInitRender.d.ts +2 -1
- package/operators/Dr.js +1 -1
- package/operators/DrAppender.js +1 -1
- package/operators/DrFor.js +1 -1
- package/operators/DrForOf.js +1 -1
- package/operators/DrForm.js +1 -1
- package/operators/DrIf.js +1 -1
- package/operators/DrInnerHTML.js +1 -1
- package/operators/DrInnerText.js +1 -1
- package/operators/DrRepeat.js +1 -1
- package/operators/DrTargetAttr.js +1 -1
- package/operators/DrTargetElement.js +1 -1
- package/operators/DrThis.js +5 -2
- package/operators/OperatorRender.d.ts +5 -1
- package/package.json +6 -2
- package/rawsets/AttrInitCallBack.d.ts +5 -0
- package/rawsets/AttrInitCallBack.js +2 -0
- package/rawsets/Attrs.d.ts +21 -0
- package/rawsets/Attrs.js +2 -0
- package/rawsets/CreatorMetaData.d.ts +18 -0
- package/rawsets/CreatorMetaData.js +2 -0
- package/rawsets/DestroyOptionType.d.ts +4 -0
- package/rawsets/DestroyOptionType.js +8 -0
- package/rawsets/ElementInitCallBack.d.ts +8 -0
- package/rawsets/ElementInitCallBack.js +2 -0
- package/{RawSet.d.ts → rawsets/RawSet.d.ts} +7 -72
- package/{RawSet.js → rawsets/RawSet.js} +42 -52
- package/rawsets/RawSetType.d.ts +7 -0
- package/rawsets/RawSetType.js +11 -0
- package/rawsets/Render.d.ts +17 -0
- package/rawsets/Render.js +2 -0
package/dist/bundle.js
CHANGED
@@ -1094,6 +1094,8 @@ var DrThis = /** @class */ (function (_super) {
|
|
1094
1094
|
var _b, _c, _d, _e, _f;
|
1095
1095
|
if (this.elementSource.attrs.drThis) {
|
1096
1096
|
var r = ScriptUtils.evalReturn(this.elementSource.attrs.drThis, this.source.obj);
|
1097
|
+
// const isStrip = ScriptUtils.eval(`if (${this.elementSource.attrs.drStripOption ?? 'false'}) { return true; } else { return false; }`, this.source.obj);
|
1098
|
+
// console.log('isStrip', isStrip)
|
1097
1099
|
if (r) {
|
1098
1100
|
if (r instanceof ComponentSet) {
|
1099
1101
|
if (this.rawSet.data) {
|
@@ -1101,7 +1103,8 @@ var DrThis = /** @class */ (function (_super) {
|
|
1101
1103
|
RawSet.destroy(this.rawSet.data.obj, [], this.source.config, destroyOptions);
|
1102
1104
|
}
|
1103
1105
|
this.rawSet.data = r;
|
1104
|
-
|
1106
|
+
var componentBody = RawSet.drThisCreate(this.rawSet, this.elementSource.element, "".concat(this.elementSource.attrs.drThis, ".obj"), (_d = this.elementSource.attrs.drVarOption) !== null && _d !== void 0 ? _d : '', this.elementSource.attrs.drStripOption, this.source.obj, this.source.config, r);
|
1107
|
+
this.returnContainer.fag.append(componentBody);
|
1105
1108
|
this.afterCallBack.onThisComponentSetCallBacks.push(r);
|
1106
1109
|
}
|
1107
1110
|
else {
|
@@ -1805,6 +1808,7 @@ exports.DestroyOptionType = void 0;
|
|
1805
1808
|
DestroyOptionType["NO_DESTROY"] = "NO_DESTROY";
|
1806
1809
|
DestroyOptionType["NO_MESSENGER_DESTROY"] = "NO_MESSENGER_DESTROY";
|
1807
1810
|
})(exports.DestroyOptionType || (exports.DestroyOptionType = {}));
|
1811
|
+
|
1808
1812
|
exports.RawSetType = void 0;
|
1809
1813
|
(function (RawSetType) {
|
1810
1814
|
RawSetType["TEXT"] = "TEXT";
|
@@ -1813,6 +1817,7 @@ exports.RawSetType = void 0;
|
|
1813
1817
|
RawSetType["TARGET_ATTR"] = "TARGET_ATTR";
|
1814
1818
|
RawSetType["UNKOWN"] = "UNKOWN";
|
1815
1819
|
})(exports.RawSetType || (exports.RawSetType = {}));
|
1820
|
+
|
1816
1821
|
var RawSet = /** @class */ (function () {
|
1817
1822
|
function RawSet(uuid, type, point, fragment, detect, data) {
|
1818
1823
|
this.uuid = uuid;
|
@@ -1985,13 +1990,12 @@ var RawSet = /** @class */ (function () {
|
|
1985
1990
|
drAttrs.forEach(function (it) {
|
1986
1991
|
if (it.drCompleteOption) {
|
1987
1992
|
// genNode.childNodes
|
1988
|
-
|
1989
|
-
|
1990
|
-
|
1991
|
-
|
1992
|
-
|
1993
|
-
|
1994
|
-
}));
|
1993
|
+
var render = Object.freeze({
|
1994
|
+
rawset: _this,
|
1995
|
+
fag: genNode,
|
1996
|
+
scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj)
|
1997
|
+
});
|
1998
|
+
ScriptUtils.eval("\n const ".concat(EventManager.FAG_VARNAME, " = this.__render.fag;\n const ").concat(EventManager.SCRIPTS_VARNAME, " = this.__render.scripts;\n const ").concat(EventManager.RAWSET_VARNAME, " = this.__render.rawset;\n ").concat(it.drCompleteOption), Object.assign(obj, { __render: render }));
|
1995
1999
|
}
|
1996
2000
|
});
|
1997
2001
|
// 중요 style isolation 나중에 :scope로 대체 가능할듯.
|
@@ -2260,7 +2264,7 @@ var RawSet = /** @class */ (function () {
|
|
2260
2264
|
end.setAttribute('id', "".concat(id, "-end"));
|
2261
2265
|
return {
|
2262
2266
|
start: start,
|
2263
|
-
end: end
|
2267
|
+
end: end
|
2264
2268
|
};
|
2265
2269
|
}
|
2266
2270
|
else if (type === exports.RawSetType.STYLE_TEXT) {
|
@@ -2510,6 +2514,8 @@ var RawSet = /** @class */ (function () {
|
|
2510
2514
|
i.componentKey = componentKey;
|
2511
2515
|
i.rawSet = rawSet;
|
2512
2516
|
i.attribute = attribute;
|
2517
|
+
i.router = config.router;
|
2518
|
+
i.scripts = render.scripts;
|
2513
2519
|
i.drAttrs = attrs;
|
2514
2520
|
i.innerHTML = element.innerHTML;
|
2515
2521
|
i.rootCreator = new Proxy(obj, new DomRenderFinalProxy());
|
@@ -3560,17 +3566,32 @@ var Appender = /** @class */ (function () {
|
|
3560
3566
|
return Appender;
|
3561
3567
|
}());
|
3562
3568
|
|
3563
|
-
var
|
3564
|
-
__extends(
|
3565
|
-
function
|
3569
|
+
var CheckedValidator = /** @class */ (function (_super) {
|
3570
|
+
__extends(CheckedValidator, _super);
|
3571
|
+
function CheckedValidator(value, target, event, autoValid) {
|
3566
3572
|
if (autoValid === void 0) { autoValid = true; }
|
3567
3573
|
return _super.call(this, value, target, event, autoValid) || this;
|
3568
3574
|
}
|
3569
|
-
|
3575
|
+
CheckedValidator.prototype.valid = function () {
|
3576
|
+
var _a, _b;
|
3577
|
+
return (_b = (_a = this.getTarget()) === null || _a === void 0 ? void 0 : _a.checked) !== null && _b !== void 0 ? _b : false;
|
3578
|
+
};
|
3579
|
+
return CheckedValidator;
|
3580
|
+
}(Validator));
|
3581
|
+
|
3582
|
+
var CountEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
|
3583
|
+
__extends(CountEqualsUnCheckedValidatorArray, _super);
|
3584
|
+
function CountEqualsUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
3585
|
+
if (autoValid === void 0) { autoValid = true; }
|
3586
|
+
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3587
|
+
_this.count = count;
|
3588
|
+
return _this;
|
3589
|
+
}
|
3590
|
+
CountEqualsUnCheckedValidatorArray.prototype.valid = function () {
|
3570
3591
|
var _a;
|
3571
|
-
return
|
3592
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length === this.count;
|
3572
3593
|
};
|
3573
|
-
return
|
3594
|
+
return CountEqualsUnCheckedValidatorArray;
|
3574
3595
|
}(ValidatorArray));
|
3575
3596
|
|
3576
3597
|
var CountGreaterThanCheckedValidatorArray = /** @class */ (function (_super) {
|
@@ -3588,18 +3609,31 @@ var CountGreaterThanCheckedValidatorArray = /** @class */ (function (_super) {
|
|
3588
3609
|
return CountGreaterThanCheckedValidatorArray;
|
3589
3610
|
}(ValidatorArray));
|
3590
3611
|
|
3591
|
-
var
|
3592
|
-
__extends(
|
3593
|
-
function
|
3612
|
+
var AllUnCheckedValidatorArray = /** @class */ (function (_super) {
|
3613
|
+
__extends(AllUnCheckedValidatorArray, _super);
|
3614
|
+
function AllUnCheckedValidatorArray(value, target, event, autoValid) {
|
3594
3615
|
if (autoValid === void 0) { autoValid = true; }
|
3595
3616
|
return _super.call(this, value, target, event, autoValid) || this;
|
3596
3617
|
}
|
3597
|
-
|
3598
|
-
var _a
|
3599
|
-
return (
|
3618
|
+
AllUnCheckedValidatorArray.prototype.valid = function () {
|
3619
|
+
var _a;
|
3620
|
+
return !(((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length > 0);
|
3600
3621
|
};
|
3601
|
-
return
|
3602
|
-
}(
|
3622
|
+
return AllUnCheckedValidatorArray;
|
3623
|
+
}(ValidatorArray));
|
3624
|
+
|
3625
|
+
var AllCheckedValidatorArray = /** @class */ (function (_super) {
|
3626
|
+
__extends(AllCheckedValidatorArray, _super);
|
3627
|
+
function AllCheckedValidatorArray(value, target, event, autoValid) {
|
3628
|
+
if (autoValid === void 0) { autoValid = true; }
|
3629
|
+
return _super.call(this, value, target, event, autoValid) || this;
|
3630
|
+
}
|
3631
|
+
AllCheckedValidatorArray.prototype.valid = function () {
|
3632
|
+
var _a;
|
3633
|
+
return !(((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length > 0);
|
3634
|
+
};
|
3635
|
+
return AllCheckedValidatorArray;
|
3636
|
+
}(ValidatorArray));
|
3603
3637
|
|
3604
3638
|
var CountEqualsCheckedValidatorArray = /** @class */ (function (_super) {
|
3605
3639
|
__extends(CountEqualsCheckedValidatorArray, _super);
|
@@ -3616,47 +3650,34 @@ var CountEqualsCheckedValidatorArray = /** @class */ (function (_super) {
|
|
3616
3650
|
return CountEqualsCheckedValidatorArray;
|
3617
3651
|
}(ValidatorArray));
|
3618
3652
|
|
3619
|
-
var
|
3620
|
-
__extends(
|
3621
|
-
function
|
3653
|
+
var CountGreaterThanEqualsCheckedValidatorArray = /** @class */ (function (_super) {
|
3654
|
+
__extends(CountGreaterThanEqualsCheckedValidatorArray, _super);
|
3655
|
+
function CountGreaterThanEqualsCheckedValidatorArray(count, value, target, event, autoValid) {
|
3622
3656
|
if (autoValid === void 0) { autoValid = true; }
|
3623
3657
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3624
3658
|
_this.count = count;
|
3625
3659
|
return _this;
|
3626
3660
|
}
|
3627
|
-
|
3628
|
-
var _a;
|
3629
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length === this.count;
|
3630
|
-
};
|
3631
|
-
return CountEqualsUnCheckedValidatorArray;
|
3632
|
-
}(ValidatorArray));
|
3633
|
-
|
3634
|
-
var AllCheckedValidatorArray = /** @class */ (function (_super) {
|
3635
|
-
__extends(AllCheckedValidatorArray, _super);
|
3636
|
-
function AllCheckedValidatorArray(value, target, event, autoValid) {
|
3637
|
-
if (autoValid === void 0) { autoValid = true; }
|
3638
|
-
return _super.call(this, value, target, event, autoValid) || this;
|
3639
|
-
}
|
3640
|
-
AllCheckedValidatorArray.prototype.valid = function () {
|
3661
|
+
CountGreaterThanEqualsCheckedValidatorArray.prototype.valid = function () {
|
3641
3662
|
var _a;
|
3642
|
-
return
|
3663
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length >= this.count;
|
3643
3664
|
};
|
3644
|
-
return
|
3665
|
+
return CountGreaterThanEqualsCheckedValidatorArray;
|
3645
3666
|
}(ValidatorArray));
|
3646
3667
|
|
3647
|
-
var
|
3648
|
-
__extends(
|
3649
|
-
function
|
3668
|
+
var CountGreaterThanEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
|
3669
|
+
__extends(CountGreaterThanEqualsUnCheckedValidatorArray, _super);
|
3670
|
+
function CountGreaterThanEqualsUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
3650
3671
|
if (autoValid === void 0) { autoValid = true; }
|
3651
3672
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3652
3673
|
_this.count = count;
|
3653
3674
|
return _this;
|
3654
3675
|
}
|
3655
|
-
|
3676
|
+
CountGreaterThanEqualsUnCheckedValidatorArray.prototype.valid = function () {
|
3656
3677
|
var _a;
|
3657
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length
|
3678
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length >= this.count;
|
3658
3679
|
};
|
3659
|
-
return
|
3680
|
+
return CountGreaterThanEqualsUnCheckedValidatorArray;
|
3660
3681
|
}(ValidatorArray));
|
3661
3682
|
|
3662
3683
|
var CountGreaterThanUnCheckedValidatorArray = /** @class */ (function (_super) {
|
@@ -3674,36 +3695,65 @@ var CountGreaterThanUnCheckedValidatorArray = /** @class */ (function (_super) {
|
|
3674
3695
|
return CountGreaterThanUnCheckedValidatorArray;
|
3675
3696
|
}(ValidatorArray));
|
3676
3697
|
|
3677
|
-
var
|
3678
|
-
__extends(
|
3679
|
-
function
|
3698
|
+
var CountLessThanEqualsCheckedValidatorArray = /** @class */ (function (_super) {
|
3699
|
+
__extends(CountLessThanEqualsCheckedValidatorArray, _super);
|
3700
|
+
function CountLessThanEqualsCheckedValidatorArray(count, value, target, event, autoValid) {
|
3680
3701
|
if (autoValid === void 0) { autoValid = true; }
|
3681
3702
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3682
3703
|
_this.count = count;
|
3683
3704
|
return _this;
|
3684
3705
|
}
|
3685
|
-
|
3706
|
+
CountLessThanEqualsCheckedValidatorArray.prototype.valid = function () {
|
3686
3707
|
var _a;
|
3687
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return
|
3708
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length <= this.count;
|
3688
3709
|
};
|
3689
|
-
return
|
3710
|
+
return CountLessThanEqualsCheckedValidatorArray;
|
3690
3711
|
}(ValidatorArray));
|
3691
3712
|
|
3692
|
-
var
|
3693
|
-
__extends(
|
3694
|
-
function
|
3713
|
+
var CountLessThanCheckedValidatorArray = /** @class */ (function (_super) {
|
3714
|
+
__extends(CountLessThanCheckedValidatorArray, _super);
|
3715
|
+
function CountLessThanCheckedValidatorArray(count, value, target, event, autoValid) {
|
3695
3716
|
if (autoValid === void 0) { autoValid = true; }
|
3696
3717
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3697
3718
|
_this.count = count;
|
3698
3719
|
return _this;
|
3699
3720
|
}
|
3700
|
-
|
3721
|
+
CountLessThanCheckedValidatorArray.prototype.valid = function () {
|
3701
3722
|
var _a;
|
3702
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length
|
3723
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length < this.count;
|
3703
3724
|
};
|
3704
|
-
return
|
3725
|
+
return CountLessThanCheckedValidatorArray;
|
3726
|
+
}(ValidatorArray));
|
3727
|
+
|
3728
|
+
var CountLessThanEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
|
3729
|
+
__extends(CountLessThanEqualsUnCheckedValidatorArray, _super);
|
3730
|
+
function CountLessThanEqualsUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
3731
|
+
if (autoValid === void 0) { autoValid = true; }
|
3732
|
+
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3733
|
+
_this.count = count;
|
3734
|
+
return _this;
|
3735
|
+
}
|
3736
|
+
CountLessThanEqualsUnCheckedValidatorArray.prototype.valid = function () {
|
3737
|
+
var _a;
|
3738
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length <= this.count;
|
3739
|
+
};
|
3740
|
+
return CountLessThanEqualsUnCheckedValidatorArray;
|
3705
3741
|
}(ValidatorArray));
|
3706
3742
|
|
3743
|
+
var EmptyValidator = /** @class */ (function (_super) {
|
3744
|
+
__extends(EmptyValidator, _super);
|
3745
|
+
function EmptyValidator(value, target, event, autoValid) {
|
3746
|
+
if (autoValid === void 0) { autoValid = true; }
|
3747
|
+
return _super.call(this, value, target, event, autoValid) || this;
|
3748
|
+
}
|
3749
|
+
EmptyValidator.prototype.valid = function () {
|
3750
|
+
var _a, _b;
|
3751
|
+
var value = this.value;
|
3752
|
+
return value === undefined || value === null || ((_b = (_a = value) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) <= 0;
|
3753
|
+
};
|
3754
|
+
return EmptyValidator;
|
3755
|
+
}(Validator));
|
3756
|
+
|
3707
3757
|
var CountUnCheckedValidatorArray = /** @class */ (function (_super) {
|
3708
3758
|
__extends(CountUnCheckedValidatorArray, _super);
|
3709
3759
|
function CountUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
@@ -3719,21 +3769,39 @@ var CountUnCheckedValidatorArray = /** @class */ (function (_super) {
|
|
3719
3769
|
return CountUnCheckedValidatorArray;
|
3720
3770
|
}(ValidatorArray));
|
3721
3771
|
|
3722
|
-
var
|
3723
|
-
__extends(
|
3724
|
-
function
|
3772
|
+
var CountLessThanUnCheckedValidatorArray = /** @class */ (function (_super) {
|
3773
|
+
__extends(CountLessThanUnCheckedValidatorArray, _super);
|
3774
|
+
function CountLessThanUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
3725
3775
|
if (autoValid === void 0) { autoValid = true; }
|
3726
3776
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3727
3777
|
_this.count = count;
|
3728
3778
|
return _this;
|
3729
3779
|
}
|
3730
|
-
|
3780
|
+
CountLessThanUnCheckedValidatorArray.prototype.valid = function () {
|
3731
3781
|
var _a;
|
3732
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length
|
3782
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length < this.count;
|
3733
3783
|
};
|
3734
|
-
return
|
3784
|
+
return CountLessThanUnCheckedValidatorArray;
|
3735
3785
|
}(ValidatorArray));
|
3736
3786
|
|
3787
|
+
var FormValidator = /** @class */ (function (_super) {
|
3788
|
+
__extends(FormValidator, _super);
|
3789
|
+
function FormValidator(target, event, autoValid) {
|
3790
|
+
if (autoValid === void 0) { autoValid = true; }
|
3791
|
+
return _super.call(this, undefined, target, event, autoValid) || this;
|
3792
|
+
}
|
3793
|
+
FormValidator.prototype.validAction = function () {
|
3794
|
+
return _super.prototype.childValidAction.call(this);
|
3795
|
+
};
|
3796
|
+
FormValidator.prototype.valid = function () {
|
3797
|
+
return this.childValid();
|
3798
|
+
};
|
3799
|
+
FormValidator.prototype.reset = function () {
|
3800
|
+
this.targetReset();
|
3801
|
+
};
|
3802
|
+
return FormValidator;
|
3803
|
+
}(Validator));
|
3804
|
+
|
3737
3805
|
var IncludeCheckedValidatorArray = /** @class */ (function (_super) {
|
3738
3806
|
__extends(IncludeCheckedValidatorArray, _super);
|
3739
3807
|
function IncludeCheckedValidatorArray(include, allRequired, value, target, event, autoValid) {
|
@@ -3756,39 +3824,35 @@ var IncludeCheckedValidatorArray = /** @class */ (function (_super) {
|
|
3756
3824
|
return IncludeCheckedValidatorArray;
|
3757
3825
|
}(ValidatorArray));
|
3758
3826
|
|
3759
|
-
var
|
3760
|
-
__extends(
|
3761
|
-
function
|
3827
|
+
var MultipleValidator = /** @class */ (function (_super) {
|
3828
|
+
__extends(MultipleValidator, _super);
|
3829
|
+
function MultipleValidator(validators, value, target, event, autoValid) {
|
3762
3830
|
if (autoValid === void 0) { autoValid = true; }
|
3763
|
-
|
3831
|
+
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3832
|
+
_this.validators = validators.map(function (it) {
|
3833
|
+
it.setAutoValid(false);
|
3834
|
+
it.setAutoValidAction(false);
|
3835
|
+
return it;
|
3836
|
+
});
|
3837
|
+
_this.validators.forEach(function (it) {
|
3838
|
+
it.set(_this.value, _this.getTarget(), _this.getEvent());
|
3839
|
+
});
|
3840
|
+
return _this;
|
3764
3841
|
}
|
3765
|
-
|
3766
|
-
|
3842
|
+
MultipleValidator.prototype.changeValue = function (value) {
|
3843
|
+
var _this = this;
|
3844
|
+
this.validators.forEach(function (it) { return it.set(_this.value, _this.getTarget(), _this.getEvent()); });
|
3767
3845
|
};
|
3768
|
-
|
3769
|
-
return this.
|
3846
|
+
MultipleValidator.prototype.validAction = function () {
|
3847
|
+
return !(this.validators.filter(function (it) { return !it.validAction(); }).length > 0);
|
3770
3848
|
};
|
3771
|
-
|
3772
|
-
this.
|
3849
|
+
MultipleValidator.prototype.valid = function () {
|
3850
|
+
// console.log('mm', this.validators)
|
3851
|
+
return !(this.validators.filter(function (it) { return !it.valid(); }).length > 0);
|
3773
3852
|
};
|
3774
|
-
return
|
3853
|
+
return MultipleValidator;
|
3775
3854
|
}(Validator));
|
3776
3855
|
|
3777
|
-
var CountLessThanUnCheckedValidatorArray = /** @class */ (function (_super) {
|
3778
|
-
__extends(CountLessThanUnCheckedValidatorArray, _super);
|
3779
|
-
function CountLessThanUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
3780
|
-
if (autoValid === void 0) { autoValid = true; }
|
3781
|
-
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3782
|
-
_this.count = count;
|
3783
|
-
return _this;
|
3784
|
-
}
|
3785
|
-
CountLessThanUnCheckedValidatorArray.prototype.valid = function () {
|
3786
|
-
var _a;
|
3787
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length < this.count;
|
3788
|
-
};
|
3789
|
-
return CountLessThanUnCheckedValidatorArray;
|
3790
|
-
}(ValidatorArray));
|
3791
|
-
|
3792
3856
|
var ExcludeCheckedValidatorArray = /** @class */ (function (_super) {
|
3793
3857
|
__extends(ExcludeCheckedValidatorArray, _super);
|
3794
3858
|
function ExcludeCheckedValidatorArray(include, allRequired, value, target, event, autoValid) {
|
@@ -3811,35 +3875,6 @@ var ExcludeCheckedValidatorArray = /** @class */ (function (_super) {
|
|
3811
3875
|
return ExcludeCheckedValidatorArray;
|
3812
3876
|
}(ValidatorArray));
|
3813
3877
|
|
3814
|
-
var CountLessThanEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
|
3815
|
-
__extends(CountLessThanEqualsUnCheckedValidatorArray, _super);
|
3816
|
-
function CountLessThanEqualsUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
3817
|
-
if (autoValid === void 0) { autoValid = true; }
|
3818
|
-
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3819
|
-
_this.count = count;
|
3820
|
-
return _this;
|
3821
|
-
}
|
3822
|
-
CountLessThanEqualsUnCheckedValidatorArray.prototype.valid = function () {
|
3823
|
-
var _a;
|
3824
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length <= this.count;
|
3825
|
-
};
|
3826
|
-
return CountLessThanEqualsUnCheckedValidatorArray;
|
3827
|
-
}(ValidatorArray));
|
3828
|
-
|
3829
|
-
var EmptyValidator = /** @class */ (function (_super) {
|
3830
|
-
__extends(EmptyValidator, _super);
|
3831
|
-
function EmptyValidator(value, target, event, autoValid) {
|
3832
|
-
if (autoValid === void 0) { autoValid = true; }
|
3833
|
-
return _super.call(this, value, target, event, autoValid) || this;
|
3834
|
-
}
|
3835
|
-
EmptyValidator.prototype.valid = function () {
|
3836
|
-
var _a, _b;
|
3837
|
-
var value = this.value;
|
3838
|
-
return value === undefined || value === null || ((_b = (_a = value) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) <= 0;
|
3839
|
-
};
|
3840
|
-
return EmptyValidator;
|
3841
|
-
}(Validator));
|
3842
|
-
|
3843
3878
|
var NotEmptyValidator = /** @class */ (function (_super) {
|
3844
3879
|
__extends(NotEmptyValidator, _super);
|
3845
3880
|
function NotEmptyValidator(value, target, event, autoValid) {
|
@@ -3855,35 +3890,6 @@ var NotEmptyValidator = /** @class */ (function (_super) {
|
|
3855
3890
|
return NotEmptyValidator;
|
3856
3891
|
}(Validator));
|
3857
3892
|
|
3858
|
-
var MultipleValidator = /** @class */ (function (_super) {
|
3859
|
-
__extends(MultipleValidator, _super);
|
3860
|
-
function MultipleValidator(validators, value, target, event, autoValid) {
|
3861
|
-
if (autoValid === void 0) { autoValid = true; }
|
3862
|
-
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3863
|
-
_this.validators = validators.map(function (it) {
|
3864
|
-
it.setAutoValid(false);
|
3865
|
-
it.setAutoValidAction(false);
|
3866
|
-
return it;
|
3867
|
-
});
|
3868
|
-
_this.validators.forEach(function (it) {
|
3869
|
-
it.set(_this.value, _this.getTarget(), _this.getEvent());
|
3870
|
-
});
|
3871
|
-
return _this;
|
3872
|
-
}
|
3873
|
-
MultipleValidator.prototype.changeValue = function (value) {
|
3874
|
-
var _this = this;
|
3875
|
-
this.validators.forEach(function (it) { return it.set(_this.value, _this.getTarget(), _this.getEvent()); });
|
3876
|
-
};
|
3877
|
-
MultipleValidator.prototype.validAction = function () {
|
3878
|
-
return !(this.validators.filter(function (it) { return !it.validAction(); }).length > 0);
|
3879
|
-
};
|
3880
|
-
MultipleValidator.prototype.valid = function () {
|
3881
|
-
// console.log('mm', this.validators)
|
3882
|
-
return !(this.validators.filter(function (it) { return !it.valid(); }).length > 0);
|
3883
|
-
};
|
3884
|
-
return MultipleValidator;
|
3885
|
-
}(Validator));
|
3886
|
-
|
3887
3893
|
var PassValidator = /** @class */ (function (_super) {
|
3888
3894
|
__extends(PassValidator, _super);
|
3889
3895
|
function PassValidator(value, target, event, autoValid) {
|
@@ -3896,40 +3902,56 @@ var PassValidator = /** @class */ (function (_super) {
|
|
3896
3902
|
return PassValidator;
|
3897
3903
|
}(Validator));
|
3898
3904
|
|
3899
|
-
var
|
3900
|
-
__extends(
|
3901
|
-
function
|
3902
|
-
if (autoValid === void 0) { autoValid = true; }
|
3903
|
-
return _super.call(this, value, target, event, autoValid) || this;
|
3904
|
-
}
|
3905
|
-
RequiredValidator.prototype.valid = function () {
|
3906
|
-
var value = this.value;
|
3907
|
-
// console.log('required', value, value !== undefined && value !== null)
|
3908
|
-
return value !== undefined && value !== null;
|
3909
|
-
};
|
3910
|
-
return RequiredValidator;
|
3911
|
-
}(Validator));
|
3912
|
-
|
3913
|
-
var NotRegExpTestValidator = /** @class */ (function (_super) {
|
3914
|
-
__extends(NotRegExpTestValidator, _super);
|
3915
|
-
function NotRegExpTestValidator(regexp, value, target, event, autoValid) {
|
3905
|
+
var RegExpTestValidator = /** @class */ (function (_super) {
|
3906
|
+
__extends(RegExpTestValidator, _super);
|
3907
|
+
function RegExpTestValidator(regexp, value, target, event, autoValid) {
|
3916
3908
|
if (autoValid === void 0) { autoValid = true; }
|
3917
3909
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3918
3910
|
_this.regexp = DomRenderProxy.final(regexp);
|
3919
3911
|
return _this;
|
3920
3912
|
}
|
3921
|
-
|
3913
|
+
RegExpTestValidator.prototype.valid = function () {
|
3922
3914
|
var _a;
|
3923
3915
|
var value = this.value;
|
3924
3916
|
var regExp = (_a = this.regexp._DomRender_origin) !== null && _a !== void 0 ? _a : this.regexp;
|
3917
|
+
// console.log('regexp-->', value, this.regexp, regExp.test(value))
|
3925
3918
|
if (value) {
|
3926
|
-
return
|
3919
|
+
return regExp.test(value);
|
3927
3920
|
}
|
3928
3921
|
else {
|
3929
|
-
return
|
3922
|
+
return false;
|
3930
3923
|
}
|
3931
3924
|
};
|
3932
|
-
return
|
3925
|
+
return RegExpTestValidator;
|
3926
|
+
}(Validator));
|
3927
|
+
|
3928
|
+
var ValidMultipleValidator = /** @class */ (function (_super) {
|
3929
|
+
__extends(ValidMultipleValidator, _super);
|
3930
|
+
function ValidMultipleValidator(validMultipleCallback, validators, value, target, event, autoValid) {
|
3931
|
+
if (autoValid === void 0) { autoValid = true; }
|
3932
|
+
var _this = _super.call(this, validators, value, target, event, autoValid) || this;
|
3933
|
+
_this.validMultipleCallback = validMultipleCallback;
|
3934
|
+
_this.validators = validators;
|
3935
|
+
return _this;
|
3936
|
+
}
|
3937
|
+
ValidMultipleValidator.prototype.valid = function () {
|
3938
|
+
return this.validMultipleCallback(this.validators, this.value, this.getTarget(), this.getEvent());
|
3939
|
+
};
|
3940
|
+
return ValidMultipleValidator;
|
3941
|
+
}(MultipleValidator));
|
3942
|
+
|
3943
|
+
var RequiredValidator = /** @class */ (function (_super) {
|
3944
|
+
__extends(RequiredValidator, _super);
|
3945
|
+
function RequiredValidator(value, target, event, autoValid) {
|
3946
|
+
if (autoValid === void 0) { autoValid = true; }
|
3947
|
+
return _super.call(this, value, target, event, autoValid) || this;
|
3948
|
+
}
|
3949
|
+
RequiredValidator.prototype.valid = function () {
|
3950
|
+
var value = this.value;
|
3951
|
+
// console.log('required', value, value !== undefined && value !== null)
|
3952
|
+
return value !== undefined && value !== null;
|
3953
|
+
};
|
3954
|
+
return RequiredValidator;
|
3933
3955
|
}(Validator));
|
3934
3956
|
|
3935
3957
|
var UnCheckedValidator = /** @class */ (function (_super) {
|
@@ -3945,20 +3967,19 @@ var UnCheckedValidator = /** @class */ (function (_super) {
|
|
3945
3967
|
return UnCheckedValidator;
|
3946
3968
|
}(Validator));
|
3947
3969
|
|
3948
|
-
var
|
3949
|
-
__extends(
|
3950
|
-
function
|
3970
|
+
var ValidValidatorArray = /** @class */ (function (_super) {
|
3971
|
+
__extends(ValidValidatorArray, _super);
|
3972
|
+
function ValidValidatorArray(validCallBack, value, target, event, autoValid) {
|
3951
3973
|
if (autoValid === void 0) { autoValid = true; }
|
3952
|
-
var _this = _super.call(this,
|
3953
|
-
_this.
|
3954
|
-
_this.validators = validators;
|
3974
|
+
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3975
|
+
_this.validCallBack = validCallBack;
|
3955
3976
|
return _this;
|
3956
3977
|
}
|
3957
|
-
|
3958
|
-
return this.
|
3978
|
+
ValidValidatorArray.prototype.valid = function () {
|
3979
|
+
return this.validCallBack(this.value, this.getTarget(), this.getEvent());
|
3959
3980
|
};
|
3960
|
-
return
|
3961
|
-
}(
|
3981
|
+
return ValidValidatorArray;
|
3982
|
+
}(ValidatorArray));
|
3962
3983
|
|
3963
3984
|
var ValidValidator = /** @class */ (function (_super) {
|
3964
3985
|
__extends(ValidValidator, _super);
|
@@ -3974,42 +3995,41 @@ var ValidValidator = /** @class */ (function (_super) {
|
|
3974
3995
|
return ValidValidator;
|
3975
3996
|
}(Validator));
|
3976
3997
|
|
3977
|
-
var
|
3978
|
-
__extends(
|
3979
|
-
function
|
3998
|
+
var NotRegExpTestValidator = /** @class */ (function (_super) {
|
3999
|
+
__extends(NotRegExpTestValidator, _super);
|
4000
|
+
function NotRegExpTestValidator(regexp, value, target, event, autoValid) {
|
3980
4001
|
if (autoValid === void 0) { autoValid = true; }
|
3981
4002
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3982
4003
|
_this.regexp = DomRenderProxy.final(regexp);
|
3983
4004
|
return _this;
|
3984
4005
|
}
|
3985
|
-
|
4006
|
+
NotRegExpTestValidator.prototype.valid = function () {
|
3986
4007
|
var _a;
|
3987
4008
|
var value = this.value;
|
3988
4009
|
var regExp = (_a = this.regexp._DomRender_origin) !== null && _a !== void 0 ? _a : this.regexp;
|
3989
|
-
// console.log('regexp-->', value, this.regexp, regExp.test(value))
|
3990
4010
|
if (value) {
|
3991
|
-
return regExp.test(value);
|
4011
|
+
return !regExp.test(value);
|
3992
4012
|
}
|
3993
4013
|
else {
|
3994
|
-
return
|
4014
|
+
return true;
|
3995
4015
|
}
|
3996
4016
|
};
|
3997
|
-
return
|
4017
|
+
return NotRegExpTestValidator;
|
3998
4018
|
}(Validator));
|
3999
4019
|
|
4000
|
-
var
|
4001
|
-
__extends(
|
4002
|
-
function
|
4020
|
+
var ValueEqualsValidator = /** @class */ (function (_super) {
|
4021
|
+
__extends(ValueEqualsValidator, _super);
|
4022
|
+
function ValueEqualsValidator(equalsValue, value, target, event, autoValid) {
|
4003
4023
|
if (autoValid === void 0) { autoValid = true; }
|
4004
4024
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4005
|
-
_this.
|
4025
|
+
_this.equalsValue = equalsValue;
|
4006
4026
|
return _this;
|
4007
4027
|
}
|
4008
|
-
|
4009
|
-
return this.
|
4028
|
+
ValueEqualsValidator.prototype.valid = function () {
|
4029
|
+
return this.value === this.equalsValue;
|
4010
4030
|
};
|
4011
|
-
return
|
4012
|
-
}(
|
4031
|
+
return ValueEqualsValidator;
|
4032
|
+
}(Validator));
|
4013
4033
|
|
4014
4034
|
var ValueNotEqualsValidator = /** @class */ (function (_super) {
|
4015
4035
|
__extends(ValueNotEqualsValidator, _super);
|
@@ -4025,20 +4045,6 @@ var ValueNotEqualsValidator = /** @class */ (function (_super) {
|
|
4025
4045
|
return ValueNotEqualsValidator;
|
4026
4046
|
}(Validator));
|
4027
4047
|
|
4028
|
-
var ValueEqualsValidator = /** @class */ (function (_super) {
|
4029
|
-
__extends(ValueEqualsValidator, _super);
|
4030
|
-
function ValueEqualsValidator(equalsValue, value, target, event, autoValid) {
|
4031
|
-
if (autoValid === void 0) { autoValid = true; }
|
4032
|
-
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4033
|
-
_this.equalsValue = equalsValue;
|
4034
|
-
return _this;
|
4035
|
-
}
|
4036
|
-
ValueEqualsValidator.prototype.valid = function () {
|
4037
|
-
return this.value === this.equalsValue;
|
4038
|
-
};
|
4039
|
-
return ValueEqualsValidator;
|
4040
|
-
}(Validator));
|
4041
|
-
|
4042
4048
|
var ClipBoardUtils = /** @class */ (function () {
|
4043
4049
|
function ClipBoardUtils() {
|
4044
4050
|
}
|