@dooboostore/dom-render 1.0.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (230) hide show
  1. package/DomRender.d.ts +24 -0
  2. package/DomRender.js +115 -0
  3. package/DomRenderProxy.d.ts +38 -0
  4. package/DomRenderProxy.js +586 -0
  5. package/README.MD +938 -0
  6. package/components/ComponentBase.d.ts +41 -0
  7. package/components/ComponentBase.js +210 -0
  8. package/components/ComponentSet.d.ts +22 -0
  9. package/components/ComponentSet.js +23 -0
  10. package/components/appender/Appender.d.ts +23 -0
  11. package/components/appender/Appender.js +59 -0
  12. package/components/checkbox/CheckBox.d.ts +47 -0
  13. package/components/checkbox/CheckBox.js +118 -0
  14. package/components/choose/Choose.d.ts +39 -0
  15. package/components/choose/Choose.js +110 -0
  16. package/components/details/Details.d.ts +57 -0
  17. package/components/details/Details.js +199 -0
  18. package/components/dialog/Dialog.d.ts +1 -0
  19. package/components/dialog/Dialog.js +85 -0
  20. package/components/dialog/example/ImageEditorDialog.d.ts +1 -0
  21. package/components/dialog/example/ImageEditorDialog.js +116 -0
  22. package/components/forOf/ForOf.d.ts +18 -0
  23. package/components/forOf/ForOf.js +32 -0
  24. package/components/if/If.d.ts +21 -0
  25. package/components/if/If.js +40 -0
  26. package/components/index.d.ts +27 -0
  27. package/components/index.js +13 -0
  28. package/components/input/Input.d.ts +34 -0
  29. package/components/input/Input.js +86 -0
  30. package/components/promise/PromiseSwitch.d.ts +55 -0
  31. package/components/promise/PromiseSwitch.js +181 -0
  32. package/components/radio/Radio.d.ts +45 -0
  33. package/components/radio/Radio.js +123 -0
  34. package/components/select/Select.d.ts +23 -0
  35. package/components/select/Select.js +52 -0
  36. package/components/this/This.d.ts +24 -0
  37. package/components/this/This.js +62 -0
  38. package/components/timer/Timer.d.ts +26 -0
  39. package/components/timer/Timer.js +102 -0
  40. package/configs/Config.d.ts +34 -0
  41. package/configs/Config.js +2 -0
  42. package/configs/TargetAttr.d.ts +7 -0
  43. package/configs/TargetAttr.js +2 -0
  44. package/configs/TargetElement.d.ts +16 -0
  45. package/configs/TargetElement.js +2 -0
  46. package/css/parse/index.d.ts +49 -0
  47. package/css/parse/index.js +498 -0
  48. package/css/stringify/compiler.d.ts +34 -0
  49. package/css/stringify/compiler.js +36 -0
  50. package/css/stringify/compress.d.ts +104 -0
  51. package/css/stringify/compress.js +147 -0
  52. package/css/stringify/identity.d.ts +109 -0
  53. package/css/stringify/identity.js +183 -0
  54. package/css/stringify/index.d.ts +24 -0
  55. package/css/stringify/index.js +27 -0
  56. package/css/stringify/types.d.ts +15 -0
  57. package/css/stringify/types.js +2 -0
  58. package/css/types.d.ts +10 -0
  59. package/css/types.js +2 -0
  60. package/decorators/DomRenderNoProxy.d.ts +4 -0
  61. package/decorators/DomRenderNoProxy.js +15 -0
  62. package/events/EventManager.d.ts +68 -0
  63. package/events/EventManager.js +477 -0
  64. package/index.d.ts +2 -0
  65. package/index.js +2 -0
  66. package/iterators/Range.d.ts +24 -0
  67. package/iterators/Range.js +70 -0
  68. package/lifecycle/OnBeforeReturnGet.d.ts +4 -0
  69. package/lifecycle/OnBeforeReturnGet.js +2 -0
  70. package/lifecycle/OnBeforeReturnSet.d.ts +5 -0
  71. package/lifecycle/OnBeforeReturnSet.js +4 -0
  72. package/lifecycle/OnChangeAttrRender.d.ts +9 -0
  73. package/lifecycle/OnChangeAttrRender.js +4 -0
  74. package/lifecycle/OnChildRenderedByProperty.d.ts +5 -0
  75. package/lifecycle/OnChildRenderedByProperty.js +4 -0
  76. package/lifecycle/OnCreateRender.d.ts +5 -0
  77. package/lifecycle/OnCreateRender.js +4 -0
  78. package/lifecycle/OnCreateRenderData.d.ts +10 -0
  79. package/lifecycle/OnCreateRenderData.js +4 -0
  80. package/lifecycle/OnCreateRendered.d.ts +8 -0
  81. package/lifecycle/OnCreateRendered.js +4 -0
  82. package/lifecycle/OnCreatedThisChild.d.ts +6 -0
  83. package/lifecycle/OnCreatedThisChild.js +4 -0
  84. package/lifecycle/OnDestroyRender.d.ts +9 -0
  85. package/lifecycle/OnDestroyRender.js +4 -0
  86. package/lifecycle/OnInitRender.d.ts +6 -0
  87. package/lifecycle/OnInitRender.js +4 -0
  88. package/lifecycle/OnProxyDomRender.d.ts +5 -0
  89. package/lifecycle/OnProxyDomRender.js +2 -0
  90. package/lifecycle/dr-this/OnDrThisBind.d.ts +5 -0
  91. package/lifecycle/dr-this/OnDrThisBind.js +4 -0
  92. package/lifecycle/dr-this/OnDrThisUnBind.d.ts +5 -0
  93. package/lifecycle/dr-this/OnDrThisUnBind.js +4 -0
  94. package/managers/RenderManager.d.ts +2 -0
  95. package/managers/RenderManager.js +12 -0
  96. package/messenger/DefaultMessenger.d.ts +4 -0
  97. package/messenger/DefaultMessenger.js +4 -0
  98. package/messenger/Messenger.d.ts +79 -0
  99. package/messenger/Messenger.js +185 -0
  100. package/operators/Appender.d.ts +15 -0
  101. package/operators/Appender.js +90 -0
  102. package/operators/Dr.d.ts +9 -0
  103. package/operators/Dr.js +53 -0
  104. package/operators/DrAppender.d.ts +9 -0
  105. package/operators/DrAppender.js +69 -0
  106. package/operators/DrFor.d.ts +9 -0
  107. package/operators/DrFor.js +58 -0
  108. package/operators/DrForOf.d.ts +9 -0
  109. package/operators/DrForOf.js +120 -0
  110. package/operators/DrForm.d.ts +9 -0
  111. package/operators/DrForm.js +79 -0
  112. package/operators/DrIf.d.ts +9 -0
  113. package/operators/DrIf.js +70 -0
  114. package/operators/DrInnerHTML.d.ts +9 -0
  115. package/operators/DrInnerHTML.js +48 -0
  116. package/operators/DrInnerText.d.ts +9 -0
  117. package/operators/DrInnerText.js +46 -0
  118. package/operators/DrPre.d.ts +8 -0
  119. package/operators/DrPre.js +22 -0
  120. package/operators/DrRepeat.d.ts +9 -0
  121. package/operators/DrRepeat.js +70 -0
  122. package/operators/DrStripElement.d.ts +9 -0
  123. package/operators/DrStripElement.js +50 -0
  124. package/operators/DrTargetAttr.d.ts +8 -0
  125. package/operators/DrTargetAttr.js +45 -0
  126. package/operators/DrTargetElement.d.ts +13 -0
  127. package/operators/DrTargetElement.js +91 -0
  128. package/operators/DrTargetElementIsElement.d.ts +13 -0
  129. package/operators/DrTargetElementIsElement.js +79 -0
  130. package/operators/DrThis.d.ts +7 -0
  131. package/operators/DrThis.js +72 -0
  132. package/operators/DrThisProperty.d.ts +11 -0
  133. package/operators/DrThisProperty.js +93 -0
  134. package/operators/OperatorExecuter.d.ts +50 -0
  135. package/operators/OperatorExecuter.js +50 -0
  136. package/operators/OperatorExecuterAttrRequire.d.ts +9 -0
  137. package/operators/OperatorExecuterAttrRequire.js +25 -0
  138. package/package.json +70 -0
  139. package/rawsets/AttrInitCallBack.d.ts +6 -0
  140. package/rawsets/AttrInitCallBack.js +2 -0
  141. package/rawsets/Attrs.d.ts +27 -0
  142. package/rawsets/Attrs.js +2 -0
  143. package/rawsets/CreatorMetaData.d.ts +20 -0
  144. package/rawsets/CreatorMetaData.js +2 -0
  145. package/rawsets/DestroyOptionType.d.ts +5 -0
  146. package/rawsets/DestroyOptionType.js +6 -0
  147. package/rawsets/ElementInitCallBack.d.ts +9 -0
  148. package/rawsets/ElementInitCallBack.js +2 -0
  149. package/rawsets/RawSet.d.ts +180 -0
  150. package/rawsets/RawSet.js +1450 -0
  151. package/rawsets/RawSetOperatorType.d.ts +4 -0
  152. package/rawsets/RawSetOperatorType.js +5 -0
  153. package/rawsets/RawSetType.d.ts +8 -0
  154. package/rawsets/RawSetType.js +9 -0
  155. package/rawsets/Render.d.ts +27 -0
  156. package/rawsets/Render.js +2 -0
  157. package/routers/HashRouter.d.ts +24 -0
  158. package/routers/HashRouter.js +86 -0
  159. package/routers/PathRouter.d.ts +23 -0
  160. package/routers/PathRouter.js +73 -0
  161. package/routers/Router.d.ts +68 -0
  162. package/routers/Router.js +132 -0
  163. package/types/Types.d.ts +12 -0
  164. package/types/Types.js +26 -0
  165. package/validators/AllCheckedValidatorArray.d.ts +7 -0
  166. package/validators/AllCheckedValidatorArray.js +11 -0
  167. package/validators/AllUnCheckedValidatorArray.d.ts +7 -0
  168. package/validators/AllUnCheckedValidatorArray.js +11 -0
  169. package/validators/CheckedValidator.d.ts +6 -0
  170. package/validators/CheckedValidator.js +11 -0
  171. package/validators/CountEqualsCheckedValidatorArray.d.ts +8 -0
  172. package/validators/CountEqualsCheckedValidatorArray.js +12 -0
  173. package/validators/CountEqualsUnCheckedValidatorArray.d.ts +8 -0
  174. package/validators/CountEqualsUnCheckedValidatorArray.js +12 -0
  175. package/validators/CountGreaterThanCheckedValidatorArray.d.ts +8 -0
  176. package/validators/CountGreaterThanCheckedValidatorArray.js +12 -0
  177. package/validators/CountGreaterThanEqualsCheckedValidatorArray.d.ts +8 -0
  178. package/validators/CountGreaterThanEqualsCheckedValidatorArray.js +12 -0
  179. package/validators/CountGreaterThanEqualsUnCheckedValidatorArray.d.ts +8 -0
  180. package/validators/CountGreaterThanEqualsUnCheckedValidatorArray.js +12 -0
  181. package/validators/CountGreaterThanUnCheckedValidatorArray.d.ts +8 -0
  182. package/validators/CountGreaterThanUnCheckedValidatorArray.js +12 -0
  183. package/validators/CountLessThanCheckedValidatorArray.d.ts +8 -0
  184. package/validators/CountLessThanCheckedValidatorArray.js +12 -0
  185. package/validators/CountLessThanEqualsCheckedValidatorArray.d.ts +8 -0
  186. package/validators/CountLessThanEqualsCheckedValidatorArray.js +12 -0
  187. package/validators/CountLessThanEqualsUnCheckedValidatorArray.d.ts +8 -0
  188. package/validators/CountLessThanEqualsUnCheckedValidatorArray.js +12 -0
  189. package/validators/CountLessThanUnCheckedValidatorArray.d.ts +8 -0
  190. package/validators/CountLessThanUnCheckedValidatorArray.js +12 -0
  191. package/validators/CountUnCheckedValidatorArray.d.ts +8 -0
  192. package/validators/CountUnCheckedValidatorArray.js +12 -0
  193. package/validators/EmptyValidator.d.ts +6 -0
  194. package/validators/EmptyValidator.js +12 -0
  195. package/validators/ExcludeCheckedValidatorArray.d.ts +9 -0
  196. package/validators/ExcludeCheckedValidatorArray.js +17 -0
  197. package/validators/FormValidator.d.ts +8 -0
  198. package/validators/FormValidator.js +16 -0
  199. package/validators/IncludeCheckedValidatorArray.d.ts +9 -0
  200. package/validators/IncludeCheckedValidatorArray.js +17 -0
  201. package/validators/MultipleValidator.d.ts +9 -0
  202. package/validators/MultipleValidator.js +25 -0
  203. package/validators/NonPassValidator.d.ts +6 -0
  204. package/validators/NonPassValidator.js +10 -0
  205. package/validators/NotEmptyValidator.d.ts +6 -0
  206. package/validators/NotEmptyValidator.js +13 -0
  207. package/validators/NotRegExpTestValidator.d.ts +7 -0
  208. package/validators/NotRegExpTestValidator.js +20 -0
  209. package/validators/PassValidator.d.ts +6 -0
  210. package/validators/PassValidator.js +10 -0
  211. package/validators/RegExpTestValidator.d.ts +7 -0
  212. package/validators/RegExpTestValidator.js +21 -0
  213. package/validators/RequiredValidator.d.ts +6 -0
  214. package/validators/RequiredValidator.js +12 -0
  215. package/validators/UnCheckedValidator.d.ts +6 -0
  216. package/validators/UnCheckedValidator.js +11 -0
  217. package/validators/ValidMultipleValidator.d.ts +10 -0
  218. package/validators/ValidMultipleValidator.js +12 -0
  219. package/validators/ValidValidator.d.ts +7 -0
  220. package/validators/ValidValidator.js +11 -0
  221. package/validators/ValidValidatorArray.d.ts +8 -0
  222. package/validators/ValidValidatorArray.js +11 -0
  223. package/validators/Validator.d.ts +58 -0
  224. package/validators/Validator.js +203 -0
  225. package/validators/ValidatorArray.d.ts +18 -0
  226. package/validators/ValidatorArray.js +77 -0
  227. package/validators/ValueEqualsValidator.d.ts +7 -0
  228. package/validators/ValueEqualsValidator.js +11 -0
  229. package/validators/ValueNotEqualsValidator.d.ts +7 -0
  230. package/validators/ValueNotEqualsValidator.js +11 -0
@@ -0,0 +1,203 @@
1
+ // export interface Valid<T = any, E = Element> {
2
+ // valid(value?: T, target?: E, event?: Event): boolean;
3
+ // }
4
+ export class Validator {
5
+ constructor(_value, target, event, autoValid = true, autoValidAction = true) {
6
+ this._value = _value;
7
+ this.setTarget(target);
8
+ this.setEvent(event);
9
+ this.setAutoValid(autoValid);
10
+ this.setAutoValidAction(autoValidAction);
11
+ }
12
+ getValidAction() {
13
+ return this._validAction;
14
+ }
15
+ setValidAction(value) {
16
+ this._validAction = value;
17
+ return this;
18
+ }
19
+ getAutoValid() {
20
+ return this._autoValid;
21
+ }
22
+ setAutoValid(autoValid) {
23
+ this._autoValid = autoValid;
24
+ return this;
25
+ }
26
+ getAutoValidAction() {
27
+ return this._autoValidAction;
28
+ }
29
+ setAutoValidAction(autoValid) {
30
+ this._autoValidAction = autoValid;
31
+ return this;
32
+ }
33
+ getEvent() {
34
+ return this._event;
35
+ }
36
+ setEvent(event) {
37
+ if (event) {
38
+ this._event = this.domRenderFinal(event);
39
+ }
40
+ return this;
41
+ }
42
+ getTarget() {
43
+ return this._target;
44
+ }
45
+ targetFocus() {
46
+ var _a, _b;
47
+ (_b = (_a = this._target) === null || _a === void 0 ? void 0 : _a.focus) === null || _b === void 0 ? void 0 : _b.call(_a);
48
+ }
49
+ targetReset() {
50
+ var _a, _b;
51
+ (_b = (_a = this._target) === null || _a === void 0 ? void 0 : _a.reset) === null || _b === void 0 ? void 0 : _b.call(_a);
52
+ }
53
+ targetDispatchEvent(event) {
54
+ var _a;
55
+ return (_a = this._target) === null || _a === void 0 ? void 0 : _a.dispatchEvent(event);
56
+ }
57
+ setTarget(target) {
58
+ if (target) {
59
+ this._target = this.domRenderFinal(target);
60
+ }
61
+ return this;
62
+ }
63
+ domRenderFinal(obj) {
64
+ obj._DomRender_isFinal = true;
65
+ return obj;
66
+ }
67
+ get value() {
68
+ var _a;
69
+ if (this._value === undefined || this._value === null) {
70
+ this._value = (_a = this.getTarget()) === null || _a === void 0 ? void 0 : _a.value;
71
+ }
72
+ return this._value;
73
+ }
74
+ set value(value) {
75
+ // console.log('---?set?', value, this)
76
+ this._value = value;
77
+ this.tickValue(value);
78
+ }
79
+ tickValue(value) {
80
+ this.changeValue(value);
81
+ const target = this.getTarget();
82
+ if (target && (target === null || target === void 0 ? void 0 : target.value) !== undefined && (target === null || target === void 0 ? void 0 : target.value) !== null) {
83
+ try {
84
+ target.value = this._value;
85
+ }
86
+ catch (e) {
87
+ console.error('set value function is blocked ');
88
+ }
89
+ }
90
+ if (this.getAutoValidAction()) {
91
+ this.validAction();
92
+ }
93
+ else if (this.getAutoValid()) {
94
+ this.valid();
95
+ }
96
+ }
97
+ set(value, target, event) {
98
+ this.setTarget(target);
99
+ this.setEvent(event);
100
+ this.value = value;
101
+ }
102
+ changeValue(value) {
103
+ }
104
+ get checked() {
105
+ var _a, _b;
106
+ return (_b = (_a = this.getTarget()) === null || _a === void 0 ? void 0 : _a.checked) !== null && _b !== void 0 ? _b : false;
107
+ }
108
+ set checked(checked) {
109
+ const target = this.getTarget();
110
+ if (target) {
111
+ target.checked = checked;
112
+ }
113
+ }
114
+ get selectedIndex() {
115
+ var _a, _b;
116
+ return (_b = (_a = this.getTarget()) === null || _a === void 0 ? void 0 : _a.selectedIndex) !== null && _b !== void 0 ? _b : -1;
117
+ }
118
+ set selectedIndex(selectedIndex) {
119
+ const target = this.getTarget();
120
+ if (target) {
121
+ target.selectedIndex = selectedIndex;
122
+ }
123
+ }
124
+ querySelector(selector) {
125
+ var _a;
126
+ return (_a = this.getTarget()) === null || _a === void 0 ? void 0 : _a.querySelector(selector);
127
+ }
128
+ querySelectorALL(selector) {
129
+ var _a;
130
+ return (_a = this.getTarget()) === null || _a === void 0 ? void 0 : _a.querySelectorAll(selector);
131
+ }
132
+ validAction() {
133
+ var _a;
134
+ const valid = this.valid();
135
+ (_a = this.getValidAction()) === null || _a === void 0 ? void 0 : _a(valid, this.value, this.getTarget(), this.getEvent());
136
+ return valid;
137
+ }
138
+ inValid() {
139
+ return !this.valid();
140
+ }
141
+ ;
142
+ allValid() {
143
+ return this.valid() && this.childInValid();
144
+ }
145
+ allValidAction() {
146
+ return this.validAction() && this.childInValidAction();
147
+ }
148
+ allInValid() {
149
+ return !this.allValid();
150
+ }
151
+ allInValidAction() {
152
+ return !this.allValidAction();
153
+ }
154
+ childValid() {
155
+ return !this.childInValid();
156
+ }
157
+ childValue() {
158
+ const data = {};
159
+ this.childValidators().filter(([k, v]) => {
160
+ data[k] = v.value;
161
+ });
162
+ return data;
163
+ }
164
+ childValidAction() {
165
+ return !this.childInValidAction();
166
+ }
167
+ childInValid() {
168
+ const inValid = this.childValidators().filter(([k, v]) => !v.valid());
169
+ return inValid.length > 0;
170
+ }
171
+ childInValidValidator() {
172
+ const inValid = this.childValidators().filter(([k, v]) => !v.valid());
173
+ return inValid;
174
+ }
175
+ childInValidAction() {
176
+ const inValid = this.childValidators().filter(([k, v]) => !v.validAction());
177
+ return inValid.length > 0;
178
+ }
179
+ childValidator(name) {
180
+ var _a;
181
+ return (_a = Object.entries(this).find(([k, v]) => (k === name && (v instanceof Validator)))) === null || _a === void 0 ? void 0 : _a[1];
182
+ }
183
+ childValidators() {
184
+ return Object.entries(this).filter(([k, v]) => (v instanceof Validator));
185
+ }
186
+ childValidValidator() {
187
+ return this.childValidators().filter(it => it[1].valid());
188
+ }
189
+ syncValue() {
190
+ var _a;
191
+ this.value = (_a = this.getTarget()) === null || _a === void 0 ? void 0 : _a.value;
192
+ }
193
+ allSyncValue() {
194
+ this.childValidators().forEach(([k, e]) => {
195
+ e.syncValue();
196
+ });
197
+ }
198
+ get length() {
199
+ var _a, _b;
200
+ return (_b = (_a = this.value) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
201
+ }
202
+ }
203
+ //# sourceMappingURL=Validator.js.map
@@ -0,0 +1,18 @@
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>[];
12
+ getValidator(e: E): Validator<T, E>;
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
+ }
18
+ //# sourceMappingURL=ValidatorArray.d.ts.map
@@ -0,0 +1,77 @@
1
+ import { Validator } from './Validator';
2
+ import { NonPassValidator } from './NonPassValidator';
3
+ export class ValidatorArray extends Validator {
4
+ constructor(value, target, event, autoValid = true) {
5
+ super(value, target, event, autoValid);
6
+ this._makeValidatorFactory = (value, target, event) => {
7
+ return new NonPassValidator(value, target, event);
8
+ };
9
+ }
10
+ getMakeValidatorFactory() {
11
+ return this._makeValidatorFactory;
12
+ }
13
+ setMakeValidatorFactory(value) {
14
+ this._makeValidatorFactory = value;
15
+ return this;
16
+ }
17
+ setArrayValue(target, value, event) {
18
+ var _a;
19
+ (_a = this.value) === null || _a === void 0 ? void 0 : _a.filter(it => {
20
+ if (it.getTarget()) {
21
+ return it.getTarget() === target;
22
+ }
23
+ else {
24
+ return false;
25
+ }
26
+ }).forEach(it => {
27
+ it.set(value, target, event);
28
+ });
29
+ this.tickValue(this.value);
30
+ }
31
+ addValidator(value, target, event) {
32
+ var _a, _b;
33
+ if (!this.value) {
34
+ this.value = [];
35
+ }
36
+ if (value instanceof Validator) {
37
+ (_a = this.value) === null || _a === void 0 ? void 0 : _a.push(value);
38
+ }
39
+ else {
40
+ (_b = this.value) === null || _b === void 0 ? void 0 : _b.push(this.makeValidator(value, target, event));
41
+ }
42
+ this.tickValue(this.value);
43
+ }
44
+ allChecked(checked) {
45
+ var _a;
46
+ this.checked = checked;
47
+ (_a = this.value) === null || _a === void 0 ? void 0 : _a.forEach(it => {
48
+ it.checked = checked;
49
+ });
50
+ }
51
+ getValidators() {
52
+ return this._value;
53
+ }
54
+ getValidator(e) {
55
+ var _a;
56
+ return (_a = this.value) === null || _a === void 0 ? void 0 : _a.filter(it => it.getTarget() === e)[0];
57
+ }
58
+ getValidatorByValue(value) {
59
+ const validatorByValue = this.getValidatorByValues(value)[0];
60
+ return validatorByValue;
61
+ }
62
+ getValidatorByValues(value) {
63
+ var _a, _b;
64
+ return (_b = (_a = this.value) === null || _a === void 0 ? void 0 : _a.filter(it => it.value === value)) !== null && _b !== void 0 ? _b : [];
65
+ }
66
+ removeElement(e) {
67
+ const value = this.value;
68
+ if (value) {
69
+ this.value = value.filter(it => it.getTarget() !== e);
70
+ }
71
+ }
72
+ makeValidator(value, target, event) {
73
+ return this._makeValidatorFactory(value, target, event);
74
+ }
75
+ ;
76
+ }
77
+ //# sourceMappingURL=ValidatorArray.js.map
@@ -0,0 +1,7 @@
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
+ }
7
+ //# sourceMappingURL=ValueEqualsValidator.d.ts.map
@@ -0,0 +1,11 @@
1
+ import { Validator } from './Validator';
2
+ export class ValueEqualsValidator extends Validator {
3
+ constructor(equalsValue, value, target, event, autoValid = true) {
4
+ super(value, target, event, autoValid);
5
+ this.equalsValue = equalsValue;
6
+ }
7
+ valid() {
8
+ return this.value === this.equalsValue;
9
+ }
10
+ }
11
+ //# sourceMappingURL=ValueEqualsValidator.js.map
@@ -0,0 +1,7 @@
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
+ }
7
+ //# sourceMappingURL=ValueNotEqualsValidator.d.ts.map
@@ -0,0 +1,11 @@
1
+ import { Validator } from './Validator';
2
+ export class ValueNotEqualsValidator extends Validator {
3
+ constructor(equalsValue, value, target, event, autoValid = true) {
4
+ super(value, target, event, autoValid);
5
+ this.equalsValue = equalsValue;
6
+ }
7
+ valid() {
8
+ return this.value !== this.equalsValue;
9
+ }
10
+ }
11
+ //# sourceMappingURL=ValueNotEqualsValidator.js.map