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.
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/dom-render.iml +9 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/jpa-buddy.xml +6 -0
- package/.idea/misc.xml +8 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/README.MD +6 -793
- package/package.json +1 -1
- package/DomRender.d.ts +0 -13
- package/DomRender.js +0 -72
- package/DomRenderProxy.d.ts +0 -30
- package/DomRenderProxy.js +0 -515
- package/components/ComponentSet.d.ts +0 -10
- package/components/ComponentSet.js +0 -13
- package/configs/Config.d.ts +0 -34
- package/configs/Config.js +0 -2
- package/configs/TargetAttr.d.ts +0 -6
- package/configs/TargetAttr.js +0 -2
- package/configs/TargetElement.d.ts +0 -14
- package/configs/TargetElement.js +0 -2
- package/css/parse/index.d.ts +0 -1
- package/css/parse/index.js +0 -512
- package/css/stringify/compiler.d.ts +0 -32
- package/css/stringify/compiler.js +0 -40
- package/css/stringify/compress.d.ts +0 -75
- package/css/stringify/compress.js +0 -156
- package/css/stringify/identity.d.ts +0 -85
- package/css/stringify/identity.js +0 -194
- package/css/stringify/index.d.ts +0 -14
- package/css/stringify/index.js +0 -44
- package/dist/bundle.js +0 -5442
- package/events/EventManager.d.ts +0 -49
- package/events/EventManager.js +0 -529
- package/iterators/Range.d.ts +0 -23
- package/iterators/Range.js +0 -80
- package/lifecycle/OnBeforeReturnGet.d.ts +0 -3
- package/lifecycle/OnBeforeReturnGet.js +0 -2
- package/lifecycle/OnBeforeReturnSet.d.ts +0 -3
- package/lifecycle/OnBeforeReturnSet.js +0 -2
- package/lifecycle/OnChangeAttrRender.d.ts +0 -3
- package/lifecycle/OnChangeAttrRender.js +0 -2
- package/lifecycle/OnCreateRender.d.ts +0 -3
- package/lifecycle/OnCreateRender.js +0 -2
- package/lifecycle/OnDestroyRender.d.ts +0 -4
- package/lifecycle/OnDestroyRender.js +0 -2
- package/lifecycle/OnInitRender.d.ts +0 -3
- package/lifecycle/OnInitRender.js +0 -2
- package/lifecycle/OnProxyDomRender.d.ts +0 -4
- package/lifecycle/OnProxyDomRender.js +0 -2
- package/managers/RenderManager.d.ts +0 -3
- package/managers/RenderManager.js +0 -18
- package/messenger/DefaultMessenger.d.ts +0 -3
- package/messenger/DefaultMessenger.js +0 -27
- package/messenger/Messenger.d.ts +0 -78
- package/messenger/Messenger.js +0 -201
- package/operators/Appender.d.ts +0 -10
- package/operators/Appender.js +0 -64
- package/operators/AttrExpresion.d.ts +0 -0
- package/operators/AttrExpresion.js +0 -44
- package/operators/Dr.d.ts +0 -8
- package/operators/Dr.js +0 -101
- package/operators/DrAppender.d.ts +0 -8
- package/operators/DrAppender.js +0 -105
- package/operators/DrFor.d.ts +0 -8
- package/operators/DrFor.js +0 -102
- package/operators/DrForOf.d.ts +0 -8
- package/operators/DrForOf.js +0 -105
- package/operators/DrForm.d.ts +0 -8
- package/operators/DrForm.js +0 -138
- package/operators/DrIf.d.ts +0 -8
- package/operators/DrIf.js +0 -106
- package/operators/DrInnerHTML.d.ts +0 -8
- package/operators/DrInnerHTML.js +0 -99
- package/operators/DrInnerText.d.ts +0 -8
- package/operators/DrInnerText.js +0 -97
- package/operators/DrPre.d.ts +0 -7
- package/operators/DrPre.js +0 -71
- package/operators/DrRepeat.d.ts +0 -8
- package/operators/DrRepeat.js +0 -103
- package/operators/DrTargetAttr.d.ts +0 -7
- package/operators/DrTargetAttr.js +0 -96
- package/operators/DrTargetElement.d.ts +0 -7
- package/operators/DrTargetElement.js +0 -112
- package/operators/DrThis.d.ts +0 -5
- package/operators/DrThis.js +0 -108
- package/operators/DrThisProperty.d.ts +0 -10
- package/operators/DrThisProperty.js +0 -141
- package/operators/OperatorExecuter.d.ts +0 -49
- package/operators/OperatorExecuter.js +0 -89
- package/operators/OperatorExecuterAttrRequire.d.ts +0 -8
- package/operators/OperatorExecuterAttrRequire.js +0 -79
- package/rawsets/AttrInitCallBack.d.ts +0 -5
- package/rawsets/AttrInitCallBack.js +0 -2
- package/rawsets/Attrs.d.ts +0 -24
- package/rawsets/Attrs.js +0 -2
- package/rawsets/CreatorMetaData.d.ts +0 -18
- package/rawsets/CreatorMetaData.js +0 -2
- package/rawsets/DestroyOptionType.d.ts +0 -4
- package/rawsets/DestroyOptionType.js +0 -8
- package/rawsets/ElementInitCallBack.d.ts +0 -8
- package/rawsets/ElementInitCallBack.js +0 -2
- package/rawsets/RawSet.d.ts +0 -118
- package/rawsets/RawSet.js +0 -1142
- package/rawsets/RawSetOperatorType.d.ts +0 -3
- package/rawsets/RawSetOperatorType.js +0 -7
- package/rawsets/RawSetType.d.ts +0 -7
- package/rawsets/RawSetType.js +0 -11
- package/rawsets/Render.d.ts +0 -17
- package/rawsets/Render.js +0 -2
- package/routers/HashRouter.d.ts +0 -9
- package/routers/HashRouter.js +0 -53
- package/routers/PathRouter.d.ts +0 -9
- package/routers/PathRouter.js +0 -52
- package/routers/Router.d.ts +0 -28
- package/routers/Router.js +0 -126
- package/types/Types.d.ts +0 -14
- package/types/Types.js +0 -36
- package/utils/clipboard/ClipBoardUtils.d.ts +0 -6
- package/utils/clipboard/ClipBoardUtils.js +0 -25
- package/utils/dom/DomUtils.d.ts +0 -13
- package/utils/dom/DomUtils.js +0 -47
- package/utils/location/LocationUtils.d.ts +0 -16
- package/utils/location/LocationUtils.js +0 -63
- package/utils/node/NodeUtils.d.ts +0 -10
- package/utils/node/NodeUtils.js +0 -27
- package/utils/random/RandomUtils.d.ts +0 -7
- package/utils/random/RandomUtils.js +0 -47
- package/utils/script/ScriptUtils.d.ts +0 -14
- package/utils/script/ScriptUtils.js +0 -89
- package/utils/storage/StorageUtils.d.ts +0 -16
- package/utils/storage/StorageUtils.js +0 -87
- package/utils/string/StringUtils.d.ts +0 -6
- package/utils/string/StringUtils.js +0 -58
- package/utils/valid/ValidUtils.d.ts +0 -10
- package/utils/valid/ValidUtils.js +0 -78
- package/validators/AllCheckedValidatorArray.d.ts +0 -6
- package/validators/AllCheckedValidatorArray.js +0 -32
- package/validators/AllUnCheckedValidatorArray.d.ts +0 -6
- package/validators/AllUnCheckedValidatorArray.js +0 -32
- package/validators/CheckedValidator.d.ts +0 -5
- package/validators/CheckedValidator.js +0 -32
- package/validators/CountEqualsCheckedValidatorArray.d.ts +0 -7
- package/validators/CountEqualsCheckedValidatorArray.js +0 -34
- package/validators/CountEqualsUnCheckedValidatorArray.d.ts +0 -7
- package/validators/CountEqualsUnCheckedValidatorArray.js +0 -34
- package/validators/CountGreaterThanCheckedValidatorArray.d.ts +0 -7
- package/validators/CountGreaterThanCheckedValidatorArray.js +0 -34
- package/validators/CountGreaterThanEqualsCheckedValidatorArray.d.ts +0 -7
- package/validators/CountGreaterThanEqualsCheckedValidatorArray.js +0 -34
- package/validators/CountGreaterThanEqualsUnCheckedValidatorArray.d.ts +0 -7
- package/validators/CountGreaterThanEqualsUnCheckedValidatorArray.js +0 -34
- package/validators/CountGreaterThanUnCheckedValidatorArray.d.ts +0 -7
- package/validators/CountGreaterThanUnCheckedValidatorArray.js +0 -34
- package/validators/CountLessThanCheckedValidatorArray.d.ts +0 -7
- package/validators/CountLessThanCheckedValidatorArray.js +0 -34
- package/validators/CountLessThanEqualsCheckedValidatorArray.d.ts +0 -7
- package/validators/CountLessThanEqualsCheckedValidatorArray.js +0 -34
- package/validators/CountLessThanEqualsUnCheckedValidatorArray.d.ts +0 -7
- package/validators/CountLessThanEqualsUnCheckedValidatorArray.js +0 -34
- package/validators/CountLessThanUnCheckedValidatorArray.d.ts +0 -7
- package/validators/CountLessThanUnCheckedValidatorArray.js +0 -34
- package/validators/CountUnCheckedValidatorArray.d.ts +0 -7
- package/validators/CountUnCheckedValidatorArray.js +0 -34
- package/validators/EmptyValidator.d.ts +0 -5
- package/validators/EmptyValidator.js +0 -33
- package/validators/ExcludeCheckedValidatorArray.d.ts +0 -8
- package/validators/ExcludeCheckedValidatorArray.js +0 -41
- package/validators/FormValidator.d.ts +0 -7
- package/validators/FormValidator.js +0 -37
- package/validators/IncludeCheckedValidatorArray.d.ts +0 -8
- package/validators/IncludeCheckedValidatorArray.js +0 -41
- package/validators/MultipleValidator.d.ts +0 -8
- package/validators/MultipleValidator.js +0 -48
- package/validators/NonPassValidator.d.ts +0 -5
- package/validators/NonPassValidator.js +0 -31
- package/validators/NotEmptyValidator.d.ts +0 -5
- package/validators/NotEmptyValidator.js +0 -34
- package/validators/NotRegExpTestValidator.d.ts +0 -6
- package/validators/NotRegExpTestValidator.js +0 -42
- package/validators/PassValidator.d.ts +0 -5
- package/validators/PassValidator.js +0 -31
- package/validators/RegExpTestValidator.d.ts +0 -6
- package/validators/RegExpTestValidator.js +0 -43
- package/validators/RequiredValidator.d.ts +0 -5
- package/validators/RequiredValidator.js +0 -33
- package/validators/UnCheckedValidator.d.ts +0 -5
- package/validators/UnCheckedValidator.js +0 -32
- package/validators/ValidMultipleValidator.d.ts +0 -9
- package/validators/ValidMultipleValidator.js +0 -34
- package/validators/ValidValidator.d.ts +0 -6
- package/validators/ValidValidator.js +0 -33
- package/validators/ValidValidatorArray.d.ts +0 -7
- package/validators/ValidValidatorArray.js +0 -33
- package/validators/Validator.d.ts +0 -57
- package/validators/Validator.js +0 -242
- package/validators/ValidatorArray.d.ts +0 -17
- package/validators/ValidatorArray.js +0 -99
- package/validators/ValueEqualsValidator.d.ts +0 -6
- package/validators/ValueEqualsValidator.js +0 -33
- package/validators/ValueNotEqualsValidator.d.ts +0 -6
- package/validators/ValueNotEqualsValidator.js +0 -33
package/validators/Validator.js
DELETED
@@ -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,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,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;
|