dom-render 1.0.98 → 1.0.99

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 (202) hide show
  1. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  2. package/.idea/dom-render.iml +9 -0
  3. package/.idea/inspectionProfiles/Project_Default.xml +6 -0
  4. package/.idea/jpa-buddy.xml +6 -0
  5. package/.idea/misc.xml +8 -0
  6. package/.idea/modules.xml +8 -0
  7. package/.idea/vcs.xml +6 -0
  8. package/README.MD +6 -793
  9. package/package.json +1 -1
  10. package/DomRender.d.ts +0 -13
  11. package/DomRender.js +0 -72
  12. package/DomRenderProxy.d.ts +0 -30
  13. package/DomRenderProxy.js +0 -515
  14. package/components/ComponentSet.d.ts +0 -10
  15. package/components/ComponentSet.js +0 -13
  16. package/configs/Config.d.ts +0 -34
  17. package/configs/Config.js +0 -2
  18. package/configs/TargetAttr.d.ts +0 -6
  19. package/configs/TargetAttr.js +0 -2
  20. package/configs/TargetElement.d.ts +0 -14
  21. package/configs/TargetElement.js +0 -2
  22. package/css/parse/index.d.ts +0 -1
  23. package/css/parse/index.js +0 -512
  24. package/css/stringify/compiler.d.ts +0 -32
  25. package/css/stringify/compiler.js +0 -40
  26. package/css/stringify/compress.d.ts +0 -75
  27. package/css/stringify/compress.js +0 -156
  28. package/css/stringify/identity.d.ts +0 -85
  29. package/css/stringify/identity.js +0 -194
  30. package/css/stringify/index.d.ts +0 -14
  31. package/css/stringify/index.js +0 -44
  32. package/dist/bundle.js +0 -5442
  33. package/events/EventManager.d.ts +0 -49
  34. package/events/EventManager.js +0 -529
  35. package/iterators/Range.d.ts +0 -23
  36. package/iterators/Range.js +0 -80
  37. package/lifecycle/OnBeforeReturnGet.d.ts +0 -3
  38. package/lifecycle/OnBeforeReturnGet.js +0 -2
  39. package/lifecycle/OnBeforeReturnSet.d.ts +0 -3
  40. package/lifecycle/OnBeforeReturnSet.js +0 -2
  41. package/lifecycle/OnChangeAttrRender.d.ts +0 -3
  42. package/lifecycle/OnChangeAttrRender.js +0 -2
  43. package/lifecycle/OnCreateRender.d.ts +0 -3
  44. package/lifecycle/OnCreateRender.js +0 -2
  45. package/lifecycle/OnDestroyRender.d.ts +0 -4
  46. package/lifecycle/OnDestroyRender.js +0 -2
  47. package/lifecycle/OnInitRender.d.ts +0 -3
  48. package/lifecycle/OnInitRender.js +0 -2
  49. package/lifecycle/OnProxyDomRender.d.ts +0 -4
  50. package/lifecycle/OnProxyDomRender.js +0 -2
  51. package/managers/RenderManager.d.ts +0 -3
  52. package/managers/RenderManager.js +0 -18
  53. package/messenger/DefaultMessenger.d.ts +0 -3
  54. package/messenger/DefaultMessenger.js +0 -27
  55. package/messenger/Messenger.d.ts +0 -78
  56. package/messenger/Messenger.js +0 -201
  57. package/operators/Appender.d.ts +0 -10
  58. package/operators/Appender.js +0 -64
  59. package/operators/AttrExpresion.d.ts +0 -0
  60. package/operators/AttrExpresion.js +0 -44
  61. package/operators/Dr.d.ts +0 -8
  62. package/operators/Dr.js +0 -101
  63. package/operators/DrAppender.d.ts +0 -8
  64. package/operators/DrAppender.js +0 -105
  65. package/operators/DrFor.d.ts +0 -8
  66. package/operators/DrFor.js +0 -102
  67. package/operators/DrForOf.d.ts +0 -8
  68. package/operators/DrForOf.js +0 -105
  69. package/operators/DrForm.d.ts +0 -8
  70. package/operators/DrForm.js +0 -138
  71. package/operators/DrIf.d.ts +0 -8
  72. package/operators/DrIf.js +0 -106
  73. package/operators/DrInnerHTML.d.ts +0 -8
  74. package/operators/DrInnerHTML.js +0 -99
  75. package/operators/DrInnerText.d.ts +0 -8
  76. package/operators/DrInnerText.js +0 -97
  77. package/operators/DrPre.d.ts +0 -7
  78. package/operators/DrPre.js +0 -71
  79. package/operators/DrRepeat.d.ts +0 -8
  80. package/operators/DrRepeat.js +0 -103
  81. package/operators/DrTargetAttr.d.ts +0 -7
  82. package/operators/DrTargetAttr.js +0 -96
  83. package/operators/DrTargetElement.d.ts +0 -7
  84. package/operators/DrTargetElement.js +0 -112
  85. package/operators/DrThis.d.ts +0 -5
  86. package/operators/DrThis.js +0 -108
  87. package/operators/DrThisProperty.d.ts +0 -10
  88. package/operators/DrThisProperty.js +0 -141
  89. package/operators/OperatorExecuter.d.ts +0 -49
  90. package/operators/OperatorExecuter.js +0 -89
  91. package/operators/OperatorExecuterAttrRequire.d.ts +0 -8
  92. package/operators/OperatorExecuterAttrRequire.js +0 -79
  93. package/rawsets/AttrInitCallBack.d.ts +0 -5
  94. package/rawsets/AttrInitCallBack.js +0 -2
  95. package/rawsets/Attrs.d.ts +0 -24
  96. package/rawsets/Attrs.js +0 -2
  97. package/rawsets/CreatorMetaData.d.ts +0 -18
  98. package/rawsets/CreatorMetaData.js +0 -2
  99. package/rawsets/DestroyOptionType.d.ts +0 -4
  100. package/rawsets/DestroyOptionType.js +0 -8
  101. package/rawsets/ElementInitCallBack.d.ts +0 -8
  102. package/rawsets/ElementInitCallBack.js +0 -2
  103. package/rawsets/RawSet.d.ts +0 -118
  104. package/rawsets/RawSet.js +0 -1142
  105. package/rawsets/RawSetOperatorType.d.ts +0 -3
  106. package/rawsets/RawSetOperatorType.js +0 -7
  107. package/rawsets/RawSetType.d.ts +0 -7
  108. package/rawsets/RawSetType.js +0 -11
  109. package/rawsets/Render.d.ts +0 -17
  110. package/rawsets/Render.js +0 -2
  111. package/routers/HashRouter.d.ts +0 -9
  112. package/routers/HashRouter.js +0 -53
  113. package/routers/PathRouter.d.ts +0 -9
  114. package/routers/PathRouter.js +0 -52
  115. package/routers/Router.d.ts +0 -28
  116. package/routers/Router.js +0 -126
  117. package/types/Types.d.ts +0 -14
  118. package/types/Types.js +0 -36
  119. package/utils/clipboard/ClipBoardUtils.d.ts +0 -6
  120. package/utils/clipboard/ClipBoardUtils.js +0 -25
  121. package/utils/dom/DomUtils.d.ts +0 -13
  122. package/utils/dom/DomUtils.js +0 -47
  123. package/utils/location/LocationUtils.d.ts +0 -16
  124. package/utils/location/LocationUtils.js +0 -63
  125. package/utils/node/NodeUtils.d.ts +0 -10
  126. package/utils/node/NodeUtils.js +0 -27
  127. package/utils/random/RandomUtils.d.ts +0 -7
  128. package/utils/random/RandomUtils.js +0 -47
  129. package/utils/script/ScriptUtils.d.ts +0 -14
  130. package/utils/script/ScriptUtils.js +0 -89
  131. package/utils/storage/StorageUtils.d.ts +0 -16
  132. package/utils/storage/StorageUtils.js +0 -87
  133. package/utils/string/StringUtils.d.ts +0 -6
  134. package/utils/string/StringUtils.js +0 -58
  135. package/utils/valid/ValidUtils.d.ts +0 -10
  136. package/utils/valid/ValidUtils.js +0 -78
  137. package/validators/AllCheckedValidatorArray.d.ts +0 -6
  138. package/validators/AllCheckedValidatorArray.js +0 -32
  139. package/validators/AllUnCheckedValidatorArray.d.ts +0 -6
  140. package/validators/AllUnCheckedValidatorArray.js +0 -32
  141. package/validators/CheckedValidator.d.ts +0 -5
  142. package/validators/CheckedValidator.js +0 -32
  143. package/validators/CountEqualsCheckedValidatorArray.d.ts +0 -7
  144. package/validators/CountEqualsCheckedValidatorArray.js +0 -34
  145. package/validators/CountEqualsUnCheckedValidatorArray.d.ts +0 -7
  146. package/validators/CountEqualsUnCheckedValidatorArray.js +0 -34
  147. package/validators/CountGreaterThanCheckedValidatorArray.d.ts +0 -7
  148. package/validators/CountGreaterThanCheckedValidatorArray.js +0 -34
  149. package/validators/CountGreaterThanEqualsCheckedValidatorArray.d.ts +0 -7
  150. package/validators/CountGreaterThanEqualsCheckedValidatorArray.js +0 -34
  151. package/validators/CountGreaterThanEqualsUnCheckedValidatorArray.d.ts +0 -7
  152. package/validators/CountGreaterThanEqualsUnCheckedValidatorArray.js +0 -34
  153. package/validators/CountGreaterThanUnCheckedValidatorArray.d.ts +0 -7
  154. package/validators/CountGreaterThanUnCheckedValidatorArray.js +0 -34
  155. package/validators/CountLessThanCheckedValidatorArray.d.ts +0 -7
  156. package/validators/CountLessThanCheckedValidatorArray.js +0 -34
  157. package/validators/CountLessThanEqualsCheckedValidatorArray.d.ts +0 -7
  158. package/validators/CountLessThanEqualsCheckedValidatorArray.js +0 -34
  159. package/validators/CountLessThanEqualsUnCheckedValidatorArray.d.ts +0 -7
  160. package/validators/CountLessThanEqualsUnCheckedValidatorArray.js +0 -34
  161. package/validators/CountLessThanUnCheckedValidatorArray.d.ts +0 -7
  162. package/validators/CountLessThanUnCheckedValidatorArray.js +0 -34
  163. package/validators/CountUnCheckedValidatorArray.d.ts +0 -7
  164. package/validators/CountUnCheckedValidatorArray.js +0 -34
  165. package/validators/EmptyValidator.d.ts +0 -5
  166. package/validators/EmptyValidator.js +0 -33
  167. package/validators/ExcludeCheckedValidatorArray.d.ts +0 -8
  168. package/validators/ExcludeCheckedValidatorArray.js +0 -41
  169. package/validators/FormValidator.d.ts +0 -7
  170. package/validators/FormValidator.js +0 -37
  171. package/validators/IncludeCheckedValidatorArray.d.ts +0 -8
  172. package/validators/IncludeCheckedValidatorArray.js +0 -41
  173. package/validators/MultipleValidator.d.ts +0 -8
  174. package/validators/MultipleValidator.js +0 -48
  175. package/validators/NonPassValidator.d.ts +0 -5
  176. package/validators/NonPassValidator.js +0 -31
  177. package/validators/NotEmptyValidator.d.ts +0 -5
  178. package/validators/NotEmptyValidator.js +0 -34
  179. package/validators/NotRegExpTestValidator.d.ts +0 -6
  180. package/validators/NotRegExpTestValidator.js +0 -42
  181. package/validators/PassValidator.d.ts +0 -5
  182. package/validators/PassValidator.js +0 -31
  183. package/validators/RegExpTestValidator.d.ts +0 -6
  184. package/validators/RegExpTestValidator.js +0 -43
  185. package/validators/RequiredValidator.d.ts +0 -5
  186. package/validators/RequiredValidator.js +0 -33
  187. package/validators/UnCheckedValidator.d.ts +0 -5
  188. package/validators/UnCheckedValidator.js +0 -32
  189. package/validators/ValidMultipleValidator.d.ts +0 -9
  190. package/validators/ValidMultipleValidator.js +0 -34
  191. package/validators/ValidValidator.d.ts +0 -6
  192. package/validators/ValidValidator.js +0 -33
  193. package/validators/ValidValidatorArray.d.ts +0 -7
  194. package/validators/ValidValidatorArray.js +0 -33
  195. package/validators/Validator.d.ts +0 -57
  196. package/validators/Validator.js +0 -242
  197. package/validators/ValidatorArray.d.ts +0 -17
  198. package/validators/ValidatorArray.js +0 -99
  199. package/validators/ValueEqualsValidator.d.ts +0 -6
  200. package/validators/ValueEqualsValidator.js +0 -33
  201. package/validators/ValueNotEqualsValidator.d.ts +0 -6
  202. package/validators/ValueNotEqualsValidator.js +0 -33
@@ -1,242 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Validator = void 0;
4
- // export interface Valid<T = any, E = Element> {
5
- // valid(value?: T, target?: E, event?: Event): boolean;
6
- // }
7
- var Validator = /** @class */ (function () {
8
- function Validator(_value, target, event, autoValid, autoValidAction) {
9
- if (autoValid === void 0) { autoValid = true; }
10
- if (autoValidAction === void 0) { autoValidAction = true; }
11
- this._value = _value;
12
- this.setTarget(target);
13
- this.setEvent(event);
14
- this.setAutoValid(autoValid);
15
- this.setAutoValidAction(autoValidAction);
16
- }
17
- Validator.prototype.getValidAction = function () {
18
- return this._validAction;
19
- };
20
- Validator.prototype.setValidAction = function (value) {
21
- this._validAction = value;
22
- return this;
23
- };
24
- Validator.prototype.getAutoValid = function () {
25
- return this._autoValid;
26
- };
27
- Validator.prototype.setAutoValid = function (autoValid) {
28
- this._autoValid = autoValid;
29
- return this;
30
- };
31
- Validator.prototype.getAutoValidAction = function () {
32
- return this._autoValidAction;
33
- };
34
- Validator.prototype.setAutoValidAction = function (autoValid) {
35
- this._autoValidAction = autoValid;
36
- return this;
37
- };
38
- Validator.prototype.getEvent = function () {
39
- return this._event;
40
- };
41
- Validator.prototype.setEvent = function (event) {
42
- if (event) {
43
- this._event = this.domRenderFinal(event);
44
- }
45
- return this;
46
- };
47
- Validator.prototype.getTarget = function () {
48
- return this._target;
49
- };
50
- Validator.prototype.targetFocus = function () {
51
- var _a, _b;
52
- (_b = (_a = this._target) === null || _a === void 0 ? void 0 : _a.focus) === null || _b === void 0 ? void 0 : _b.call(_a);
53
- };
54
- Validator.prototype.targetReset = function () {
55
- var _a, _b;
56
- (_b = (_a = this._target) === null || _a === void 0 ? void 0 : _a.reset) === null || _b === void 0 ? void 0 : _b.call(_a);
57
- };
58
- Validator.prototype.targetDispatchEvent = function (event) {
59
- var _a;
60
- return (_a = this._target) === null || _a === void 0 ? void 0 : _a.dispatchEvent(event);
61
- };
62
- Validator.prototype.setTarget = function (target) {
63
- if (target) {
64
- this._target = this.domRenderFinal(target);
65
- }
66
- return this;
67
- };
68
- Validator.prototype.domRenderFinal = function (obj) {
69
- obj._DomRender_isFinal = true;
70
- return obj;
71
- };
72
- Object.defineProperty(Validator.prototype, "value", {
73
- get: function () {
74
- var _a;
75
- if (this._value === undefined || this._value === null) {
76
- this._value = (_a = this.getTarget()) === null || _a === void 0 ? void 0 : _a.value;
77
- }
78
- return this._value;
79
- },
80
- set: function (value) {
81
- // console.log('---?set?', value, this)
82
- this._value = value;
83
- this.tickValue(value);
84
- },
85
- enumerable: false,
86
- configurable: true
87
- });
88
- Validator.prototype.tickValue = function (value) {
89
- this.changeValue(value);
90
- var target = this.getTarget();
91
- if (target && (target === null || target === void 0 ? void 0 : target.value) !== undefined && (target === null || target === void 0 ? void 0 : target.value) !== null) {
92
- try {
93
- target.value = this._value;
94
- }
95
- catch (e) {
96
- console.error('set value function is blocked ');
97
- }
98
- }
99
- if (this.getAutoValidAction()) {
100
- this.validAction();
101
- }
102
- else if (this.getAutoValid()) {
103
- this.valid();
104
- }
105
- };
106
- Validator.prototype.set = function (value, target, event) {
107
- this.setTarget(target);
108
- this.setEvent(event);
109
- this.value = value;
110
- };
111
- Validator.prototype.changeValue = function (value) {
112
- };
113
- Object.defineProperty(Validator.prototype, "checked", {
114
- get: function () {
115
- var _a, _b;
116
- return (_b = (_a = this.getTarget()) === null || _a === void 0 ? void 0 : _a.checked) !== null && _b !== void 0 ? _b : false;
117
- },
118
- set: function (checked) {
119
- var target = this.getTarget();
120
- if (target) {
121
- target.checked = checked;
122
- }
123
- },
124
- enumerable: false,
125
- configurable: true
126
- });
127
- Object.defineProperty(Validator.prototype, "selectedIndex", {
128
- get: function () {
129
- var _a, _b;
130
- return (_b = (_a = this.getTarget()) === null || _a === void 0 ? void 0 : _a.selectedIndex) !== null && _b !== void 0 ? _b : -1;
131
- },
132
- set: function (selectedIndex) {
133
- var target = this.getTarget();
134
- if (target) {
135
- target.selectedIndex = selectedIndex;
136
- }
137
- },
138
- enumerable: false,
139
- configurable: true
140
- });
141
- Validator.prototype.querySelector = function (selector) {
142
- var _a;
143
- return (_a = this.getTarget()) === null || _a === void 0 ? void 0 : _a.querySelector(selector);
144
- };
145
- Validator.prototype.querySelectorALL = function (selector) {
146
- var _a;
147
- return (_a = this.getTarget()) === null || _a === void 0 ? void 0 : _a.querySelectorAll(selector);
148
- };
149
- Validator.prototype.validAction = function () {
150
- var _a;
151
- var valid = this.valid();
152
- (_a = this.getValidAction()) === null || _a === void 0 ? void 0 : _a(valid, this.value, this.getTarget(), this.getEvent());
153
- return valid;
154
- };
155
- Validator.prototype.inValid = function () {
156
- return !this.valid();
157
- };
158
- ;
159
- Validator.prototype.allValid = function () {
160
- return this.valid() && this.childInValid();
161
- };
162
- Validator.prototype.allValidAction = function () {
163
- return this.validAction() && this.childInValidAction();
164
- };
165
- Validator.prototype.allInValid = function () {
166
- return !this.allValid();
167
- };
168
- Validator.prototype.allInValidAction = function () {
169
- return !this.allValidAction();
170
- };
171
- Validator.prototype.childValid = function () {
172
- return !this.childInValid();
173
- };
174
- Validator.prototype.childValue = function () {
175
- var data = {};
176
- this.childValidators().filter(function (_a) {
177
- var k = _a[0], v = _a[1];
178
- data[k] = v.value;
179
- });
180
- return data;
181
- };
182
- Validator.prototype.childValidAction = function () {
183
- return !this.childInValidAction();
184
- };
185
- Validator.prototype.childInValid = function () {
186
- var inValid = this.childValidators().filter(function (_a) {
187
- var k = _a[0], v = _a[1];
188
- return !v.valid();
189
- });
190
- return inValid.length > 0;
191
- };
192
- Validator.prototype.childInValidValidator = function () {
193
- var inValid = this.childValidators().filter(function (_a) {
194
- var k = _a[0], v = _a[1];
195
- return !v.valid();
196
- });
197
- return inValid;
198
- };
199
- Validator.prototype.childInValidAction = function () {
200
- var inValid = this.childValidators().filter(function (_a) {
201
- var k = _a[0], v = _a[1];
202
- return !v.validAction();
203
- });
204
- return inValid.length > 0;
205
- };
206
- Validator.prototype.childValidator = function (name) {
207
- var _a;
208
- return (_a = Object.entries(this).find(function (_a) {
209
- var k = _a[0], v = _a[1];
210
- return (k === name && (v instanceof Validator));
211
- })) === null || _a === void 0 ? void 0 : _a[1];
212
- };
213
- Validator.prototype.childValidators = function () {
214
- return Object.entries(this).filter(function (_a) {
215
- var k = _a[0], v = _a[1];
216
- return (v instanceof Validator);
217
- });
218
- };
219
- Validator.prototype.childValidValidator = function () {
220
- return this.childValidators().filter(function (it) { return it[1].valid(); });
221
- };
222
- Validator.prototype.syncValue = function () {
223
- var _a;
224
- this.value = (_a = this.getTarget()) === null || _a === void 0 ? void 0 : _a.value;
225
- };
226
- Validator.prototype.allSyncValue = function () {
227
- this.childValidators().forEach(function (_a) {
228
- var k = _a[0], e = _a[1];
229
- e.syncValue();
230
- });
231
- };
232
- Object.defineProperty(Validator.prototype, "length", {
233
- get: function () {
234
- var _a, _b;
235
- return (_b = (_a = this.value) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
236
- },
237
- enumerable: false,
238
- configurable: true
239
- });
240
- return Validator;
241
- }());
242
- exports.Validator = Validator;
@@ -1,17 +0,0 @@
1
- import { Validator } from './Validator';
2
- export type MakeValidator<T = any, E = Element> = (value: T, target: E, event?: Event) => Validator<T, E>;
3
- export declare abstract class ValidatorArray<T = any, E = Element> extends Validator<Validator<T, E>[], E> {
4
- private _makeValidatorFactory;
5
- constructor(value?: Validator<T, E>[], target?: E, event?: Event, autoValid?: boolean);
6
- getMakeValidatorFactory(): MakeValidator<T, E>;
7
- setMakeValidatorFactory(value: MakeValidator<T, E>): this;
8
- setArrayValue(target: E, value: T, event?: Event): void;
9
- addValidator(value: T, target: E, event?: Event): void;
10
- allChecked(checked: boolean): void;
11
- getValidators(): Validator<T, E>[] | undefined;
12
- getValidator(e: E): Validator<T, E> | undefined;
13
- getValidatorByValue(value: T): Validator<T, E>;
14
- getValidatorByValues(value: T): Validator<T, E>[];
15
- removeElement(e: E): void;
16
- makeValidator(value: T, target: E, event?: Event): Validator<T, E>;
17
- }
@@ -1,99 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.ValidatorArray = void 0;
19
- var Validator_1 = require("./Validator");
20
- var NonPassValidator_1 = require("./NonPassValidator");
21
- var ValidatorArray = /** @class */ (function (_super) {
22
- __extends(ValidatorArray, _super);
23
- function ValidatorArray(value, target, event, autoValid) {
24
- if (autoValid === void 0) { autoValid = true; }
25
- var _this = _super.call(this, value, target, event, autoValid) || this;
26
- _this._makeValidatorFactory = function (value, target, event) {
27
- return new NonPassValidator_1.NonPassValidator(value, target, event);
28
- };
29
- return _this;
30
- }
31
- ValidatorArray.prototype.getMakeValidatorFactory = function () {
32
- return this._makeValidatorFactory;
33
- };
34
- ValidatorArray.prototype.setMakeValidatorFactory = function (value) {
35
- this._makeValidatorFactory = value;
36
- return this;
37
- };
38
- ValidatorArray.prototype.setArrayValue = function (target, value, event) {
39
- var _a;
40
- (_a = this.value) === null || _a === void 0 ? void 0 : _a.filter(function (it) {
41
- if (it.getTarget()) {
42
- return it.getTarget() === target;
43
- }
44
- else {
45
- return false;
46
- }
47
- }).forEach(function (it) {
48
- it.set(value, target, event);
49
- });
50
- this.tickValue(this.value);
51
- };
52
- ValidatorArray.prototype.addValidator = function (value, target, event) {
53
- var _a, _b;
54
- if (!this.value) {
55
- this.value = [];
56
- }
57
- if (value instanceof Validator_1.Validator) {
58
- (_a = this.value) === null || _a === void 0 ? void 0 : _a.push(value);
59
- }
60
- else {
61
- (_b = this.value) === null || _b === void 0 ? void 0 : _b.push(this.makeValidator(value, target, event));
62
- }
63
- this.tickValue(this.value);
64
- };
65
- ValidatorArray.prototype.allChecked = function (checked) {
66
- var _a;
67
- this.checked = checked;
68
- (_a = this.value) === null || _a === void 0 ? void 0 : _a.forEach(function (it) {
69
- it.checked = checked;
70
- });
71
- };
72
- ValidatorArray.prototype.getValidators = function () {
73
- return this._value;
74
- };
75
- ValidatorArray.prototype.getValidator = function (e) {
76
- var _a;
77
- return (_a = this.value) === null || _a === void 0 ? void 0 : _a.filter(function (it) { return it.getTarget() === e; })[0];
78
- };
79
- ValidatorArray.prototype.getValidatorByValue = function (value) {
80
- var validatorByValue = this.getValidatorByValues(value)[0];
81
- return validatorByValue;
82
- };
83
- ValidatorArray.prototype.getValidatorByValues = function (value) {
84
- var _a, _b;
85
- return (_b = (_a = this.value) === null || _a === void 0 ? void 0 : _a.filter(function (it) { return it.value === value; })) !== null && _b !== void 0 ? _b : [];
86
- };
87
- ValidatorArray.prototype.removeElement = function (e) {
88
- var value = this.value;
89
- if (value) {
90
- this.value = value.filter(function (it) { return it.getTarget() !== e; });
91
- }
92
- };
93
- ValidatorArray.prototype.makeValidator = function (value, target, event) {
94
- return this._makeValidatorFactory(value, target, event);
95
- };
96
- ;
97
- return ValidatorArray;
98
- }(Validator_1.Validator));
99
- exports.ValidatorArray = ValidatorArray;
@@ -1,6 +0,0 @@
1
- import { Validator } from './Validator';
2
- export declare class ValueEqualsValidator<T = any, E = Element> extends Validator<T, E> {
3
- equalsValue: T;
4
- constructor(equalsValue: T, value?: T, target?: E, event?: Event, autoValid?: boolean);
5
- valid(): boolean;
6
- }
@@ -1,33 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.ValueEqualsValidator = void 0;
19
- var Validator_1 = require("./Validator");
20
- var ValueEqualsValidator = /** @class */ (function (_super) {
21
- __extends(ValueEqualsValidator, _super);
22
- function ValueEqualsValidator(equalsValue, value, target, event, autoValid) {
23
- if (autoValid === void 0) { autoValid = true; }
24
- var _this = _super.call(this, value, target, event, autoValid) || this;
25
- _this.equalsValue = equalsValue;
26
- return _this;
27
- }
28
- ValueEqualsValidator.prototype.valid = function () {
29
- return this.value === this.equalsValue;
30
- };
31
- return ValueEqualsValidator;
32
- }(Validator_1.Validator));
33
- exports.ValueEqualsValidator = ValueEqualsValidator;
@@ -1,6 +0,0 @@
1
- import { Validator } from './Validator';
2
- export declare class ValueNotEqualsValidator<T = any, E = Element> extends Validator<T, E> {
3
- equalsValue: T;
4
- constructor(equalsValue: T, value?: T, target?: E, event?: Event, autoValid?: boolean);
5
- valid(): boolean;
6
- }
@@ -1,33 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.ValueNotEqualsValidator = void 0;
19
- var Validator_1 = require("./Validator");
20
- var ValueNotEqualsValidator = /** @class */ (function (_super) {
21
- __extends(ValueNotEqualsValidator, _super);
22
- function ValueNotEqualsValidator(equalsValue, value, target, event, autoValid) {
23
- if (autoValid === void 0) { autoValid = true; }
24
- var _this = _super.call(this, value, target, event, autoValid) || this;
25
- _this.equalsValue = equalsValue;
26
- return _this;
27
- }
28
- ValueNotEqualsValidator.prototype.valid = function () {
29
- return this.value !== this.equalsValue;
30
- };
31
- return ValueNotEqualsValidator;
32
- }(Validator_1.Validator));
33
- exports.ValueNotEqualsValidator = ValueNotEqualsValidator;