dom-render 1.0.54 → 1.0.58

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.
Files changed (119) hide show
  1. package/DomRenderProxy.d.ts +1 -0
  2. package/DomRenderProxy.js +6 -6
  3. package/README.MD +84 -159
  4. package/RawSet.js +15 -12
  5. package/dist/DomRenderProxy.d.ts +1 -0
  6. package/dist/bundle.js +190 -63
  7. package/dist/bundle.js.map +1 -1
  8. package/dist/iterators/Range.d.ts +1 -0
  9. package/dist/validators/AllCheckedValidatorArray.d.ts +6 -0
  10. package/dist/validators/AllUnCheckedValidatorArray.d.ts +6 -0
  11. package/dist/validators/CheckedValidator.d.ts +5 -0
  12. package/dist/validators/CountEqualsCheckedValidatorArray.d.ts +7 -0
  13. package/dist/validators/CountEqualsUnCheckedValidatorArray.d.ts +7 -0
  14. package/dist/validators/CountGreaterThanCheckedValidatorArray.d.ts +7 -0
  15. package/dist/validators/CountGreaterThanEqualsCheckedValidatorArray.d.ts +7 -0
  16. package/dist/validators/CountGreaterThanEqualsUnCheckedValidatorArray.d.ts +7 -0
  17. package/dist/validators/CountGreaterThanUnCheckedValidatorArray.d.ts +7 -0
  18. package/dist/validators/CountLessThanCheckedValidatorArray.d.ts +7 -0
  19. package/dist/validators/CountLessThanEqualsCheckedValidatorArray.d.ts +7 -0
  20. package/dist/validators/CountLessThanEqualsUnCheckedValidatorArray.d.ts +7 -0
  21. package/dist/validators/CountLessThanUnCheckedValidatorArray.d.ts +7 -0
  22. package/dist/validators/CountUnCheckedValidatorArray.d.ts +7 -0
  23. package/dist/validators/EmptyValidator.d.ts +5 -0
  24. package/dist/validators/ExcludeCheckedValidatorArray.d.ts +8 -0
  25. package/dist/validators/FormValidator.d.ts +5 -0
  26. package/dist/validators/IncludeCheckedValidatorArray.d.ts +8 -0
  27. package/dist/validators/MultipleValidator.d.ts +7 -0
  28. package/dist/validators/NonPassValidator.d.ts +5 -0
  29. package/dist/validators/NotEmptyValidator.d.ts +5 -0
  30. package/dist/validators/NotRegExpTestValidator.d.ts +6 -0
  31. package/dist/validators/PassValidator.d.ts +5 -0
  32. package/dist/validators/RegExpTestValidator.d.ts +6 -0
  33. package/dist/validators/RequiredValidator.d.ts +5 -0
  34. package/dist/validators/UnCheckedValidator.d.ts +5 -0
  35. package/dist/validators/ValidMultipleValidator.d.ts +9 -0
  36. package/dist/validators/ValidValidator.d.ts +6 -0
  37. package/dist/validators/ValidValidatorArray.d.ts +7 -0
  38. package/dist/validators/Validator.d.ts +31 -0
  39. package/dist/validators/ValidatorArray.d.ts +17 -0
  40. package/dist/validators/ValueEqualsValidator.d.ts +6 -0
  41. package/dist/validators/ValueNotEqualsValidator.d.ts +6 -0
  42. package/events/EventManager.js +0 -2
  43. package/iterators/Range.d.ts +1 -0
  44. package/iterators/Range.js +12 -0
  45. package/package.json +1 -1
  46. package/validators/AllCheckedValidatorArray.d.ts +6 -0
  47. package/validators/AllCheckedValidatorArray.js +29 -0
  48. package/validators/AllUnCheckedValidatorArray.d.ts +6 -0
  49. package/validators/AllUnCheckedValidatorArray.js +29 -0
  50. package/validators/CheckedValidator.d.ts +5 -0
  51. package/validators/CheckedValidator.js +29 -0
  52. package/validators/CountEqualsCheckedValidatorArray.d.ts +7 -0
  53. package/validators/CountEqualsCheckedValidatorArray.js +31 -0
  54. package/validators/CountEqualsUnCheckedValidatorArray.d.ts +7 -0
  55. package/validators/CountEqualsUnCheckedValidatorArray.js +31 -0
  56. package/validators/CountGreaterThanCheckedValidatorArray.d.ts +7 -0
  57. package/validators/CountGreaterThanCheckedValidatorArray.js +31 -0
  58. package/validators/CountGreaterThanEqualsCheckedValidatorArray.d.ts +7 -0
  59. package/validators/CountGreaterThanEqualsCheckedValidatorArray.js +31 -0
  60. package/validators/CountGreaterThanEqualsUnCheckedValidatorArray.d.ts +7 -0
  61. package/validators/CountGreaterThanEqualsUnCheckedValidatorArray.js +31 -0
  62. package/validators/CountGreaterThanUnCheckedValidatorArray.d.ts +7 -0
  63. package/validators/CountGreaterThanUnCheckedValidatorArray.js +31 -0
  64. package/validators/CountLessThanCheckedValidatorArray.d.ts +7 -0
  65. package/validators/CountLessThanCheckedValidatorArray.js +31 -0
  66. package/validators/CountLessThanEqualsCheckedValidatorArray.d.ts +7 -0
  67. package/validators/CountLessThanEqualsCheckedValidatorArray.js +31 -0
  68. package/validators/CountLessThanEqualsUnCheckedValidatorArray.d.ts +7 -0
  69. package/validators/CountLessThanEqualsUnCheckedValidatorArray.js +31 -0
  70. package/validators/CountLessThanUnCheckedValidatorArray.d.ts +7 -0
  71. package/validators/CountLessThanUnCheckedValidatorArray.js +31 -0
  72. package/validators/CountUnCheckedValidatorArray.d.ts +7 -0
  73. package/validators/CountUnCheckedValidatorArray.js +31 -0
  74. package/validators/EmptyValidator.d.ts +5 -0
  75. package/validators/EmptyValidator.js +30 -0
  76. package/validators/ExcludeCheckedValidatorArray.d.ts +8 -0
  77. package/validators/ExcludeCheckedValidatorArray.js +38 -0
  78. package/validators/FormValidator.d.ts +5 -0
  79. package/validators/FormValidator.js +28 -0
  80. package/validators/IncludeCheckedValidatorArray.d.ts +8 -0
  81. package/validators/IncludeCheckedValidatorArray.js +38 -0
  82. package/validators/MultipleValidator.d.ts +7 -0
  83. package/validators/MultipleValidator.js +35 -0
  84. package/validators/NonPassValidator.d.ts +5 -0
  85. package/validators/NonPassValidator.js +28 -0
  86. package/validators/NotEmptyValidator.d.ts +5 -0
  87. package/validators/NotEmptyValidator.js +30 -0
  88. package/validators/NotRegExpTestValidator.d.ts +6 -0
  89. package/validators/NotRegExpTestValidator.js +39 -0
  90. package/validators/PassValidator.d.ts +5 -0
  91. package/validators/PassValidator.js +28 -0
  92. package/validators/RegExpTestValidator.d.ts +6 -0
  93. package/validators/RegExpTestValidator.js +39 -0
  94. package/validators/RequiredValidator.d.ts +5 -0
  95. package/{validations/validators → validators}/RequiredValidator.js +7 -5
  96. package/validators/UnCheckedValidator.d.ts +5 -0
  97. package/validators/UnCheckedValidator.js +29 -0
  98. package/validators/ValidMultipleValidator.d.ts +9 -0
  99. package/validators/ValidMultipleValidator.js +31 -0
  100. package/validators/ValidValidator.d.ts +6 -0
  101. package/validators/ValidValidator.js +30 -0
  102. package/validators/ValidValidatorArray.d.ts +7 -0
  103. package/validators/ValidValidatorArray.js +30 -0
  104. package/validators/Validator.d.ts +31 -0
  105. package/validators/Validator.js +146 -0
  106. package/validators/ValidatorArray.d.ts +17 -0
  107. package/validators/ValidatorArray.js +94 -0
  108. package/validators/ValueEqualsValidator.d.ts +6 -0
  109. package/validators/ValueEqualsValidator.js +30 -0
  110. package/validators/ValueNotEqualsValidator.d.ts +6 -0
  111. package/validators/ValueNotEqualsValidator.js +30 -0
  112. package/dist/validations/Validation.d.ts +0 -13
  113. package/dist/validations/Validations.d.ts +0 -9
  114. package/dist/validations/validators/RequiredValidator.d.ts +0 -5
  115. package/validations/Validation.d.ts +0 -13
  116. package/validations/Validation.js +0 -53
  117. package/validations/Validations.d.ts +0 -9
  118. package/validations/Validations.js +0 -63
  119. package/validations/validators/RequiredValidator.d.ts +0 -5
@@ -0,0 +1,31 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ import { ValidatorArray } from './ValidatorArray';
17
+ var CountLessThanEqualsUnCheckedValidatorArray = (function (_super) {
18
+ __extends(CountLessThanEqualsUnCheckedValidatorArray, _super);
19
+ function CountLessThanEqualsUnCheckedValidatorArray(count, value, target, event, autoValid) {
20
+ if (autoValid === void 0) { autoValid = true; }
21
+ var _this = _super.call(this, value, target, event, autoValid) || this;
22
+ _this.count = count;
23
+ return _this;
24
+ }
25
+ CountLessThanEqualsUnCheckedValidatorArray.prototype.valid = function () {
26
+ var _a;
27
+ return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length <= this.count;
28
+ };
29
+ return CountLessThanEqualsUnCheckedValidatorArray;
30
+ }(ValidatorArray));
31
+ export { CountLessThanEqualsUnCheckedValidatorArray };
@@ -0,0 +1,7 @@
1
+ import { Validator } from './Validator';
2
+ import { ValidatorArray } from './ValidatorArray';
3
+ export declare class CountLessThanUnCheckedValidatorArray<T = any, E = Element> extends ValidatorArray<T, E> {
4
+ count: number;
5
+ constructor(count: number, value?: Validator<T, E>[], target?: E, event?: Event, autoValid?: boolean);
6
+ valid(): boolean;
7
+ }
@@ -0,0 +1,31 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ import { ValidatorArray } from './ValidatorArray';
17
+ var CountLessThanUnCheckedValidatorArray = (function (_super) {
18
+ __extends(CountLessThanUnCheckedValidatorArray, _super);
19
+ function CountLessThanUnCheckedValidatorArray(count, value, target, event, autoValid) {
20
+ if (autoValid === void 0) { autoValid = true; }
21
+ var _this = _super.call(this, value, target, event, autoValid) || this;
22
+ _this.count = count;
23
+ return _this;
24
+ }
25
+ CountLessThanUnCheckedValidatorArray.prototype.valid = function () {
26
+ var _a;
27
+ return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length < this.count;
28
+ };
29
+ return CountLessThanUnCheckedValidatorArray;
30
+ }(ValidatorArray));
31
+ export { CountLessThanUnCheckedValidatorArray };
@@ -0,0 +1,7 @@
1
+ import { Validator } from './Validator';
2
+ import { ValidatorArray } from './ValidatorArray';
3
+ export declare class CountUnCheckedValidatorArray<T = any, E = Element> extends ValidatorArray<T, E> {
4
+ count: number;
5
+ constructor(count: number, value?: Validator<T, E>[], target?: E, event?: Event, autoValid?: boolean);
6
+ valid(): boolean;
7
+ }
@@ -0,0 +1,31 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ import { ValidatorArray } from './ValidatorArray';
17
+ var CountUnCheckedValidatorArray = (function (_super) {
18
+ __extends(CountUnCheckedValidatorArray, _super);
19
+ function CountUnCheckedValidatorArray(count, value, target, event, autoValid) {
20
+ if (autoValid === void 0) { autoValid = true; }
21
+ var _this = _super.call(this, value, target, event, autoValid) || this;
22
+ _this.count = count;
23
+ return _this;
24
+ }
25
+ CountUnCheckedValidatorArray.prototype.valid = function () {
26
+ var _a;
27
+ return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length >= this.count;
28
+ };
29
+ return CountUnCheckedValidatorArray;
30
+ }(ValidatorArray));
31
+ export { CountUnCheckedValidatorArray };
@@ -0,0 +1,5 @@
1
+ import { Validator } from './Validator';
2
+ export declare class EmptyValidator<T = any, E = Element> extends Validator<T, E> {
3
+ constructor(value?: T, target?: E, event?: Event, autoValid?: boolean);
4
+ valid(): boolean;
5
+ }
@@ -0,0 +1,30 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ import { Validator } from './Validator';
17
+ var EmptyValidator = (function (_super) {
18
+ __extends(EmptyValidator, _super);
19
+ function EmptyValidator(value, target, event, autoValid) {
20
+ if (autoValid === void 0) { autoValid = true; }
21
+ return _super.call(this, value, target, event, autoValid) || this;
22
+ }
23
+ EmptyValidator.prototype.valid = function () {
24
+ var _a, _b;
25
+ var value = this.value;
26
+ return value === undefined || value === null || ((_b = (_a = value) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) <= 0;
27
+ };
28
+ return EmptyValidator;
29
+ }(Validator));
30
+ export { EmptyValidator };
@@ -0,0 +1,8 @@
1
+ import { Validator } from './Validator';
2
+ import { ValidatorArray } from './ValidatorArray';
3
+ export declare class ExcludeCheckedValidatorArray<T = any, E = Element> extends ValidatorArray<T, E> {
4
+ include: any[];
5
+ allRequired: boolean;
6
+ constructor(include: any[], allRequired?: boolean, value?: Validator<T, E>[], target?: E, event?: Event, autoValid?: boolean);
7
+ valid(): boolean;
8
+ }
@@ -0,0 +1,38 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ import { ValidatorArray } from './ValidatorArray';
17
+ var ExcludeCheckedValidatorArray = (function (_super) {
18
+ __extends(ExcludeCheckedValidatorArray, _super);
19
+ function ExcludeCheckedValidatorArray(include, allRequired, value, target, event, autoValid) {
20
+ if (allRequired === void 0) { allRequired = false; }
21
+ if (autoValid === void 0) { autoValid = true; }
22
+ var _this = _super.call(this, value, target, event, autoValid) || this;
23
+ _this.include = include;
24
+ _this.allRequired = allRequired;
25
+ return _this;
26
+ }
27
+ ExcludeCheckedValidatorArray.prototype.valid = function () {
28
+ var _this = this;
29
+ var _a;
30
+ var valus = (_a = this.value) !== null && _a !== void 0 ? _a : [];
31
+ var unCheckedValue = valus.filter(function (it) { return !it.checked; }).map(function (it) { return it.value; });
32
+ return unCheckedValue.length > 0 &&
33
+ (!(unCheckedValue.filter(function (it) { return !_this.include.includes(it); }).length > 0)) &&
34
+ (this.allRequired ? unCheckedValue.filter(function (it) { return _this.include.includes(it); }).length === this.include.length : true);
35
+ };
36
+ return ExcludeCheckedValidatorArray;
37
+ }(ValidatorArray));
38
+ export { ExcludeCheckedValidatorArray };
@@ -0,0 +1,5 @@
1
+ import { Validator } from './Validator';
2
+ export declare class FormValidator<E = HTMLFormElement> extends Validator<void, E> {
3
+ constructor(target?: E, event?: Event, autoValid?: boolean);
4
+ valid(): boolean;
5
+ }
@@ -0,0 +1,28 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ import { Validator } from './Validator';
17
+ var FormValidator = (function (_super) {
18
+ __extends(FormValidator, _super);
19
+ function FormValidator(target, event, autoValid) {
20
+ if (autoValid === void 0) { autoValid = true; }
21
+ return _super.call(this, undefined, target, event, autoValid) || this;
22
+ }
23
+ FormValidator.prototype.valid = function () {
24
+ return this.childValids();
25
+ };
26
+ return FormValidator;
27
+ }(Validator));
28
+ export { FormValidator };
@@ -0,0 +1,8 @@
1
+ import { Validator } from './Validator';
2
+ import { ValidatorArray } from './ValidatorArray';
3
+ export declare class IncludeCheckedValidatorArray<T = any, E = Element> extends ValidatorArray<T, E> {
4
+ include: any[];
5
+ allRequired: boolean;
6
+ constructor(include: any[], allRequired?: boolean, value?: Validator<T, E>[], target?: E, event?: Event, autoValid?: boolean);
7
+ valid(): boolean;
8
+ }
@@ -0,0 +1,38 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ import { ValidatorArray } from './ValidatorArray';
17
+ var IncludeCheckedValidatorArray = (function (_super) {
18
+ __extends(IncludeCheckedValidatorArray, _super);
19
+ function IncludeCheckedValidatorArray(include, allRequired, value, target, event, autoValid) {
20
+ if (allRequired === void 0) { allRequired = false; }
21
+ if (autoValid === void 0) { autoValid = true; }
22
+ var _this = _super.call(this, value, target, event, autoValid) || this;
23
+ _this.include = include;
24
+ _this.allRequired = allRequired;
25
+ return _this;
26
+ }
27
+ IncludeCheckedValidatorArray.prototype.valid = function () {
28
+ var _this = this;
29
+ var _a;
30
+ var valus = (_a = this.value) !== null && _a !== void 0 ? _a : [];
31
+ var checkedValue = valus.filter(function (it) { return it.checked; }).map(function (it) { return it.value; });
32
+ return checkedValue.length > 0 &&
33
+ (!(checkedValue.filter(function (it) { return !_this.include.includes(it); }).length > 0)) &&
34
+ (this.allRequired ? checkedValue.filter(function (it) { return _this.include.includes(it); }).length === this.include.length : true);
35
+ };
36
+ return IncludeCheckedValidatorArray;
37
+ }(ValidatorArray));
38
+ export { IncludeCheckedValidatorArray };
@@ -0,0 +1,7 @@
1
+ import { Validator } from './Validator';
2
+ export declare class MultipleValidator<T = any, E = Element> extends Validator<T, E> {
3
+ validators: Validator<T, E>[];
4
+ constructor(validators: Validator<T, E>[], value?: T, target?: E, event?: Event, autoValid?: boolean);
5
+ changeValue(value: T | undefined): void;
6
+ valid(): boolean;
7
+ }
@@ -0,0 +1,35 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ import { Validator } from './Validator';
17
+ var MultipleValidator = (function (_super) {
18
+ __extends(MultipleValidator, _super);
19
+ function MultipleValidator(validators, value, target, event, autoValid) {
20
+ if (autoValid === void 0) { autoValid = true; }
21
+ var _this = _super.call(this, value, target, event, autoValid) || this;
22
+ _this.validators = validators;
23
+ _this.validators.forEach(function (it) { return it.set(_this.value, _this.getTarget(), _this.getEvent()); });
24
+ return _this;
25
+ }
26
+ MultipleValidator.prototype.changeValue = function (value) {
27
+ var _this = this;
28
+ this.validators.forEach(function (it) { return it.set(_this.value, _this.getTarget(), _this.getEvent()); });
29
+ };
30
+ MultipleValidator.prototype.valid = function () {
31
+ return !(this.validators.filter(function (it) { return !it.valid(); }).length > 0);
32
+ };
33
+ return MultipleValidator;
34
+ }(Validator));
35
+ export { MultipleValidator };
@@ -0,0 +1,5 @@
1
+ import { Validator } from './Validator';
2
+ export declare class NonPassValidator<T = any, E = Element> extends Validator<T, E> {
3
+ constructor(value?: T, target?: E, event?: Event, autoValid?: boolean);
4
+ valid(): boolean;
5
+ }
@@ -0,0 +1,28 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ import { Validator } from './Validator';
17
+ var NonPassValidator = (function (_super) {
18
+ __extends(NonPassValidator, _super);
19
+ function NonPassValidator(value, target, event, autoValid) {
20
+ if (autoValid === void 0) { autoValid = true; }
21
+ return _super.call(this, value, target, event, autoValid) || this;
22
+ }
23
+ NonPassValidator.prototype.valid = function () {
24
+ return false;
25
+ };
26
+ return NonPassValidator;
27
+ }(Validator));
28
+ export { NonPassValidator };
@@ -0,0 +1,5 @@
1
+ import { Validator } from './Validator';
2
+ export declare class NotEmptyValidator<T = any, E = Element> extends Validator<T, E> {
3
+ constructor(value?: T, target?: E, event?: Event, autoValid?: boolean);
4
+ valid(): boolean;
5
+ }
@@ -0,0 +1,30 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ import { Validator } from './Validator';
17
+ var NotEmptyValidator = (function (_super) {
18
+ __extends(NotEmptyValidator, _super);
19
+ function NotEmptyValidator(value, target, event, autoValid) {
20
+ if (autoValid === void 0) { autoValid = true; }
21
+ return _super.call(this, value, target, event, autoValid) || this;
22
+ }
23
+ NotEmptyValidator.prototype.valid = function () {
24
+ var _a, _b;
25
+ var value = this.value;
26
+ return value !== undefined && value !== null && ((_b = (_a = value) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0;
27
+ };
28
+ return NotEmptyValidator;
29
+ }(Validator));
30
+ export { NotEmptyValidator };
@@ -0,0 +1,6 @@
1
+ import { Validator } from './Validator';
2
+ export declare class NotRegExpTestValidator<T = any, E = Element> extends Validator<T, E> {
3
+ regexp: RegExp;
4
+ constructor(regexp: RegExp, value?: T, target?: E, event?: Event, autoValid?: boolean);
5
+ valid(): boolean;
6
+ }
@@ -0,0 +1,39 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ import { Validator } from './Validator';
17
+ import { DomRenderProxy } from '../DomRenderProxy';
18
+ var NotRegExpTestValidator = (function (_super) {
19
+ __extends(NotRegExpTestValidator, _super);
20
+ function NotRegExpTestValidator(regexp, value, target, event, autoValid) {
21
+ if (autoValid === void 0) { autoValid = true; }
22
+ var _this = _super.call(this, value, target, event, autoValid) || this;
23
+ _this.regexp = DomRenderProxy.final(regexp);
24
+ return _this;
25
+ }
26
+ NotRegExpTestValidator.prototype.valid = function () {
27
+ var _a;
28
+ var value = this.value;
29
+ var regExp = (_a = this.regexp._DomRender_origin) !== null && _a !== void 0 ? _a : this.regexp;
30
+ if (value) {
31
+ return !regExp.test(value);
32
+ }
33
+ else {
34
+ return true;
35
+ }
36
+ };
37
+ return NotRegExpTestValidator;
38
+ }(Validator));
39
+ export { NotRegExpTestValidator };
@@ -0,0 +1,5 @@
1
+ import { Validator } from './Validator';
2
+ export declare class PassValidator<T = any, E = Element> extends Validator<T, E> {
3
+ constructor(value?: T, target?: E, event?: Event, autoValid?: boolean);
4
+ valid(): boolean;
5
+ }
@@ -0,0 +1,28 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ import { Validator } from './Validator';
17
+ var PassValidator = (function (_super) {
18
+ __extends(PassValidator, _super);
19
+ function PassValidator(value, target, event, autoValid) {
20
+ if (autoValid === void 0) { autoValid = true; }
21
+ return _super.call(this, value, target, event, autoValid) || this;
22
+ }
23
+ PassValidator.prototype.valid = function () {
24
+ return true;
25
+ };
26
+ return PassValidator;
27
+ }(Validator));
28
+ export { PassValidator };
@@ -0,0 +1,6 @@
1
+ import { Validator } from './Validator';
2
+ export declare class RegExpTestValidator<T = any, E = Element> extends Validator<T, E> {
3
+ regexp: RegExp;
4
+ constructor(regexp: RegExp, value?: T, target?: E, event?: Event, autoValid?: boolean);
5
+ valid(): boolean;
6
+ }
@@ -0,0 +1,39 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ import { Validator } from './Validator';
17
+ import { DomRenderProxy } from '../DomRenderProxy';
18
+ var RegExpTestValidator = (function (_super) {
19
+ __extends(RegExpTestValidator, _super);
20
+ function RegExpTestValidator(regexp, value, target, event, autoValid) {
21
+ if (autoValid === void 0) { autoValid = true; }
22
+ var _this = _super.call(this, value, target, event, autoValid) || this;
23
+ _this.regexp = DomRenderProxy.final(regexp);
24
+ return _this;
25
+ }
26
+ RegExpTestValidator.prototype.valid = function () {
27
+ var _a;
28
+ var value = this.value;
29
+ var regExp = (_a = this.regexp._DomRender_origin) !== null && _a !== void 0 ? _a : this.regexp;
30
+ if (value) {
31
+ return regExp.test(value);
32
+ }
33
+ else {
34
+ return false;
35
+ }
36
+ };
37
+ return RegExpTestValidator;
38
+ }(Validator));
39
+ export { RegExpTestValidator };
@@ -0,0 +1,5 @@
1
+ import { Validator } from './Validator';
2
+ export declare class RequiredValidator<T = any, E = Element> extends Validator<T, E> {
3
+ constructor(value?: T, target?: E, event?: Event, autoValid?: boolean);
4
+ valid(): boolean;
5
+ }
@@ -13,15 +13,17 @@ var __extends = (this && this.__extends) || (function () {
13
13
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
14
  };
15
15
  })();
16
- import { Validation } from '../Validation';
16
+ import { Validator } from './Validator';
17
17
  var RequiredValidator = (function (_super) {
18
18
  __extends(RequiredValidator, _super);
19
- function RequiredValidator(value, target, event) {
20
- return _super.call(this, value, target, event) || this;
19
+ function RequiredValidator(value, target, event, autoValid) {
20
+ if (autoValid === void 0) { autoValid = true; }
21
+ return _super.call(this, value, target, event, autoValid) || this;
21
22
  }
22
23
  RequiredValidator.prototype.valid = function () {
23
- return this.value !== undefined && this.value !== null;
24
+ var value = this.value;
25
+ return value !== undefined && value !== null;
24
26
  };
25
27
  return RequiredValidator;
26
- }(Validation));
28
+ }(Validator));
27
29
  export { RequiredValidator };
@@ -0,0 +1,5 @@
1
+ import { Validator } from './Validator';
2
+ export declare class UnCheckedValidator<T = any, E = HTMLElement> extends Validator<T, E> {
3
+ constructor(value?: T, target?: E, event?: Event, autoValid?: boolean);
4
+ valid(): boolean;
5
+ }
@@ -0,0 +1,29 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ import { Validator } from './Validator';
17
+ var UnCheckedValidator = (function (_super) {
18
+ __extends(UnCheckedValidator, _super);
19
+ function UnCheckedValidator(value, target, event, autoValid) {
20
+ if (autoValid === void 0) { autoValid = true; }
21
+ return _super.call(this, value, target, event, autoValid) || this;
22
+ }
23
+ UnCheckedValidator.prototype.valid = function () {
24
+ var _a, _b;
25
+ return !((_b = (_a = this.getTarget()) === null || _a === void 0 ? void 0 : _a.checked) !== null && _b !== void 0 ? _b : false);
26
+ };
27
+ return UnCheckedValidator;
28
+ }(Validator));
29
+ export { UnCheckedValidator };
@@ -0,0 +1,9 @@
1
+ import { Validator } from './Validator';
2
+ import { MultipleValidator } from './MultipleValidator';
3
+ export declare type ValidMulltiple<T = any, E = Element> = (validators: Validator<T, E>[], value?: T, target?: E, event?: Event) => boolean;
4
+ export declare class ValidMultipleValidator<T = any, E = Element> extends MultipleValidator<T, E> {
5
+ validMultipleCallback: ValidMulltiple<T, E>;
6
+ validators: Validator<T, E>[];
7
+ constructor(validMultipleCallback: ValidMulltiple<T, E>, validators: Validator<T, E>[], value?: T, target?: E, event?: Event, autoValid?: boolean);
8
+ valid(): boolean;
9
+ }