dom-render 1.0.82 → 1.0.83
Sign up to get free protection for your applications and to get access to all the features.
- package/README.MD +2 -2
- package/RawSet.js +13 -6
- package/dist/bundle.js +166 -159
- package/package.json +1 -1
package/README.MD
CHANGED
@@ -7,7 +7,7 @@ DOM-RENDER
|
|
7
7
|
|
8
8
|
# 🚀 Quick start
|
9
9
|
```html
|
10
|
-
<script src="https://cdn.jsdelivr.net/npm/dom-render@1.0.
|
10
|
+
<script src="https://cdn.jsdelivr.net/npm/dom-render@1.0.83/dist/bundle.js"></script>
|
11
11
|
```
|
12
12
|
```html
|
13
13
|
<!DOCTYPE html>
|
@@ -18,7 +18,7 @@ DOM-RENDER
|
|
18
18
|
</head>
|
19
19
|
<body id="app">
|
20
20
|
${this.name}$
|
21
|
-
<script src="https://cdn.jsdelivr.net/npm/dom-render@1.0.
|
21
|
+
<script src="https://cdn.jsdelivr.net/npm/dom-render@1.0.83/dist/bundle.js"></script>
|
22
22
|
<script>
|
23
23
|
let data = {
|
24
24
|
name: 'my name is dom-render'
|
package/RawSet.js
CHANGED
@@ -249,12 +249,19 @@ var RawSet = /** @class */ (function () {
|
|
249
249
|
// rule.selectorText = `${start} ~ *:not(${start} ~ ${end} ~ ${rule.selectorText})`;
|
250
250
|
// console.log('-----', rule, rule.selectorText)
|
251
251
|
if (!rule.selectorText.startsWith(':root')) {
|
252
|
-
rule.selectorText =
|
253
|
-
//
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
252
|
+
// rule.selectorText = `${start} ~ ${rule.selectorText}:not(${start} ~ ${end} ~ *)`;
|
253
|
+
// rule.selectorText = `${start} ~ ${rule.selectorText}:not(${start} ~ ${end} ~ *)`;
|
254
|
+
var selectorText = ":is(".concat(start_1, " ~ *:not(").concat(start_1, " ~ ").concat(end_1, " ~ *))");
|
255
|
+
if (rule.selectorText.startsWith('.')) {
|
256
|
+
rule.selectorText = "".concat(selectorText).concat(rule.selectorText, ", ").concat(selectorText, " ").concat(rule.selectorText);
|
257
|
+
// rule.selectorText = `${start} ~ *:not(${start} ~ ${end} ~ *)${rule.selectorText}`;
|
258
|
+
}
|
259
|
+
else {
|
260
|
+
var divText = "".concat(start_1, " ~ ").concat(rule.selectorText, ":not(").concat(start_1, " ~ ").concat(end_1, " ~ *)");
|
261
|
+
rule.selectorText = "".concat(selectorText, " ").concat(rule.selectorText, ", ").concat(divText);
|
262
|
+
// rule.selectorText = `${selectorText} ${rule.selectorText}`;
|
263
|
+
// rule.selectorText = `${rule.selectorText} ~ ${start} ~ *:not(${start} ~ ${end} ~ *)`;
|
264
|
+
}
|
258
265
|
}
|
259
266
|
// console.log(rule.selectorText);
|
260
267
|
});
|
package/dist/bundle.js
CHANGED
@@ -2007,12 +2007,19 @@ var RawSet = /** @class */ (function () {
|
|
2007
2007
|
// rule.selectorText = `${start} ~ *:not(${start} ~ ${end} ~ ${rule.selectorText})`;
|
2008
2008
|
// console.log('-----', rule, rule.selectorText)
|
2009
2009
|
if (!rule.selectorText.startsWith(':root')) {
|
2010
|
-
rule.selectorText =
|
2011
|
-
//
|
2012
|
-
|
2013
|
-
|
2014
|
-
|
2015
|
-
|
2010
|
+
// rule.selectorText = `${start} ~ ${rule.selectorText}:not(${start} ~ ${end} ~ *)`;
|
2011
|
+
// rule.selectorText = `${start} ~ ${rule.selectorText}:not(${start} ~ ${end} ~ *)`;
|
2012
|
+
var selectorText = ":is(".concat(start_1, " ~ *:not(").concat(start_1, " ~ ").concat(end_1, " ~ *))");
|
2013
|
+
if (rule.selectorText.startsWith('.')) {
|
2014
|
+
rule.selectorText = "".concat(selectorText).concat(rule.selectorText, ", ").concat(selectorText, " ").concat(rule.selectorText);
|
2015
|
+
// rule.selectorText = `${start} ~ *:not(${start} ~ ${end} ~ *)${rule.selectorText}`;
|
2016
|
+
}
|
2017
|
+
else {
|
2018
|
+
var divText = "".concat(start_1, " ~ ").concat(rule.selectorText, ":not(").concat(start_1, " ~ ").concat(end_1, " ~ *)");
|
2019
|
+
rule.selectorText = "".concat(selectorText, " ").concat(rule.selectorText, ", ").concat(divText);
|
2020
|
+
// rule.selectorText = `${selectorText} ${rule.selectorText}`;
|
2021
|
+
// rule.selectorText = `${rule.selectorText} ~ ${start} ~ *:not(${start} ~ ${end} ~ *)`;
|
2022
|
+
}
|
2016
2023
|
}
|
2017
2024
|
// console.log(rule.selectorText);
|
2018
2025
|
});
|
@@ -3504,6 +3511,19 @@ var AllCheckedValidatorArray = /** @class */ (function (_super) {
|
|
3504
3511
|
return AllCheckedValidatorArray;
|
3505
3512
|
}(ValidatorArray));
|
3506
3513
|
|
3514
|
+
var CheckedValidator = /** @class */ (function (_super) {
|
3515
|
+
__extends(CheckedValidator, _super);
|
3516
|
+
function CheckedValidator(value, target, event, autoValid) {
|
3517
|
+
if (autoValid === void 0) { autoValid = true; }
|
3518
|
+
return _super.call(this, value, target, event, autoValid) || this;
|
3519
|
+
}
|
3520
|
+
CheckedValidator.prototype.valid = function () {
|
3521
|
+
var _a, _b;
|
3522
|
+
return (_b = (_a = this.getTarget()) === null || _a === void 0 ? void 0 : _a.checked) !== null && _b !== void 0 ? _b : false;
|
3523
|
+
};
|
3524
|
+
return CheckedValidator;
|
3525
|
+
}(Validator));
|
3526
|
+
|
3507
3527
|
var AllUnCheckedValidatorArray = /** @class */ (function (_super) {
|
3508
3528
|
__extends(AllUnCheckedValidatorArray, _super);
|
3509
3529
|
function AllUnCheckedValidatorArray(value, target, event, autoValid) {
|
@@ -3532,18 +3552,20 @@ var CountEqualsCheckedValidatorArray = /** @class */ (function (_super) {
|
|
3532
3552
|
return CountEqualsCheckedValidatorArray;
|
3533
3553
|
}(ValidatorArray));
|
3534
3554
|
|
3535
|
-
var
|
3536
|
-
__extends(
|
3537
|
-
function
|
3555
|
+
var CountGreaterThanEqualsCheckedValidatorArray = /** @class */ (function (_super) {
|
3556
|
+
__extends(CountGreaterThanEqualsCheckedValidatorArray, _super);
|
3557
|
+
function CountGreaterThanEqualsCheckedValidatorArray(count, value, target, event, autoValid) {
|
3538
3558
|
if (autoValid === void 0) { autoValid = true; }
|
3539
|
-
|
3559
|
+
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3560
|
+
_this.count = count;
|
3561
|
+
return _this;
|
3540
3562
|
}
|
3541
|
-
|
3542
|
-
var _a
|
3543
|
-
return (
|
3563
|
+
CountGreaterThanEqualsCheckedValidatorArray.prototype.valid = function () {
|
3564
|
+
var _a;
|
3565
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length >= this.count;
|
3544
3566
|
};
|
3545
|
-
return
|
3546
|
-
}(
|
3567
|
+
return CountGreaterThanEqualsCheckedValidatorArray;
|
3568
|
+
}(ValidatorArray));
|
3547
3569
|
|
3548
3570
|
var CountGreaterThanCheckedValidatorArray = /** @class */ (function (_super) {
|
3549
3571
|
__extends(CountGreaterThanCheckedValidatorArray, _super);
|
@@ -3560,19 +3582,34 @@ var CountGreaterThanCheckedValidatorArray = /** @class */ (function (_super) {
|
|
3560
3582
|
return CountGreaterThanCheckedValidatorArray;
|
3561
3583
|
}(ValidatorArray));
|
3562
3584
|
|
3563
|
-
var
|
3564
|
-
__extends(
|
3565
|
-
function
|
3585
|
+
var CountGreaterThanUnCheckedValidatorArray = /** @class */ (function (_super) {
|
3586
|
+
__extends(CountGreaterThanUnCheckedValidatorArray, _super);
|
3587
|
+
function CountGreaterThanUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
3566
3588
|
if (autoValid === void 0) { autoValid = true; }
|
3567
3589
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3568
3590
|
_this.count = count;
|
3569
3591
|
return _this;
|
3570
3592
|
}
|
3571
|
-
|
3593
|
+
CountGreaterThanUnCheckedValidatorArray.prototype.valid = function () {
|
3572
3594
|
var _a;
|
3573
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length
|
3595
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length > this.count;
|
3574
3596
|
};
|
3575
|
-
return
|
3597
|
+
return CountGreaterThanUnCheckedValidatorArray;
|
3598
|
+
}(ValidatorArray));
|
3599
|
+
|
3600
|
+
var CountEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
|
3601
|
+
__extends(CountEqualsUnCheckedValidatorArray, _super);
|
3602
|
+
function CountEqualsUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
3603
|
+
if (autoValid === void 0) { autoValid = true; }
|
3604
|
+
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3605
|
+
_this.count = count;
|
3606
|
+
return _this;
|
3607
|
+
}
|
3608
|
+
CountEqualsUnCheckedValidatorArray.prototype.valid = function () {
|
3609
|
+
var _a;
|
3610
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length === this.count;
|
3611
|
+
};
|
3612
|
+
return CountEqualsUnCheckedValidatorArray;
|
3576
3613
|
}(ValidatorArray));
|
3577
3614
|
|
3578
3615
|
var CountGreaterThanEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
|
@@ -3605,21 +3642,6 @@ var CountLessThanCheckedValidatorArray = /** @class */ (function (_super) {
|
|
3605
3642
|
return CountLessThanCheckedValidatorArray;
|
3606
3643
|
}(ValidatorArray));
|
3607
3644
|
|
3608
|
-
var CountGreaterThanUnCheckedValidatorArray = /** @class */ (function (_super) {
|
3609
|
-
__extends(CountGreaterThanUnCheckedValidatorArray, _super);
|
3610
|
-
function CountGreaterThanUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
3611
|
-
if (autoValid === void 0) { autoValid = true; }
|
3612
|
-
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3613
|
-
_this.count = count;
|
3614
|
-
return _this;
|
3615
|
-
}
|
3616
|
-
CountGreaterThanUnCheckedValidatorArray.prototype.valid = function () {
|
3617
|
-
var _a;
|
3618
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length > this.count;
|
3619
|
-
};
|
3620
|
-
return CountGreaterThanUnCheckedValidatorArray;
|
3621
|
-
}(ValidatorArray));
|
3622
|
-
|
3623
3645
|
var CountLessThanEqualsCheckedValidatorArray = /** @class */ (function (_super) {
|
3624
3646
|
__extends(CountLessThanEqualsCheckedValidatorArray, _super);
|
3625
3647
|
function CountLessThanEqualsCheckedValidatorArray(count, value, target, event, autoValid) {
|
@@ -3635,19 +3657,19 @@ var CountLessThanEqualsCheckedValidatorArray = /** @class */ (function (_super)
|
|
3635
3657
|
return CountLessThanEqualsCheckedValidatorArray;
|
3636
3658
|
}(ValidatorArray));
|
3637
3659
|
|
3638
|
-
var
|
3639
|
-
__extends(
|
3640
|
-
function
|
3660
|
+
var CountLessThanEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
|
3661
|
+
__extends(CountLessThanEqualsUnCheckedValidatorArray, _super);
|
3662
|
+
function CountLessThanEqualsUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
3641
3663
|
if (autoValid === void 0) { autoValid = true; }
|
3642
3664
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3643
3665
|
_this.count = count;
|
3644
3666
|
return _this;
|
3645
3667
|
}
|
3646
|
-
|
3668
|
+
CountLessThanEqualsUnCheckedValidatorArray.prototype.valid = function () {
|
3647
3669
|
var _a;
|
3648
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length
|
3670
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length <= this.count;
|
3649
3671
|
};
|
3650
|
-
return
|
3672
|
+
return CountLessThanEqualsUnCheckedValidatorArray;
|
3651
3673
|
}(ValidatorArray));
|
3652
3674
|
|
3653
3675
|
var CountLessThanUnCheckedValidatorArray = /** @class */ (function (_super) {
|
@@ -3680,21 +3702,6 @@ var CountUnCheckedValidatorArray = /** @class */ (function (_super) {
|
|
3680
3702
|
return CountUnCheckedValidatorArray;
|
3681
3703
|
}(ValidatorArray));
|
3682
3704
|
|
3683
|
-
var CountLessThanEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
|
3684
|
-
__extends(CountLessThanEqualsUnCheckedValidatorArray, _super);
|
3685
|
-
function CountLessThanEqualsUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
3686
|
-
if (autoValid === void 0) { autoValid = true; }
|
3687
|
-
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3688
|
-
_this.count = count;
|
3689
|
-
return _this;
|
3690
|
-
}
|
3691
|
-
CountLessThanEqualsUnCheckedValidatorArray.prototype.valid = function () {
|
3692
|
-
var _a;
|
3693
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length <= this.count;
|
3694
|
-
};
|
3695
|
-
return CountLessThanEqualsUnCheckedValidatorArray;
|
3696
|
-
}(ValidatorArray));
|
3697
|
-
|
3698
3705
|
var EmptyValidator = /** @class */ (function (_super) {
|
3699
3706
|
__extends(EmptyValidator, _super);
|
3700
3707
|
function EmptyValidator(value, target, event, autoValid) {
|
@@ -3731,40 +3738,6 @@ var ExcludeCheckedValidatorArray = /** @class */ (function (_super) {
|
|
3731
3738
|
return ExcludeCheckedValidatorArray;
|
3732
3739
|
}(ValidatorArray));
|
3733
3740
|
|
3734
|
-
var IncludeCheckedValidatorArray = /** @class */ (function (_super) {
|
3735
|
-
__extends(IncludeCheckedValidatorArray, _super);
|
3736
|
-
function IncludeCheckedValidatorArray(include, allRequired, value, target, event, autoValid) {
|
3737
|
-
if (allRequired === void 0) { allRequired = false; }
|
3738
|
-
if (autoValid === void 0) { autoValid = true; }
|
3739
|
-
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3740
|
-
_this.include = include;
|
3741
|
-
_this.allRequired = allRequired;
|
3742
|
-
return _this;
|
3743
|
-
}
|
3744
|
-
IncludeCheckedValidatorArray.prototype.valid = function () {
|
3745
|
-
var _this = this;
|
3746
|
-
var _a;
|
3747
|
-
var valus = (_a = this.value) !== null && _a !== void 0 ? _a : [];
|
3748
|
-
var checkedValue = valus.filter(function (it) { return it.checked; }).map(function (it) { return it.value; });
|
3749
|
-
return checkedValue.length > 0 &&
|
3750
|
-
(!(checkedValue.filter(function (it) { return !_this.include.includes(it); }).length > 0)) &&
|
3751
|
-
(this.allRequired ? checkedValue.filter(function (it) { return _this.include.includes(it); }).length === this.include.length : true);
|
3752
|
-
};
|
3753
|
-
return IncludeCheckedValidatorArray;
|
3754
|
-
}(ValidatorArray));
|
3755
|
-
|
3756
|
-
var PassValidator = /** @class */ (function (_super) {
|
3757
|
-
__extends(PassValidator, _super);
|
3758
|
-
function PassValidator(value, target, event, autoValid) {
|
3759
|
-
if (autoValid === void 0) { autoValid = true; }
|
3760
|
-
return _super.call(this, value, target, event, autoValid) || this;
|
3761
|
-
}
|
3762
|
-
PassValidator.prototype.valid = function () {
|
3763
|
-
return true;
|
3764
|
-
};
|
3765
|
-
return PassValidator;
|
3766
|
-
}(Validator));
|
3767
|
-
|
3768
3741
|
var FormValidator = /** @class */ (function (_super) {
|
3769
3742
|
__extends(FormValidator, _super);
|
3770
3743
|
function FormValidator(target, event, autoValid) {
|
@@ -3783,19 +3756,27 @@ var FormValidator = /** @class */ (function (_super) {
|
|
3783
3756
|
return FormValidator;
|
3784
3757
|
}(Validator));
|
3785
3758
|
|
3786
|
-
var
|
3787
|
-
__extends(
|
3788
|
-
function
|
3759
|
+
var IncludeCheckedValidatorArray = /** @class */ (function (_super) {
|
3760
|
+
__extends(IncludeCheckedValidatorArray, _super);
|
3761
|
+
function IncludeCheckedValidatorArray(include, allRequired, value, target, event, autoValid) {
|
3762
|
+
if (allRequired === void 0) { allRequired = false; }
|
3789
3763
|
if (autoValid === void 0) { autoValid = true; }
|
3790
|
-
|
3764
|
+
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3765
|
+
_this.include = include;
|
3766
|
+
_this.allRequired = allRequired;
|
3767
|
+
return _this;
|
3791
3768
|
}
|
3792
|
-
|
3793
|
-
var
|
3794
|
-
|
3795
|
-
|
3769
|
+
IncludeCheckedValidatorArray.prototype.valid = function () {
|
3770
|
+
var _this = this;
|
3771
|
+
var _a;
|
3772
|
+
var valus = (_a = this.value) !== null && _a !== void 0 ? _a : [];
|
3773
|
+
var checkedValue = valus.filter(function (it) { return it.checked; }).map(function (it) { return it.value; });
|
3774
|
+
return checkedValue.length > 0 &&
|
3775
|
+
(!(checkedValue.filter(function (it) { return !_this.include.includes(it); }).length > 0)) &&
|
3776
|
+
(this.allRequired ? checkedValue.filter(function (it) { return _this.include.includes(it); }).length === this.include.length : true);
|
3796
3777
|
};
|
3797
|
-
return
|
3798
|
-
}(
|
3778
|
+
return IncludeCheckedValidatorArray;
|
3779
|
+
}(ValidatorArray));
|
3799
3780
|
|
3800
3781
|
var MultipleValidator = /** @class */ (function (_super) {
|
3801
3782
|
__extends(MultipleValidator, _super);
|
@@ -3826,6 +3807,69 @@ var MultipleValidator = /** @class */ (function (_super) {
|
|
3826
3807
|
return MultipleValidator;
|
3827
3808
|
}(Validator));
|
3828
3809
|
|
3810
|
+
var NotEmptyValidator = /** @class */ (function (_super) {
|
3811
|
+
__extends(NotEmptyValidator, _super);
|
3812
|
+
function NotEmptyValidator(value, target, event, autoValid) {
|
3813
|
+
if (autoValid === void 0) { autoValid = true; }
|
3814
|
+
return _super.call(this, value, target, event, autoValid) || this;
|
3815
|
+
}
|
3816
|
+
NotEmptyValidator.prototype.valid = function () {
|
3817
|
+
var _a, _b;
|
3818
|
+
var value = this.value;
|
3819
|
+
// console.log('NotEmptyValidator', value, value !== undefined && value !== null && ((value as any)?.length ?? 0) > 0)
|
3820
|
+
return value !== undefined && value !== null && ((_b = (_a = value) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0;
|
3821
|
+
};
|
3822
|
+
return NotEmptyValidator;
|
3823
|
+
}(Validator));
|
3824
|
+
|
3825
|
+
var NotRegExpTestValidator = /** @class */ (function (_super) {
|
3826
|
+
__extends(NotRegExpTestValidator, _super);
|
3827
|
+
function NotRegExpTestValidator(regexp, value, target, event, autoValid) {
|
3828
|
+
if (autoValid === void 0) { autoValid = true; }
|
3829
|
+
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3830
|
+
_this.regexp = DomRenderProxy.final(regexp);
|
3831
|
+
return _this;
|
3832
|
+
}
|
3833
|
+
NotRegExpTestValidator.prototype.valid = function () {
|
3834
|
+
var _a;
|
3835
|
+
var value = this.value;
|
3836
|
+
var regExp = (_a = this.regexp._DomRender_origin) !== null && _a !== void 0 ? _a : this.regexp;
|
3837
|
+
if (value) {
|
3838
|
+
return !regExp.test(value);
|
3839
|
+
}
|
3840
|
+
else {
|
3841
|
+
return true;
|
3842
|
+
}
|
3843
|
+
};
|
3844
|
+
return NotRegExpTestValidator;
|
3845
|
+
}(Validator));
|
3846
|
+
|
3847
|
+
var PassValidator = /** @class */ (function (_super) {
|
3848
|
+
__extends(PassValidator, _super);
|
3849
|
+
function PassValidator(value, target, event, autoValid) {
|
3850
|
+
if (autoValid === void 0) { autoValid = true; }
|
3851
|
+
return _super.call(this, value, target, event, autoValid) || this;
|
3852
|
+
}
|
3853
|
+
PassValidator.prototype.valid = function () {
|
3854
|
+
return true;
|
3855
|
+
};
|
3856
|
+
return PassValidator;
|
3857
|
+
}(Validator));
|
3858
|
+
|
3859
|
+
var RequiredValidator = /** @class */ (function (_super) {
|
3860
|
+
__extends(RequiredValidator, _super);
|
3861
|
+
function RequiredValidator(value, target, event, autoValid) {
|
3862
|
+
if (autoValid === void 0) { autoValid = true; }
|
3863
|
+
return _super.call(this, value, target, event, autoValid) || this;
|
3864
|
+
}
|
3865
|
+
RequiredValidator.prototype.valid = function () {
|
3866
|
+
var value = this.value;
|
3867
|
+
// console.log('required', value, value !== undefined && value !== null)
|
3868
|
+
return value !== undefined && value !== null;
|
3869
|
+
};
|
3870
|
+
return RequiredValidator;
|
3871
|
+
}(Validator));
|
3872
|
+
|
3829
3873
|
var RegExpTestValidator = /** @class */ (function (_super) {
|
3830
3874
|
__extends(RegExpTestValidator, _super);
|
3831
3875
|
function RegExpTestValidator(regexp, value, target, event, autoValid) {
|
@@ -3862,28 +3906,34 @@ var UnCheckedValidator = /** @class */ (function (_super) {
|
|
3862
3906
|
return UnCheckedValidator;
|
3863
3907
|
}(Validator));
|
3864
3908
|
|
3865
|
-
var
|
3866
|
-
__extends(
|
3867
|
-
function
|
3909
|
+
var ValidValidator = /** @class */ (function (_super) {
|
3910
|
+
__extends(ValidValidator, _super);
|
3911
|
+
function ValidValidator(validCallBack, value, target, event, autoValid) {
|
3868
3912
|
if (autoValid === void 0) { autoValid = true; }
|
3869
3913
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3870
|
-
_this.
|
3914
|
+
_this.validCallBack = validCallBack;
|
3871
3915
|
return _this;
|
3872
3916
|
}
|
3873
|
-
|
3874
|
-
|
3875
|
-
var value = this.value;
|
3876
|
-
var regExp = (_a = this.regexp._DomRender_origin) !== null && _a !== void 0 ? _a : this.regexp;
|
3877
|
-
if (value) {
|
3878
|
-
return !regExp.test(value);
|
3879
|
-
}
|
3880
|
-
else {
|
3881
|
-
return true;
|
3882
|
-
}
|
3917
|
+
ValidValidator.prototype.valid = function (value, target, event) {
|
3918
|
+
return this.validCallBack(value, target, event);
|
3883
3919
|
};
|
3884
|
-
return
|
3920
|
+
return ValidValidator;
|
3885
3921
|
}(Validator));
|
3886
3922
|
|
3923
|
+
var ValidValidatorArray = /** @class */ (function (_super) {
|
3924
|
+
__extends(ValidValidatorArray, _super);
|
3925
|
+
function ValidValidatorArray(validCallBack, value, target, event, autoValid) {
|
3926
|
+
if (autoValid === void 0) { autoValid = true; }
|
3927
|
+
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3928
|
+
_this.validCallBack = validCallBack;
|
3929
|
+
return _this;
|
3930
|
+
}
|
3931
|
+
ValidValidatorArray.prototype.valid = function () {
|
3932
|
+
return this.validCallBack(this.value, this.getTarget(), this.getEvent());
|
3933
|
+
};
|
3934
|
+
return ValidValidatorArray;
|
3935
|
+
}(ValidatorArray));
|
3936
|
+
|
3887
3937
|
var ValidMultipleValidator = /** @class */ (function (_super) {
|
3888
3938
|
__extends(ValidMultipleValidator, _super);
|
3889
3939
|
function ValidMultipleValidator(validMultipleCallback, validators, value, target, event, autoValid) {
|
@@ -3899,35 +3949,6 @@ var ValidMultipleValidator = /** @class */ (function (_super) {
|
|
3899
3949
|
return ValidMultipleValidator;
|
3900
3950
|
}(MultipleValidator));
|
3901
3951
|
|
3902
|
-
var NotEmptyValidator = /** @class */ (function (_super) {
|
3903
|
-
__extends(NotEmptyValidator, _super);
|
3904
|
-
function NotEmptyValidator(value, target, event, autoValid) {
|
3905
|
-
if (autoValid === void 0) { autoValid = true; }
|
3906
|
-
return _super.call(this, value, target, event, autoValid) || this;
|
3907
|
-
}
|
3908
|
-
NotEmptyValidator.prototype.valid = function () {
|
3909
|
-
var _a, _b;
|
3910
|
-
var value = this.value;
|
3911
|
-
// console.log('NotEmptyValidator', value, value !== undefined && value !== null && ((value as any)?.length ?? 0) > 0)
|
3912
|
-
return value !== undefined && value !== null && ((_b = (_a = value) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0;
|
3913
|
-
};
|
3914
|
-
return NotEmptyValidator;
|
3915
|
-
}(Validator));
|
3916
|
-
|
3917
|
-
var ValidValidator = /** @class */ (function (_super) {
|
3918
|
-
__extends(ValidValidator, _super);
|
3919
|
-
function ValidValidator(validCallBack, value, target, event, autoValid) {
|
3920
|
-
if (autoValid === void 0) { autoValid = true; }
|
3921
|
-
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3922
|
-
_this.validCallBack = validCallBack;
|
3923
|
-
return _this;
|
3924
|
-
}
|
3925
|
-
ValidValidator.prototype.valid = function (value, target, event) {
|
3926
|
-
return this.validCallBack(value, target, event);
|
3927
|
-
};
|
3928
|
-
return ValidValidator;
|
3929
|
-
}(Validator));
|
3930
|
-
|
3931
3952
|
var ValueEqualsValidator = /** @class */ (function (_super) {
|
3932
3953
|
__extends(ValueEqualsValidator, _super);
|
3933
3954
|
function ValueEqualsValidator(equalsValue, value, target, event, autoValid) {
|
@@ -3942,20 +3963,6 @@ var ValueEqualsValidator = /** @class */ (function (_super) {
|
|
3942
3963
|
return ValueEqualsValidator;
|
3943
3964
|
}(Validator));
|
3944
3965
|
|
3945
|
-
var ValidValidatorArray = /** @class */ (function (_super) {
|
3946
|
-
__extends(ValidValidatorArray, _super);
|
3947
|
-
function ValidValidatorArray(validCallBack, value, target, event, autoValid) {
|
3948
|
-
if (autoValid === void 0) { autoValid = true; }
|
3949
|
-
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3950
|
-
_this.validCallBack = validCallBack;
|
3951
|
-
return _this;
|
3952
|
-
}
|
3953
|
-
ValidValidatorArray.prototype.valid = function () {
|
3954
|
-
return this.validCallBack(this.value, this.getTarget(), this.getEvent());
|
3955
|
-
};
|
3956
|
-
return ValidValidatorArray;
|
3957
|
-
}(ValidatorArray));
|
3958
|
-
|
3959
3966
|
var ValueNotEqualsValidator = /** @class */ (function (_super) {
|
3960
3967
|
__extends(ValueNotEqualsValidator, _super);
|
3961
3968
|
function ValueNotEqualsValidator(equalsValue, value, target, event, autoValid) {
|