dom-render 1.0.97 → 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.
- package/DomRender.d.ts +1 -1
- package/DomRender.js +3 -3
- package/DomRenderProxy.js +19 -14
- package/README.MD +39 -39
- package/components/ComponentSet.d.ts +1 -1
- package/configs/Config.d.ts +1 -1
- package/configs/TargetAttr.d.ts +1 -1
- package/configs/TargetElement.d.ts +1 -1
- package/css/stringify/compiler.d.ts +1 -1
- package/dist/bundle.js +408 -459
- package/events/EventManager.js +27 -27
- package/messenger/Messenger.d.ts +4 -4
- package/operators/Dr.js +2 -2
- package/operators/DrAppender.js +3 -5
- package/operators/DrFor.js +3 -5
- package/operators/DrForOf.js +3 -5
- package/operators/DrForm.js +12 -12
- package/operators/DrIf.js +3 -5
- package/operators/DrInnerHTML.js +2 -2
- package/operators/DrInnerText.js +2 -2
- package/operators/DrPre.js +2 -4
- package/operators/DrRepeat.js +3 -5
- package/operators/DrTargetAttr.js +2 -4
- package/operators/DrTargetElement.js +3 -5
- package/operators/DrThis.js +2 -2
- package/operators/DrThisProperty.js +4 -6
- package/operators/OperatorExecuter.d.ts +6 -6
- package/operators/OperatorExecuter.js +2 -2
- 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 +59 -58
- package/rawsets/Render.d.ts +1 -1
- package/routers/Router.d.ts +1 -1
- package/routers/Router.js +1 -1
- package/utils/dom/DomUtils.d.ts +1 -1
- package/utils/node/NodeUtils.d.ts +1 -1
- package/utils/script/ScriptUtils.js +2 -2
- 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,
|
@@ -407,7 +376,7 @@ var ScriptUtils = /** @class */ (function () {
|
|
407
376
|
}, new GetDetectProxy());
|
408
377
|
try {
|
409
378
|
// eslint-disable-next-line no-new-func,no-unused-expressions
|
410
|
-
Function("\"use strict\"; "
|
379
|
+
Function("\"use strict\"; ".concat(script, "; ")).bind(destUser)();
|
411
380
|
}
|
412
381
|
catch (e) {
|
413
382
|
console.error(e);
|
@@ -423,7 +392,7 @@ var ScriptUtils = /** @class */ (function () {
|
|
423
392
|
};
|
424
393
|
ScriptUtils.eval = function (script, thisTarget) {
|
425
394
|
// eslint-disable-next-line no-new-func,no-unused-expressions
|
426
|
-
return Function("\"use strict\"; "
|
395
|
+
return Function("\"use strict\"; ".concat(script, " ")).bind(thisTarget)();
|
427
396
|
};
|
428
397
|
ScriptUtils.loadElement = function (name, attribute, document) {
|
429
398
|
return new Promise(function (resolve, reject) {
|
@@ -633,21 +602,21 @@ var EventManager = /** @class */ (function () {
|
|
633
602
|
EventManager.onInitAttrName,
|
634
603
|
this.eventParam
|
635
604
|
];
|
636
|
-
this.bindScript = "\n const "
|
605
|
+
this.bindScript = "\n const ".concat(EventManager.VALUE_VARNAME, " = this.__render.value;\n const ").concat(EventManager.SCRIPTS_VARNAME, " = this.__render.scripts;\n const ").concat(EventManager.RANGE_VARNAME, " = this.__render.range;\n const ").concat(EventManager.ROUTER_VARNAME, " = this.__render.router;\n const ").concat(EventManager.ATTRIBUTE_VARNAME, " = this.__render.attribute;\n const ").concat(EventManager.ELEMENT_VARNAME, " = this.__render.element;\n const ").concat(EventManager.TARGET_VARNAME, " = this.__render.target;\n const ").concat(EventManager.EVENT_VARNAME, " = this.__render.event;\n ");
|
637
606
|
this.eventNames.forEach(function (it) {
|
638
607
|
_this.attrNames.push(EventManager.attrPrefix + 'event-' + it);
|
639
608
|
});
|
640
609
|
if (typeof window !== 'undefined') {
|
641
610
|
EventManager.WINDOW_EVENTS.forEach(function (eventName) {
|
642
611
|
window === null || window === void 0 ? void 0 : window.addEventListener(eventName, function (event) {
|
643
|
-
var targetAttr = "dr-window-event-"
|
644
|
-
document.querySelectorAll("["
|
612
|
+
var targetAttr = "dr-window-event-".concat(eventName);
|
613
|
+
document.querySelectorAll("[".concat(targetAttr, "]")).forEach(function (it) {
|
645
614
|
var _a;
|
646
615
|
var script = it.getAttribute(targetAttr);
|
647
616
|
if (script) {
|
648
617
|
var obj = it.obj;
|
649
618
|
var config = (_a = obj === null || obj === void 0 ? void 0 : obj._DomRender_proxy) === null || _a === void 0 ? void 0 : _a.config;
|
650
|
-
ScriptUtils.eval(_this.bindScript
|
619
|
+
ScriptUtils.eval("".concat(_this.bindScript, " ").concat(script, " "), Object.assign(obj, {
|
651
620
|
__render: Object.freeze({
|
652
621
|
target: DomRenderFinalProxy.final(event.target),
|
653
622
|
element: it,
|
@@ -675,7 +644,7 @@ var EventManager = /** @class */ (function () {
|
|
675
644
|
var elements = new Set();
|
676
645
|
var addAttributes = (_b = (_a = config === null || config === void 0 ? void 0 : config.applyEvents) === null || _a === void 0 ? void 0 : _a.map(function (it) { return it.attrName; })) !== null && _b !== void 0 ? _b : [];
|
677
646
|
addAttributes.concat(this.attrNames).forEach(function (attrName) {
|
678
|
-
fragment === null || fragment === void 0 ? void 0 : fragment.querySelectorAll("["
|
647
|
+
fragment === null || fragment === void 0 ? void 0 : fragment.querySelectorAll("[".concat(attrName, "]")).forEach(function (it) {
|
679
648
|
elements.add(it);
|
680
649
|
});
|
681
650
|
});
|
@@ -711,7 +680,7 @@ var EventManager = /** @class */ (function () {
|
|
711
680
|
this.procAttr(childNodes, EventManager.normalAttrMapAttrName, function (it, attribute) {
|
712
681
|
var map = new Map(JSON.parse(attribute));
|
713
682
|
map.forEach(function (v, k) {
|
714
|
-
var data = ScriptUtils.eval("const $element = this.element; return "
|
683
|
+
var data = ScriptUtils.eval("const $element = this.element; return ".concat(v, " "), Object.assign(obj, {
|
715
684
|
__render: Object.freeze({
|
716
685
|
element: it,
|
717
686
|
attribute: DomUtils.getAttributeToObject(it)
|
@@ -730,7 +699,7 @@ var EventManager = /** @class */ (function () {
|
|
730
699
|
this.procAttr(childNodes, EventManager.valueLinkAttrName, function (it, varName) {
|
731
700
|
if (varName) {
|
732
701
|
var ownerVariablePathName = it.getAttribute(EventManager.ownerVariablePathAttrName);
|
733
|
-
var mapScript_1 = it.getAttribute(EventManager.valueLinkAttrName
|
702
|
+
var mapScript_1 = it.getAttribute("".concat(EventManager.valueLinkAttrName, ":map"));
|
734
703
|
// const inMapScript = it.getAttribute(`${valueLinkAttrName}:in-map`);
|
735
704
|
var bindObj_1 = obj;
|
736
705
|
if (ownerVariablePathName) {
|
@@ -741,7 +710,7 @@ var EventManager = /** @class */ (function () {
|
|
741
710
|
if (typeof getValue === 'function' && getValue) {
|
742
711
|
var setValue = it.value;
|
743
712
|
if (mapScript_1) {
|
744
|
-
setValue = ScriptUtils.eval(_this.getBindScript(config)
|
713
|
+
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)) }));
|
745
714
|
}
|
746
715
|
getValue(setValue);
|
747
716
|
// 여기서 value가 먼저냐 value-link가 먼저냐 선을 정해야되는거네...
|
@@ -749,14 +718,14 @@ var EventManager = /** @class */ (function () {
|
|
749
718
|
else if (getValue) {
|
750
719
|
var setValue = getValue;
|
751
720
|
if (mapScript_1) {
|
752
|
-
setValue = ScriptUtils.eval(_this.getBindScript(config)
|
721
|
+
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)) }));
|
753
722
|
}
|
754
723
|
it.value = setValue;
|
755
724
|
}
|
756
725
|
it.addEventListener('input', function (event) {
|
757
726
|
var value = it.value;
|
758
727
|
if (mapScript_1) {
|
759
|
-
value = ScriptUtils.eval(_this.getBindScript(config)
|
728
|
+
value = ScriptUtils.eval("".concat(_this.getBindScript(config), " return ").concat(mapScript_1), Object.assign(bindObj_1, {
|
760
729
|
__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))
|
761
730
|
}));
|
762
731
|
}
|
@@ -776,7 +745,7 @@ var EventManager = /** @class */ (function () {
|
|
776
745
|
script = 'return ' + script;
|
777
746
|
}
|
778
747
|
if (script) {
|
779
|
-
ScriptUtils.eval(_this.getBindScript(config)
|
748
|
+
ScriptUtils.eval("".concat(_this.getBindScript(config), "; ").concat(script, " "), Object.assign(obj, {
|
780
749
|
__render: Object.freeze(__assign({ element: it, attribute: DomUtils.getAttributeToObject(it) }, config === null || config === void 0 ? void 0 : config.eventVariables))
|
781
750
|
}));
|
782
751
|
// console.log('onInit--->', obj, varName, it)
|
@@ -807,20 +776,20 @@ var EventManager = /** @class */ (function () {
|
|
807
776
|
if (ownerVariablePathName) {
|
808
777
|
bindObj = ScriptUtils.evalReturn(ownerVariablePathName, obj);
|
809
778
|
}
|
810
|
-
var mapScript = it.getAttribute(EventManager.valueLinkAttrName
|
779
|
+
var mapScript = it.getAttribute("".concat(EventManager.valueLinkAttrName, ":map"));
|
811
780
|
if (attribute && attribute === varName) {
|
812
781
|
var getValue = _this.getValue(obj, attribute, bindObj);
|
813
782
|
if (typeof getValue === 'function' && getValue) {
|
814
783
|
var setValue = it.value;
|
815
784
|
if (mapScript) {
|
816
|
-
setValue = ScriptUtils.eval(_this.getBindScript(config)
|
785
|
+
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)) }));
|
817
786
|
}
|
818
787
|
getValue(setValue);
|
819
788
|
}
|
820
789
|
else { // if (getValue !== undefined && getValue !== null)
|
821
790
|
var setValue = getValue;
|
822
791
|
if (mapScript) {
|
823
|
-
setValue = ScriptUtils.eval(_this.getBindScript(config)
|
792
|
+
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)) }));
|
824
793
|
}
|
825
794
|
it.value = setValue;
|
826
795
|
}
|
@@ -833,7 +802,7 @@ var EventManager = /** @class */ (function () {
|
|
833
802
|
script = 'return ' + script;
|
834
803
|
}
|
835
804
|
if (EventManager.isUsingThisVar(script, varName) || varName === undefined) {
|
836
|
-
var data = ScriptUtils.eval("const $element = this.__render.element; "
|
805
|
+
var data = ScriptUtils.eval("const $element = this.__render.element; ".concat(script, " "), Object.assign(obj, {
|
837
806
|
__render: Object.freeze({
|
838
807
|
element: it,
|
839
808
|
attribute: DomUtils.getAttributeToObject(it)
|
@@ -885,7 +854,7 @@ var EventManager = /** @class */ (function () {
|
|
885
854
|
script = 'return ' + script;
|
886
855
|
}
|
887
856
|
if (EventManager.isUsingThisVar(script, varName) || varName === undefined) {
|
888
|
-
var data = ScriptUtils.eval("const $element = this.__render.element; "
|
857
|
+
var data = ScriptUtils.eval("const $element = this.__render.element; ".concat(script, " "), Object.assign(obj, {
|
889
858
|
__render: Object.freeze({
|
890
859
|
element: it,
|
891
860
|
attribute: DomUtils.getAttributeToObject(it)
|
@@ -914,7 +883,7 @@ var EventManager = /** @class */ (function () {
|
|
914
883
|
script = 'return ' + script;
|
915
884
|
}
|
916
885
|
if (EventManager.isUsingThisVar(script, varName) || varName === undefined) {
|
917
|
-
var data = ScriptUtils.eval("const $element = this.element; "
|
886
|
+
var data = ScriptUtils.eval("const $element = this.element; ".concat(script, " "), Object.assign(obj, {
|
918
887
|
__render: Object.freeze({
|
919
888
|
element: it,
|
920
889
|
attribute: DomUtils.getAttributeToObject(it)
|
@@ -949,7 +918,7 @@ var EventManager = /** @class */ (function () {
|
|
949
918
|
var isUsing = EventManager.isUsingThisVar(v, varName);
|
950
919
|
// console.log('---isUsing--> varName:', varName, 'k:', k, 'v:', v, 'isUsing:', isUsing);
|
951
920
|
if (isUsing) {
|
952
|
-
var data = ScriptUtils.eval("const $element = this.element; return "
|
921
|
+
var data = ScriptUtils.eval("const $element = this.element; return ".concat(v, " "), Object.assign(obj, {
|
953
922
|
__render: Object.freeze({
|
954
923
|
element: it,
|
955
924
|
attribute: DomUtils.getAttributeToObject(it)
|
@@ -969,15 +938,15 @@ var EventManager = /** @class */ (function () {
|
|
969
938
|
var script = attribute;
|
970
939
|
it.addEventListener(eventName, function (event) {
|
971
940
|
var filter = true;
|
972
|
-
var filterScript = it.getAttribute(attr
|
941
|
+
var filterScript = it.getAttribute("".concat(attr, ":filter"));
|
973
942
|
var thisTarget = Object.assign(obj, {
|
974
943
|
__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))
|
975
944
|
});
|
976
945
|
if (filterScript) {
|
977
|
-
filter = ScriptUtils.eval(_this.getBindScript(config)
|
946
|
+
filter = ScriptUtils.eval("".concat(_this.getBindScript(config), " return ").concat(filterScript), thisTarget);
|
978
947
|
}
|
979
948
|
if (filter) {
|
980
|
-
ScriptUtils.eval(_this.getBindScript(config)
|
949
|
+
ScriptUtils.eval("".concat(_this.getBindScript(config), " ").concat(script, " "), thisTarget);
|
981
950
|
}
|
982
951
|
});
|
983
952
|
});
|
@@ -1000,7 +969,7 @@ var EventManager = /** @class */ (function () {
|
|
1000
969
|
});
|
1001
970
|
bind.split(',').forEach(function (eventName) {
|
1002
971
|
it.addEventListener(eventName.trim(), function (event) {
|
1003
|
-
ScriptUtils.eval("const $params = this.__render.params; "
|
972
|
+
ScriptUtils.eval("const $params = this.__render.params; ".concat(_this.getBindScript(config), " ").concat(script_1, " "), Object.assign(obj, {
|
1004
973
|
__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))
|
1005
974
|
}));
|
1006
975
|
});
|
@@ -1021,7 +990,7 @@ var EventManager = /** @class */ (function () {
|
|
1021
990
|
if (it.nodeType === 1) {
|
1022
991
|
var e = it;
|
1023
992
|
sets.add(e);
|
1024
|
-
e.querySelectorAll("["
|
993
|
+
e.querySelectorAll("[".concat(attrName, "]")).forEach(function (it) {
|
1025
994
|
sets.add(it);
|
1026
995
|
});
|
1027
996
|
}
|
@@ -1044,7 +1013,7 @@ var EventManager = /** @class */ (function () {
|
|
1044
1013
|
};
|
1045
1014
|
EventManager.prototype.setValue = function (obj, name, value) {
|
1046
1015
|
name = name.replaceAll('this.', 'this.this.');
|
1047
|
-
ScriptUtils.eval(name
|
1016
|
+
ScriptUtils.eval("".concat(name, " = this.value;"), {
|
1048
1017
|
this: obj,
|
1049
1018
|
value: value
|
1050
1019
|
});
|
@@ -1058,7 +1027,7 @@ var EventManager = /** @class */ (function () {
|
|
1058
1027
|
}
|
1059
1028
|
EventManager.VARNAMES.forEach(function (it) {
|
1060
1029
|
// raws = raws!.replace(RegExp(it.replace('$', '\\$'), 'g'), `this?.___${it}`);
|
1061
|
-
raws = raws.replace(RegExp(it.replace('$', '\\$'), 'g'), "this.___"
|
1030
|
+
raws = raws.replace(RegExp(it.replace('$', '\\$'), 'g'), "this.___".concat(it));
|
1062
1031
|
});
|
1063
1032
|
var variablePaths = ScriptUtils.getVariablePaths(raws !== null && raws !== void 0 ? raws : '');
|
1064
1033
|
return variablePaths.has(varName);
|
@@ -1083,10 +1052,10 @@ var EventManager = /** @class */ (function () {
|
|
1083
1052
|
if (config === null || config === void 0 ? void 0 : config.eventVariables) {
|
1084
1053
|
var bindScript = Object.entries(config.eventVariables).filter(function (_a) {
|
1085
1054
|
var key = _a[0]; _a[1];
|
1086
|
-
return !_this.bindScript.includes("const "
|
1055
|
+
return !_this.bindScript.includes("const ".concat(key));
|
1087
1056
|
}).map(function (_a) {
|
1088
1057
|
var key = _a[0]; _a[1];
|
1089
|
-
return "const "
|
1058
|
+
return "const ".concat(key, " = this.__render.").concat(key, ";");
|
1090
1059
|
}).join(';');
|
1091
1060
|
return this.bindScript + '' + bindScript;
|
1092
1061
|
}
|
@@ -1153,7 +1122,7 @@ var OperatorExecuter = /** @class */ (function () {
|
|
1153
1122
|
}
|
1154
1123
|
r = attrValue;
|
1155
1124
|
if (r && this.startingExecute) {
|
1156
|
-
r = ScriptUtils.eval(" "
|
1125
|
+
r = ScriptUtils.eval(" ".concat(this.render.bindScript, "; return ").concat(attrValue), Object.assign(this.source.obj, { __render: this.render }));
|
1157
1126
|
}
|
1158
1127
|
if ((_c = this.source.operatorAround) === null || _c === void 0 ? void 0 : _c.before) {
|
1159
1128
|
r = (_d = this.source.operatorAround) === null || _d === void 0 ? void 0 : _d.before(r, this);
|
@@ -1173,10 +1142,8 @@ var OperatorExecuter = /** @class */ (function () {
|
|
1173
1142
|
var DrPre = /** @class */ (function (_super) {
|
1174
1143
|
__extends(DrPre, _super);
|
1175
1144
|
function DrPre(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
1176
|
-
var _this = this;
|
1177
1145
|
source.operatorAround = undefined;
|
1178
|
-
|
1179
|
-
return _this;
|
1146
|
+
return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack) || this;
|
1180
1147
|
}
|
1181
1148
|
DrPre.prototype.execute = function (value) {
|
1182
1149
|
return __awaiter(this, void 0, void 0, function () {
|
@@ -1225,7 +1192,7 @@ var Dr = /** @class */ (function (_super) {
|
|
1225
1192
|
itRandom = RawSet.drItOtherEncoding(this.elementSource.element);
|
1226
1193
|
vars = RawSet.drVarEncoding(this.elementSource.element, (_a = this.elementSource.attrs.drVarOption) !== null && _a !== void 0 ? _a : '');
|
1227
1194
|
newTemp = this.source.config.window.document.createElement('temp');
|
1228
|
-
ScriptUtils.eval("\n "
|
1195
|
+
ScriptUtils.eval("\n ".concat(this.render.bindScript, "\n const n = $element.cloneNode(true);\n var destIt = ").concat(this.elementSource.attrs.drItOption, ";\n if (destIt !== undefined) {\n n.getAttributeNames().forEach(it => n.setAttribute(it, n.getAttribute(it).replace(/\\#it\\#/g, destIt)))\n // console.log('----', n.innerHTML);\n n.innerHTML = n.innerHTML.replace(/\\#it\\#/g, destIt);\n // console.log('----', n.innerHTML);\n }\n if (this.__render.drStripOption === 'true') {\n Array.from(n.childNodes).forEach(it => this.__fag.append(it));\n } else {\n this.__render.fag.append(n);\n }"), Object.assign(this.source.obj, {
|
1229
1196
|
__render: Object.freeze(__assign({ fag: newTemp, drStripOption: this.elementSource.attrs.drStripOption }, this.render))
|
1230
1197
|
}));
|
1231
1198
|
RawSet.drVarDecoding(newTemp, vars);
|
@@ -1246,10 +1213,8 @@ var Dr = /** @class */ (function (_super) {
|
|
1246
1213
|
var DrIf = /** @class */ (function (_super) {
|
1247
1214
|
__extends(DrIf, _super);
|
1248
1215
|
function DrIf(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
1249
|
-
var _this = this;
|
1250
1216
|
source.operatorAround = undefined;
|
1251
|
-
|
1252
|
-
return _this;
|
1217
|
+
return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
|
1253
1218
|
}
|
1254
1219
|
DrIf.prototype.executeAttrRequire = function (attr) {
|
1255
1220
|
var _a, _b, _c, _d;
|
@@ -1260,7 +1225,7 @@ var DrIf = /** @class */ (function (_super) {
|
|
1260
1225
|
itRandom = RawSet.drItOtherEncoding(this.elementSource.element);
|
1261
1226
|
vars = RawSet.drVarEncoding(this.elementSource.element, (_a = this.elementSource.attrs.drVarOption) !== null && _a !== void 0 ? _a : '');
|
1262
1227
|
newTemp = this.source.config.window.document.createElement('temp');
|
1263
|
-
keepgoing = ScriptUtils.eval("\n "
|
1228
|
+
keepgoing = ScriptUtils.eval("\n ".concat(this.render.bindScript, "\n ").concat((_b = this.elementSource.attrs.drBeforeOption) !== null && _b !== void 0 ? _b : '', "\n if ($rawset.data === (").concat(attr, ")) {\n return false;\n }\n $rawset.data = ").concat(attr, ";\n if($rawset.data) {\n const n = $element.cloneNode(true);\n Object.entries(this.__render.drAttr).filter(([k,v]) => k !== 'drIf' && v).forEach(([k, v]) => n.setAttribute(this.__render.drAttrsOriginName[k], v));\n var destIt = ").concat(this.elementSource.attrs.drItOption, ";\n if (destIt !== undefined) {\n n.getAttributeNames().forEach(it => n.setAttribute(it, n.getAttribute(it).replace(/\\#it\\#/g, destIt)))\n n.innerHTML = n.innerHTML.replace(/\\#it\\#/g, destIt);\n }\n if (this.__render.drStripOption === 'true') {\n Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));\n } else {\n this.__render.fag.append(n);\n }\n }\n ").concat((_c = this.elementSource.attrs.drAfterOption) !== null && _c !== void 0 ? _c : '', ";\n return true;\n "), Object.assign(this.source.obj, {
|
1264
1229
|
__render: Object.freeze(__assign({ fag: newTemp, drAttr: this.elementSource.attrs, drAttrsOriginName: RawSet.drAttrsOriginName, drStripOption: this.elementSource.attrs.drStripOption }, this.render))
|
1265
1230
|
}));
|
1266
1231
|
// TODO: 뭐지?? 지워야되는거 아닌가?
|
@@ -1312,7 +1277,7 @@ var DrThis = /** @class */ (function (_super) {
|
|
1312
1277
|
RawSet.destroy(this.rawSet.data.obj, [], this.source.config, destroyOptions);
|
1313
1278
|
}
|
1314
1279
|
this.rawSet.data = attr;
|
1315
|
-
return [4 /*yield*/, RawSet.drThisCreate(this.rawSet, this.elementSource.element, ""
|
1280
|
+
return [4 /*yield*/, RawSet.drThisCreate(this.rawSet, this.elementSource.element, "".concat(this.elementSource.attrs.drThis).concat(attr.config.objPath ? ('.' + attr.config.objPath) : ''), (_c = this.elementSource.attrs.drVarOption) !== null && _c !== void 0 ? _c : '', this.elementSource.attrs.drStripOption, this.source.obj, this.source.config, attr)];
|
1316
1281
|
case 1:
|
1317
1282
|
componentBody = _j.sent();
|
1318
1283
|
this.returnContainer.fag.append(componentBody);
|
@@ -1683,9 +1648,9 @@ var DrForm = /** @class */ (function (_super) {
|
|
1683
1648
|
var _this = this;
|
1684
1649
|
return __generator(this, function (_c) {
|
1685
1650
|
RawSet.drFormOtherMoveAttr(this.elementSource.element, 'name', 'temp-name', this.source.config);
|
1686
|
-
data = ScriptUtils.evalReturn(""
|
1651
|
+
data = ScriptUtils.evalReturn("".concat(attr), this.source.obj);
|
1687
1652
|
childs = Array.from(this.elementSource.element.querySelectorAll('[name]'));
|
1688
|
-
fromName = ScriptUtils.evalReturn((_a = this.elementSource.element.getAttribute(RawSet.DR_FORM_NAME
|
1653
|
+
fromName = ScriptUtils.evalReturn((_a = this.elementSource.element.getAttribute("".concat(RawSet.DR_FORM_NAME, ":name"))) !== null && _a !== void 0 ? _a : '', this.source.obj);
|
1689
1654
|
thisName = fromName !== null && fromName !== void 0 ? fromName : this.elementSource.element.getAttribute('name');
|
1690
1655
|
// // 자기자신이 Input 대상일때
|
1691
1656
|
if (childs.length <= 0 && thisName) {
|
@@ -1698,32 +1663,32 @@ var DrForm = /** @class */ (function (_super) {
|
|
1698
1663
|
}
|
1699
1664
|
childs.forEach(function (it) {
|
1700
1665
|
var _a, _b, _c, _d, _e;
|
1701
|
-
var eventName = (_a = it.getAttribute(RawSet.DR_FORM_NAME
|
1702
|
-
var validatorName = it.getAttribute(RawSet.DR_FORM_NAME
|
1666
|
+
var eventName = (_a = it.getAttribute("".concat(RawSet.DR_FORM_NAME, ":event"))) !== null && _a !== void 0 ? _a : 'change';
|
1667
|
+
var validatorName = it.getAttribute("".concat(RawSet.DR_FORM_NAME, ":validator"));
|
1703
1668
|
var attrEventName = EventManager.attrPrefix + 'event-' + eventName;
|
1704
|
-
var varpath = (_c = ScriptUtils.evalReturn((_b = _this.elementSource.element.getAttribute(RawSet.DR_FORM_NAME
|
1669
|
+
var varpath = (_c = ScriptUtils.evalReturn((_b = _this.elementSource.element.getAttribute("".concat(RawSet.DR_FORM_NAME, ":name"))) !== null && _b !== void 0 ? _b : '', _this.source.obj)) !== null && _c !== void 0 ? _c : it.getAttribute('name');
|
1705
1670
|
if (varpath != null) {
|
1706
1671
|
if (validatorName) {
|
1707
|
-
ScriptUtils.eval("\n "
|
1672
|
+
ScriptUtils.eval("\n ".concat(_this.render.bindScript, "\n const validator = typeof ").concat(validatorName, " ==='function' ? new ").concat(validatorName, "() : ").concat(validatorName, ";\n ").concat(attr, "['").concat(varpath, "'] = validator;\n "), Object.assign(_this.source.obj, {
|
1708
1673
|
__render: Object.freeze(__assign({ drStripOption: _this.elementSource.attrs.drStripOption }, _this.render))
|
1709
1674
|
}));
|
1710
1675
|
}
|
1711
|
-
varpath = attr
|
1712
|
-
var data_1 = ScriptUtils.evalReturn(""
|
1676
|
+
varpath = "".concat(attr, "['").concat(varpath, "']");
|
1677
|
+
var data_1 = ScriptUtils.evalReturn("".concat(varpath), _this.source.obj);
|
1713
1678
|
if (data_1 instanceof ValidatorArray) {
|
1714
|
-
it.setAttribute(attrEventName, varpath
|
1679
|
+
it.setAttribute(attrEventName, "".concat(varpath, ".setArrayValue($target, $target.value, $event); ").concat((_d = it.getAttribute(attrEventName)) !== null && _d !== void 0 ? _d : '', ";"));
|
1715
1680
|
data_1.addValidator(it.value, it);
|
1716
1681
|
}
|
1717
1682
|
else if (data_1 instanceof Validator) {
|
1718
1683
|
// varpath += (varpath ? '.value' : 'value');
|
1719
1684
|
// varpath = drAttr.drForm + '.' + varpath;
|
1720
1685
|
// it.setAttribute(attrEventName, `${varpath} = $target.value; ${target}=$target; ${event}=$event;`);
|
1721
|
-
it.setAttribute(attrEventName, varpath
|
1686
|
+
it.setAttribute(attrEventName, "".concat(varpath, ".set($target.value, $target, $event); ").concat((_e = it.getAttribute(attrEventName)) !== null && _e !== void 0 ? _e : '', ";"));
|
1722
1687
|
data_1.setTarget(it);
|
1723
1688
|
data_1.value = it.value;
|
1724
1689
|
}
|
1725
1690
|
else {
|
1726
|
-
it.setAttribute(attrEventName, varpath
|
1691
|
+
it.setAttribute(attrEventName, "".concat(varpath, " = $target.value;"));
|
1727
1692
|
}
|
1728
1693
|
}
|
1729
1694
|
});
|
@@ -1748,7 +1713,7 @@ var DrInnerText = /** @class */ (function (_super) {
|
|
1748
1713
|
var _d;
|
1749
1714
|
return __generator(this, function (_e) {
|
1750
1715
|
newTemp = this.source.config.window.document.createElement('temp');
|
1751
|
-
ScriptUtils.eval(" \n "
|
1716
|
+
ScriptUtils.eval(" \n ".concat(this.render.bindScript, "\n const n = $element.cloneNode(true); \n ").concat((_a = this.elementSource.attrs.drBeforeOption) !== null && _a !== void 0 ? _a : '', "\n n.innerText = ").concat(attr, ";\n if (this.__render.drStripOption === 'true') {\n Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));\n } else {\n this.__render.fag.append(n);\n }\n ").concat((_b = this.elementSource.attrs.drAfterOption) !== null && _b !== void 0 ? _b : '', "\n "), Object.assign(this.source.obj, {
|
1752
1717
|
__render: Object.freeze(__assign({ drStripOption: this.elementSource.attrs.drStripOption, fag: newTemp }, this.render))
|
1753
1718
|
}));
|
1754
1719
|
tempalte = this.source.config.window.document.createElement('template');
|
@@ -1776,7 +1741,7 @@ var DrInnerHTML = /** @class */ (function (_super) {
|
|
1776
1741
|
var _d;
|
1777
1742
|
return __generator(this, function (_e) {
|
1778
1743
|
newTemp = this.source.config.window.document.createElement('temp');
|
1779
|
-
ScriptUtils.eval("\n "
|
1744
|
+
ScriptUtils.eval("\n ".concat(this.render.bindScript, "\n const n = $element.cloneNode(true);\n ").concat((_a = this.elementSource.attrs.drBeforeOption) !== null && _a !== void 0 ? _a : '', "\n n.innerHTML = ").concat(attr, ";\n if (this.__render.drStripOption === 'true') {\n Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));\n } else {\n this.__render.fag.append(n);\n }\n ").concat((_b = this.elementSource.attrs.drAfterOption) !== null && _b !== void 0 ? _b : '', "\n "), Object.assign(this.source.obj, {
|
1780
1745
|
__render: Object.freeze(__assign({ drStripOption: this.elementSource.attrs.drStripOption, fag: newTemp }, this.render
|
1781
1746
|
// eslint-disable-next-line no-use-before-define
|
1782
1747
|
))
|
@@ -1797,10 +1762,8 @@ var DrInnerHTML = /** @class */ (function (_super) {
|
|
1797
1762
|
var DrFor = /** @class */ (function (_super) {
|
1798
1763
|
__extends(DrFor, _super);
|
1799
1764
|
function DrFor(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
1800
|
-
var _this = this;
|
1801
1765
|
source.operatorAround = undefined;
|
1802
|
-
|
1803
|
-
return _this;
|
1766
|
+
return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
|
1804
1767
|
}
|
1805
1768
|
DrFor.prototype.executeAttrRequire = function (attr) {
|
1806
1769
|
var _a, _b, _c, _d;
|
@@ -1811,7 +1774,7 @@ var DrFor = /** @class */ (function (_super) {
|
|
1811
1774
|
itRandom = RawSet.drItOtherEncoding(this.elementSource.element);
|
1812
1775
|
vars = RawSet.drVarEncoding(this.elementSource.element, (_a = this.elementSource.attrs.drVarOption) !== null && _a !== void 0 ? _a : '');
|
1813
1776
|
newTemp = this.source.config.window.document.createElement('temp');
|
1814
|
-
ScriptUtils.eval("\n "
|
1777
|
+
ScriptUtils.eval("\n ".concat(this.render.bindScript, "\n ").concat((_b = this.elementSource.attrs.drBeforeOption) !== null && _b !== void 0 ? _b : '', "\n for(").concat(attr, ") {\n const n = this.__render.element.cloneNode(true);\n var destIt = ").concat(this.elementSource.attrs.drItOption, ";\n if (destIt !== undefined) {\n n.getAttributeNames().forEach(it => n.setAttribute(it, n.getAttribute(it).replace(/\\#it\\#/g, destIt).replace(/\\#nearForIt\\#/g, destIt).replace(/\\#nearForIndex\\#/g, destIt))) \n n.innerHTML = n.innerHTML.replace(/\\#it\\#/g, destIt).replace(/\\#index\\#/g, destIt);\n }\n if (this.__render.drStripOption === 'true') {\n Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));\n } else {\n this.__render.fag.append(n);\n }\n }\n ").concat((_c = this.elementSource.attrs.drAfterOption) !== null && _c !== void 0 ? _c : '', "\n "), Object.assign(this.source.obj, {
|
1815
1778
|
__render: Object.freeze(__assign({ fag: newTemp, drStripOption: this.elementSource.attrs.drStripOption }, this.render))
|
1816
1779
|
}));
|
1817
1780
|
RawSet.drVarDecoding(newTemp, vars);
|
@@ -1832,10 +1795,8 @@ var DrFor = /** @class */ (function (_super) {
|
|
1832
1795
|
var DrForOf = /** @class */ (function (_super) {
|
1833
1796
|
__extends(DrForOf, _super);
|
1834
1797
|
function DrForOf(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
1835
|
-
var _this = this;
|
1836
1798
|
source.operatorAround = undefined;
|
1837
|
-
|
1838
|
-
return _this;
|
1799
|
+
return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
|
1839
1800
|
}
|
1840
1801
|
DrForOf.prototype.executeAttrRequire = function (attr) {
|
1841
1802
|
var _a, _b, _c, _d;
|
@@ -1846,7 +1807,7 @@ var DrForOf = /** @class */ (function (_super) {
|
|
1846
1807
|
itRandom = RawSet.drItOtherEncoding(this.elementSource.element);
|
1847
1808
|
vars = RawSet.drVarEncoding(this.elementSource.element, (_a = this.elementSource.attrs.drVarOption) !== null && _a !== void 0 ? _a : '');
|
1848
1809
|
newTemp = this.source.config.window.document.createElement('temp');
|
1849
|
-
ScriptUtils.eval("\n "
|
1810
|
+
ScriptUtils.eval("\n ".concat(this.render.bindScript, "\n ").concat((_b = this.elementSource.attrs.drBeforeOption) !== null && _b !== void 0 ? _b : '', "\n var i = 0; \n const forOf = ").concat(attr, ";\n const forOfStr = `").concat(attr, "`.trim();\n if (forOf) {\n for(const it of forOf) {\n var destIt = it;\n if (/\\[(.*,?)\\],/g.test(forOfStr)) {\n if (typeof it === 'string') {\n destIt = it;\n } else {\n destIt = forOfStr.substring(1, forOfStr.length-1).split(',')[i];\n }\n } else if (forOf.isRange) {\n destIt = it;\n } else {\n destIt = forOfStr + '[' + i +']'\n }\n const n = this.__render.element.cloneNode(true);\n Object.entries(this.__render.drAttr).filter(([k,v]) => k !== 'drForOf' && k !== 'drNextOption' && v).forEach(([k, v]) => n.setAttribute(this.__render.drAttrsOriginName[k], v));\n n.getAttributeNames().forEach(it => n.setAttribute(it, n.getAttribute(it).replace(/\\#it\\#/g, destIt).replace(/\\#nearForOfIt\\#/g, destIt).replace(/\\#it\\#/g, destIt).replace(/\\#nearForOfIndex\\#/g, i)))\n n.innerHTML = n.innerHTML.replace(/\\#it\\#/g, destIt).replace(/\\#index\\#/g, i);\n if (this.__render.drStripOption === 'true') {\n Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));\n } else {\n this.__render.fag.append(n);\n }\n i++;\n }\n \n if('").concat(this.elementSource.attrs.drNextOption, "' !== 'null') {\n const n = this.__render.element.cloneNode(true);\n Object.entries(this.__render.drAttr).filter(([k,v]) => k !== 'drForOf' && k !== 'drNextOption' && v).forEach(([k, v]) => n.setAttribute(this.__render.drAttrsOriginName[k], v));\n const [name, idx] = '").concat(this.elementSource.attrs.drNextOption, "'.split(',');\n n.setAttribute('dr-for-of', name + '[' + idx + ']');\n n.setAttribute('dr-next', name + ',' + (Number(idx) + 1));\n this.__render.fag.append(n);\n }\n }\n ").concat((_c = this.elementSource.attrs.drAfterOption) !== null && _c !== void 0 ? _c : '', "\n "), Object.assign(this.source.obj, {
|
1850
1811
|
__render: Object.freeze(__assign({ drStripOption: this.elementSource.attrs.drStripOption, drAttr: this.elementSource.attrs, drAttrsOriginName: RawSet.drAttrsOriginName, fag: newTemp }, this.render
|
1851
1812
|
// eslint-disable-next-line no-use-before-define
|
1852
1813
|
))
|
@@ -1870,10 +1831,8 @@ var DrForOf = /** @class */ (function (_super) {
|
|
1870
1831
|
var DrAppender = /** @class */ (function (_super) {
|
1871
1832
|
__extends(DrAppender, _super);
|
1872
1833
|
function DrAppender(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
1873
|
-
var _this = this;
|
1874
1834
|
source.operatorAround = undefined;
|
1875
|
-
|
1876
|
-
return _this;
|
1835
|
+
return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
|
1877
1836
|
}
|
1878
1837
|
DrAppender.prototype.executeAttrRequire = function (attr) {
|
1879
1838
|
var _a, _b, _c, _d;
|
@@ -1884,7 +1843,7 @@ var DrAppender = /** @class */ (function (_super) {
|
|
1884
1843
|
itRandom = RawSet.drItOtherEncoding(this.elementSource.element);
|
1885
1844
|
vars = RawSet.drVarEncoding(this.elementSource.element, (_a = this.elementSource.attrs.drVarOption) !== null && _a !== void 0 ? _a : '');
|
1886
1845
|
newTemp = this.source.config.window.document.createElement('temp');
|
1887
|
-
ScriptUtils.eval("\n try{\n "
|
1846
|
+
ScriptUtils.eval("\n try{\n ".concat(this.render.bindScript, "\n ").concat((_b = this.elementSource.attrs.drBeforeOption) !== null && _b !== void 0 ? _b : '', "\n const ifWrap = document.createElement('div');\n ifWrap.setAttribute('dr-strip', 'true');\n ifWrap.setAttribute('dr-if', '").concat(this.elementSource.attrs.drAppender, " && ").concat(this.elementSource.attrs.drAppender, ".length > 0');\n const n = this.__render.element.cloneNode(true);\n Object.entries(this.__render.drAttr).filter(([k,v]) => k !== 'drAppender' && v).forEach(([k, v]) => n.setAttribute(this.__render.drAttrsOriginName[k], v));\n n.setAttribute('dr-for-of', '").concat(this.elementSource.attrs.drAppender, "[' + (").concat(this.elementSource.attrs.drAppender, ".length-1) + ']');\n n.setAttribute('dr-next', '").concat(this.elementSource.attrs.drAppender, ",' + ").concat(this.elementSource.attrs.drAppender, ".length);\n ifWrap.append(n);\n this.__render.fag.append(ifWrap);\n ").concat((_c = this.elementSource.attrs.drAfterOption) !== null && _c !== void 0 ? _c : '', "\n }catch(e){}\n "), Object.assign(this.source.obj, {
|
1888
1847
|
__render: Object.freeze(__assign({ drStripOption: this.elementSource.attrs.drStripOption, drAttr: this.elementSource.attrs, drAttrsOriginName: RawSet.drAttrsOriginName, fag: newTemp }, this.render
|
1889
1848
|
// eslint-disable-next-line no-use-before-define
|
1890
1849
|
))
|
@@ -1908,10 +1867,8 @@ var DrAppender = /** @class */ (function (_super) {
|
|
1908
1867
|
var DrRepeat = /** @class */ (function (_super) {
|
1909
1868
|
__extends(DrRepeat, _super);
|
1910
1869
|
function DrRepeat(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
1911
|
-
var _this = this;
|
1912
1870
|
source.operatorAround = undefined;
|
1913
|
-
|
1914
|
-
return _this;
|
1871
|
+
return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
|
1915
1872
|
}
|
1916
1873
|
DrRepeat.prototype.executeAttrRequire = function (attr) {
|
1917
1874
|
var _a, _b, _c, _d;
|
@@ -1922,7 +1879,7 @@ var DrRepeat = /** @class */ (function (_super) {
|
|
1922
1879
|
itRandom = RawSet.drItOtherEncoding(this.elementSource.element);
|
1923
1880
|
vars = RawSet.drVarEncoding(this.elementSource.element, (_a = this.elementSource.attrs.drVarOption) !== null && _a !== void 0 ? _a : '');
|
1924
1881
|
newTemp = this.source.config.window.document.createElement('temp');
|
1925
|
-
ScriptUtils.eval("\n "
|
1882
|
+
ScriptUtils.eval("\n ".concat(this.render.bindScript, "\n ").concat((_b = this.elementSource.attrs.drBeforeOption) !== null && _b !== void 0 ? _b : '', "\n var i = 0; \n const repeat = ").concat(attr, ";\n const repeatStr = `").concat(attr, "`;\n let range = repeat;\n if (typeof repeat === 'number') {\n range = ").concat(EventManager.RANGE_VARNAME, "(repeat);\n } \n for(const it of range) {\n var destIt = it;\n if (range.isRange) {\n destIt = it;\n } else {\n destIt = repeatStr + '[' + i +']'\n }\n const n = this.__render.element.cloneNode(true);\n n.getAttributeNames().forEach(it => n.setAttribute(it, n.getAttribute(it).replace(/\\#it\\#/g, destIt).replace(/\\#nearRangeIt\\#/g, destIt).replace(/\\#nearRangeIndex\\#/g, destIt)))\n n.innerHTML = n.innerHTML.replace(/\\#it\\#/g, destIt).replace(/\\#index\\#/g, destIt);\n \n if (this.__render.drStripOption === 'true') {\n Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));\n } else {\n this.__render.fag.append(n);\n }\n i++;\n }\n ").concat((_c = this.elementSource.attrs.drAfterOption) !== null && _c !== void 0 ? _c : '', "\n "), Object.assign(this.source.obj, {
|
1926
1883
|
__render: Object.freeze(__assign({ fag: newTemp, drStripOption: this.elementSource.attrs.drStripOption }, this.render))
|
1927
1884
|
}));
|
1928
1885
|
RawSet.drVarDecoding(newTemp, vars);
|
@@ -1943,10 +1900,8 @@ var DrRepeat = /** @class */ (function (_super) {
|
|
1943
1900
|
var DrTargetElement = /** @class */ (function (_super) {
|
1944
1901
|
__extends(DrTargetElement, _super);
|
1945
1902
|
function DrTargetElement(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
1946
|
-
var _this = this;
|
1947
1903
|
source.operatorAround = undefined;
|
1948
|
-
|
1949
|
-
return _this;
|
1904
|
+
return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
|
1950
1905
|
}
|
1951
1906
|
DrTargetElement.prototype.execute = function () {
|
1952
1907
|
var _a, _b, _c, _d;
|
@@ -1970,7 +1925,7 @@ var DrTargetElement = /** @class */ (function (_super) {
|
|
1970
1925
|
if (detectAction_1 && render_1) {
|
1971
1926
|
this.rawSet.detect = {
|
1972
1927
|
action: function () {
|
1973
|
-
var script = "var $component = this.__render.component; var $element = this.__render.element; var $innerHTML = this.__render.innerHTML; var $attribute = this.__render.attribute; "
|
1928
|
+
var script = "var $component = this.__render.component; var $element = this.__render.element; var $innerHTML = this.__render.innerHTML; var $attribute = this.__render.attribute; ".concat(detectAction_1, " ");
|
1974
1929
|
ScriptUtils.eval(script, Object.assign(_this.source.obj, {
|
1975
1930
|
__render: render_1
|
1976
1931
|
}));
|
@@ -2000,10 +1955,8 @@ var DrTargetElement = /** @class */ (function (_super) {
|
|
2000
1955
|
var DrTargetAttr = /** @class */ (function (_super) {
|
2001
1956
|
__extends(DrTargetAttr, _super);
|
2002
1957
|
function DrTargetAttr(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
2003
|
-
var _this = this;
|
2004
1958
|
source.operatorAround = undefined;
|
2005
|
-
|
2006
|
-
return _this;
|
1959
|
+
return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
|
2007
1960
|
}
|
2008
1961
|
DrTargetAttr.prototype.execute = function () {
|
2009
1962
|
var _a, _b, _c, _d;
|
@@ -2057,10 +2010,8 @@ exports.RawSetType = void 0;
|
|
2057
2010
|
var DrThisProperty = /** @class */ (function (_super) {
|
2058
2011
|
__extends(DrThisProperty, _super);
|
2059
2012
|
function DrThisProperty(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
2060
|
-
var _this = this;
|
2061
2013
|
source.operatorAround = undefined;
|
2062
|
-
|
2063
|
-
return _this;
|
2014
|
+
return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
|
2064
2015
|
}
|
2065
2016
|
DrThisProperty.prototype.executeAttrRequire = function (attr) {
|
2066
2017
|
var _a, _b, _c, _d, _e;
|
@@ -2079,7 +2030,7 @@ var DrThisProperty = /** @class */ (function (_super) {
|
|
2079
2030
|
// }
|
2080
2031
|
// await new Promise(resolve => setTimeout(resolve, 1000));
|
2081
2032
|
// console.log('!!!!!!!!!!!!!!', this.rawSet);
|
2082
|
-
ScriptUtils.eval("\n "
|
2033
|
+
ScriptUtils.eval("\n ".concat(this.render.bindScript, "\n ").concat((_c = this.elementSource.attrs.drBeforeOption) !== null && _c !== void 0 ? _c : '', "\n var i = 0; \n const dictionary = ").concat(attr, ";\n const dictionaryKey = '").concat(dictionaryKey, "';\n const dictionaryStr = `").concat(attr, "`.trim();\n // console.log('----@#!@#@!#', this.__render.oldChild);\n if (dictionary) {\n for(const it in dictionary) {\n var destIt = dictionaryStr + '[\"' + it + '\"]';\n const n = this.__render.element.cloneNode(true);\n n.setAttribute('dr-this', destIt);\n n.setAttribute('dr-key', it);\n // n.setAttribute('dr-dictionary-key', it);\n this.__render.fag.append(n);\n i++;\n }\n this.__render.rawset.point.start.setAttribute('dr-has-keys',Object.keys(dictionary).join(','));\n }\n ").concat((_d = this.elementSource.attrs.drAfterOption) !== null && _d !== void 0 ? _d : '', "\n "), Object.assign(this.source.obj, {
|
2083
2034
|
__render: Object.freeze(__assign({ drStripOption: this.elementSource.attrs.drStripOption, drAttr: this.elementSource.attrs, drAttrsOriginName: RawSet.drAttrsOriginName, fag: newTemp }, this.render))
|
2084
2035
|
}));
|
2085
2036
|
RawSet.drVarDecoding(newTemp, vars);
|
@@ -2105,7 +2056,7 @@ var DrThisProperty = /** @class */ (function (_super) {
|
|
2105
2056
|
var cNode = _c[_i];
|
2106
2057
|
var element = cNode.cloneNode(true);
|
2107
2058
|
element.removeAttribute(RawSet.DR_THIS_PROPERTY_NAME);
|
2108
|
-
element.setAttribute(RawSet.DR_THIS_NAME, "this."
|
2059
|
+
element.setAttribute(RawSet.DR_THIS_NAME, "this.".concat(fullPath));
|
2109
2060
|
element.setAttribute(RawSet.DR_KEY_OPTIONNAME, key);
|
2110
2061
|
// rawSet.point.end.after(element);
|
2111
2062
|
var fg = config.window.document.createDocumentFragment();
|
@@ -2138,12 +2089,14 @@ exports.RawSetOperatorType = void 0;
|
|
2138
2089
|
var commentre = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
|
2139
2090
|
function cssParse (css, options) {
|
2140
2091
|
options = options || {};
|
2092
|
+
|
2141
2093
|
/**
|
2142
2094
|
* Positional.
|
2143
2095
|
*/
|
2144
2096
|
|
2145
2097
|
var lineno = 1;
|
2146
2098
|
var column = 1;
|
2099
|
+
|
2147
2100
|
/**
|
2148
2101
|
* Update lineno and column based on `str`.
|
2149
2102
|
*/
|
@@ -2154,11 +2107,11 @@ function cssParse (css, options) {
|
|
2154
2107
|
var i = str.lastIndexOf('\n');
|
2155
2108
|
column = ~i ? str.length - i : column + str.length;
|
2156
2109
|
}
|
2110
|
+
|
2157
2111
|
/**
|
2158
2112
|
* Mark position and patch `node.position`.
|
2159
2113
|
*/
|
2160
2114
|
|
2161
|
-
|
2162
2115
|
function position() {
|
2163
2116
|
var start = {
|
2164
2117
|
line: lineno,
|
@@ -2170,11 +2123,11 @@ function cssParse (css, options) {
|
|
2170
2123
|
return node;
|
2171
2124
|
};
|
2172
2125
|
}
|
2126
|
+
|
2173
2127
|
/**
|
2174
2128
|
* Store position information for a node
|
2175
2129
|
*/
|
2176
2130
|
|
2177
|
-
|
2178
2131
|
function Position(start) {
|
2179
2132
|
this.start = start;
|
2180
2133
|
this.end = {
|
@@ -2183,18 +2136,18 @@ function cssParse (css, options) {
|
|
2183
2136
|
};
|
2184
2137
|
this.source = options.source;
|
2185
2138
|
}
|
2139
|
+
|
2186
2140
|
/**
|
2187
2141
|
* Non-enumerable source string
|
2188
2142
|
*/
|
2189
2143
|
|
2190
|
-
|
2191
2144
|
Position.prototype.content = css;
|
2145
|
+
|
2192
2146
|
/**
|
2193
2147
|
* Error `msg`.
|
2194
2148
|
*/
|
2195
2149
|
|
2196
2150
|
var errorsList = [];
|
2197
|
-
|
2198
2151
|
function error(msg) {
|
2199
2152
|
var err = new Error(options.source + ':' + lineno + ':' + column + ': ' + msg);
|
2200
2153
|
err.reason = msg;
|
@@ -2202,18 +2155,17 @@ function cssParse (css, options) {
|
|
2202
2155
|
err.line = lineno;
|
2203
2156
|
err.column = column;
|
2204
2157
|
err.source = css;
|
2205
|
-
|
2206
2158
|
if (options.silent) {
|
2207
2159
|
errorsList.push(err);
|
2208
2160
|
} else {
|
2209
2161
|
throw err;
|
2210
2162
|
}
|
2211
2163
|
}
|
2164
|
+
|
2212
2165
|
/**
|
2213
2166
|
* Parse stylesheet.
|
2214
2167
|
*/
|
2215
2168
|
|
2216
|
-
|
2217
2169
|
function stylesheet() {
|
2218
2170
|
var rulesList = rules();
|
2219
2171
|
return {
|
@@ -2225,47 +2177,45 @@ function cssParse (css, options) {
|
|
2225
2177
|
}
|
2226
2178
|
};
|
2227
2179
|
}
|
2180
|
+
|
2228
2181
|
/**
|
2229
2182
|
* Opening brace.
|
2230
2183
|
*/
|
2231
2184
|
|
2232
|
-
|
2233
2185
|
function open() {
|
2234
2186
|
return match(/^{\s*/);
|
2235
2187
|
}
|
2188
|
+
|
2236
2189
|
/**
|
2237
2190
|
* Closing brace.
|
2238
2191
|
*/
|
2239
2192
|
|
2240
|
-
|
2241
2193
|
function close() {
|
2242
2194
|
return match(/^}/);
|
2243
2195
|
}
|
2196
|
+
|
2244
2197
|
/**
|
2245
2198
|
* Parse ruleset.
|
2246
2199
|
*/
|
2247
2200
|
|
2248
|
-
|
2249
2201
|
function rules() {
|
2250
2202
|
var node;
|
2251
2203
|
var rules = [];
|
2252
2204
|
whitespace();
|
2253
2205
|
comments(rules);
|
2254
|
-
|
2255
2206
|
while (css.length && css.charAt(0) != '}' && (node = atrule() || rule())) {
|
2256
2207
|
if (node !== false) {
|
2257
2208
|
rules.push(node);
|
2258
2209
|
comments(rules);
|
2259
2210
|
}
|
2260
2211
|
}
|
2261
|
-
|
2262
2212
|
return rules;
|
2263
2213
|
}
|
2214
|
+
|
2264
2215
|
/**
|
2265
2216
|
* Match `re` and return captures.
|
2266
2217
|
*/
|
2267
2218
|
|
2268
|
-
|
2269
2219
|
function match(re) {
|
2270
2220
|
var m = re.exec(css);
|
2271
2221
|
if (!m) return;
|
@@ -2274,49 +2224,43 @@ function cssParse (css, options) {
|
|
2274
2224
|
css = css.slice(str.length);
|
2275
2225
|
return m;
|
2276
2226
|
}
|
2227
|
+
|
2277
2228
|
/**
|
2278
2229
|
* Parse whitespace.
|
2279
2230
|
*/
|
2280
2231
|
|
2281
|
-
|
2282
2232
|
function whitespace() {
|
2283
2233
|
match(/^\s*/);
|
2284
2234
|
}
|
2235
|
+
|
2285
2236
|
/**
|
2286
2237
|
* Parse comments;
|
2287
2238
|
*/
|
2288
2239
|
|
2289
|
-
|
2290
2240
|
function comments(rules) {
|
2291
2241
|
var c;
|
2292
2242
|
rules = rules || [];
|
2293
|
-
|
2294
2243
|
while (c = comment()) {
|
2295
2244
|
if (c !== false) {
|
2296
2245
|
rules.push(c);
|
2297
2246
|
}
|
2298
2247
|
}
|
2299
|
-
|
2300
2248
|
return rules;
|
2301
2249
|
}
|
2250
|
+
|
2302
2251
|
/**
|
2303
2252
|
* Parse comment.
|
2304
2253
|
*/
|
2305
2254
|
|
2306
|
-
|
2307
2255
|
function comment() {
|
2308
2256
|
var pos = position();
|
2309
2257
|
if ('/' != css.charAt(0) || '*' != css.charAt(1)) return;
|
2310
2258
|
var i = 2;
|
2311
|
-
|
2312
2259
|
while ("" != css.charAt(i) && ('*' != css.charAt(i) || '/' != css.charAt(i + 1))) ++i;
|
2313
|
-
|
2314
2260
|
i += 2;
|
2315
|
-
|
2316
2261
|
if ("" === css.charAt(i - 1)) {
|
2317
2262
|
return error('End of comment missing');
|
2318
2263
|
}
|
2319
|
-
|
2320
2264
|
var str = css.slice(2, i - 2);
|
2321
2265
|
column += 2;
|
2322
2266
|
updatePosition(str);
|
@@ -2327,84 +2271,84 @@ function cssParse (css, options) {
|
|
2327
2271
|
comment: str
|
2328
2272
|
});
|
2329
2273
|
}
|
2274
|
+
|
2330
2275
|
/**
|
2331
2276
|
* Parse selector.
|
2332
2277
|
*/
|
2333
2278
|
|
2334
|
-
|
2335
2279
|
function selector() {
|
2336
2280
|
var m = match(/^([^{]+)/);
|
2337
2281
|
if (!m) return;
|
2338
2282
|
/* @fix Remove all comments from selectors
|
2339
2283
|
* http://ostermiller.org/findcomment.html */
|
2340
|
-
|
2341
2284
|
return trim(m[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g, '').replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g, function (m) {
|
2342
2285
|
return m.replace(/,/g, '\u200C');
|
2343
2286
|
}).split(/\s*(?![^(]*\)),\s*/).map(function (s) {
|
2344
2287
|
return s.replace(/\u200C/g, ',');
|
2345
2288
|
});
|
2346
2289
|
}
|
2290
|
+
|
2347
2291
|
/**
|
2348
2292
|
* Parse declaration.
|
2349
2293
|
*/
|
2350
2294
|
|
2351
|
-
|
2352
2295
|
function declaration() {
|
2353
|
-
var pos = position();
|
2296
|
+
var pos = position();
|
2354
2297
|
|
2298
|
+
// prop
|
2355
2299
|
var prop = match(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);
|
2356
2300
|
if (!prop) return;
|
2357
|
-
prop = trim(prop[0]);
|
2301
|
+
prop = trim(prop[0]);
|
2358
2302
|
|
2359
|
-
|
2303
|
+
// :
|
2304
|
+
if (!match(/^:\s*/)) return error("property missing ':'");
|
2360
2305
|
|
2306
|
+
// val
|
2361
2307
|
var val = match(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/);
|
2362
2308
|
var ret = pos({
|
2363
2309
|
type: 'declaration',
|
2364
2310
|
property: prop.replace(commentre, ''),
|
2365
2311
|
value: val ? trim(val[0]).replace(commentre, '') : ''
|
2366
|
-
});
|
2312
|
+
});
|
2367
2313
|
|
2314
|
+
// ;
|
2368
2315
|
match(/^[;\s]*/);
|
2369
2316
|
return ret;
|
2370
2317
|
}
|
2318
|
+
|
2371
2319
|
/**
|
2372
2320
|
* Parse declarations.
|
2373
2321
|
*/
|
2374
2322
|
|
2375
|
-
|
2376
2323
|
function declarations() {
|
2377
2324
|
var decls = [];
|
2378
2325
|
if (!open()) return error("missing '{'");
|
2379
|
-
comments(decls);
|
2326
|
+
comments(decls);
|
2380
2327
|
|
2328
|
+
// declarations
|
2381
2329
|
var decl;
|
2382
|
-
|
2383
2330
|
while (decl = declaration()) {
|
2384
2331
|
if (decl !== false) {
|
2385
2332
|
decls.push(decl);
|
2386
2333
|
comments(decls);
|
2387
2334
|
}
|
2388
2335
|
}
|
2389
|
-
|
2390
2336
|
if (!close()) return error("missing '}'");
|
2391
2337
|
return decls;
|
2392
2338
|
}
|
2339
|
+
|
2393
2340
|
/**
|
2394
2341
|
* Parse keyframe.
|
2395
2342
|
*/
|
2396
2343
|
|
2397
|
-
|
2398
2344
|
function keyframe() {
|
2399
2345
|
var m;
|
2400
2346
|
var vals = [];
|
2401
2347
|
var pos = position();
|
2402
|
-
|
2403
2348
|
while (m = match(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/)) {
|
2404
2349
|
vals.push(m[1]);
|
2405
2350
|
match(/^,\s*/);
|
2406
2351
|
}
|
2407
|
-
|
2408
2352
|
if (!vals.length) return;
|
2409
2353
|
return pos({
|
2410
2354
|
type: 'keyframe',
|
@@ -2412,29 +2356,28 @@ function cssParse (css, options) {
|
|
2412
2356
|
declarations: declarations()
|
2413
2357
|
});
|
2414
2358
|
}
|
2359
|
+
|
2415
2360
|
/**
|
2416
2361
|
* Parse keyframes.
|
2417
2362
|
*/
|
2418
2363
|
|
2419
|
-
|
2420
2364
|
function atkeyframes() {
|
2421
2365
|
var pos = position();
|
2422
2366
|
var m = match(/^@([-\w]+)?keyframes\s*/);
|
2423
2367
|
if (!m) return;
|
2424
|
-
var vendor = m[1];
|
2368
|
+
var vendor = m[1];
|
2425
2369
|
|
2370
|
+
// identifier
|
2426
2371
|
var m = match(/^([-\w]+)\s*/);
|
2427
2372
|
if (!m) return error("@keyframes missing name");
|
2428
2373
|
var name = m[1];
|
2429
2374
|
if (!open()) return error("@keyframes missing '{'");
|
2430
2375
|
var frame;
|
2431
2376
|
var frames = comments();
|
2432
|
-
|
2433
2377
|
while (frame = keyframe()) {
|
2434
2378
|
frames.push(frame);
|
2435
2379
|
frames = frames.concat(comments());
|
2436
2380
|
}
|
2437
|
-
|
2438
2381
|
if (!close()) return error("@keyframes missing '}'");
|
2439
2382
|
return pos({
|
2440
2383
|
type: 'keyframes',
|
@@ -2443,11 +2386,11 @@ function cssParse (css, options) {
|
|
2443
2386
|
keyframes: frames
|
2444
2387
|
});
|
2445
2388
|
}
|
2389
|
+
|
2446
2390
|
/**
|
2447
2391
|
* Parse supports.
|
2448
2392
|
*/
|
2449
2393
|
|
2450
|
-
|
2451
2394
|
function atsupports() {
|
2452
2395
|
var pos = position();
|
2453
2396
|
var m = match(/^@supports *([^{]+)/);
|
@@ -2462,11 +2405,11 @@ function cssParse (css, options) {
|
|
2462
2405
|
rules: style
|
2463
2406
|
});
|
2464
2407
|
}
|
2408
|
+
|
2465
2409
|
/**
|
2466
2410
|
* Parse host.
|
2467
2411
|
*/
|
2468
2412
|
|
2469
|
-
|
2470
2413
|
function athost() {
|
2471
2414
|
var pos = position();
|
2472
2415
|
var m = match(/^@host\s*/);
|
@@ -2479,11 +2422,11 @@ function cssParse (css, options) {
|
|
2479
2422
|
rules: style
|
2480
2423
|
});
|
2481
2424
|
}
|
2425
|
+
|
2482
2426
|
/**
|
2483
2427
|
* Parse media.
|
2484
2428
|
*/
|
2485
2429
|
|
2486
|
-
|
2487
2430
|
function atmedia() {
|
2488
2431
|
var pos = position();
|
2489
2432
|
var m = match(/^@media *([^{]+)/);
|
@@ -2498,11 +2441,11 @@ function cssParse (css, options) {
|
|
2498
2441
|
rules: style
|
2499
2442
|
});
|
2500
2443
|
}
|
2444
|
+
|
2501
2445
|
/**
|
2502
2446
|
* Parse custom-media.
|
2503
2447
|
*/
|
2504
2448
|
|
2505
|
-
|
2506
2449
|
function atcustommedia() {
|
2507
2450
|
var pos = position();
|
2508
2451
|
var m = match(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);
|
@@ -2513,26 +2456,25 @@ function cssParse (css, options) {
|
|
2513
2456
|
media: trim(m[2])
|
2514
2457
|
});
|
2515
2458
|
}
|
2459
|
+
|
2516
2460
|
/**
|
2517
2461
|
* Parse paged media.
|
2518
2462
|
*/
|
2519
2463
|
|
2520
|
-
|
2521
2464
|
function atpage() {
|
2522
2465
|
var pos = position();
|
2523
2466
|
var m = match(/^@page */);
|
2524
2467
|
if (!m) return;
|
2525
2468
|
var sel = selector() || [];
|
2526
2469
|
if (!open()) return error("@page missing '{'");
|
2527
|
-
var decls = comments();
|
2470
|
+
var decls = comments();
|
2528
2471
|
|
2472
|
+
// declarations
|
2529
2473
|
var decl;
|
2530
|
-
|
2531
2474
|
while (decl = declaration()) {
|
2532
2475
|
decls.push(decl);
|
2533
2476
|
decls = decls.concat(comments());
|
2534
2477
|
}
|
2535
|
-
|
2536
2478
|
if (!close()) return error("@page missing '}'");
|
2537
2479
|
return pos({
|
2538
2480
|
type: 'page',
|
@@ -2540,11 +2482,11 @@ function cssParse (css, options) {
|
|
2540
2482
|
declarations: decls
|
2541
2483
|
});
|
2542
2484
|
}
|
2485
|
+
|
2543
2486
|
/**
|
2544
2487
|
* Parse document.
|
2545
2488
|
*/
|
2546
2489
|
|
2547
|
-
|
2548
2490
|
function atdocument() {
|
2549
2491
|
var pos = position();
|
2550
2492
|
var m = match(/^@([-\w]+)?document *([^{]+)/);
|
@@ -2561,54 +2503,53 @@ function cssParse (css, options) {
|
|
2561
2503
|
rules: style
|
2562
2504
|
});
|
2563
2505
|
}
|
2506
|
+
|
2564
2507
|
/**
|
2565
2508
|
* Parse font-face.
|
2566
2509
|
*/
|
2567
2510
|
|
2568
|
-
|
2569
2511
|
function atfontface() {
|
2570
2512
|
var pos = position();
|
2571
2513
|
var m = match(/^@font-face\s*/);
|
2572
2514
|
if (!m) return;
|
2573
2515
|
if (!open()) return error("@font-face missing '{'");
|
2574
|
-
var decls = comments();
|
2516
|
+
var decls = comments();
|
2575
2517
|
|
2518
|
+
// declarations
|
2576
2519
|
var decl;
|
2577
|
-
|
2578
2520
|
while (decl = declaration()) {
|
2579
2521
|
decls.push(decl);
|
2580
2522
|
decls = decls.concat(comments());
|
2581
2523
|
}
|
2582
|
-
|
2583
2524
|
if (!close()) return error("@font-face missing '}'");
|
2584
2525
|
return pos({
|
2585
2526
|
type: 'font-face',
|
2586
2527
|
declarations: decls
|
2587
2528
|
});
|
2588
2529
|
}
|
2530
|
+
|
2589
2531
|
/**
|
2590
2532
|
* Parse import
|
2591
2533
|
*/
|
2592
2534
|
|
2593
|
-
|
2594
2535
|
var atimport = _compileAtrule('import');
|
2536
|
+
|
2595
2537
|
/**
|
2596
2538
|
* Parse charset
|
2597
2539
|
*/
|
2598
2540
|
|
2599
|
-
|
2600
2541
|
var atcharset = _compileAtrule('charset');
|
2542
|
+
|
2601
2543
|
/**
|
2602
2544
|
* Parse namespace
|
2603
2545
|
*/
|
2604
2546
|
|
2605
|
-
|
2606
2547
|
var atnamespace = _compileAtrule('namespace');
|
2548
|
+
|
2607
2549
|
/**
|
2608
2550
|
* Parse non-block at-rules
|
2609
2551
|
*/
|
2610
2552
|
|
2611
|
-
|
2612
2553
|
function _compileAtrule(name) {
|
2613
2554
|
var re = new RegExp('^@' + name + '\\s*([^;]+);');
|
2614
2555
|
return function () {
|
@@ -2622,20 +2563,20 @@ function cssParse (css, options) {
|
|
2622
2563
|
return pos(ret);
|
2623
2564
|
};
|
2624
2565
|
}
|
2566
|
+
|
2625
2567
|
/**
|
2626
2568
|
* Parse at rule.
|
2627
2569
|
*/
|
2628
2570
|
|
2629
|
-
|
2630
2571
|
function atrule() {
|
2631
2572
|
if (css[0] != '@') return;
|
2632
2573
|
return atkeyframes() || atmedia() || atcustommedia() || atsupports() || atimport() || atcharset() || atnamespace() || atdocument() || atpage() || athost() || atfontface();
|
2633
2574
|
}
|
2575
|
+
|
2634
2576
|
/**
|
2635
2577
|
* Parse rule.
|
2636
2578
|
*/
|
2637
2579
|
|
2638
|
-
|
2639
2580
|
function rule() {
|
2640
2581
|
var pos = position();
|
2641
2582
|
var sel = selector();
|
@@ -2647,9 +2588,9 @@ function cssParse (css, options) {
|
|
2647
2588
|
declarations: declarations()
|
2648
2589
|
});
|
2649
2590
|
}
|
2650
|
-
|
2651
2591
|
return addParent(stylesheet());
|
2652
2592
|
}
|
2593
|
+
|
2653
2594
|
/**
|
2654
2595
|
* Trim `str`.
|
2655
2596
|
*/
|
@@ -2657,18 +2598,16 @@ function cssParse (css, options) {
|
|
2657
2598
|
function trim(str) {
|
2658
2599
|
return str ? str.replace(/^\s+|\s+$/g, '') : '';
|
2659
2600
|
}
|
2601
|
+
|
2660
2602
|
/**
|
2661
2603
|
* Adds non-enumerable parent node reference to each node.
|
2662
2604
|
*/
|
2663
2605
|
|
2664
|
-
|
2665
2606
|
function addParent(obj, parent) {
|
2666
2607
|
var isNode = obj && typeof obj.type === 'string';
|
2667
2608
|
var childParent = isNode ? obj : parent;
|
2668
|
-
|
2669
2609
|
for (var k in obj) {
|
2670
2610
|
var value = obj[k];
|
2671
|
-
|
2672
2611
|
if (Array.isArray(value)) {
|
2673
2612
|
value.forEach(function (v) {
|
2674
2613
|
addParent(v, childParent);
|
@@ -2677,7 +2616,6 @@ function addParent(obj, parent) {
|
|
2677
2616
|
addParent(value, childParent);
|
2678
2617
|
}
|
2679
2618
|
}
|
2680
|
-
|
2681
2619
|
if (isNode) {
|
2682
2620
|
Object.defineProperty(obj, 'parent', {
|
2683
2621
|
configurable: true,
|
@@ -2686,16 +2624,16 @@ function addParent(obj, parent) {
|
|
2686
2624
|
value: parent || null
|
2687
2625
|
});
|
2688
2626
|
}
|
2689
|
-
|
2690
2627
|
return obj;
|
2691
2628
|
}
|
2692
2629
|
|
2693
2630
|
/**
|
2694
2631
|
* Module dependencies.
|
2695
2632
|
*/
|
2696
|
-
var Compressed = require('./compress');
|
2697
2633
|
|
2634
|
+
var Compressed = require('./compress');
|
2698
2635
|
var Identity = require('./identity');
|
2636
|
+
|
2699
2637
|
/**
|
2700
2638
|
* Stringfy the given AST `node`.
|
2701
2639
|
*
|
@@ -2710,10 +2648,11 @@ var Identity = require('./identity');
|
|
2710
2648
|
* @api public
|
2711
2649
|
*/
|
2712
2650
|
|
2713
|
-
|
2714
2651
|
function cssStringify (node, options) {
|
2715
2652
|
options = options || {};
|
2716
|
-
var compiler = options.compress ? new Compressed(options) : new Identity(options);
|
2653
|
+
var compiler = options.compress ? new Compressed(options) : new Identity(options);
|
2654
|
+
|
2655
|
+
// source maps
|
2717
2656
|
// if (options.sourcemap) {
|
2718
2657
|
// var sourcemaps = require('./source-map-support');
|
2719
2658
|
// sourcemaps(compiler);
|
@@ -2757,7 +2696,7 @@ var RawSet = /** @class */ (function () {
|
|
2757
2696
|
var _a, _b, _c;
|
2758
2697
|
var script = '';
|
2759
2698
|
if (cNode.nodeType === Node.TEXT_NODE) {
|
2760
|
-
script = "`"
|
2699
|
+
script = "`".concat((_a = cNode.textContent) !== null && _a !== void 0 ? _a : '', "`");
|
2761
2700
|
// console.log('???????', script)
|
2762
2701
|
}
|
2763
2702
|
else if (cNode.nodeType === Node.ELEMENT_NODE) {
|
@@ -2786,11 +2725,11 @@ var RawSet = /** @class */ (function () {
|
|
2786
2725
|
EventManager.VARNAMES.forEach(function (it) {
|
2787
2726
|
// script = script.replace(RegExp(it.replace('$', '\\$'), 'g'), `this?.___${it}`);
|
2788
2727
|
// script = script.replace(RegExp(it.replace('$', '\\$'), 'g'), `this.___${it}`);
|
2789
|
-
script = script.replace(RegExp(it.replace('$', '\\$'), 'g'), "this.___"
|
2728
|
+
script = script.replace(RegExp(it.replace('$', '\\$'), 'g'), "this.___".concat(it));
|
2790
2729
|
// console.log('scripts-->', script)
|
2791
2730
|
});
|
2792
2731
|
// console.log('----------', script);
|
2793
|
-
Array.from(ScriptUtils.getVariablePaths(script)).filter(function (it) { return !it.startsWith("___"
|
2732
|
+
Array.from(ScriptUtils.getVariablePaths(script)).filter(function (it) { return !it.startsWith("___".concat(EventManager.SCRIPTS_VARNAME)); }).forEach(function (it) { return usingTriggerVariables.add(it); });
|
2794
2733
|
}
|
2795
2734
|
});
|
2796
2735
|
// console.log('usingTriggerVariable----------->', usingTriggerVariables)
|
@@ -2827,7 +2766,7 @@ var RawSet = /** @class */ (function () {
|
|
2827
2766
|
range: Range.range,
|
2828
2767
|
element: cNode,
|
2829
2768
|
attribute: attribute,
|
2830
|
-
bindScript: "\n const "
|
2769
|
+
bindScript: "\n const ".concat(EventManager.SCRIPTS_VARNAME, " = this.__render.scripts;\n const ").concat(EventManager.RAWSET_VARNAME, " = this.__render.rawset;\n const ").concat(EventManager.ELEMENT_VARNAME, " = this.__render.element;\n const ").concat(EventManager.ATTRIBUTE_VARNAME, " = this.__render.attribute;\n const ").concat(EventManager.RANGE_VARNAME, " = this.__render.range;\n const ").concat(EventManager.ROUTER_VARNAME, " = this.__render.router;\n ")
|
2831
2770
|
// eslint-disable-next-line no-use-before-define
|
2832
2771
|
});
|
2833
2772
|
fag = config.window.document.createDocumentFragment();
|
@@ -2836,13 +2775,13 @@ var RawSet = /** @class */ (function () {
|
|
2836
2775
|
runText = RawSet.exporesionGrouops(textContent)[0][1];
|
2837
2776
|
newNode = void 0;
|
2838
2777
|
if (textContent === null || textContent === void 0 ? void 0 : textContent.startsWith('#')) {
|
2839
|
-
r = ScriptUtils.eval(__render.bindScript
|
2778
|
+
r = ScriptUtils.eval("".concat(__render.bindScript, " return ").concat(runText), Object.assign(obj, { __render: __render }));
|
2840
2779
|
template = config.window.document.createElement('template');
|
2841
2780
|
template.innerHTML = r;
|
2842
2781
|
newNode = template.content;
|
2843
2782
|
}
|
2844
2783
|
else {
|
2845
|
-
r = ScriptUtils.eval(__render.bindScript
|
2784
|
+
r = ScriptUtils.eval("".concat(__render.bindScript, " return ").concat(runText), Object.assign(obj, { __render: __render }));
|
2846
2785
|
newNode = config.window.document.createTextNode(r);
|
2847
2786
|
}
|
2848
2787
|
(_a = cNode.parentNode) === null || _a === void 0 ? void 0 : _a.replaceChild(newNode, cNode);
|
@@ -2927,7 +2866,7 @@ var RawSet = /** @class */ (function () {
|
|
2927
2866
|
fag: genNode,
|
2928
2867
|
scripts: EventManager.setBindProperty(config === null || config === void 0 ? void 0 : config.scripts, obj)
|
2929
2868
|
});
|
2930
|
-
ScriptUtils.eval("\n const "
|
2869
|
+
ScriptUtils.eval("\n const ".concat(EventManager.FAG_VARNAME, " = this.__render.fag;\n const ").concat(EventManager.SCRIPTS_VARNAME, " = this.__render.scripts;\n const ").concat(EventManager.RAWSET_VARNAME, " = this.__render.rawset;\n ").concat(it.drCompleteOption), Object.assign(obj, { __render: render }));
|
2931
2870
|
}
|
2932
2871
|
});
|
2933
2872
|
// 중요 style isolation 나중에 :scope로 대체 가능할듯.
|
@@ -2943,7 +2882,7 @@ var RawSet = /** @class */ (function () {
|
|
2943
2882
|
oninit = it_2.targetElement.__render.element.getAttribute(RawSet.DR_ON_INIT_ARGUMENTS_OPTIONNAME);
|
2944
2883
|
param = [];
|
2945
2884
|
if (oninit) {
|
2946
|
-
script = it_2.targetElement.__render.renderScript
|
2885
|
+
script = "".concat(it_2.targetElement.__render.renderScript, " return ").concat(oninit, " ");
|
2947
2886
|
param = ScriptUtils.eval(script, Object.assign(obj, {
|
2948
2887
|
__render: it_2.targetElement.__render
|
2949
2888
|
}));
|
@@ -3005,8 +2944,8 @@ var RawSet = /** @class */ (function () {
|
|
3005
2944
|
};
|
3006
2945
|
RawSet.generateCSS = function (id, cssRule) {
|
3007
2946
|
var _this = this;
|
3008
|
-
var start = "#"
|
3009
|
-
var end = "#"
|
2947
|
+
var start = "#".concat(id, "-start");
|
2948
|
+
var end = "#".concat(id, "-end");
|
3010
2949
|
if (cssRule.constructor.name === 'CSSStyleRule') {
|
3011
2950
|
var rule = cssRule;
|
3012
2951
|
// rule.selectorText = `${start} ~ *:not(${start} ~ ${end} ~ *) ${rule.selectorText}`;
|
@@ -3015,14 +2954,14 @@ var RawSet = /** @class */ (function () {
|
|
3015
2954
|
if (!rule.selectorText.startsWith(':root')) {
|
3016
2955
|
// rule.selectorText = `${start} ~ ${rule.selectorText}:not(${start} ~ ${end} ~ *)`;
|
3017
2956
|
// rule.selectorText = `${start} ~ ${rule.selectorText}:not(${start} ~ ${end} ~ *)`;
|
3018
|
-
var selectorText = ":is("
|
2957
|
+
var selectorText = ":is(".concat(start, " ~ *:not(").concat(start, " ~ ").concat(end, " ~ *))");
|
3019
2958
|
if (rule.selectorText.startsWith('.')) {
|
3020
|
-
rule.selectorText = ""
|
2959
|
+
rule.selectorText = "".concat(selectorText).concat(rule.selectorText, ", ").concat(selectorText, " ").concat(rule.selectorText);
|
3021
2960
|
// rule.selectorText = `${start} ~ *:not(${start} ~ ${end} ~ *)${rule.selectorText}`;
|
3022
2961
|
}
|
3023
2962
|
else {
|
3024
|
-
var divText = start
|
3025
|
-
rule.selectorText = selectorText
|
2963
|
+
var divText = "".concat(start, " ~ ").concat(rule.selectorText, ":not(").concat(start, " ~ ").concat(end, " ~ *)");
|
2964
|
+
rule.selectorText = "".concat(selectorText, " ").concat(rule.selectorText, ", ").concat(divText);
|
3026
2965
|
// rule.selectorText = `${selectorText} ${rule.selectorText}`;
|
3027
2966
|
// rule.selectorText = `${rule.selectorText} ~ ${start} ~ *:not(${start} ~ ${end} ~ *)`;
|
3028
2967
|
}
|
@@ -3043,10 +2982,10 @@ var RawSet = /** @class */ (function () {
|
|
3043
2982
|
if (Array.isArray(styleBody)) {
|
3044
2983
|
styleBody = styleBody.join('\n');
|
3045
2984
|
}
|
3046
|
-
var start = "#"
|
3047
|
-
var end = "#"
|
2985
|
+
var start = "#".concat(componentKey, "-start");
|
2986
|
+
var end = "#".concat(componentKey, "-end");
|
3048
2987
|
var before = StringUtils.regexExecArrayReplace(styleBody, /(\$\{.*?\}\$)/g, function (data) {
|
3049
|
-
return "var(--domrender-"
|
2988
|
+
return "var(--domrender-".concat(data[0], ")");
|
3050
2989
|
});
|
3051
2990
|
var cssobject = cssParse(before);
|
3052
2991
|
(_a = cssobject.stylesheet) === null || _a === void 0 ? void 0 : _a.rules.forEach(function (rule) {
|
@@ -3054,13 +2993,13 @@ var RawSet = /** @class */ (function () {
|
|
3054
2993
|
var isRoot = (_a = rule.selectors) === null || _a === void 0 ? void 0 : _a.find(function (it) { return it.startsWith(':root'); });
|
3055
2994
|
if (rule.type === 'rule' && !isRoot) { // && !!isRoot
|
3056
2995
|
rule.selectors = (_b = rule.selectors) === null || _b === void 0 ? void 0 : _b.map(function (sit) {
|
3057
|
-
var selectorText = ":is("
|
2996
|
+
var selectorText = ":is(".concat(start, " ~ *:not(").concat(start, " ~ ").concat(end, " ~ *))");
|
3058
2997
|
if (sit.startsWith('.')) {
|
3059
|
-
return ""
|
2998
|
+
return "".concat(selectorText).concat(sit, ", ").concat(selectorText, " ").concat(sit);
|
3060
2999
|
}
|
3061
3000
|
else {
|
3062
|
-
var divText = start
|
3063
|
-
return selectorText
|
3001
|
+
var divText = "".concat(start, " ~ ").concat(sit, ":not(").concat(start, " ~ ").concat(end, " ~ *)");
|
3002
|
+
return "".concat(selectorText, " ").concat(sit, ", ").concat(divText);
|
3064
3003
|
}
|
3065
3004
|
});
|
3066
3005
|
}
|
@@ -3070,7 +3009,7 @@ var RawSet = /** @class */ (function () {
|
|
3070
3009
|
return data[2];
|
3071
3010
|
});
|
3072
3011
|
if (styleTagWrap) {
|
3073
|
-
styleBody = "<style id='"
|
3012
|
+
styleBody = "<style id='".concat(componentKey, "-style' domstyle>").concat(after, "</style>");
|
3074
3013
|
}
|
3075
3014
|
return styleBody;
|
3076
3015
|
};
|
@@ -3091,13 +3030,13 @@ var RawSet = /** @class */ (function () {
|
|
3091
3030
|
var data = element.getAttribute(RawSet.DR_APPENDER_NAME);
|
3092
3031
|
// if (data && !/\[[0-9]+\]/g.test(data)) {
|
3093
3032
|
if (data && !/\[.+\]/g.test(data)) {
|
3094
|
-
var currentIndex = ScriptUtils.evalReturn(data
|
3033
|
+
var currentIndex = ScriptUtils.evalReturn("".concat(data, "?.length -1"), obj);
|
3095
3034
|
// console.log('------?', currentIndex)
|
3096
3035
|
// if (currentIndex === undefined || isNaN(currentIndex)) {
|
3097
3036
|
// return undefined;
|
3098
3037
|
// }
|
3099
3038
|
// const currentIndex = ScriptUtils.evalReturn(`${data}.length`, obj);
|
3100
|
-
data = data
|
3039
|
+
data = "".concat(data, "[").concat(currentIndex, "]");
|
3101
3040
|
element.setAttribute(RawSet.DR_APPENDER_NAME, data);
|
3102
3041
|
// element.setAttribute(RawSet.DR_IF_NAME, data);
|
3103
3042
|
// element.setAttribute('dr-id', data);
|
@@ -3241,7 +3180,7 @@ var RawSet = /** @class */ (function () {
|
|
3241
3180
|
var element = node;
|
3242
3181
|
var start = config.window.document.createElement('meta');
|
3243
3182
|
var end = config.window.document.createElement('meta');
|
3244
|
-
start.setAttribute('id', id
|
3183
|
+
start.setAttribute('id', "".concat(id, "-start"));
|
3245
3184
|
var keys = element.getAttribute(RawSet.DR_KEY_OPTIONNAME);
|
3246
3185
|
var thisPropertyType = element.getAttribute(RawSet.DR_THIS_PROPERTY_NAME);
|
3247
3186
|
if (thisPropertyType) {
|
@@ -3251,19 +3190,19 @@ var RawSet = /** @class */ (function () {
|
|
3251
3190
|
element.removeAttribute(RawSet.DR_KEY_OPTIONNAME);
|
3252
3191
|
start.setAttribute(RawSet.DR_KEY_OPTIONNAME, keys);
|
3253
3192
|
}
|
3254
|
-
end.setAttribute('id', id
|
3193
|
+
end.setAttribute('id', "".concat(id, "-end"));
|
3255
3194
|
return { start: start, end: end };
|
3256
3195
|
}
|
3257
3196
|
else if (type === exports.RawSetType.STYLE_TEXT) {
|
3258
3197
|
return {
|
3259
|
-
start: config.window.document.createTextNode("/*start text "
|
3260
|
-
end: config.window.document.createTextNode("/*end text "
|
3198
|
+
start: config.window.document.createTextNode("/*start text ".concat(id, "*/")),
|
3199
|
+
end: config.window.document.createTextNode("/*end text ".concat(id, "*/"))
|
3261
3200
|
};
|
3262
3201
|
}
|
3263
3202
|
else { // text
|
3264
3203
|
return {
|
3265
|
-
start: config.window.document.createComment("start text "
|
3266
|
-
end: config.window.document.createComment("end text "
|
3204
|
+
start: config.window.document.createComment("start text ".concat(id)),
|
3205
|
+
end: config.window.document.createComment("end text ".concat(id))
|
3267
3206
|
};
|
3268
3207
|
}
|
3269
3208
|
};
|
@@ -3310,13 +3249,13 @@ var RawSet = /** @class */ (function () {
|
|
3310
3249
|
RawSet.drItOtherEncoding = function (element) {
|
3311
3250
|
var random = RandomUtils.uuid();
|
3312
3251
|
var regex = /#it#/g;
|
3313
|
-
element.querySelectorAll("["
|
3252
|
+
element.querySelectorAll("[".concat(RawSet.DR_IT_OPTIONNAME, "], [").concat(RawSet.DR_FOR_OF_NAME, "], [").concat(RawSet.DR_REPEAT_NAME, "]")).forEach(function (it) {
|
3314
3253
|
it.innerHTML = it.innerHTML.replace(regex, random);
|
3315
3254
|
});
|
3316
3255
|
return random;
|
3317
3256
|
};
|
3318
3257
|
RawSet.drItOtherDecoding = function (element, random) {
|
3319
|
-
element.querySelectorAll("["
|
3258
|
+
element.querySelectorAll("[".concat(RawSet.DR_IT_OPTIONNAME, "], [").concat(RawSet.DR_FOR_OF_NAME, "], [").concat(RawSet.DR_REPEAT_NAME, "]")).forEach(function (it) {
|
3320
3259
|
it.innerHTML = it.innerHTML.replace(RegExp(random, 'g'), '#it#');
|
3321
3260
|
});
|
3322
3261
|
};
|
@@ -3329,35 +3268,36 @@ var RawSet = /** @class */ (function () {
|
|
3329
3268
|
// element.querySelectorAll(`[${RawSet.DR_PRE_NAME}]`).forEach(it => {
|
3330
3269
|
// let message = it.innerHTML;
|
3331
3270
|
// })
|
3332
|
-
element.querySelectorAll("["
|
3333
|
-
it.innerHTML = it.innerHTML.replace(
|
3271
|
+
element.querySelectorAll("[".concat(RawSet.DR_PRE_NAME, "]")).forEach(function (it) {
|
3272
|
+
it.innerHTML = it.innerHTML.replace(/@this@/g, thisRandom);
|
3334
3273
|
});
|
3335
|
-
element.querySelectorAll("["
|
3274
|
+
element.querySelectorAll("[".concat(RawSet.DR_THIS_NAME, "]")).forEach(function (it) {
|
3336
3275
|
var message = it.innerHTML;
|
3337
|
-
StringUtils.regexExec(/([^(dr\-)])?this(?=.?)/g, message).reverse().forEach(
|
3276
|
+
// StringUtils.regexExec(/([^(dr\-)])?this(?=.?)/g, message).reverse().forEach(it => {
|
3277
|
+
StringUtils.regexExec(/@this@/g, message).reverse().forEach(function (it) {
|
3338
3278
|
var _a;
|
3339
|
-
message = message.substr(0, it.index) + message.substr(it.index).replace(it[0], ""
|
3279
|
+
message = message.substr(0, it.index) + message.substr(it.index).replace(it[0], "".concat((_a = it[1]) !== null && _a !== void 0 ? _a : '').concat(drThis));
|
3340
3280
|
});
|
3341
3281
|
it.innerHTML = message;
|
3342
3282
|
});
|
3343
3283
|
var message = element.innerHTML;
|
3344
|
-
StringUtils.regexExec(
|
3284
|
+
StringUtils.regexExec(/@this@/g, message).reverse().forEach(function (it) {
|
3345
3285
|
var _a;
|
3346
|
-
message = message.substr(0, it.index) + message.substr(it.index).replace(it[0], ""
|
3286
|
+
message = message.substr(0, it.index) + message.substr(it.index).replace(it[0], "".concat((_a = it[1]) !== null && _a !== void 0 ? _a : '').concat(drThis));
|
3347
3287
|
});
|
3348
3288
|
element.innerHTML = message;
|
3349
3289
|
return thisRandom;
|
3350
3290
|
};
|
3351
3291
|
RawSet.drThisDecoding = function (element, thisRandom) {
|
3352
|
-
element.querySelectorAll("["
|
3353
|
-
it.innerHTML = it.innerHTML.replace(RegExp(thisRandom, 'g'), 'this');
|
3292
|
+
element.querySelectorAll("[".concat(RawSet.DR_PRE_NAME, "]")).forEach(function (it) {
|
3293
|
+
it.innerHTML = it.innerHTML.replace(RegExp(thisRandom, 'g'), '@this@');
|
3354
3294
|
});
|
3355
|
-
element.querySelectorAll("["
|
3356
|
-
it.innerHTML = it.innerHTML.replace(RegExp(thisRandom, 'g'), 'this');
|
3295
|
+
element.querySelectorAll("[".concat(RawSet.DR_THIS_NAME, "]")).forEach(function (it) {
|
3296
|
+
it.innerHTML = it.innerHTML.replace(RegExp(thisRandom, 'g'), '@this@');
|
3357
3297
|
});
|
3358
3298
|
};
|
3359
3299
|
RawSet.drFormOtherMoveAttr = function (element, as, to, config) {
|
3360
|
-
element.querySelectorAll("["
|
3300
|
+
element.querySelectorAll("[".concat(RawSet.DR_FORM_NAME, "]")).forEach(function (subElement) {
|
3361
3301
|
var _a;
|
3362
3302
|
var nodeIterator = config.window.document.createNodeIterator(subElement, NodeFilter.SHOW_ELEMENT, {
|
3363
3303
|
acceptNode: function (node) {
|
@@ -3395,7 +3335,7 @@ var RawSet = /** @class */ (function () {
|
|
3395
3335
|
};
|
3396
3336
|
});
|
3397
3337
|
// element.querySelectorAll(`[${RawSet.DR_THIS_NAME}]`).forEach(it => {
|
3398
|
-
element.querySelectorAll("["
|
3338
|
+
element.querySelectorAll("[".concat(RawSet.DR_VAR_OPTIONNAME, "]")).forEach(function (it) {
|
3399
3339
|
vars.filter(function (vit) { return vit.value && vit.name; }).forEach(function (vit) {
|
3400
3340
|
it.innerHTML = it.innerHTML.replace(vit.regex, vit.random);
|
3401
3341
|
});
|
@@ -3406,7 +3346,7 @@ var RawSet = /** @class */ (function () {
|
|
3406
3346
|
return vars;
|
3407
3347
|
};
|
3408
3348
|
RawSet.drVarDecoding = function (element, vars) {
|
3409
|
-
element.querySelectorAll("["
|
3349
|
+
element.querySelectorAll("[".concat(RawSet.DR_THIS_NAME, "]")).forEach(function (it) {
|
3410
3350
|
vars.filter(function (vit) { return vit.value && vit.name; }).forEach(function (vit) {
|
3411
3351
|
it.innerHTML = it.innerHTML.replace(RegExp(vit.random, 'g'), vit.value);
|
3412
3352
|
});
|
@@ -3468,7 +3408,7 @@ var RawSet = /** @class */ (function () {
|
|
3468
3408
|
renderScript = '';
|
3469
3409
|
createParam = [];
|
3470
3410
|
if (onCreate) {
|
3471
|
-
script = renderScript
|
3411
|
+
script = "".concat(renderScript, " return ").concat(onCreate, " ");
|
3472
3412
|
createParam = ScriptUtils.eval(script, obj);
|
3473
3413
|
if (!Array.isArray(createParam)) {
|
3474
3414
|
createParam = [createParam];
|
@@ -3477,12 +3417,12 @@ var RawSet = /** @class */ (function () {
|
|
3477
3417
|
(_e = (_d = set.obj) === null || _d === void 0 ? void 0 : _d.onCreateRender) === null || _e === void 0 ? void 0 : _e.call.apply(_e, __spreadArray([_d], createParam, false));
|
3478
3418
|
oninit = element.getAttribute(RawSet.DR_ON_CREATED_CALLBACK_OPTIONNAME);
|
3479
3419
|
if (oninit) {
|
3480
|
-
script = renderScript
|
3420
|
+
script = "".concat(renderScript, " ").concat(oninit, " ");
|
3481
3421
|
ScriptUtils.eval(script, obj);
|
3482
3422
|
}
|
3483
3423
|
_m.label = 12;
|
3484
3424
|
case 12:
|
3485
|
-
n.querySelectorAll(eventManager.attrNames.map(function (it) { return "["
|
3425
|
+
n.querySelectorAll(eventManager.attrNames.map(function (it) { return "[".concat(it, "]"); }).join(',')).forEach(function (it) {
|
3486
3426
|
it.setAttribute(EventManager.ownerVariablePathAttrName, 'this');
|
3487
3427
|
});
|
3488
3428
|
// attribute
|
@@ -3610,7 +3550,7 @@ var RawSet = /** @class */ (function () {
|
|
3610
3550
|
constructorParam = [];
|
3611
3551
|
// dr-constructor
|
3612
3552
|
if (constructor) {
|
3613
|
-
script = renderScript
|
3553
|
+
script = "".concat(renderScript, " return ").concat(constructor, " ");
|
3614
3554
|
param = (_b = ScriptUtils.eval(script, Object.assign(obj, { __render: render }))) !== null && _b !== void 0 ? _b : [];
|
3615
3555
|
if (!Array.isArray(param)) {
|
3616
3556
|
param = [param];
|
@@ -3622,7 +3562,7 @@ var RawSet = /** @class */ (function () {
|
|
3622
3562
|
instance = domrenderComponents[componentKey];
|
3623
3563
|
i = instance.__domrender_component_new = ((_c = instance.__domrender_component_new) !== null && _c !== void 0 ? _c : new Proxy({}, new DomRenderFinalProxy()));
|
3624
3564
|
i.thisVariableName = rawSet.point.thisVariableName;
|
3625
|
-
i.thisFullVariableName = "this.__domrender_components."
|
3565
|
+
i.thisFullVariableName = "this.__domrender_components.".concat(componentKey);
|
3626
3566
|
i.componentKey = componentKey;
|
3627
3567
|
i.rawSet = rawSet;
|
3628
3568
|
i.attribute = attribute;
|
@@ -3637,7 +3577,7 @@ var RawSet = /** @class */ (function () {
|
|
3637
3577
|
normalAttrMap = element.getAttribute(EventManager.normalAttrMapAttrName);
|
3638
3578
|
if (instance.onChangeAttrRender && normalAttrMap) {
|
3639
3579
|
new Map(JSON.parse(normalAttrMap)).forEach(function (value, key) {
|
3640
|
-
var script = renderScript
|
3580
|
+
var script = "".concat(renderScript, " return ").concat(value, " ");
|
3641
3581
|
var cval = ScriptUtils.eval(script, Object.assign(obj, { __render: render }));
|
3642
3582
|
// element.setAttribute(key, cval);
|
3643
3583
|
instance.onChangeAttrRender(key, cval);
|
@@ -3647,7 +3587,7 @@ var RawSet = /** @class */ (function () {
|
|
3647
3587
|
this.__render = render;
|
3648
3588
|
createParam = [];
|
3649
3589
|
if (onCreate) {
|
3650
|
-
script = renderScript
|
3590
|
+
script = "".concat(renderScript, " return ").concat(onCreate, " ");
|
3651
3591
|
createParam = ScriptUtils.eval(script, Object.assign(obj, { __render: render }));
|
3652
3592
|
if (!Array.isArray(createParam)) {
|
3653
3593
|
createParam = [createParam];
|
@@ -3663,20 +3603,20 @@ var RawSet = /** @class */ (function () {
|
|
3663
3603
|
innerHTMLThisRandom = RandomUtils.uuid();
|
3664
3604
|
applayTemplate = applayTemplate.replace(/this\./g, innerHTMLThisRandom);
|
3665
3605
|
// }
|
3666
|
-
applayTemplate = applayTemplate.replace(RegExp("#"
|
3606
|
+
applayTemplate = applayTemplate.replace(RegExp("#".concat(componentName, "#"), 'g'), 'this');
|
3667
3607
|
}
|
3668
3608
|
// applayTemplate = template.replace(RegExp(`#${innerHTMLName}#`, 'g'), applayTemplate);
|
3669
|
-
applayTemplate = ((_g = this.template) !== null && _g !== void 0 ? _g : '').replace(RegExp("#"
|
3609
|
+
applayTemplate = ((_g = this.template) !== null && _g !== void 0 ? _g : '').replace(RegExp("#".concat(innerHTMLName, "#"), 'g'), applayTemplate);
|
3670
3610
|
oninit = element.getAttribute(RawSet.DR_ON_CREATED_CALLBACK_OPTIONNAME);
|
3671
3611
|
if (oninit) {
|
3672
|
-
script = renderScript
|
3612
|
+
script = "".concat(renderScript, " ").concat(oninit, " ");
|
3673
3613
|
ScriptUtils.eval(script, Object.assign(obj, {
|
3674
3614
|
__render: render
|
3675
3615
|
}));
|
3676
3616
|
}
|
3677
3617
|
style = RawSet.generateStyleTransform(this.styles, componentKey, true);
|
3678
3618
|
element.innerHTML = style + (applayTemplate !== null && applayTemplate !== void 0 ? applayTemplate : '');
|
3679
|
-
return [4 /*yield*/, RawSet.drThisCreate(rawSet, element, "this.__domrender_components."
|
3619
|
+
return [4 /*yield*/, RawSet.drThisCreate(rawSet, element, "this.__domrender_components.".concat(componentKey), '', true, obj, config)];
|
3680
3620
|
case 12:
|
3681
3621
|
data = _p.sent();
|
3682
3622
|
// 넘어온 innerHTML에 this가 있는걸 다시 복호화해서 제대로 작동하도록한다.
|
@@ -3807,9 +3747,9 @@ var DomRenderProxy = /** @class */ (function () {
|
|
3807
3747
|
};
|
3808
3748
|
DomRenderProxy.prototype.run = function (objProxy) {
|
3809
3749
|
var _this = this;
|
3810
|
-
var _a
|
3750
|
+
var _a;
|
3811
3751
|
this._domRender_proxy = objProxy;
|
3812
|
-
(
|
3752
|
+
(_a = objProxy === null || objProxy === void 0 ? void 0 : objProxy.onProxyDomRender) === null || _a === void 0 ? void 0 : _a.call(objProxy, this.config);
|
3813
3753
|
var obj = objProxy._DomRender_origin;
|
3814
3754
|
if (obj) {
|
3815
3755
|
Object.keys(obj).forEach(function (it) {
|
@@ -3836,6 +3776,9 @@ var DomRenderProxy = /** @class */ (function () {
|
|
3836
3776
|
DomRenderProxy.prototype.initRender = function (target) {
|
3837
3777
|
var _this = this;
|
3838
3778
|
var _a, _b, _c, _d;
|
3779
|
+
if (target instanceof Element) {
|
3780
|
+
target.innerHTML = target.innerHTML.replace(/@this@/g, 'this');
|
3781
|
+
}
|
3839
3782
|
var onCreate = (_b = (_a = target).getAttribute) === null || _b === void 0 ? void 0 : _b.call(_a, RawSet.DR_ON_CREATE_ARGUMENTS_OPTIONNAME);
|
3840
3783
|
var createParam = [];
|
3841
3784
|
if (onCreate) {
|
@@ -3845,6 +3788,7 @@ var DomRenderProxy = /** @class */ (function () {
|
|
3845
3788
|
}
|
3846
3789
|
}
|
3847
3790
|
(_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));
|
3791
|
+
// const innerHTML = (target as any).innerHTML ?? '';
|
3848
3792
|
this._targets.add(target);
|
3849
3793
|
var rawSets = RawSet.checkPointCreates(target, this._domRender_proxy, this.config);
|
3850
3794
|
// console.log('initRender -------rawSet', rawSets)
|
@@ -3923,11 +3867,11 @@ var DomRenderProxy = /** @class */ (function () {
|
|
3923
3867
|
new Map(JSON.parse(targetAttrMap)).forEach(function (v, k) {
|
3924
3868
|
var _a;
|
3925
3869
|
// it?.data.onChangeAttrRender(k, null, v);
|
3926
|
-
var isUsing = EventManager.isUsingThisVar(v, "this."
|
3870
|
+
var isUsing = EventManager.isUsingThisVar(v, "this.".concat(fullPathStr));
|
3927
3871
|
if (isUsing) {
|
3928
3872
|
var render = it_1.fragment.render;
|
3929
3873
|
// console.log('render-->', (it.fragment as any).render)
|
3930
|
-
var script = render.renderScript
|
3874
|
+
var script = "".concat(render.renderScript, " return ").concat(v, " ");
|
3931
3875
|
var cval = ScriptUtils.eval(script, Object.assign((_a = _this._domRender_proxy) !== null && _a !== void 0 ? _a : {}, { __render: render }));
|
3932
3876
|
it_1.data.onChangeAttrRender(k, cval);
|
3933
3877
|
}
|
@@ -3999,7 +3943,7 @@ var DomRenderProxy = /** @class */ (function () {
|
|
3999
3943
|
// const firstPathStr = paths.slice(1).reverse().join('.');
|
4000
3944
|
var strings = paths.reverse();
|
4001
3945
|
// array같은경우도 키값으로 접근하기때문에 특정 인덱스를 찾아서 그부분만 바꿔줄수 있다.
|
4002
|
-
var fullPathStr_1 = strings.map(function (it) { return isNaN(Number(it)) ? '.' + it : "["
|
3946
|
+
var fullPathStr_1 = strings.map(function (it) { return isNaN(Number(it)) ? '.' + it : "[".concat(it, "]"); }).join('').slice(1);
|
4003
3947
|
// console.log('-------fullPathStr', fullPathStr, lastDoneExecute);
|
4004
3948
|
if (lastDoneExecute) {
|
4005
3949
|
// const firstData = ScriptUtils.evalReturn('this.' + firstPathStr, this._domRender_proxy);
|
@@ -4008,7 +3952,7 @@ var DomRenderProxy = /** @class */ (function () {
|
|
4008
3952
|
// }
|
4009
3953
|
var iterable_1 = this._rawSets.get(fullPathStr_1);
|
4010
3954
|
// array check
|
4011
|
-
var front_1 = strings.slice(0, strings.length - 1).map(function (it) { return isNaN(Number(it)) ? '.' + it : "["
|
3955
|
+
var front_1 = strings.slice(0, strings.length - 1).map(function (it) { return isNaN(Number(it)) ? '.' + it : "[".concat(it, "]"); }).join('');
|
4012
3956
|
var last_1 = strings[strings.length - 1];
|
4013
3957
|
var data_1 = ScriptUtils.evalReturn('this' + front_1, this._domRender_proxy);
|
4014
3958
|
// console.log('-------!!!!!', fullPathStr, iterable, data, front, last);
|
@@ -4063,12 +4007,14 @@ var DomRenderProxy = /** @class */ (function () {
|
|
4063
4007
|
return _this.render(Array.from(iterable_1), fullPathStr_1);
|
4064
4008
|
}
|
4065
4009
|
}).then(function (it) {
|
4010
|
+
console.log('target1------->,', it);
|
4066
4011
|
_this._targets.forEach(function (it) {
|
4012
|
+
console.log('target2------->,', it);
|
4067
4013
|
// return;
|
4068
4014
|
if (it.nodeType === Node.DOCUMENT_FRAGMENT_NODE || it.nodeType === Node.ELEMENT_NODE) {
|
4069
4015
|
var targets = eventManager.findAttrElements(it, _this.config);
|
4070
4016
|
// console.log('------>', targets);
|
4071
|
-
eventManager.changeVar(_this._domRender_proxy, targets, "this."
|
4017
|
+
eventManager.changeVar(_this._domRender_proxy, targets, "this.".concat(fullPathStr_1), _this.config);
|
4072
4018
|
}
|
4073
4019
|
});
|
4074
4020
|
});
|
@@ -4078,7 +4024,7 @@ var DomRenderProxy = /** @class */ (function () {
|
|
4078
4024
|
return fullPaths;
|
4079
4025
|
};
|
4080
4026
|
DomRenderProxy.prototype.set = function (target, p, value, receiver) {
|
4081
|
-
var _a, _b
|
4027
|
+
var _a, _b;
|
4082
4028
|
// console.log('set-->', p, value, target, receiver);
|
4083
4029
|
if (typeof p === 'string' && p !== '__domrender_components' && excludeGetSetPropertys.includes(p)) {
|
4084
4030
|
target[p] = value;
|
@@ -4100,12 +4046,12 @@ var DomRenderProxy = /** @class */ (function () {
|
|
4100
4046
|
}
|
4101
4047
|
// console.log('full path:', fullPath);
|
4102
4048
|
if (('onBeforeReturnSet' in receiver) && typeof p === 'string' && !((_a = this.config.proxyExcludeOnBeforeReturnSets) !== null && _a !== void 0 ? _a : []).concat(excludeGetSetPropertys).includes(p)) {
|
4103
|
-
(
|
4049
|
+
(_b = receiver === null || receiver === void 0 ? void 0 : receiver.onBeforeReturnSet) === null || _b === void 0 ? void 0 : _b.call(receiver, p, value, fullPath);
|
4104
4050
|
}
|
4105
4051
|
return true;
|
4106
4052
|
};
|
4107
4053
|
DomRenderProxy.prototype.get = function (target, p, receiver) {
|
4108
|
-
var _a, _b
|
4054
|
+
var _a, _b;
|
4109
4055
|
// console.log('get-->', target, p, receiver);
|
4110
4056
|
if (p === '_DomRender_origin') {
|
4111
4057
|
return this._domRender_origin;
|
@@ -4136,7 +4082,7 @@ var DomRenderProxy = /** @class */ (function () {
|
|
4136
4082
|
it_2 = it_2._DomRender_origin;
|
4137
4083
|
}
|
4138
4084
|
if (('onBeforeReturnGet' in receiver) && typeof p === 'string' && !((_a = this.config.proxyExcludeOnBeforeReturnGets) !== null && _a !== void 0 ? _a : []).concat(excludeGetSetPropertys).includes(p)) {
|
4139
|
-
(
|
4085
|
+
(_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));
|
4140
4086
|
}
|
4141
4087
|
return it_2;
|
4142
4088
|
}
|
@@ -4252,7 +4198,7 @@ var Router = /** @class */ (function () {
|
|
4252
4198
|
var _this = this;
|
4253
4199
|
var proxy = this.rootObj._DomRender_proxy;
|
4254
4200
|
if (proxy) {
|
4255
|
-
var key = "___"
|
4201
|
+
var key = "___".concat(EventManager.ROUTER_VARNAME);
|
4256
4202
|
proxy.render(key);
|
4257
4203
|
}
|
4258
4204
|
this.attachCallbacks.forEach(function (it) {
|
@@ -4679,7 +4625,7 @@ var DomRender = /** @class */ (function () {
|
|
4679
4625
|
function DomRender() {
|
4680
4626
|
}
|
4681
4627
|
DomRender.run = function (obj, target, oConfig) {
|
4682
|
-
var _a, _b, _c;
|
4628
|
+
var _a, _b, _c, _d;
|
4683
4629
|
var robj = obj;
|
4684
4630
|
if ('_DomRender_isProxy' in obj) {
|
4685
4631
|
if (target) {
|
@@ -4706,7 +4652,10 @@ var DomRender = /** @class */ (function () {
|
|
4706
4652
|
else if (config.routerType === 'hash') {
|
4707
4653
|
config.router = (_c = config.router) !== null && _c !== void 0 ? _c : new HashRouter(robj, config.window);
|
4708
4654
|
}
|
4709
|
-
else
|
4655
|
+
else { // default
|
4656
|
+
config.routerType = 'hash';
|
4657
|
+
config.router = (_d = config.router) !== null && _d !== void 0 ? _d : new HashRouter(robj, config.window);
|
4658
|
+
}
|
4710
4659
|
domRender.run(robj);
|
4711
4660
|
return robj;
|
4712
4661
|
};
|
@@ -4828,19 +4777,6 @@ var AllUnCheckedValidatorArray = /** @class */ (function (_super) {
|
|
4828
4777
|
return AllUnCheckedValidatorArray;
|
4829
4778
|
}(ValidatorArray));
|
4830
4779
|
|
4831
|
-
var CheckedValidator = /** @class */ (function (_super) {
|
4832
|
-
__extends(CheckedValidator, _super);
|
4833
|
-
function CheckedValidator(value, target, event, autoValid) {
|
4834
|
-
if (autoValid === void 0) { autoValid = true; }
|
4835
|
-
return _super.call(this, value, target, event, autoValid) || this;
|
4836
|
-
}
|
4837
|
-
CheckedValidator.prototype.valid = function () {
|
4838
|
-
var _a, _b;
|
4839
|
-
return (_b = (_a = this.getTarget()) === null || _a === void 0 ? void 0 : _a.checked) !== null && _b !== void 0 ? _b : false;
|
4840
|
-
};
|
4841
|
-
return CheckedValidator;
|
4842
|
-
}(Validator));
|
4843
|
-
|
4844
4780
|
var CountEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
|
4845
4781
|
__extends(CountEqualsUnCheckedValidatorArray, _super);
|
4846
4782
|
function CountEqualsUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
@@ -4856,6 +4792,19 @@ var CountEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
|
|
4856
4792
|
return CountEqualsUnCheckedValidatorArray;
|
4857
4793
|
}(ValidatorArray));
|
4858
4794
|
|
4795
|
+
var CheckedValidator = /** @class */ (function (_super) {
|
4796
|
+
__extends(CheckedValidator, _super);
|
4797
|
+
function CheckedValidator(value, target, event, autoValid) {
|
4798
|
+
if (autoValid === void 0) { autoValid = true; }
|
4799
|
+
return _super.call(this, value, target, event, autoValid) || this;
|
4800
|
+
}
|
4801
|
+
CheckedValidator.prototype.valid = function () {
|
4802
|
+
var _a, _b;
|
4803
|
+
return (_b = (_a = this.getTarget()) === null || _a === void 0 ? void 0 : _a.checked) !== null && _b !== void 0 ? _b : false;
|
4804
|
+
};
|
4805
|
+
return CheckedValidator;
|
4806
|
+
}(Validator));
|
4807
|
+
|
4859
4808
|
var CountGreaterThanCheckedValidatorArray = /** @class */ (function (_super) {
|
4860
4809
|
__extends(CountGreaterThanCheckedValidatorArray, _super);
|
4861
4810
|
function CountGreaterThanCheckedValidatorArray(count, value, target, event, autoValid) {
|
@@ -4871,34 +4820,19 @@ var CountGreaterThanCheckedValidatorArray = /** @class */ (function (_super) {
|
|
4871
4820
|
return CountGreaterThanCheckedValidatorArray;
|
4872
4821
|
}(ValidatorArray));
|
4873
4822
|
|
4874
|
-
var
|
4875
|
-
__extends(
|
4876
|
-
function
|
4877
|
-
if (autoValid === void 0) { autoValid = true; }
|
4878
|
-
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4879
|
-
_this.count = count;
|
4880
|
-
return _this;
|
4881
|
-
}
|
4882
|
-
CountEqualsCheckedValidatorArray.prototype.valid = function () {
|
4883
|
-
var _a;
|
4884
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length === this.count;
|
4885
|
-
};
|
4886
|
-
return CountEqualsCheckedValidatorArray;
|
4887
|
-
}(ValidatorArray));
|
4888
|
-
|
4889
|
-
var CountGreaterThanUnCheckedValidatorArray = /** @class */ (function (_super) {
|
4890
|
-
__extends(CountGreaterThanUnCheckedValidatorArray, _super);
|
4891
|
-
function CountGreaterThanUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
4823
|
+
var CountGreaterThanEqualsCheckedValidatorArray = /** @class */ (function (_super) {
|
4824
|
+
__extends(CountGreaterThanEqualsCheckedValidatorArray, _super);
|
4825
|
+
function CountGreaterThanEqualsCheckedValidatorArray(count, value, target, event, autoValid) {
|
4892
4826
|
if (autoValid === void 0) { autoValid = true; }
|
4893
4827
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4894
4828
|
_this.count = count;
|
4895
4829
|
return _this;
|
4896
4830
|
}
|
4897
|
-
|
4831
|
+
CountGreaterThanEqualsCheckedValidatorArray.prototype.valid = function () {
|
4898
4832
|
var _a;
|
4899
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return
|
4833
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length >= this.count;
|
4900
4834
|
};
|
4901
|
-
return
|
4835
|
+
return CountGreaterThanEqualsCheckedValidatorArray;
|
4902
4836
|
}(ValidatorArray));
|
4903
4837
|
|
4904
4838
|
var CountGreaterThanEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
|
@@ -4916,19 +4850,19 @@ var CountGreaterThanEqualsUnCheckedValidatorArray = /** @class */ (function (_su
|
|
4916
4850
|
return CountGreaterThanEqualsUnCheckedValidatorArray;
|
4917
4851
|
}(ValidatorArray));
|
4918
4852
|
|
4919
|
-
var
|
4920
|
-
__extends(
|
4921
|
-
function
|
4853
|
+
var CountLessThanEqualsCheckedValidatorArray = /** @class */ (function (_super) {
|
4854
|
+
__extends(CountLessThanEqualsCheckedValidatorArray, _super);
|
4855
|
+
function CountLessThanEqualsCheckedValidatorArray(count, value, target, event, autoValid) {
|
4922
4856
|
if (autoValid === void 0) { autoValid = true; }
|
4923
4857
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4924
4858
|
_this.count = count;
|
4925
4859
|
return _this;
|
4926
4860
|
}
|
4927
|
-
|
4861
|
+
CountLessThanEqualsCheckedValidatorArray.prototype.valid = function () {
|
4928
4862
|
var _a;
|
4929
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length
|
4863
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length <= this.count;
|
4930
4864
|
};
|
4931
|
-
return
|
4865
|
+
return CountLessThanEqualsCheckedValidatorArray;
|
4932
4866
|
}(ValidatorArray));
|
4933
4867
|
|
4934
4868
|
var CountLessThanCheckedValidatorArray = /** @class */ (function (_super) {
|
@@ -4946,34 +4880,65 @@ var CountLessThanCheckedValidatorArray = /** @class */ (function (_super) {
|
|
4946
4880
|
return CountLessThanCheckedValidatorArray;
|
4947
4881
|
}(ValidatorArray));
|
4948
4882
|
|
4949
|
-
var
|
4950
|
-
__extends(
|
4951
|
-
function
|
4883
|
+
var CountLessThanEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
|
4884
|
+
__extends(CountLessThanEqualsUnCheckedValidatorArray, _super);
|
4885
|
+
function CountLessThanEqualsUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
4952
4886
|
if (autoValid === void 0) { autoValid = true; }
|
4953
4887
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4954
4888
|
_this.count = count;
|
4955
4889
|
return _this;
|
4956
4890
|
}
|
4957
|
-
|
4891
|
+
CountLessThanEqualsUnCheckedValidatorArray.prototype.valid = function () {
|
4958
4892
|
var _a;
|
4959
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length
|
4893
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length <= this.count;
|
4960
4894
|
};
|
4961
|
-
return
|
4895
|
+
return CountLessThanEqualsUnCheckedValidatorArray;
|
4962
4896
|
}(ValidatorArray));
|
4963
4897
|
|
4964
|
-
var
|
4965
|
-
__extends(
|
4966
|
-
function
|
4898
|
+
var CountEqualsCheckedValidatorArray = /** @class */ (function (_super) {
|
4899
|
+
__extends(CountEqualsCheckedValidatorArray, _super);
|
4900
|
+
function CountEqualsCheckedValidatorArray(count, value, target, event, autoValid) {
|
4967
4901
|
if (autoValid === void 0) { autoValid = true; }
|
4968
|
-
|
4902
|
+
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4903
|
+
_this.count = count;
|
4904
|
+
return _this;
|
4969
4905
|
}
|
4970
|
-
|
4971
|
-
var _a
|
4972
|
-
|
4973
|
-
return value === undefined || value === null || ((_b = (_a = value) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) <= 0;
|
4906
|
+
CountEqualsCheckedValidatorArray.prototype.valid = function () {
|
4907
|
+
var _a;
|
4908
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length === this.count;
|
4974
4909
|
};
|
4975
|
-
return
|
4976
|
-
}(
|
4910
|
+
return CountEqualsCheckedValidatorArray;
|
4911
|
+
}(ValidatorArray));
|
4912
|
+
|
4913
|
+
var CountUnCheckedValidatorArray = /** @class */ (function (_super) {
|
4914
|
+
__extends(CountUnCheckedValidatorArray, _super);
|
4915
|
+
function CountUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
4916
|
+
if (autoValid === void 0) { autoValid = true; }
|
4917
|
+
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4918
|
+
_this.count = count;
|
4919
|
+
return _this;
|
4920
|
+
}
|
4921
|
+
CountUnCheckedValidatorArray.prototype.valid = function () {
|
4922
|
+
var _a;
|
4923
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length >= this.count;
|
4924
|
+
};
|
4925
|
+
return CountUnCheckedValidatorArray;
|
4926
|
+
}(ValidatorArray));
|
4927
|
+
|
4928
|
+
var CountGreaterThanUnCheckedValidatorArray = /** @class */ (function (_super) {
|
4929
|
+
__extends(CountGreaterThanUnCheckedValidatorArray, _super);
|
4930
|
+
function CountGreaterThanUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
4931
|
+
if (autoValid === void 0) { autoValid = true; }
|
4932
|
+
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4933
|
+
_this.count = count;
|
4934
|
+
return _this;
|
4935
|
+
}
|
4936
|
+
CountGreaterThanUnCheckedValidatorArray.prototype.valid = function () {
|
4937
|
+
var _a;
|
4938
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length > this.count;
|
4939
|
+
};
|
4940
|
+
return CountGreaterThanUnCheckedValidatorArray;
|
4941
|
+
}(ValidatorArray));
|
4977
4942
|
|
4978
4943
|
var ExcludeCheckedValidatorArray = /** @class */ (function (_super) {
|
4979
4944
|
__extends(ExcludeCheckedValidatorArray, _super);
|
@@ -4997,6 +4962,20 @@ var ExcludeCheckedValidatorArray = /** @class */ (function (_super) {
|
|
4997
4962
|
return ExcludeCheckedValidatorArray;
|
4998
4963
|
}(ValidatorArray));
|
4999
4964
|
|
4965
|
+
var EmptyValidator = /** @class */ (function (_super) {
|
4966
|
+
__extends(EmptyValidator, _super);
|
4967
|
+
function EmptyValidator(value, target, event, autoValid) {
|
4968
|
+
if (autoValid === void 0) { autoValid = true; }
|
4969
|
+
return _super.call(this, value, target, event, autoValid) || this;
|
4970
|
+
}
|
4971
|
+
EmptyValidator.prototype.valid = function () {
|
4972
|
+
var _a;
|
4973
|
+
var value = this.value;
|
4974
|
+
return value === undefined || value === null || ((_a = value === null || value === void 0 ? void 0 : value.length) !== null && _a !== void 0 ? _a : 0) <= 0;
|
4975
|
+
};
|
4976
|
+
return EmptyValidator;
|
4977
|
+
}(Validator));
|
4978
|
+
|
5000
4979
|
var IncludeCheckedValidatorArray = /** @class */ (function (_super) {
|
5001
4980
|
__extends(IncludeCheckedValidatorArray, _super);
|
5002
4981
|
function IncludeCheckedValidatorArray(include, allRequired, value, target, event, autoValid) {
|
@@ -5019,24 +4998,6 @@ var IncludeCheckedValidatorArray = /** @class */ (function (_super) {
|
|
5019
4998
|
return IncludeCheckedValidatorArray;
|
5020
4999
|
}(ValidatorArray));
|
5021
5000
|
|
5022
|
-
var FormValidator = /** @class */ (function (_super) {
|
5023
|
-
__extends(FormValidator, _super);
|
5024
|
-
function FormValidator(target, event, autoValid) {
|
5025
|
-
if (autoValid === void 0) { autoValid = true; }
|
5026
|
-
return _super.call(this, undefined, target, event, autoValid) || this;
|
5027
|
-
}
|
5028
|
-
FormValidator.prototype.validAction = function () {
|
5029
|
-
return _super.prototype.childValidAction.call(this);
|
5030
|
-
};
|
5031
|
-
FormValidator.prototype.valid = function () {
|
5032
|
-
return this.childValid();
|
5033
|
-
};
|
5034
|
-
FormValidator.prototype.reset = function () {
|
5035
|
-
this.targetReset();
|
5036
|
-
};
|
5037
|
-
return FormValidator;
|
5038
|
-
}(Validator));
|
5039
|
-
|
5040
5001
|
var MultipleValidator = /** @class */ (function (_super) {
|
5041
5002
|
__extends(MultipleValidator, _super);
|
5042
5003
|
function MultipleValidator(validators, value, target, event, autoValid) {
|
@@ -5066,20 +5027,60 @@ var MultipleValidator = /** @class */ (function (_super) {
|
|
5066
5027
|
return MultipleValidator;
|
5067
5028
|
}(Validator));
|
5068
5029
|
|
5069
|
-
var
|
5070
|
-
__extends(
|
5071
|
-
function
|
5030
|
+
var FormValidator = /** @class */ (function (_super) {
|
5031
|
+
__extends(FormValidator, _super);
|
5032
|
+
function FormValidator(target, event, autoValid) {
|
5033
|
+
if (autoValid === void 0) { autoValid = true; }
|
5034
|
+
return _super.call(this, undefined, target, event, autoValid) || this;
|
5035
|
+
}
|
5036
|
+
FormValidator.prototype.validAction = function () {
|
5037
|
+
return _super.prototype.childValidAction.call(this);
|
5038
|
+
};
|
5039
|
+
FormValidator.prototype.valid = function () {
|
5040
|
+
return this.childValid();
|
5041
|
+
};
|
5042
|
+
FormValidator.prototype.reset = function () {
|
5043
|
+
this.targetReset();
|
5044
|
+
};
|
5045
|
+
return FormValidator;
|
5046
|
+
}(Validator));
|
5047
|
+
|
5048
|
+
var NotEmptyValidator = /** @class */ (function (_super) {
|
5049
|
+
__extends(NotEmptyValidator, _super);
|
5050
|
+
function NotEmptyValidator(value, target, event, autoValid) {
|
5051
|
+
if (autoValid === void 0) { autoValid = true; }
|
5052
|
+
return _super.call(this, value, target, event, autoValid) || this;
|
5053
|
+
}
|
5054
|
+
NotEmptyValidator.prototype.valid = function () {
|
5055
|
+
var _a;
|
5056
|
+
var value = this.value;
|
5057
|
+
// console.log('NotEmptyValidator', value, value !== undefined && value !== null && ((value as any)?.length ?? 0) > 0)
|
5058
|
+
return value !== undefined && value !== null && ((_a = value === null || value === void 0 ? void 0 : value.length) !== null && _a !== void 0 ? _a : 0) > 0;
|
5059
|
+
};
|
5060
|
+
return NotEmptyValidator;
|
5061
|
+
}(Validator));
|
5062
|
+
|
5063
|
+
var NotRegExpTestValidator = /** @class */ (function (_super) {
|
5064
|
+
__extends(NotRegExpTestValidator, _super);
|
5065
|
+
function NotRegExpTestValidator(regexp, value, target, event, autoValid) {
|
5072
5066
|
if (autoValid === void 0) { autoValid = true; }
|
5073
5067
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
5074
|
-
_this.
|
5068
|
+
_this.regexp = DomRenderProxy.final(regexp);
|
5075
5069
|
return _this;
|
5076
5070
|
}
|
5077
|
-
|
5071
|
+
NotRegExpTestValidator.prototype.valid = function () {
|
5078
5072
|
var _a;
|
5079
|
-
|
5073
|
+
var value = this.value;
|
5074
|
+
var regExp = (_a = this.regexp._DomRender_origin) !== null && _a !== void 0 ? _a : this.regexp;
|
5075
|
+
if (value) {
|
5076
|
+
return !regExp.test(value);
|
5077
|
+
}
|
5078
|
+
else {
|
5079
|
+
return true;
|
5080
|
+
}
|
5080
5081
|
};
|
5081
|
-
return
|
5082
|
-
}(
|
5082
|
+
return NotRegExpTestValidator;
|
5083
|
+
}(Validator));
|
5083
5084
|
|
5084
5085
|
var RegExpTestValidator = /** @class */ (function (_super) {
|
5085
5086
|
__extends(RegExpTestValidator, _super);
|
@@ -5104,55 +5105,32 @@ var RegExpTestValidator = /** @class */ (function (_super) {
|
|
5104
5105
|
return RegExpTestValidator;
|
5105
5106
|
}(Validator));
|
5106
5107
|
|
5107
|
-
var
|
5108
|
-
__extends(
|
5109
|
-
function
|
5110
|
-
if (autoValid === void 0) { autoValid = true; }
|
5111
|
-
return _super.call(this, value, target, event, autoValid) || this;
|
5112
|
-
}
|
5113
|
-
RequiredValidator.prototype.valid = function () {
|
5114
|
-
var value = this.value;
|
5115
|
-
// console.log('required', value, value !== undefined && value !== null)
|
5116
|
-
return value !== undefined && value !== null;
|
5117
|
-
};
|
5118
|
-
return RequiredValidator;
|
5119
|
-
}(Validator));
|
5120
|
-
|
5121
|
-
var NotRegExpTestValidator = /** @class */ (function (_super) {
|
5122
|
-
__extends(NotRegExpTestValidator, _super);
|
5123
|
-
function NotRegExpTestValidator(regexp, value, target, event, autoValid) {
|
5108
|
+
var ValidValidator = /** @class */ (function (_super) {
|
5109
|
+
__extends(ValidValidator, _super);
|
5110
|
+
function ValidValidator(validCallBack, value, target, event, autoValid) {
|
5124
5111
|
if (autoValid === void 0) { autoValid = true; }
|
5125
5112
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
5126
|
-
_this.
|
5113
|
+
_this.validCallBack = validCallBack;
|
5127
5114
|
return _this;
|
5128
5115
|
}
|
5129
|
-
|
5130
|
-
|
5131
|
-
var value = this.value;
|
5132
|
-
var regExp = (_a = this.regexp._DomRender_origin) !== null && _a !== void 0 ? _a : this.regexp;
|
5133
|
-
if (value) {
|
5134
|
-
return !regExp.test(value);
|
5135
|
-
}
|
5136
|
-
else {
|
5137
|
-
return true;
|
5138
|
-
}
|
5116
|
+
ValidValidator.prototype.valid = function (value, target, event) {
|
5117
|
+
return this.validCallBack(value, target, event);
|
5139
5118
|
};
|
5140
|
-
return
|
5119
|
+
return ValidValidator;
|
5141
5120
|
}(Validator));
|
5142
5121
|
|
5143
|
-
var
|
5144
|
-
__extends(
|
5145
|
-
function
|
5122
|
+
var RequiredValidator = /** @class */ (function (_super) {
|
5123
|
+
__extends(RequiredValidator, _super);
|
5124
|
+
function RequiredValidator(value, target, event, autoValid) {
|
5146
5125
|
if (autoValid === void 0) { autoValid = true; }
|
5147
5126
|
return _super.call(this, value, target, event, autoValid) || this;
|
5148
5127
|
}
|
5149
|
-
|
5150
|
-
var _a, _b;
|
5128
|
+
RequiredValidator.prototype.valid = function () {
|
5151
5129
|
var value = this.value;
|
5152
|
-
// console.log('
|
5153
|
-
return value !== undefined && value !== null
|
5130
|
+
// console.log('required', value, value !== undefined && value !== null)
|
5131
|
+
return value !== undefined && value !== null;
|
5154
5132
|
};
|
5155
|
-
return
|
5133
|
+
return RequiredValidator;
|
5156
5134
|
}(Validator));
|
5157
5135
|
|
5158
5136
|
var ValidMultipleValidator = /** @class */ (function (_super) {
|
@@ -5183,34 +5161,6 @@ var UnCheckedValidator = /** @class */ (function (_super) {
|
|
5183
5161
|
return UnCheckedValidator;
|
5184
5162
|
}(Validator));
|
5185
5163
|
|
5186
|
-
var ValidValidator = /** @class */ (function (_super) {
|
5187
|
-
__extends(ValidValidator, _super);
|
5188
|
-
function ValidValidator(validCallBack, value, target, event, autoValid) {
|
5189
|
-
if (autoValid === void 0) { autoValid = true; }
|
5190
|
-
var _this = _super.call(this, value, target, event, autoValid) || this;
|
5191
|
-
_this.validCallBack = validCallBack;
|
5192
|
-
return _this;
|
5193
|
-
}
|
5194
|
-
ValidValidator.prototype.valid = function (value, target, event) {
|
5195
|
-
return this.validCallBack(value, target, event);
|
5196
|
-
};
|
5197
|
-
return ValidValidator;
|
5198
|
-
}(Validator));
|
5199
|
-
|
5200
|
-
var ValidValidatorArray = /** @class */ (function (_super) {
|
5201
|
-
__extends(ValidValidatorArray, _super);
|
5202
|
-
function ValidValidatorArray(validCallBack, value, target, event, autoValid) {
|
5203
|
-
if (autoValid === void 0) { autoValid = true; }
|
5204
|
-
var _this = _super.call(this, value, target, event, autoValid) || this;
|
5205
|
-
_this.validCallBack = validCallBack;
|
5206
|
-
return _this;
|
5207
|
-
}
|
5208
|
-
ValidValidatorArray.prototype.valid = function () {
|
5209
|
-
return this.validCallBack(this.value, this.getTarget(), this.getEvent());
|
5210
|
-
};
|
5211
|
-
return ValidValidatorArray;
|
5212
|
-
}(ValidatorArray));
|
5213
|
-
|
5214
5164
|
var ValueEqualsValidator = /** @class */ (function (_super) {
|
5215
5165
|
__extends(ValueEqualsValidator, _super);
|
5216
5166
|
function ValueEqualsValidator(equalsValue, value, target, event, autoValid) {
|
@@ -5225,48 +5175,33 @@ var ValueEqualsValidator = /** @class */ (function (_super) {
|
|
5225
5175
|
return ValueEqualsValidator;
|
5226
5176
|
}(Validator));
|
5227
5177
|
|
5228
|
-
var
|
5229
|
-
__extends(
|
5230
|
-
function
|
5231
|
-
if (autoValid === void 0) { autoValid = true; }
|
5232
|
-
var _this = _super.call(this, value, target, event, autoValid) || this;
|
5233
|
-
_this.equalsValue = equalsValue;
|
5234
|
-
return _this;
|
5235
|
-
}
|
5236
|
-
ValueNotEqualsValidator.prototype.valid = function () {
|
5237
|
-
return this.value !== this.equalsValue;
|
5238
|
-
};
|
5239
|
-
return ValueNotEqualsValidator;
|
5240
|
-
}(Validator));
|
5241
|
-
|
5242
|
-
var CountLessThanEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
|
5243
|
-
__extends(CountLessThanEqualsUnCheckedValidatorArray, _super);
|
5244
|
-
function CountLessThanEqualsUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
5178
|
+
var CountLessThanUnCheckedValidatorArray = /** @class */ (function (_super) {
|
5179
|
+
__extends(CountLessThanUnCheckedValidatorArray, _super);
|
5180
|
+
function CountLessThanUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
5245
5181
|
if (autoValid === void 0) { autoValid = true; }
|
5246
5182
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
5247
5183
|
_this.count = count;
|
5248
5184
|
return _this;
|
5249
5185
|
}
|
5250
|
-
|
5186
|
+
CountLessThanUnCheckedValidatorArray.prototype.valid = function () {
|
5251
5187
|
var _a;
|
5252
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length
|
5188
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length < this.count;
|
5253
5189
|
};
|
5254
|
-
return
|
5190
|
+
return CountLessThanUnCheckedValidatorArray;
|
5255
5191
|
}(ValidatorArray));
|
5256
5192
|
|
5257
|
-
var
|
5258
|
-
__extends(
|
5259
|
-
function
|
5193
|
+
var ValidValidatorArray = /** @class */ (function (_super) {
|
5194
|
+
__extends(ValidValidatorArray, _super);
|
5195
|
+
function ValidValidatorArray(validCallBack, value, target, event, autoValid) {
|
5260
5196
|
if (autoValid === void 0) { autoValid = true; }
|
5261
5197
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
5262
|
-
_this.
|
5198
|
+
_this.validCallBack = validCallBack;
|
5263
5199
|
return _this;
|
5264
5200
|
}
|
5265
|
-
|
5266
|
-
|
5267
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length <= this.count;
|
5201
|
+
ValidValidatorArray.prototype.valid = function () {
|
5202
|
+
return this.validCallBack(this.value, this.getTarget(), this.getEvent());
|
5268
5203
|
};
|
5269
|
-
return
|
5204
|
+
return ValidValidatorArray;
|
5270
5205
|
}(ValidatorArray));
|
5271
5206
|
|
5272
5207
|
var PassValidator = /** @class */ (function (_super) {
|
@@ -5281,29 +5216,19 @@ var PassValidator = /** @class */ (function (_super) {
|
|
5281
5216
|
return PassValidator;
|
5282
5217
|
}(Validator));
|
5283
5218
|
|
5284
|
-
var
|
5285
|
-
|
5219
|
+
var ValueNotEqualsValidator = /** @class */ (function (_super) {
|
5220
|
+
__extends(ValueNotEqualsValidator, _super);
|
5221
|
+
function ValueNotEqualsValidator(equalsValue, value, target, event, autoValid) {
|
5222
|
+
if (autoValid === void 0) { autoValid = true; }
|
5223
|
+
var _this = _super.call(this, value, target, event, autoValid) || this;
|
5224
|
+
_this.equalsValue = equalsValue;
|
5225
|
+
return _this;
|
5286
5226
|
}
|
5287
|
-
|
5288
|
-
|
5289
|
-
while (node === null || node === void 0 ? void 0 : node.firstChild) {
|
5290
|
-
node.firstChild.remove();
|
5291
|
-
}
|
5292
|
-
};
|
5293
|
-
NodeUtils.appendChild = function (parentNode, childNode) {
|
5294
|
-
return parentNode.appendChild(childNode);
|
5295
|
-
};
|
5296
|
-
NodeUtils.replaceNode = function (targetNode, newNode) {
|
5297
|
-
var _a;
|
5298
|
-
// console.log('repalceNode', targetNode, newNode, targetNode.parentNode)
|
5299
|
-
return (_a = targetNode.parentNode) === null || _a === void 0 ? void 0 : _a.replaceChild(newNode, targetNode);
|
5300
|
-
};
|
5301
|
-
NodeUtils.addNode = function (targetNode, newNode) {
|
5302
|
-
var _a;
|
5303
|
-
return (_a = targetNode.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(newNode, targetNode.nextSibling);
|
5227
|
+
ValueNotEqualsValidator.prototype.valid = function () {
|
5228
|
+
return this.value !== this.equalsValue;
|
5304
5229
|
};
|
5305
|
-
return
|
5306
|
-
}());
|
5230
|
+
return ValueNotEqualsValidator;
|
5231
|
+
}(Validator));
|
5307
5232
|
|
5308
5233
|
var StorageUtils = /** @class */ (function () {
|
5309
5234
|
function StorageUtils() {
|
@@ -5389,6 +5314,30 @@ var StorageUtils = /** @class */ (function () {
|
|
5389
5314
|
return StorageUtils;
|
5390
5315
|
}());
|
5391
5316
|
|
5317
|
+
var NodeUtils = /** @class */ (function () {
|
5318
|
+
function NodeUtils() {
|
5319
|
+
}
|
5320
|
+
// https://stackoverflow.com/questions/3955229/remove-all-child-elements-of-a-dom-node-in-javascript
|
5321
|
+
NodeUtils.removeAllChildNode = function (node) {
|
5322
|
+
while (node === null || node === void 0 ? void 0 : node.firstChild) {
|
5323
|
+
node.firstChild.remove();
|
5324
|
+
}
|
5325
|
+
};
|
5326
|
+
NodeUtils.appendChild = function (parentNode, childNode) {
|
5327
|
+
return parentNode.appendChild(childNode);
|
5328
|
+
};
|
5329
|
+
NodeUtils.replaceNode = function (targetNode, newNode) {
|
5330
|
+
var _a;
|
5331
|
+
// console.log('repalceNode', targetNode, newNode, targetNode.parentNode)
|
5332
|
+
return (_a = targetNode.parentNode) === null || _a === void 0 ? void 0 : _a.replaceChild(newNode, targetNode);
|
5333
|
+
};
|
5334
|
+
NodeUtils.addNode = function (targetNode, newNode) {
|
5335
|
+
var _a;
|
5336
|
+
return (_a = targetNode.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(newNode, targetNode.nextSibling);
|
5337
|
+
};
|
5338
|
+
return NodeUtils;
|
5339
|
+
}());
|
5340
|
+
|
5392
5341
|
var ClipBoardUtils = /** @class */ (function () {
|
5393
5342
|
function ClipBoardUtils() {
|
5394
5343
|
}
|