dom-render 1.0.92 → 1.0.93
Sign up to get free protection for your applications and to get access to all the features.
- package/DomRenderProxy.js +7 -7
- package/components/ComponentSet.d.ts +1 -1
- package/configs/Config.d.ts +4 -1
- package/configs/TargetAttr.d.ts +1 -1
- package/configs/TargetElement.d.ts +1 -1
- package/dist/bundle.js +224 -293
- package/events/EventManager.d.ts +1 -0
- package/events/EventManager.js +42 -54
- package/messenger/Messenger.d.ts +4 -4
- package/operators/Dr.js +1 -1
- package/operators/DrAppender.js +2 -4
- package/operators/DrFor.js +2 -4
- package/operators/DrForOf.js +2 -4
- package/operators/DrForm.js +1 -1
- package/operators/DrIf.js +2 -4
- package/operators/DrInnerHTML.js +1 -1
- package/operators/DrInnerText.js +1 -1
- package/operators/DrPre.js +2 -4
- package/operators/DrRepeat.js +2 -4
- package/operators/DrTargetAttr.js +2 -4
- package/operators/DrTargetElement.js +2 -4
- package/operators/DrThis.js +1 -1
- package/operators/OperatorExecuter.d.ts +5 -5
- package/operators/OperatorExecuter.js +1 -1
- package/operators/OperatorExecuterAttrRequire.js +1 -1
- package/package.json +1 -1
- package/rawsets/AttrInitCallBack.d.ts +1 -1
- package/rawsets/Attrs.d.ts +1 -1
- package/rawsets/CreatorMetaData.d.ts +1 -1
- package/rawsets/ElementInitCallBack.d.ts +1 -1
- package/rawsets/RawSet.js +1 -1
- package/rawsets/Render.d.ts +1 -1
- package/routers/Router.d.ts +1 -1
- package/utils/dom/DomUtils.d.ts +1 -1
- package/utils/node/NodeUtils.d.ts +1 -1
- package/validators/EmptyValidator.js +2 -2
- package/validators/NotEmptyValidator.js +2 -2
- package/validators/ValidMultipleValidator.d.ts +1 -1
- package/validators/Validator.d.ts +2 -2
- package/validators/ValidatorArray.d.ts +1 -1
package/dist/bundle.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
try{if(!exports){exports = {};} }catch(e){var exports = {}};
|
4
4
|
|
5
|
-
|
5
|
+
/******************************************************************************
|
6
6
|
Copyright (c) Microsoft Corporation.
|
7
7
|
|
8
8
|
Permission to use, copy, modify, and/or distribute this software for any
|
@@ -16,8 +16,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
16
16
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
17
17
|
PERFORMANCE OF THIS SOFTWARE.
|
18
18
|
***************************************************************************** */
|
19
|
-
|
20
19
|
/* global Reflect, Promise */
|
20
|
+
|
21
21
|
var extendStatics = function (d, b) {
|
22
22
|
extendStatics = Object.setPrototypeOf || {
|
23
23
|
__proto__: []
|
@@ -26,31 +26,24 @@ var extendStatics = function (d, b) {
|
|
26
26
|
} || function (d, b) {
|
27
27
|
for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
|
28
28
|
};
|
29
|
-
|
30
29
|
return extendStatics(d, b);
|
31
30
|
};
|
32
|
-
|
33
31
|
function __extends(d, b) {
|
34
32
|
if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
35
33
|
extendStatics(d, b);
|
36
|
-
|
37
34
|
function __() {
|
38
35
|
this.constructor = d;
|
39
36
|
}
|
40
|
-
|
41
37
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
42
38
|
}
|
43
39
|
var __assign = function () {
|
44
40
|
__assign = Object.assign || function __assign(t) {
|
45
41
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
46
42
|
s = arguments[i];
|
47
|
-
|
48
43
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
49
44
|
}
|
50
|
-
|
51
45
|
return t;
|
52
46
|
};
|
53
|
-
|
54
47
|
return __assign.apply(this, arguments);
|
55
48
|
};
|
56
49
|
function __awaiter(thisArg, _arguments, P, generator) {
|
@@ -59,7 +52,6 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
59
52
|
resolve(value);
|
60
53
|
});
|
61
54
|
}
|
62
|
-
|
63
55
|
return new (P || (P = Promise))(function (resolve, reject) {
|
64
56
|
function fulfilled(value) {
|
65
57
|
try {
|
@@ -68,7 +60,6 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
68
60
|
reject(e);
|
69
61
|
}
|
70
62
|
}
|
71
|
-
|
72
63
|
function rejected(value) {
|
73
64
|
try {
|
74
65
|
step(generator["throw"](value));
|
@@ -76,28 +67,26 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
76
67
|
reject(e);
|
77
68
|
}
|
78
69
|
}
|
79
|
-
|
80
70
|
function step(result) {
|
81
71
|
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
82
72
|
}
|
83
|
-
|
84
73
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
85
74
|
});
|
86
75
|
}
|
87
76
|
function __generator(thisArg, body) {
|
88
77
|
var _ = {
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
78
|
+
label: 0,
|
79
|
+
sent: function () {
|
80
|
+
if (t[0] & 1) throw t[1];
|
81
|
+
return t[1];
|
82
|
+
},
|
83
|
+
trys: [],
|
84
|
+
ops: []
|
93
85
|
},
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
y,
|
99
|
-
t,
|
100
|
-
g;
|
86
|
+
f,
|
87
|
+
y,
|
88
|
+
t,
|
89
|
+
g;
|
101
90
|
return g = {
|
102
91
|
next: verb(0),
|
103
92
|
"throw": verb(1),
|
@@ -105,78 +94,59 @@ function __generator(thisArg, body) {
|
|
105
94
|
}, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
|
106
95
|
return this;
|
107
96
|
}), g;
|
108
|
-
|
109
97
|
function verb(n) {
|
110
98
|
return function (v) {
|
111
99
|
return step([n, v]);
|
112
100
|
};
|
113
101
|
}
|
114
|
-
|
115
102
|
function step(op) {
|
116
103
|
if (f) throw new TypeError("Generator is already executing.");
|
117
|
-
|
118
|
-
while (_) try {
|
104
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
119
105
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
120
106
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
121
|
-
|
122
107
|
switch (op[0]) {
|
123
108
|
case 0:
|
124
109
|
case 1:
|
125
110
|
t = op;
|
126
111
|
break;
|
127
|
-
|
128
112
|
case 4:
|
129
113
|
_.label++;
|
130
114
|
return {
|
131
115
|
value: op[1],
|
132
116
|
done: false
|
133
117
|
};
|
134
|
-
|
135
118
|
case 5:
|
136
119
|
_.label++;
|
137
120
|
y = op[1];
|
138
121
|
op = [0];
|
139
122
|
continue;
|
140
|
-
|
141
123
|
case 7:
|
142
124
|
op = _.ops.pop();
|
143
|
-
|
144
125
|
_.trys.pop();
|
145
|
-
|
146
126
|
continue;
|
147
|
-
|
148
127
|
default:
|
149
128
|
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
150
129
|
_ = 0;
|
151
130
|
continue;
|
152
131
|
}
|
153
|
-
|
154
132
|
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
155
133
|
_.label = op[1];
|
156
134
|
break;
|
157
135
|
}
|
158
|
-
|
159
136
|
if (op[0] === 6 && _.label < t[1]) {
|
160
137
|
_.label = t[1];
|
161
138
|
t = op;
|
162
139
|
break;
|
163
140
|
}
|
164
|
-
|
165
141
|
if (t && _.label < t[2]) {
|
166
142
|
_.label = t[2];
|
167
|
-
|
168
143
|
_.ops.push(op);
|
169
|
-
|
170
144
|
break;
|
171
145
|
}
|
172
|
-
|
173
146
|
if (t[2]) _.ops.pop();
|
174
|
-
|
175
147
|
_.trys.pop();
|
176
|
-
|
177
148
|
continue;
|
178
149
|
}
|
179
|
-
|
180
150
|
op = body.call(thisArg, _);
|
181
151
|
} catch (e) {
|
182
152
|
op = [6, e];
|
@@ -184,7 +154,6 @@ function __generator(thisArg, body) {
|
|
184
154
|
} finally {
|
185
155
|
f = t = 0;
|
186
156
|
}
|
187
|
-
|
188
157
|
if (op[0] & 5) throw op[1];
|
189
158
|
return {
|
190
159
|
value: op[0] ? op[1] : void 0,
|
@@ -621,7 +590,8 @@ var EventManager = /** @class */ (function () {
|
|
621
590
|
element: it,
|
622
591
|
event: event,
|
623
592
|
range: Range.range,
|
624
|
-
scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj)
|
593
|
+
scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj),
|
594
|
+
// ...EventManager.eventVariables
|
625
595
|
})
|
626
596
|
}));
|
627
597
|
}
|
@@ -708,7 +678,7 @@ var EventManager = /** @class */ (function () {
|
|
708
678
|
if (typeof getValue === 'function' && getValue) {
|
709
679
|
var setValue = it.value;
|
710
680
|
if (mapScript_1) {
|
711
|
-
setValue = ScriptUtils.eval("".concat(_this.
|
681
|
+
setValue = ScriptUtils.eval("".concat(_this.getBindScript(config), " return ").concat(mapScript_1), Object.assign(bindObj_1, { __render: Object.freeze(__assign({ element: it, target: bindObj_1, range: Range.range, value: setValue, scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj) }, config === null || config === void 0 ? void 0 : config.eventVariables)) }));
|
712
682
|
}
|
713
683
|
getValue(setValue);
|
714
684
|
// 여기서 value가 먼저냐 value-link가 먼저냐 선을 정해야되는거네...
|
@@ -716,36 +686,15 @@ var EventManager = /** @class */ (function () {
|
|
716
686
|
else if (getValue) {
|
717
687
|
var setValue = getValue;
|
718
688
|
if (mapScript_1) {
|
719
|
-
setValue = ScriptUtils.eval("".concat(_this.
|
689
|
+
setValue = ScriptUtils.eval("".concat(_this.getBindScript(config), " return ").concat(mapScript_1), Object.assign(bindObj_1, { __render: Object.freeze(__assign({ element: it, target: bindObj_1, range: Range.range, value: setValue, scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj) }, config === null || config === void 0 ? void 0 : config.eventVariables)) }));
|
720
690
|
}
|
721
691
|
it.value = setValue;
|
722
|
-
// this.setValue(obj, varName, setValue)
|
723
692
|
}
|
724
|
-
// } else if (getValue) { // 이구분이 있어야되나?? 없어도될것같은데..
|
725
|
-
// let setValue = getValue;
|
726
|
-
// if (inMapScript) {
|
727
|
-
// setValue = ScriptUtils.eval(`${this.bindScript} return ${inMapScript}`, Object.assign(bindObj, {__render: Object.freeze({element: it, target: bindObj, range: Range.range, value: setValue, scripts: EventManager.setBindProperty(config?.scripts, obj)})}));
|
728
|
-
// }
|
729
|
-
// this.setValue(obj, varName, setValue)
|
730
|
-
// } else {
|
731
|
-
// let setValue = it.value;
|
732
|
-
// if (mapScript) {
|
733
|
-
// setValue = ScriptUtils.eval(`${this.bindScript} return ${mapScript}`, Object.assign(bindObj, {__render: Object.freeze({element: it, target: bindObj, range: Range.range, value: setValue, scripts: EventManager.setBindProperty(config?.scripts, obj)})}));
|
734
|
-
// }
|
735
|
-
// this.setValue(obj, varName, setValue)
|
736
|
-
// }
|
737
693
|
it.addEventListener('input', function (event) {
|
738
694
|
var value = it.value;
|
739
695
|
if (mapScript_1) {
|
740
|
-
value = ScriptUtils.eval("".concat(_this.
|
741
|
-
__render: Object.freeze({
|
742
|
-
event: event,
|
743
|
-
element: it,
|
744
|
-
attribute: DomUtils.getAttributeToObject(it),
|
745
|
-
target: event.target,
|
746
|
-
range: Range.range,
|
747
|
-
scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj)
|
748
|
-
})
|
696
|
+
value = ScriptUtils.eval("".concat(_this.getBindScript(config), " return ").concat(mapScript_1), Object.assign(bindObj_1, {
|
697
|
+
__render: Object.freeze(__assign({ event: event, element: it, attribute: DomUtils.getAttributeToObject(it), target: event.target, range: Range.range, scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj) }, config === null || config === void 0 ? void 0 : config.eventVariables))
|
749
698
|
}));
|
750
699
|
}
|
751
700
|
if (typeof _this.getValue(obj, varName, bindObj_1) === 'function') {
|
@@ -764,11 +713,8 @@ var EventManager = /** @class */ (function () {
|
|
764
713
|
script = 'return ' + script;
|
765
714
|
}
|
766
715
|
if (script) {
|
767
|
-
ScriptUtils.eval("".concat(_this.
|
768
|
-
__render: Object.freeze({
|
769
|
-
element: it,
|
770
|
-
attribute: DomUtils.getAttributeToObject(it)
|
771
|
-
})
|
716
|
+
ScriptUtils.eval("".concat(_this.getBindScript(config), "; ").concat(script, " "), Object.assign(obj, {
|
717
|
+
__render: Object.freeze(__assign({ element: it, attribute: DomUtils.getAttributeToObject(it) }, config === null || config === void 0 ? void 0 : config.eventVariables))
|
772
718
|
}));
|
773
719
|
// console.log('onInit--->', obj, varName, it)
|
774
720
|
// if (typeof this.getValue(obj, varName) === 'function') {
|
@@ -803,14 +749,14 @@ var EventManager = /** @class */ (function () {
|
|
803
749
|
if (typeof getValue === 'function' && getValue) {
|
804
750
|
var setValue = it.value;
|
805
751
|
if (mapScript) {
|
806
|
-
setValue = ScriptUtils.eval("".concat(_this.
|
752
|
+
setValue = ScriptUtils.eval("".concat(_this.getBindScript(config), " return ").concat(mapScript), Object.assign(bindObj, { __render: Object.freeze(__assign({ element: it, target: bindObj, range: Range.range, value: setValue, scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj) }, config === null || config === void 0 ? void 0 : config.eventVariables)) }));
|
807
753
|
}
|
808
754
|
getValue(setValue);
|
809
755
|
}
|
810
756
|
else { // if (getValue !== undefined && getValue !== null)
|
811
757
|
var setValue = getValue;
|
812
758
|
if (mapScript) {
|
813
|
-
setValue = ScriptUtils.eval("".concat(_this.
|
759
|
+
setValue = ScriptUtils.eval("".concat(_this.getBindScript(config), " return ").concat(mapScript), Object.assign(bindObj, { __render: Object.freeze(__assign({ element: it, target: bindObj, range: Range.range, value: setValue, scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj) }, config === null || config === void 0 ? void 0 : config.eventVariables)) }));
|
814
760
|
}
|
815
761
|
it.value = setValue;
|
816
762
|
}
|
@@ -961,21 +907,13 @@ var EventManager = /** @class */ (function () {
|
|
961
907
|
var filter = true;
|
962
908
|
var filterScript = it.getAttribute("".concat(attr, ":filter"));
|
963
909
|
var thisTarget = Object.assign(obj, {
|
964
|
-
__render: Object.freeze({
|
965
|
-
event: event,
|
966
|
-
element: it,
|
967
|
-
target: event.target,
|
968
|
-
range: Range.range,
|
969
|
-
attribute: DomUtils.getAttributeToObject(it),
|
970
|
-
router: config === null || config === void 0 ? void 0 : config.router,
|
971
|
-
scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj)
|
972
|
-
})
|
910
|
+
__render: Object.freeze(__assign({ event: event, element: it, target: event.target, range: Range.range, attribute: DomUtils.getAttributeToObject(it), router: config === null || config === void 0 ? void 0 : config.router, scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj) }, config === null || config === void 0 ? void 0 : config.eventVariables))
|
973
911
|
});
|
974
912
|
if (filterScript) {
|
975
|
-
filter = ScriptUtils.eval("".concat(_this.
|
913
|
+
filter = ScriptUtils.eval("".concat(_this.getBindScript(config), " return ").concat(filterScript), thisTarget);
|
976
914
|
}
|
977
915
|
if (filter) {
|
978
|
-
ScriptUtils.eval("".concat(_this.
|
916
|
+
ScriptUtils.eval("".concat(_this.getBindScript(config), " ").concat(script, " "), thisTarget);
|
979
917
|
}
|
980
918
|
});
|
981
919
|
});
|
@@ -998,16 +936,8 @@ var EventManager = /** @class */ (function () {
|
|
998
936
|
});
|
999
937
|
bind.split(',').forEach(function (eventName) {
|
1000
938
|
it.addEventListener(eventName.trim(), function (event) {
|
1001
|
-
ScriptUtils.eval("const $params = this.__render.params; ".concat(_this.
|
1002
|
-
__render: Object.freeze({
|
1003
|
-
event: event,
|
1004
|
-
element: it,
|
1005
|
-
attribute: DomUtils.getAttributeToObject(it),
|
1006
|
-
target: event.target,
|
1007
|
-
range: Range.range,
|
1008
|
-
scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj),
|
1009
|
-
params: params_1
|
1010
|
-
})
|
939
|
+
ScriptUtils.eval("const $params = this.__render.params; ".concat(_this.getBindScript(config), " ").concat(script_1, " "), Object.assign(obj, {
|
940
|
+
__render: Object.freeze(__assign({ event: event, element: it, attribute: DomUtils.getAttributeToObject(it), target: event.target, range: Range.range, scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj), params: params_1 }, config === null || config === void 0 ? void 0 : config.eventVariables))
|
1011
941
|
}));
|
1012
942
|
});
|
1013
943
|
});
|
@@ -1084,6 +1014,22 @@ var EventManager = /** @class */ (function () {
|
|
1084
1014
|
return newScripts;
|
1085
1015
|
}
|
1086
1016
|
};
|
1017
|
+
EventManager.prototype.getBindScript = function (config) {
|
1018
|
+
var _this = this;
|
1019
|
+
if (config === null || config === void 0 ? void 0 : config.eventVariables) {
|
1020
|
+
var bindScript = Object.entries(config.eventVariables).filter(function (_a) {
|
1021
|
+
var key = _a[0]; _a[1];
|
1022
|
+
return !_this.bindScript.includes("const ".concat(key));
|
1023
|
+
}).map(function (_a) {
|
1024
|
+
var key = _a[0]; _a[1];
|
1025
|
+
return "const ".concat(key, " = this.__render.").concat(key, ";");
|
1026
|
+
}).join(';');
|
1027
|
+
return this.bindScript + '' + bindScript;
|
1028
|
+
}
|
1029
|
+
else {
|
1030
|
+
return this.bindScript;
|
1031
|
+
}
|
1032
|
+
};
|
1087
1033
|
EventManager.ownerVariablePathAttrName = 'dr-owner-variable-path';
|
1088
1034
|
EventManager.attrPrefix = 'dr-';
|
1089
1035
|
EventManager.onInitAttrName = EventManager.attrPrefix + 'on-init';
|
@@ -1163,10 +1109,8 @@ var OperatorExecuter = /** @class */ (function () {
|
|
1163
1109
|
var DrPre = /** @class */ (function (_super) {
|
1164
1110
|
__extends(DrPre, _super);
|
1165
1111
|
function DrPre(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
1166
|
-
var _this = this;
|
1167
1112
|
source.operatorAround = undefined;
|
1168
|
-
|
1169
|
-
return _this;
|
1113
|
+
return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack) || this;
|
1170
1114
|
}
|
1171
1115
|
DrPre.prototype.execute = function (value) {
|
1172
1116
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -1236,10 +1180,8 @@ var Dr = /** @class */ (function (_super) {
|
|
1236
1180
|
var DrIf = /** @class */ (function (_super) {
|
1237
1181
|
__extends(DrIf, _super);
|
1238
1182
|
function DrIf(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
1239
|
-
var _this = this;
|
1240
1183
|
source.operatorAround = undefined;
|
1241
|
-
|
1242
|
-
return _this;
|
1184
|
+
return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
|
1243
1185
|
}
|
1244
1186
|
DrIf.prototype.executeAttrRequire = function (attr) {
|
1245
1187
|
var _a, _b, _c, _d;
|
@@ -1785,10 +1727,8 @@ var DrInnerHTML = /** @class */ (function (_super) {
|
|
1785
1727
|
var DrFor = /** @class */ (function (_super) {
|
1786
1728
|
__extends(DrFor, _super);
|
1787
1729
|
function DrFor(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
1788
|
-
var _this = this;
|
1789
1730
|
source.operatorAround = undefined;
|
1790
|
-
|
1791
|
-
return _this;
|
1731
|
+
return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
|
1792
1732
|
}
|
1793
1733
|
DrFor.prototype.executeAttrRequire = function (attr) {
|
1794
1734
|
var _a, _b, _c, _d;
|
@@ -1820,10 +1760,8 @@ var DrFor = /** @class */ (function (_super) {
|
|
1820
1760
|
var DrForOf = /** @class */ (function (_super) {
|
1821
1761
|
__extends(DrForOf, _super);
|
1822
1762
|
function DrForOf(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
1823
|
-
var _this = this;
|
1824
1763
|
source.operatorAround = undefined;
|
1825
|
-
|
1826
|
-
return _this;
|
1764
|
+
return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
|
1827
1765
|
}
|
1828
1766
|
DrForOf.prototype.executeAttrRequire = function (attr) {
|
1829
1767
|
var _a, _b, _c, _d;
|
@@ -1858,10 +1796,8 @@ var DrForOf = /** @class */ (function (_super) {
|
|
1858
1796
|
var DrAppender = /** @class */ (function (_super) {
|
1859
1797
|
__extends(DrAppender, _super);
|
1860
1798
|
function DrAppender(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
1861
|
-
var _this = this;
|
1862
1799
|
source.operatorAround = undefined;
|
1863
|
-
|
1864
|
-
return _this;
|
1800
|
+
return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
|
1865
1801
|
}
|
1866
1802
|
DrAppender.prototype.executeAttrRequire = function (attr) {
|
1867
1803
|
var _a, _b, _c, _d;
|
@@ -1896,10 +1832,8 @@ var DrAppender = /** @class */ (function (_super) {
|
|
1896
1832
|
var DrRepeat = /** @class */ (function (_super) {
|
1897
1833
|
__extends(DrRepeat, _super);
|
1898
1834
|
function DrRepeat(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
1899
|
-
var _this = this;
|
1900
1835
|
source.operatorAround = undefined;
|
1901
|
-
|
1902
|
-
return _this;
|
1836
|
+
return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
|
1903
1837
|
}
|
1904
1838
|
DrRepeat.prototype.executeAttrRequire = function (attr) {
|
1905
1839
|
var _a, _b, _c, _d;
|
@@ -1931,10 +1865,8 @@ var DrRepeat = /** @class */ (function (_super) {
|
|
1931
1865
|
var DrTargetElement = /** @class */ (function (_super) {
|
1932
1866
|
__extends(DrTargetElement, _super);
|
1933
1867
|
function DrTargetElement(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
1934
|
-
var _this = this;
|
1935
1868
|
source.operatorAround = undefined;
|
1936
|
-
|
1937
|
-
return _this;
|
1869
|
+
return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
|
1938
1870
|
}
|
1939
1871
|
DrTargetElement.prototype.execute = function () {
|
1940
1872
|
var _a, _b, _c, _d;
|
@@ -1988,10 +1920,8 @@ var DrTargetElement = /** @class */ (function (_super) {
|
|
1988
1920
|
var DrTargetAttr = /** @class */ (function (_super) {
|
1989
1921
|
__extends(DrTargetAttr, _super);
|
1990
1922
|
function DrTargetAttr(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
1991
|
-
var _this = this;
|
1992
1923
|
source.operatorAround = undefined;
|
1993
|
-
|
1994
|
-
return _this;
|
1924
|
+
return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
|
1995
1925
|
}
|
1996
1926
|
DrTargetAttr.prototype.execute = function () {
|
1997
1927
|
var _a, _b, _c, _d;
|
@@ -3035,9 +2965,9 @@ var DomRenderProxy = /** @class */ (function () {
|
|
3035
2965
|
};
|
3036
2966
|
DomRenderProxy.prototype.run = function (objProxy) {
|
3037
2967
|
var _this = this;
|
3038
|
-
var _a
|
2968
|
+
var _a;
|
3039
2969
|
this._domRender_proxy = objProxy;
|
3040
|
-
(
|
2970
|
+
(_a = objProxy === null || objProxy === void 0 ? void 0 : objProxy.onProxyDomRender) === null || _a === void 0 ? void 0 : _a.call(objProxy, this.config);
|
3041
2971
|
var obj = objProxy._DomRender_origin;
|
3042
2972
|
if (obj) {
|
3043
2973
|
Object.keys(obj).forEach(function (it) {
|
@@ -3063,7 +2993,7 @@ var DomRenderProxy = /** @class */ (function () {
|
|
3063
2993
|
};
|
3064
2994
|
DomRenderProxy.prototype.initRender = function (target) {
|
3065
2995
|
var _this = this;
|
3066
|
-
var _a, _b, _c, _d, _f, _g, _h, _j;
|
2996
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
3067
2997
|
var onCreate = (_b = (_a = target).getAttribute) === null || _b === void 0 ? void 0 : _b.call(_a, RawSet.DR_ON_CREATE_ARGUMENTS_OPTIONNAME);
|
3068
2998
|
var createParam = [];
|
3069
2999
|
if (onCreate) {
|
@@ -3073,6 +3003,7 @@ var DomRenderProxy = /** @class */ (function () {
|
|
3073
3003
|
}
|
3074
3004
|
}
|
3075
3005
|
(_d = (_c = this._domRender_proxy) === null || _c === void 0 ? void 0 : _c.onCreateRender) === null || _d === void 0 ? void 0 : _d.call.apply(_d, __spreadArray([_c], createParam, false));
|
3006
|
+
(_e = target.innerHTML) !== null && _e !== void 0 ? _e : '';
|
3076
3007
|
this._targets.add(target);
|
3077
3008
|
var rawSets = RawSet.checkPointCreates(target, this._domRender_proxy, this.config);
|
3078
3009
|
// console.log('initRender -------rawSet', rawSets)
|
@@ -3256,7 +3187,7 @@ var DomRenderProxy = /** @class */ (function () {
|
|
3256
3187
|
return fullPaths;
|
3257
3188
|
};
|
3258
3189
|
DomRenderProxy.prototype.set = function (target, p, value, receiver) {
|
3259
|
-
var _a, _b
|
3190
|
+
var _a, _b;
|
3260
3191
|
if (typeof p === 'string' && p !== '__domrender_components' && excludeGetSetPropertys.includes(p)) {
|
3261
3192
|
target[p] = value;
|
3262
3193
|
return true;
|
@@ -3277,12 +3208,12 @@ var DomRenderProxy = /** @class */ (function () {
|
|
3277
3208
|
}
|
3278
3209
|
// console.log('full path:', fullPath);
|
3279
3210
|
if (('onBeforeReturnSet' in receiver) && typeof p === 'string' && !((_a = this.config.proxyExcludeOnBeforeReturnSets) !== null && _a !== void 0 ? _a : []).concat(excludeGetSetPropertys).includes(p)) {
|
3280
|
-
(
|
3211
|
+
(_b = receiver === null || receiver === void 0 ? void 0 : receiver.onBeforeReturnSet) === null || _b === void 0 ? void 0 : _b.call(receiver, p, value, fullPath);
|
3281
3212
|
}
|
3282
3213
|
return true;
|
3283
3214
|
};
|
3284
3215
|
DomRenderProxy.prototype.get = function (target, p, receiver) {
|
3285
|
-
var _a, _b
|
3216
|
+
var _a, _b;
|
3286
3217
|
// console.log('get-->', target, p, receiver);
|
3287
3218
|
if (p === '_DomRender_origin') {
|
3288
3219
|
return this._domRender_origin;
|
@@ -3313,7 +3244,7 @@ var DomRenderProxy = /** @class */ (function () {
|
|
3313
3244
|
it_2 = it_2._DomRender_origin;
|
3314
3245
|
}
|
3315
3246
|
if (('onBeforeReturnGet' in receiver) && typeof p === 'string' && !((_a = this.config.proxyExcludeOnBeforeReturnGets) !== null && _a !== void 0 ? _a : []).concat(excludeGetSetPropertys).includes(p)) {
|
3316
|
-
(
|
3247
|
+
(_b = receiver === null || receiver === void 0 ? void 0 : receiver.onBeforeReturnGet) === null || _b === void 0 ? void 0 : _b.call(receiver, p, it_2, this.root([p], it_2, false));
|
3317
3248
|
}
|
3318
3249
|
return it_2;
|
3319
3250
|
}
|
@@ -3967,19 +3898,6 @@ var Appender = /** @class */ (function () {
|
|
3967
3898
|
return Appender;
|
3968
3899
|
}());
|
3969
3900
|
|
3970
|
-
var AllCheckedValidatorArray = /** @class */ (function (_super) {
|
3971
|
-
__extends(AllCheckedValidatorArray, _super);
|
3972
|
-
function AllCheckedValidatorArray(value, target, event, autoValid) {
|
3973
|
-
if (autoValid === void 0) { autoValid = true; }
|
3974
|
-
return _super.call(this, value, target, event, autoValid) || this;
|
3975
|
-
}
|
3976
|
-
AllCheckedValidatorArray.prototype.valid = function () {
|
3977
|
-
var _a;
|
3978
|
-
return !(((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length > 0);
|
3979
|
-
};
|
3980
|
-
return AllCheckedValidatorArray;
|
3981
|
-
}(ValidatorArray));
|
3982
|
-
|
3983
3901
|
var AllUnCheckedValidatorArray = /** @class */ (function (_super) {
|
3984
3902
|
__extends(AllUnCheckedValidatorArray, _super);
|
3985
3903
|
function AllUnCheckedValidatorArray(value, target, event, autoValid) {
|
@@ -4021,19 +3939,17 @@ var CountEqualsCheckedValidatorArray = /** @class */ (function (_super) {
|
|
4021
3939
|
return CountEqualsCheckedValidatorArray;
|
4022
3940
|
}(ValidatorArray));
|
4023
3941
|
|
4024
|
-
var
|
4025
|
-
__extends(
|
4026
|
-
function
|
3942
|
+
var AllCheckedValidatorArray = /** @class */ (function (_super) {
|
3943
|
+
__extends(AllCheckedValidatorArray, _super);
|
3944
|
+
function AllCheckedValidatorArray(value, target, event, autoValid) {
|
4027
3945
|
if (autoValid === void 0) { autoValid = true; }
|
4028
|
-
|
4029
|
-
_this.count = count;
|
4030
|
-
return _this;
|
3946
|
+
return _super.call(this, value, target, event, autoValid) || this;
|
4031
3947
|
}
|
4032
|
-
|
3948
|
+
AllCheckedValidatorArray.prototype.valid = function () {
|
4033
3949
|
var _a;
|
4034
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length >
|
3950
|
+
return !(((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length > 0);
|
4035
3951
|
};
|
4036
|
-
return
|
3952
|
+
return AllCheckedValidatorArray;
|
4037
3953
|
}(ValidatorArray));
|
4038
3954
|
|
4039
3955
|
var CountEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
|
@@ -4081,49 +3997,64 @@ var CountGreaterThanEqualsUnCheckedValidatorArray = /** @class */ (function (_su
|
|
4081
3997
|
return CountGreaterThanEqualsUnCheckedValidatorArray;
|
4082
3998
|
}(ValidatorArray));
|
4083
3999
|
|
4084
|
-
var
|
4085
|
-
__extends(
|
4086
|
-
function
|
4000
|
+
var CountGreaterThanUnCheckedValidatorArray = /** @class */ (function (_super) {
|
4001
|
+
__extends(CountGreaterThanUnCheckedValidatorArray, _super);
|
4002
|
+
function CountGreaterThanUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
4087
4003
|
if (autoValid === void 0) { autoValid = true; }
|
4088
4004
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4089
4005
|
_this.count = count;
|
4090
4006
|
return _this;
|
4091
4007
|
}
|
4092
|
-
|
4008
|
+
CountGreaterThanUnCheckedValidatorArray.prototype.valid = function () {
|
4093
4009
|
var _a;
|
4094
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length
|
4010
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length > this.count;
|
4095
4011
|
};
|
4096
|
-
return
|
4012
|
+
return CountGreaterThanUnCheckedValidatorArray;
|
4097
4013
|
}(ValidatorArray));
|
4098
4014
|
|
4099
|
-
var
|
4100
|
-
__extends(
|
4101
|
-
function
|
4015
|
+
var CountGreaterThanCheckedValidatorArray = /** @class */ (function (_super) {
|
4016
|
+
__extends(CountGreaterThanCheckedValidatorArray, _super);
|
4017
|
+
function CountGreaterThanCheckedValidatorArray(count, value, target, event, autoValid) {
|
4102
4018
|
if (autoValid === void 0) { autoValid = true; }
|
4103
4019
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4104
4020
|
_this.count = count;
|
4105
4021
|
return _this;
|
4106
4022
|
}
|
4107
|
-
|
4023
|
+
CountGreaterThanCheckedValidatorArray.prototype.valid = function () {
|
4108
4024
|
var _a;
|
4109
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return
|
4025
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length > this.count;
|
4110
4026
|
};
|
4111
|
-
return
|
4027
|
+
return CountGreaterThanCheckedValidatorArray;
|
4112
4028
|
}(ValidatorArray));
|
4113
4029
|
|
4114
|
-
var
|
4115
|
-
__extends(
|
4116
|
-
function
|
4030
|
+
var CountLessThanCheckedValidatorArray = /** @class */ (function (_super) {
|
4031
|
+
__extends(CountLessThanCheckedValidatorArray, _super);
|
4032
|
+
function CountLessThanCheckedValidatorArray(count, value, target, event, autoValid) {
|
4117
4033
|
if (autoValid === void 0) { autoValid = true; }
|
4118
4034
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4119
4035
|
_this.count = count;
|
4120
4036
|
return _this;
|
4121
4037
|
}
|
4122
|
-
|
4038
|
+
CountLessThanCheckedValidatorArray.prototype.valid = function () {
|
4123
4039
|
var _a;
|
4124
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length
|
4040
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length < this.count;
|
4125
4041
|
};
|
4126
|
-
return
|
4042
|
+
return CountLessThanCheckedValidatorArray;
|
4043
|
+
}(ValidatorArray));
|
4044
|
+
|
4045
|
+
var CountLessThanUnCheckedValidatorArray = /** @class */ (function (_super) {
|
4046
|
+
__extends(CountLessThanUnCheckedValidatorArray, _super);
|
4047
|
+
function CountLessThanUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
4048
|
+
if (autoValid === void 0) { autoValid = true; }
|
4049
|
+
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4050
|
+
_this.count = count;
|
4051
|
+
return _this;
|
4052
|
+
}
|
4053
|
+
CountLessThanUnCheckedValidatorArray.prototype.valid = function () {
|
4054
|
+
var _a;
|
4055
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length < this.count;
|
4056
|
+
};
|
4057
|
+
return CountLessThanUnCheckedValidatorArray;
|
4127
4058
|
}(ValidatorArray));
|
4128
4059
|
|
4129
4060
|
var CountLessThanEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
|
@@ -4141,53 +4072,21 @@ var CountLessThanEqualsUnCheckedValidatorArray = /** @class */ (function (_super
|
|
4141
4072
|
return CountLessThanEqualsUnCheckedValidatorArray;
|
4142
4073
|
}(ValidatorArray));
|
4143
4074
|
|
4144
|
-
var
|
4145
|
-
__extends(
|
4146
|
-
function
|
4075
|
+
var CountLessThanEqualsCheckedValidatorArray = /** @class */ (function (_super) {
|
4076
|
+
__extends(CountLessThanEqualsCheckedValidatorArray, _super);
|
4077
|
+
function CountLessThanEqualsCheckedValidatorArray(count, value, target, event, autoValid) {
|
4147
4078
|
if (autoValid === void 0) { autoValid = true; }
|
4148
4079
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4149
4080
|
_this.count = count;
|
4150
4081
|
return _this;
|
4151
4082
|
}
|
4152
|
-
|
4083
|
+
CountLessThanEqualsCheckedValidatorArray.prototype.valid = function () {
|
4153
4084
|
var _a;
|
4154
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return
|
4085
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length <= this.count;
|
4155
4086
|
};
|
4156
|
-
return
|
4087
|
+
return CountLessThanEqualsCheckedValidatorArray;
|
4157
4088
|
}(ValidatorArray));
|
4158
4089
|
|
4159
|
-
var EmptyValidator = /** @class */ (function (_super) {
|
4160
|
-
__extends(EmptyValidator, _super);
|
4161
|
-
function EmptyValidator(value, target, event, autoValid) {
|
4162
|
-
if (autoValid === void 0) { autoValid = true; }
|
4163
|
-
return _super.call(this, value, target, event, autoValid) || this;
|
4164
|
-
}
|
4165
|
-
EmptyValidator.prototype.valid = function () {
|
4166
|
-
var _a, _b;
|
4167
|
-
var value = this.value;
|
4168
|
-
return value === undefined || value === null || ((_b = (_a = value) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) <= 0;
|
4169
|
-
};
|
4170
|
-
return EmptyValidator;
|
4171
|
-
}(Validator));
|
4172
|
-
|
4173
|
-
var FormValidator = /** @class */ (function (_super) {
|
4174
|
-
__extends(FormValidator, _super);
|
4175
|
-
function FormValidator(target, event, autoValid) {
|
4176
|
-
if (autoValid === void 0) { autoValid = true; }
|
4177
|
-
return _super.call(this, undefined, target, event, autoValid) || this;
|
4178
|
-
}
|
4179
|
-
FormValidator.prototype.validAction = function () {
|
4180
|
-
return _super.prototype.childValidAction.call(this);
|
4181
|
-
};
|
4182
|
-
FormValidator.prototype.valid = function () {
|
4183
|
-
return this.childValid();
|
4184
|
-
};
|
4185
|
-
FormValidator.prototype.reset = function () {
|
4186
|
-
this.targetReset();
|
4187
|
-
};
|
4188
|
-
return FormValidator;
|
4189
|
-
}(Validator));
|
4190
|
-
|
4191
4090
|
var ExcludeCheckedValidatorArray = /** @class */ (function (_super) {
|
4192
4091
|
__extends(ExcludeCheckedValidatorArray, _super);
|
4193
4092
|
function ExcludeCheckedValidatorArray(include, allRequired, value, target, event, autoValid) {
|
@@ -4210,49 +4109,49 @@ var ExcludeCheckedValidatorArray = /** @class */ (function (_super) {
|
|
4210
4109
|
return ExcludeCheckedValidatorArray;
|
4211
4110
|
}(ValidatorArray));
|
4212
4111
|
|
4213
|
-
var
|
4214
|
-
__extends(
|
4215
|
-
function
|
4112
|
+
var NotEmptyValidator = /** @class */ (function (_super) {
|
4113
|
+
__extends(NotEmptyValidator, _super);
|
4114
|
+
function NotEmptyValidator(value, target, event, autoValid) {
|
4216
4115
|
if (autoValid === void 0) { autoValid = true; }
|
4217
|
-
|
4218
|
-
_this.count = count;
|
4219
|
-
return _this;
|
4116
|
+
return _super.call(this, value, target, event, autoValid) || this;
|
4220
4117
|
}
|
4221
|
-
|
4118
|
+
NotEmptyValidator.prototype.valid = function () {
|
4222
4119
|
var _a;
|
4223
|
-
|
4120
|
+
var value = this.value;
|
4121
|
+
// console.log('NotEmptyValidator', value, value !== undefined && value !== null && ((value as any)?.length ?? 0) > 0)
|
4122
|
+
return value !== undefined && value !== null && ((_a = value === null || value === void 0 ? void 0 : value.length) !== null && _a !== void 0 ? _a : 0) > 0;
|
4224
4123
|
};
|
4225
|
-
return
|
4226
|
-
}(
|
4124
|
+
return NotEmptyValidator;
|
4125
|
+
}(Validator));
|
4227
4126
|
|
4228
|
-
var
|
4229
|
-
__extends(
|
4230
|
-
function
|
4127
|
+
var EmptyValidator = /** @class */ (function (_super) {
|
4128
|
+
__extends(EmptyValidator, _super);
|
4129
|
+
function EmptyValidator(value, target, event, autoValid) {
|
4130
|
+
if (autoValid === void 0) { autoValid = true; }
|
4131
|
+
return _super.call(this, value, target, event, autoValid) || this;
|
4132
|
+
}
|
4133
|
+
EmptyValidator.prototype.valid = function () {
|
4134
|
+
var _a;
|
4135
|
+
var value = this.value;
|
4136
|
+
return value === undefined || value === null || ((_a = value === null || value === void 0 ? void 0 : value.length) !== null && _a !== void 0 ? _a : 0) <= 0;
|
4137
|
+
};
|
4138
|
+
return EmptyValidator;
|
4139
|
+
}(Validator));
|
4140
|
+
|
4141
|
+
var CountUnCheckedValidatorArray = /** @class */ (function (_super) {
|
4142
|
+
__extends(CountUnCheckedValidatorArray, _super);
|
4143
|
+
function CountUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
4231
4144
|
if (autoValid === void 0) { autoValid = true; }
|
4232
4145
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4233
|
-
_this.
|
4234
|
-
it.setAutoValid(false);
|
4235
|
-
it.setAutoValidAction(false);
|
4236
|
-
return it;
|
4237
|
-
});
|
4238
|
-
_this.validators.forEach(function (it) {
|
4239
|
-
it.set(_this.value, _this.getTarget(), _this.getEvent());
|
4240
|
-
});
|
4146
|
+
_this.count = count;
|
4241
4147
|
return _this;
|
4242
4148
|
}
|
4243
|
-
|
4244
|
-
var
|
4245
|
-
this.
|
4246
|
-
};
|
4247
|
-
MultipleValidator.prototype.validAction = function () {
|
4248
|
-
return !(this.validators.filter(function (it) { return !it.validAction(); }).length > 0);
|
4249
|
-
};
|
4250
|
-
MultipleValidator.prototype.valid = function () {
|
4251
|
-
// console.log('mm', this.validators)
|
4252
|
-
return !(this.validators.filter(function (it) { return !it.valid(); }).length > 0);
|
4149
|
+
CountUnCheckedValidatorArray.prototype.valid = function () {
|
4150
|
+
var _a;
|
4151
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length >= this.count;
|
4253
4152
|
};
|
4254
|
-
return
|
4255
|
-
}(
|
4153
|
+
return CountUnCheckedValidatorArray;
|
4154
|
+
}(ValidatorArray));
|
4256
4155
|
|
4257
4156
|
var IncludeCheckedValidatorArray = /** @class */ (function (_super) {
|
4258
4157
|
__extends(IncludeCheckedValidatorArray, _super);
|
@@ -4276,19 +4175,16 @@ var IncludeCheckedValidatorArray = /** @class */ (function (_super) {
|
|
4276
4175
|
return IncludeCheckedValidatorArray;
|
4277
4176
|
}(ValidatorArray));
|
4278
4177
|
|
4279
|
-
var
|
4280
|
-
__extends(
|
4281
|
-
function
|
4178
|
+
var PassValidator = /** @class */ (function (_super) {
|
4179
|
+
__extends(PassValidator, _super);
|
4180
|
+
function PassValidator(value, target, event, autoValid) {
|
4282
4181
|
if (autoValid === void 0) { autoValid = true; }
|
4283
4182
|
return _super.call(this, value, target, event, autoValid) || this;
|
4284
4183
|
}
|
4285
|
-
|
4286
|
-
|
4287
|
-
var value = this.value;
|
4288
|
-
// console.log('NotEmptyValidator', value, value !== undefined && value !== null && ((value as any)?.length ?? 0) > 0)
|
4289
|
-
return value !== undefined && value !== null && ((_b = (_a = value) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0;
|
4184
|
+
PassValidator.prototype.valid = function () {
|
4185
|
+
return true;
|
4290
4186
|
};
|
4291
|
-
return
|
4187
|
+
return PassValidator;
|
4292
4188
|
}(Validator));
|
4293
4189
|
|
4294
4190
|
var NotRegExpTestValidator = /** @class */ (function (_super) {
|
@@ -4313,18 +4209,6 @@ var NotRegExpTestValidator = /** @class */ (function (_super) {
|
|
4313
4209
|
return NotRegExpTestValidator;
|
4314
4210
|
}(Validator));
|
4315
4211
|
|
4316
|
-
var PassValidator = /** @class */ (function (_super) {
|
4317
|
-
__extends(PassValidator, _super);
|
4318
|
-
function PassValidator(value, target, event, autoValid) {
|
4319
|
-
if (autoValid === void 0) { autoValid = true; }
|
4320
|
-
return _super.call(this, value, target, event, autoValid) || this;
|
4321
|
-
}
|
4322
|
-
PassValidator.prototype.valid = function () {
|
4323
|
-
return true;
|
4324
|
-
};
|
4325
|
-
return PassValidator;
|
4326
|
-
}(Validator));
|
4327
|
-
|
4328
4212
|
var RegExpTestValidator = /** @class */ (function (_super) {
|
4329
4213
|
__extends(RegExpTestValidator, _super);
|
4330
4214
|
function RegExpTestValidator(regexp, value, target, event, autoValid) {
|
@@ -4348,34 +4232,23 @@ var RegExpTestValidator = /** @class */ (function (_super) {
|
|
4348
4232
|
return RegExpTestValidator;
|
4349
4233
|
}(Validator));
|
4350
4234
|
|
4351
|
-
var
|
4352
|
-
__extends(
|
4353
|
-
function
|
4235
|
+
var FormValidator = /** @class */ (function (_super) {
|
4236
|
+
__extends(FormValidator, _super);
|
4237
|
+
function FormValidator(target, event, autoValid) {
|
4354
4238
|
if (autoValid === void 0) { autoValid = true; }
|
4355
|
-
return _super.call(this,
|
4239
|
+
return _super.call(this, undefined, target, event, autoValid) || this;
|
4356
4240
|
}
|
4357
|
-
|
4358
|
-
|
4359
|
-
// console.log('required', value, value !== undefined && value !== null)
|
4360
|
-
return value !== undefined && value !== null;
|
4241
|
+
FormValidator.prototype.validAction = function () {
|
4242
|
+
return _super.prototype.childValidAction.call(this);
|
4361
4243
|
};
|
4362
|
-
|
4363
|
-
|
4364
|
-
|
4365
|
-
var ValidMultipleValidator = /** @class */ (function (_super) {
|
4366
|
-
__extends(ValidMultipleValidator, _super);
|
4367
|
-
function ValidMultipleValidator(validMultipleCallback, validators, value, target, event, autoValid) {
|
4368
|
-
if (autoValid === void 0) { autoValid = true; }
|
4369
|
-
var _this = _super.call(this, validators, value, target, event, autoValid) || this;
|
4370
|
-
_this.validMultipleCallback = validMultipleCallback;
|
4371
|
-
_this.validators = validators;
|
4372
|
-
return _this;
|
4373
|
-
}
|
4374
|
-
ValidMultipleValidator.prototype.valid = function () {
|
4375
|
-
return this.validMultipleCallback(this.validators, this.value, this.getTarget(), this.getEvent());
|
4244
|
+
FormValidator.prototype.valid = function () {
|
4245
|
+
return this.childValid();
|
4376
4246
|
};
|
4377
|
-
|
4378
|
-
|
4247
|
+
FormValidator.prototype.reset = function () {
|
4248
|
+
this.targetReset();
|
4249
|
+
};
|
4250
|
+
return FormValidator;
|
4251
|
+
}(Validator));
|
4379
4252
|
|
4380
4253
|
var UnCheckedValidator = /** @class */ (function (_super) {
|
4381
4254
|
__extends(UnCheckedValidator, _super);
|
@@ -4390,18 +4263,33 @@ var UnCheckedValidator = /** @class */ (function (_super) {
|
|
4390
4263
|
return UnCheckedValidator;
|
4391
4264
|
}(Validator));
|
4392
4265
|
|
4393
|
-
var
|
4394
|
-
__extends(
|
4395
|
-
function
|
4266
|
+
var MultipleValidator = /** @class */ (function (_super) {
|
4267
|
+
__extends(MultipleValidator, _super);
|
4268
|
+
function MultipleValidator(validators, value, target, event, autoValid) {
|
4396
4269
|
if (autoValid === void 0) { autoValid = true; }
|
4397
4270
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4398
|
-
_this.
|
4271
|
+
_this.validators = validators.map(function (it) {
|
4272
|
+
it.setAutoValid(false);
|
4273
|
+
it.setAutoValidAction(false);
|
4274
|
+
return it;
|
4275
|
+
});
|
4276
|
+
_this.validators.forEach(function (it) {
|
4277
|
+
it.set(_this.value, _this.getTarget(), _this.getEvent());
|
4278
|
+
});
|
4399
4279
|
return _this;
|
4400
4280
|
}
|
4401
|
-
|
4402
|
-
|
4281
|
+
MultipleValidator.prototype.changeValue = function (value) {
|
4282
|
+
var _this = this;
|
4283
|
+
this.validators.forEach(function (it) { return it.set(_this.value, _this.getTarget(), _this.getEvent()); });
|
4403
4284
|
};
|
4404
|
-
|
4285
|
+
MultipleValidator.prototype.validAction = function () {
|
4286
|
+
return !(this.validators.filter(function (it) { return !it.validAction(); }).length > 0);
|
4287
|
+
};
|
4288
|
+
MultipleValidator.prototype.valid = function () {
|
4289
|
+
// console.log('mm', this.validators)
|
4290
|
+
return !(this.validators.filter(function (it) { return !it.valid(); }).length > 0);
|
4291
|
+
};
|
4292
|
+
return MultipleValidator;
|
4405
4293
|
}(Validator));
|
4406
4294
|
|
4407
4295
|
var ValidValidatorArray = /** @class */ (function (_super) {
|
@@ -4418,6 +4306,49 @@ var ValidValidatorArray = /** @class */ (function (_super) {
|
|
4418
4306
|
return ValidValidatorArray;
|
4419
4307
|
}(ValidatorArray));
|
4420
4308
|
|
4309
|
+
var ValidValidator = /** @class */ (function (_super) {
|
4310
|
+
__extends(ValidValidator, _super);
|
4311
|
+
function ValidValidator(validCallBack, value, target, event, autoValid) {
|
4312
|
+
if (autoValid === void 0) { autoValid = true; }
|
4313
|
+
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4314
|
+
_this.validCallBack = validCallBack;
|
4315
|
+
return _this;
|
4316
|
+
}
|
4317
|
+
ValidValidator.prototype.valid = function (value, target, event) {
|
4318
|
+
return this.validCallBack(value, target, event);
|
4319
|
+
};
|
4320
|
+
return ValidValidator;
|
4321
|
+
}(Validator));
|
4322
|
+
|
4323
|
+
var RequiredValidator = /** @class */ (function (_super) {
|
4324
|
+
__extends(RequiredValidator, _super);
|
4325
|
+
function RequiredValidator(value, target, event, autoValid) {
|
4326
|
+
if (autoValid === void 0) { autoValid = true; }
|
4327
|
+
return _super.call(this, value, target, event, autoValid) || this;
|
4328
|
+
}
|
4329
|
+
RequiredValidator.prototype.valid = function () {
|
4330
|
+
var value = this.value;
|
4331
|
+
// console.log('required', value, value !== undefined && value !== null)
|
4332
|
+
return value !== undefined && value !== null;
|
4333
|
+
};
|
4334
|
+
return RequiredValidator;
|
4335
|
+
}(Validator));
|
4336
|
+
|
4337
|
+
var ValidMultipleValidator = /** @class */ (function (_super) {
|
4338
|
+
__extends(ValidMultipleValidator, _super);
|
4339
|
+
function ValidMultipleValidator(validMultipleCallback, validators, value, target, event, autoValid) {
|
4340
|
+
if (autoValid === void 0) { autoValid = true; }
|
4341
|
+
var _this = _super.call(this, validators, value, target, event, autoValid) || this;
|
4342
|
+
_this.validMultipleCallback = validMultipleCallback;
|
4343
|
+
_this.validators = validators;
|
4344
|
+
return _this;
|
4345
|
+
}
|
4346
|
+
ValidMultipleValidator.prototype.valid = function () {
|
4347
|
+
return this.validMultipleCallback(this.validators, this.value, this.getTarget(), this.getEvent());
|
4348
|
+
};
|
4349
|
+
return ValidMultipleValidator;
|
4350
|
+
}(MultipleValidator));
|
4351
|
+
|
4421
4352
|
var ValueEqualsValidator = /** @class */ (function (_super) {
|
4422
4353
|
__extends(ValueEqualsValidator, _super);
|
4423
4354
|
function ValueEqualsValidator(equalsValue, value, target, event, autoValid) {
|