dom-render 1.0.93 → 1.0.95
Sign up to get free protection for your applications and to get access to all the features.
- package/DomRenderProxy.d.ts +1 -0
- package/DomRenderProxy.js +114 -48
- package/dist/bundle.js +477 -286
- package/events/EventManager.js +1 -0
- package/operators/Appender.js +9 -1
- package/operators/DrDictionary.d.ts +11 -0
- package/operators/DrDictionary.js +166 -0
- package/operators/DrThis.js +2 -0
- package/package.json +1 -1
- package/rawsets/Attrs.d.ts +2 -0
- package/rawsets/RawSet.d.ts +4 -2
- package/rawsets/RawSet.js +53 -35
package/dist/bundle.js
CHANGED
@@ -736,6 +736,7 @@ var EventManager = /** @class */ (function () {
|
|
736
736
|
EventManager.prototype.changeVar = function (obj, elements, varName, config) {
|
737
737
|
var _this = this;
|
738
738
|
// console.log('-changeVar-->', obj, elements, varName);
|
739
|
+
// forEach elements
|
739
740
|
// value-link event
|
740
741
|
this.procAttr(elements, EventManager.valueLinkAttrName, function (it, attribute) {
|
741
742
|
var ownerVariablePathName = it.getAttribute(EventManager.ownerVariablePathAttrName);
|
@@ -1251,9 +1252,11 @@ var DrThis = /** @class */ (function (_super) {
|
|
1251
1252
|
this.afterCallBack.onThisComponentSetCallBacks.push(attr);
|
1252
1253
|
return [3 /*break*/, 4];
|
1253
1254
|
case 2:
|
1255
|
+
// console.log('dr-this!!!!!!!', this.rawSet, this.source.obj)
|
1254
1256
|
_g = (_f = this.returnContainer.fag).append;
|
1255
1257
|
return [4 /*yield*/, RawSet.drThisCreate(this.rawSet, this.elementSource.element, this.elementSource.attrs.drThis, (_d = this.elementSource.attrs.drVarOption) !== null && _d !== void 0 ? _d : '', this.elementSource.attrs.drStripOption, this.source.obj, this.source.config)];
|
1256
1258
|
case 3:
|
1259
|
+
// console.log('dr-this!!!!!!!', this.rawSet, this.source.obj)
|
1257
1260
|
_g.apply(_f, [_j.sent()]);
|
1258
1261
|
_j.label = 4;
|
1259
1262
|
case 4:
|
@@ -1972,6 +1975,103 @@ exports.RawSetType = void 0;
|
|
1972
1975
|
RawSetType["UNKOWN"] = "UNKOWN";
|
1973
1976
|
})(exports.RawSetType || (exports.RawSetType = {}));
|
1974
1977
|
|
1978
|
+
var DrDictionary = /** @class */ (function (_super) {
|
1979
|
+
__extends(DrDictionary, _super);
|
1980
|
+
function DrDictionary(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
1981
|
+
source.operatorAround = undefined;
|
1982
|
+
return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
|
1983
|
+
}
|
1984
|
+
DrDictionary.prototype.executeAttrRequire = function (attr) {
|
1985
|
+
var _a, _b, _c, _d, _e;
|
1986
|
+
return __awaiter(this, void 0, void 0, function () {
|
1987
|
+
var itRandom, vars, newTemp, dictionaryKey, tempalte, rr;
|
1988
|
+
var _f;
|
1989
|
+
return __generator(this, function (_g) {
|
1990
|
+
itRandom = RawSet.drItOtherEncoding(this.elementSource.element);
|
1991
|
+
vars = RawSet.drVarEncoding(this.elementSource.element, (_a = this.elementSource.attrs.drVarOption) !== null && _a !== void 0 ? _a : '');
|
1992
|
+
newTemp = this.source.config.window.document.createElement('temp');
|
1993
|
+
ScriptUtils.evalReturn(attr, this.source.obj);
|
1994
|
+
dictionaryKey = (_b = this.elementSource.attrs.drDictionaryOption) !== null && _b !== void 0 ? _b : '';
|
1995
|
+
// console.log('--->', attr, dictionaryKey)
|
1996
|
+
// if (!(dictioanry instanceof Dictionary)) {
|
1997
|
+
// return ExecuteState.STOP;
|
1998
|
+
// }
|
1999
|
+
// await new Promise(resolve => setTimeout(resolve, 1000));
|
2000
|
+
// console.log('!!!!!!!!!!!!!!', this.rawSet);
|
2001
|
+
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 // const oldChild = this.__render.oldChild.get(it);\n // if (oldChild && oldChild.length > 0) {\n // this.__render.fag.append(...oldChild);\n // } else {\n // var destIt = dictionaryStr + '[\"' + it + '\"]';\n // const n = this.__render.element.cloneNode(true);\n // n.setAttribute('dr-this', destIt);\n // // n.setAttribute('dr-dictionary', dictionaryStr);\n // n.setAttribute('dr-dictionary-key', it);\n // this.__render.fag.append(n);\n // }\n // if (!this.__render.oldChild.get(it)) {\n // var destIt = dictionaryStr + '[\"' + it + '\"]';\n // const n = this.__render.element.cloneNode(true);\n // n.setAttribute('dr-this', destIt);\n // // n.setAttribute('dr-dictionary', dictionaryStr);\n // n.setAttribute('dr-dictionary-key', it);\n // this.__render.fag.append(n);\n // }\n var destIt = dictionaryStr + '[\"' + it + '\"]';\n const n = this.__render.element.cloneNode(true);\n n.setAttribute('dr-this', destIt);\n // n.setAttribute('dr-dictionary', dictionaryStr);\n // n.setAttribute('dr-dictionary-key', it);\n this.__render.fag.append(n);\n i++;\n }\n this.__render.rawset.point.start.setAttribute('dictionary-keys',Object.keys(dictionary).join(','));\n }\n ").concat((_d = this.elementSource.attrs.drAfterOption) !== null && _d !== void 0 ? _d : '', "\n "), Object.assign(this.source.obj, {
|
2002
|
+
__render: Object.freeze(__assign({ drStripOption: this.elementSource.attrs.drStripOption, drAttr: this.elementSource.attrs, drAttrsOriginName: RawSet.drAttrsOriginName, fag: newTemp }, this.render))
|
2003
|
+
}));
|
2004
|
+
RawSet.drVarDecoding(newTemp, vars);
|
2005
|
+
RawSet.drItOtherDecoding(newTemp, itRandom);
|
2006
|
+
tempalte = this.source.config.window.document.createElement('template');
|
2007
|
+
tempalte.innerHTML = newTemp.innerHTML;
|
2008
|
+
this.returnContainer.fag.append(tempalte.content);
|
2009
|
+
rr = RawSet.checkPointCreates(this.returnContainer.fag, this.source.obj, this.source.config);
|
2010
|
+
(_e = this.elementSource.element.parentNode) === null || _e === void 0 ? void 0 : _e.replaceChild(this.returnContainer.fag, this.elementSource.element);
|
2011
|
+
// const rrr = rr.flatMap(it => it.render(obj, config));// .flat();
|
2012
|
+
(_f = this.returnContainer.raws).push.apply(_f, rr);
|
2013
|
+
return [2 /*return*/, exports.ExecuteState.EXECUTE];
|
2014
|
+
});
|
2015
|
+
});
|
2016
|
+
};
|
2017
|
+
DrDictionary.getChildren = function (rawSet, config) {
|
2018
|
+
var _a, _b, _c;
|
2019
|
+
var next = rawSet.point.start.nextSibling;
|
2020
|
+
var oldChild = new Map();
|
2021
|
+
var currentKey = '';
|
2022
|
+
while (next) {
|
2023
|
+
if (next === rawSet.point.end) {
|
2024
|
+
break;
|
2025
|
+
}
|
2026
|
+
var dictionaryKey = (_b = (_a = next).getAttribute) === null || _b === void 0 ? void 0 : _b.call(_a, 'dictionary-key');
|
2027
|
+
if (dictionaryKey) {
|
2028
|
+
currentKey = dictionaryKey;
|
2029
|
+
oldChild.set(dictionaryKey, []);
|
2030
|
+
}
|
2031
|
+
// console.log('next-------->', currentKey, next);
|
2032
|
+
if (currentKey) {
|
2033
|
+
(_c = oldChild.get(currentKey)) === null || _c === void 0 ? void 0 : _c.push(next);
|
2034
|
+
}
|
2035
|
+
next = next.nextSibling;
|
2036
|
+
}
|
2037
|
+
return oldChild;
|
2038
|
+
};
|
2039
|
+
DrDictionary.append = function (obj, fullPath, key, rawSet, config) {
|
2040
|
+
var _this = this;
|
2041
|
+
var _a, _b;
|
2042
|
+
var genNode = config.window.document.importNode(rawSet.fragment, true);
|
2043
|
+
// console.log('---> append', rawSet, genNode);
|
2044
|
+
var rawSets = [];
|
2045
|
+
for (var _i = 0, _c = Array.from(genNode.childNodes.values()); _i < _c.length; _i++) {
|
2046
|
+
var cNode = _c[_i];
|
2047
|
+
var element = cNode.cloneNode(true);
|
2048
|
+
element.removeAttribute('dr-dictionary');
|
2049
|
+
element.setAttribute('dr-this', "this.".concat(fullPath));
|
2050
|
+
// rawSet.point.end.after(element);
|
2051
|
+
var fg = config.window.document.createDocumentFragment();
|
2052
|
+
fg.append(element);
|
2053
|
+
rawSets.push.apply(rawSets, RawSet.checkPointCreates(fg, obj, config));
|
2054
|
+
rawSet.point.end.before(fg);
|
2055
|
+
var start = rawSet.point.start;
|
2056
|
+
var keys = (_b = (_a = start.getAttribute('dictionary-keys')) === null || _a === void 0 ? void 0 : _a.split(',')) !== null && _b !== void 0 ? _b : [];
|
2057
|
+
keys.push(key);
|
2058
|
+
start.setAttribute('dictionary-keys', keys.join(','));
|
2059
|
+
rawSets.forEach(function (it) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
2060
|
+
switch (_a.label) {
|
2061
|
+
case 0: return [4 /*yield*/, it.render(obj, config)];
|
2062
|
+
case 1: return [2 /*return*/, _a.sent()];
|
2063
|
+
}
|
2064
|
+
}); }); });
|
2065
|
+
// console.log('WWW', fg, Array.from(fg.childNodes));
|
2066
|
+
// console.log('--------------------------rawSets', rawSets);
|
2067
|
+
}
|
2068
|
+
return rawSets;
|
2069
|
+
// rawSet.
|
2070
|
+
// rawSet.point.end.before()
|
2071
|
+
};
|
2072
|
+
return DrDictionary;
|
2073
|
+
}(OperatorExecuterAttrRequire));
|
2074
|
+
|
1975
2075
|
var RawSet = /** @class */ (function () {
|
1976
2076
|
function RawSet(uuid, type, point, fragment, detect, data) {
|
1977
2077
|
this.uuid = uuid;
|
@@ -2037,12 +2137,12 @@ var RawSet = /** @class */ (function () {
|
|
2037
2137
|
};
|
2038
2138
|
// 중요 render 처리 부분
|
2039
2139
|
RawSet.prototype.render = function (obj, config) {
|
2040
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
2140
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
2041
2141
|
return __awaiter(this, void 0, void 0, function () {
|
2042
|
-
var genNode, raws, onAttrInitCallBacks, onElementInitCallBacks, onThisComponentSetCallBacks, drAttrs, _i,
|
2142
|
+
var genNode, raws, onAttrInitCallBacks, onElementInitCallBacks, onThisComponentSetCallBacks, drAttrs, _i, _z, cNode, attribute, __render, fag, textContent, runText, newNode, r, template, r, element, drAttr, operators, _0, operators_1, operator, state, _1, onThisComponentSetCallBacks_1, it_1, _2, onElementInitCallBacks_1, it_2, oninit, param, script, _3, onAttrInitCallBacks_1, it_3;
|
2043
2143
|
var _this = this;
|
2044
|
-
return __generator(this, function (
|
2045
|
-
switch (
|
2144
|
+
return __generator(this, function (_4) {
|
2145
|
+
switch (_4.label) {
|
2046
2146
|
case 0:
|
2047
2147
|
genNode = config.window.document.importNode(this.fragment, true);
|
2048
2148
|
raws = [];
|
@@ -2050,11 +2150,11 @@ var RawSet = /** @class */ (function () {
|
|
2050
2150
|
onElementInitCallBacks = [];
|
2051
2151
|
onThisComponentSetCallBacks = [];
|
2052
2152
|
drAttrs = [];
|
2053
|
-
_i = 0,
|
2054
|
-
|
2153
|
+
_i = 0, _z = Array.from(genNode.childNodes.values());
|
2154
|
+
_4.label = 1;
|
2055
2155
|
case 1:
|
2056
|
-
if (!(_i <
|
2057
|
-
cNode =
|
2156
|
+
if (!(_i < _z.length)) return [3 /*break*/, 7];
|
2157
|
+
cNode = _z[_i];
|
2058
2158
|
attribute = {};
|
2059
2159
|
if (cNode.nodeType === Node.ELEMENT_NODE) {
|
2060
2160
|
attribute = DomUtils.getAttributeToObject(cNode);
|
@@ -2099,6 +2199,7 @@ var RawSet = /** @class */ (function () {
|
|
2099
2199
|
drIf: this.getAttributeAndDelete(element, RawSet.DR_IF_NAME),
|
2100
2200
|
drFor: this.getAttributeAndDelete(element, RawSet.DR_FOR_NAME),
|
2101
2201
|
drForOf: this.getAttributeAndDelete(element, RawSet.DR_FOR_OF_NAME),
|
2202
|
+
drDictionary: this.getAttributeAndDelete(element, RawSet.DR_DICTIONARY_NAME),
|
2102
2203
|
drAppender: this.getAttributeAndDelete(element, RawSet.DR_APPENDER_NAME),
|
2103
2204
|
drRepeat: this.getAttributeAndDelete(element, RawSet.DR_REPEAT_NAME),
|
2104
2205
|
drThis: this.getAttributeAndDelete(element, RawSet.DR_THIS_NAME),
|
@@ -2113,7 +2214,8 @@ var RawSet = /** @class */ (function () {
|
|
2113
2214
|
drBeforeOption: this.getAttributeAndDelete(element, RawSet.DR_BEFORE_OPTIONNAME),
|
2114
2215
|
drCompleteOption: this.getAttributeAndDelete(element, RawSet.DR_COMPLETE_OPTIONNAME),
|
2115
2216
|
drStripOption: this.getAttributeAndDelete(element, RawSet.DR_STRIP_OPTIONNAME),
|
2116
|
-
drDestroyOption: this.getAttributeAndDelete(element, RawSet.DR_DESTROY_OPTIONNAME)
|
2217
|
+
drDestroyOption: this.getAttributeAndDelete(element, RawSet.DR_DESTROY_OPTIONNAME),
|
2218
|
+
drDictionaryOption: this.getAttributeAndDelete(element, RawSet.DR_DICTIONARY_OPTIONKEYNAME)
|
2117
2219
|
};
|
2118
2220
|
drAttrs.push(drAttr);
|
2119
2221
|
operators = [
|
@@ -2126,28 +2228,29 @@ var RawSet = /** @class */ (function () {
|
|
2126
2228
|
new DrInnerHTML(this, __render, { raws: raws, fag: fag }, { element: element, attrName: RawSet.DR_INNERHTML_NAME, attr: drAttr.drInnerHTML, attrs: drAttr }, { config: config, obj: obj, operatorAround: (_h = config.operatorAround) === null || _h === void 0 ? void 0 : _h.drInnerHTML }, { onAttrInitCallBacks: onAttrInitCallBacks, onElementInitCallBacks: onElementInitCallBacks, onThisComponentSetCallBacks: onThisComponentSetCallBacks }),
|
2127
2229
|
new DrFor(this, __render, { raws: raws, fag: fag }, { element: element, attrName: RawSet.DR_FOR_NAME, attr: drAttr.drFor, attrs: drAttr }, { config: config, obj: obj, operatorAround: (_j = config.operatorAround) === null || _j === void 0 ? void 0 : _j.drFor }, { onAttrInitCallBacks: onAttrInitCallBacks, onElementInitCallBacks: onElementInitCallBacks, onThisComponentSetCallBacks: onThisComponentSetCallBacks }),
|
2128
2230
|
new DrForOf(this, __render, { raws: raws, fag: fag }, { element: element, attrName: RawSet.DR_FOR_OF_NAME, attr: drAttr.drForOf, attrs: drAttr }, { config: config, obj: obj, operatorAround: (_k = config.operatorAround) === null || _k === void 0 ? void 0 : _k.drForOf }, { onAttrInitCallBacks: onAttrInitCallBacks, onElementInitCallBacks: onElementInitCallBacks, onThisComponentSetCallBacks: onThisComponentSetCallBacks }),
|
2129
|
-
new
|
2130
|
-
new
|
2231
|
+
new DrDictionary(this, __render, { raws: raws, fag: fag }, { element: element, attrName: RawSet.DR_DICTIONARY_NAME, attr: drAttr.drDictionary, attrs: drAttr }, { config: config, obj: obj, operatorAround: (_l = config.operatorAround) === null || _l === void 0 ? void 0 : _l.drDictionary }, { onAttrInitCallBacks: onAttrInitCallBacks, onElementInitCallBacks: onElementInitCallBacks, onThisComponentSetCallBacks: onThisComponentSetCallBacks }),
|
2232
|
+
new DrAppender(this, __render, { raws: raws, fag: fag }, { element: element, attrName: RawSet.DR_APPENDER_NAME, attr: drAttr.drAppender, attrs: drAttr }, { config: config, obj: obj, operatorAround: (_m = config.operatorAround) === null || _m === void 0 ? void 0 : _m.drAppender }, { onAttrInitCallBacks: onAttrInitCallBacks, onElementInitCallBacks: onElementInitCallBacks, onThisComponentSetCallBacks: onThisComponentSetCallBacks }),
|
2233
|
+
new DrRepeat(this, __render, { raws: raws, fag: fag }, { element: element, attrName: RawSet.DR_REPEAT_NAME, attr: drAttr.drRepeat, attrs: drAttr }, { config: config, obj: obj, operatorAround: (_o = config.operatorAround) === null || _o === void 0 ? void 0 : _o.drRepeat }, { onAttrInitCallBacks: onAttrInitCallBacks, onElementInitCallBacks: onElementInitCallBacks, onThisComponentSetCallBacks: onThisComponentSetCallBacks }),
|
2131
2234
|
new DrTargetElement(this, __render, { raws: raws, fag: fag }, { element: element, attrs: drAttr }, { config: config, obj: obj }, { onAttrInitCallBacks: onAttrInitCallBacks, onElementInitCallBacks: onElementInitCallBacks, onThisComponentSetCallBacks: onThisComponentSetCallBacks }),
|
2132
2235
|
new DrTargetAttr(this, __render, { raws: raws, fag: fag }, { element: element, attrs: drAttr }, { config: config, obj: obj }, { onAttrInitCallBacks: onAttrInitCallBacks, onElementInitCallBacks: onElementInitCallBacks, onThisComponentSetCallBacks: onThisComponentSetCallBacks })
|
2133
2236
|
];
|
2134
|
-
|
2135
|
-
|
2237
|
+
_0 = 0, operators_1 = operators;
|
2238
|
+
_4.label = 3;
|
2136
2239
|
case 3:
|
2137
|
-
if (!(
|
2138
|
-
operator = operators_1[
|
2240
|
+
if (!(_0 < operators_1.length)) return [3 /*break*/, 6];
|
2241
|
+
operator = operators_1[_0];
|
2139
2242
|
return [4 /*yield*/, operator.start()];
|
2140
2243
|
case 4:
|
2141
|
-
state =
|
2244
|
+
state = _4.sent();
|
2142
2245
|
if (state === exports.ExecuteState.EXECUTE) {
|
2143
2246
|
return [3 /*break*/, 6];
|
2144
2247
|
}
|
2145
2248
|
else if (state === exports.ExecuteState.STOP) {
|
2146
2249
|
return [2 /*return*/, raws];
|
2147
2250
|
}
|
2148
|
-
|
2251
|
+
_4.label = 5;
|
2149
2252
|
case 5:
|
2150
|
-
|
2253
|
+
_0++;
|
2151
2254
|
return [3 /*break*/, 3];
|
2152
2255
|
case 6:
|
2153
2256
|
_i++;
|
@@ -2168,13 +2271,13 @@ var RawSet = /** @class */ (function () {
|
|
2168
2271
|
});
|
2169
2272
|
// 중요 style isolation 나중에 :scope로 대체 가능할듯.
|
2170
2273
|
RawSet.generateStyleSheetsLocal();
|
2171
|
-
for (
|
2172
|
-
it_1 = onThisComponentSetCallBacks_1[
|
2173
|
-
(
|
2274
|
+
for (_1 = 0, onThisComponentSetCallBacks_1 = onThisComponentSetCallBacks; _1 < onThisComponentSetCallBacks_1.length; _1++) {
|
2275
|
+
it_1 = onThisComponentSetCallBacks_1[_1];
|
2276
|
+
(_q = (_p = it_1.obj) === null || _p === void 0 ? void 0 : _p.onInitRender) === null || _q === void 0 ? void 0 : _q.call(_p);
|
2174
2277
|
}
|
2175
|
-
for (
|
2176
|
-
it_2 = onElementInitCallBacks_1[
|
2177
|
-
if (((
|
2278
|
+
for (_2 = 0, onElementInitCallBacks_1 = onElementInitCallBacks; _2 < onElementInitCallBacks_1.length; _2++) {
|
2279
|
+
it_2 = onElementInitCallBacks_1[_2];
|
2280
|
+
if (((_s = (_r = it_2.targetElement) === null || _r === void 0 ? void 0 : _r.__render) === null || _s === void 0 ? void 0 : _s.element) && ((_u = (_t = it_2.targetElement) === null || _t === void 0 ? void 0 : _t.__render) === null || _u === void 0 ? void 0 : _u.component)) {
|
2178
2281
|
oninit = it_2.targetElement.__render.element.getAttribute(RawSet.DR_ON_INIT_ARGUMENTS_OPTIONNAME);
|
2179
2282
|
param = [];
|
2180
2283
|
if (oninit) {
|
@@ -2186,14 +2289,14 @@ var RawSet = /** @class */ (function () {
|
|
2186
2289
|
param = [param];
|
2187
2290
|
}
|
2188
2291
|
}
|
2189
|
-
(
|
2292
|
+
(_w = (_v = it_2.targetElement.__render.component).onInitRender) === null || _w === void 0 ? void 0 : _w.call.apply(_w, __spreadArray([_v], param, false));
|
2190
2293
|
}
|
2191
|
-
(
|
2294
|
+
(_x = config === null || config === void 0 ? void 0 : config.onElementInit) === null || _x === void 0 ? void 0 : _x.call(config, it_2.name, obj, this, it_2.targetElement);
|
2192
2295
|
}
|
2193
2296
|
// TODO: 이부분도 위에 targetElement 처럼 해야될까?
|
2194
|
-
for (
|
2195
|
-
it_3 = onAttrInitCallBacks_1[
|
2196
|
-
(
|
2297
|
+
for (_3 = 0, onAttrInitCallBacks_1 = onAttrInitCallBacks; _3 < onAttrInitCallBacks_1.length; _3++) {
|
2298
|
+
it_3 = onAttrInitCallBacks_1[_3];
|
2299
|
+
(_y = config === null || config === void 0 ? void 0 : config.onAttrInit) === null || _y === void 0 ? void 0 : _y.call(config, it_3.attrName, it_3.attrValue, obj, this);
|
2197
2300
|
}
|
2198
2301
|
// component destroy
|
2199
2302
|
if (obj.__domrender_components) {
|
@@ -2391,9 +2494,10 @@ var RawSet = /** @class */ (function () {
|
|
2391
2494
|
else {
|
2392
2495
|
type = exports.RawSetType.TEXT;
|
2393
2496
|
}
|
2394
|
-
var
|
2497
|
+
var node = document.createTextNode(preparedText);
|
2498
|
+
var startEndPoint = RawSet.createStartEndPoint(node, it_4.uuid, type, config);
|
2395
2499
|
// layout setting
|
2396
|
-
template.content.append(
|
2500
|
+
template.content.append(node); // 앞 부분 넣고
|
2397
2501
|
template.content.append(startEndPoint.start); // add start checkpoint
|
2398
2502
|
template.content.append(startEndPoint.end); // add end checkpoint
|
2399
2503
|
// content 안쪽 RawSet render 할때 start 와 end 사이에 fragment 연산해서 들어간다.
|
@@ -2416,7 +2520,7 @@ var RawSet = /** @class */ (function () {
|
|
2416
2520
|
var element_3 = currentNode;
|
2417
2521
|
var fragment = config.window.document.createDocumentFragment();
|
2418
2522
|
var type = exports.RawSetType.TARGET_ELEMENT;
|
2419
|
-
var startEndPoint = RawSet.createStartEndPoint(uuid, type, config);
|
2523
|
+
var startEndPoint = RawSet.createStartEndPoint(element_3, uuid, type, config);
|
2420
2524
|
var isElement = ((_d = (_c = config.targetElements) === null || _c === void 0 ? void 0 : _c.map(function (it) { return it.name.toLowerCase(); })) !== null && _d !== void 0 ? _d : []).includes(element_3.tagName.toLowerCase());
|
2421
2525
|
var targetAttrNames_2 = ((_f = (_e = config.targetAttrs) === null || _e === void 0 ? void 0 : _e.map(function (it) { return it.name; })) !== null && _f !== void 0 ? _f : []).concat(RawSet.DR_ATTRIBUTES);
|
2422
2526
|
var isAttr = element_3.getAttributeNames().filter(function (it) { return targetAttrNames_2.includes(it.toLowerCase()); }).length > 0;
|
@@ -2439,11 +2543,20 @@ var RawSet = /** @class */ (function () {
|
|
2439
2543
|
// console.log('check-->', pars)
|
2440
2544
|
return pars;
|
2441
2545
|
};
|
2442
|
-
RawSet.createStartEndPoint = function (id, type, config) {
|
2546
|
+
RawSet.createStartEndPoint = function (node, id, type, config) {
|
2443
2547
|
if (type === exports.RawSetType.TARGET_ELEMENT) {
|
2548
|
+
var element = node;
|
2444
2549
|
var start = config.window.document.createElement('meta');
|
2445
2550
|
var end = config.window.document.createElement('meta');
|
2446
2551
|
start.setAttribute('id', "".concat(id, "-start"));
|
2552
|
+
var dictionaryKey = element.getAttribute('dr-dictionary-key');
|
2553
|
+
var dictionary = element.getAttribute('dr-dictionary');
|
2554
|
+
if (dictionary) {
|
2555
|
+
start.setAttribute('type', 'dictionary');
|
2556
|
+
}
|
2557
|
+
if (dictionaryKey) {
|
2558
|
+
start.setAttribute('dictionary-key', dictionaryKey);
|
2559
|
+
}
|
2447
2560
|
end.setAttribute('id', "".concat(id, "-end"));
|
2448
2561
|
return {
|
2449
2562
|
start: start,
|
@@ -2894,6 +3007,7 @@ var RawSet = /** @class */ (function () {
|
|
2894
3007
|
RawSet.DR_IF_NAME = 'dr-if';
|
2895
3008
|
RawSet.DR_FOR_NAME = 'dr-for';
|
2896
3009
|
RawSet.DR_FOR_OF_NAME = 'dr-for-of';
|
3010
|
+
RawSet.DR_DICTIONARY_NAME = 'dr-dictionary';
|
2897
3011
|
RawSet.DR_REPEAT_NAME = 'dr-repeat';
|
2898
3012
|
RawSet.DR_THIS_NAME = 'dr-this';
|
2899
3013
|
RawSet.DR_FORM_NAME = 'dr-form';
|
@@ -2912,6 +3026,7 @@ var RawSet = /** @class */ (function () {
|
|
2912
3026
|
RawSet.DR_DESTROY_OPTIONNAME = 'dr-destroy';
|
2913
3027
|
RawSet.DR_COMPONENT_NAME_OPTIONNAME = 'dr-component-name';
|
2914
3028
|
RawSet.DR_COMPONENT_INNER_HTML_NAME_OPTIONNAME = 'dr-component-inner-html-name';
|
3029
|
+
RawSet.DR_DICTIONARY_OPTIONKEYNAME = 'dr-dictionary-key';
|
2915
3030
|
RawSet.DR_ON_CREATE_ARGUMENTS_OPTIONNAME = 'dr-on-create:arguments';
|
2916
3031
|
RawSet.DR_ON_CREATED_CALLBACK_OPTIONNAME = 'dr-on-create:callback';
|
2917
3032
|
RawSet.DR_ON_INIT_ARGUMENTS_OPTIONNAME = 'dr-on-init:arguments';
|
@@ -2921,6 +3036,7 @@ var RawSet = /** @class */ (function () {
|
|
2921
3036
|
drIf: RawSet.DR_IF_NAME,
|
2922
3037
|
drFor: RawSet.DR_FOR_NAME,
|
2923
3038
|
drForOf: RawSet.DR_FOR_OF_NAME,
|
3039
|
+
drDictionary: RawSet.DR_DICTIONARY_NAME,
|
2924
3040
|
drAppender: RawSet.DR_APPENDER_NAME,
|
2925
3041
|
drRepeat: RawSet.DR_REPEAT_NAME,
|
2926
3042
|
drThis: RawSet.DR_THIS_NAME,
|
@@ -2935,10 +3051,11 @@ var RawSet = /** @class */ (function () {
|
|
2935
3051
|
drBeforeOption: RawSet.DR_BEFORE_OPTIONNAME,
|
2936
3052
|
drCompleteOption: RawSet.DR_COMPLETE_OPTIONNAME,
|
2937
3053
|
drStripOption: RawSet.DR_STRIP_OPTIONNAME,
|
2938
|
-
drDestroyOption: RawSet.DR_DESTROY_OPTIONNAME
|
3054
|
+
drDestroyOption: RawSet.DR_DESTROY_OPTIONNAME,
|
3055
|
+
drDictionaryOption: RawSet.DR_DICTIONARY_OPTIONKEYNAME
|
2939
3056
|
};
|
2940
3057
|
RawSet.DR_TAGS = [];
|
2941
|
-
RawSet.DR_ATTRIBUTES = [RawSet.DR_NAME, RawSet.DR_APPENDER_NAME, RawSet.DR_IF_NAME, RawSet.DR_FOR_OF_NAME, RawSet.DR_FOR_NAME, RawSet.DR_THIS_NAME, RawSet.DR_FORM_NAME, RawSet.DR_PRE_NAME, RawSet.DR_INNERHTML_NAME, RawSet.DR_INNERTEXT_NAME, RawSet.DR_REPEAT_NAME, RawSet.DR_DETECT_NAME];
|
3058
|
+
RawSet.DR_ATTRIBUTES = [RawSet.DR_NAME, RawSet.DR_APPENDER_NAME, RawSet.DR_IF_NAME, RawSet.DR_FOR_OF_NAME, RawSet.DR_DICTIONARY_NAME, RawSet.DR_FOR_NAME, RawSet.DR_THIS_NAME, RawSet.DR_FORM_NAME, RawSet.DR_PRE_NAME, RawSet.DR_INNERHTML_NAME, RawSet.DR_INNERTEXT_NAME, RawSet.DR_REPEAT_NAME, RawSet.DR_DETECT_NAME];
|
2942
3059
|
return RawSet;
|
2943
3060
|
}());
|
2944
3061
|
|
@@ -2993,7 +3110,7 @@ var DomRenderProxy = /** @class */ (function () {
|
|
2993
3110
|
};
|
2994
3111
|
DomRenderProxy.prototype.initRender = function (target) {
|
2995
3112
|
var _this = this;
|
2996
|
-
var _a, _b, _c, _d, _e
|
3113
|
+
var _a, _b, _c, _d, _e;
|
2997
3114
|
var onCreate = (_b = (_a = target).getAttribute) === null || _b === void 0 ? void 0 : _b.call(_a, RawSet.DR_ON_CREATE_ARGUMENTS_OPTIONNAME);
|
2998
3115
|
var createParam = [];
|
2999
3116
|
if (onCreate) {
|
@@ -3020,22 +3137,24 @@ var DomRenderProxy = /** @class */ (function () {
|
|
3020
3137
|
});
|
3021
3138
|
}
|
3022
3139
|
});
|
3023
|
-
this.render(this.getRawSets())
|
3024
|
-
|
3025
|
-
|
3026
|
-
|
3027
|
-
|
3028
|
-
|
3029
|
-
|
3030
|
-
|
3031
|
-
|
3032
|
-
|
3033
|
-
|
3034
|
-
|
3035
|
-
initParam
|
3140
|
+
this.render(this.getRawSets()).then(function (it) {
|
3141
|
+
var _a, _b, _c, _d;
|
3142
|
+
// const render = {target} as Render;
|
3143
|
+
// const creatorMetaData = {
|
3144
|
+
// creator: this._domRender_proxy,
|
3145
|
+
// rootCreator: this._domRender_proxy,
|
3146
|
+
// innerHTML
|
3147
|
+
// } as CreatorMetaData;
|
3148
|
+
(_b = (_a = target).getAttribute) === null || _b === void 0 ? void 0 : _b.call(_a, RawSet.DR_ON_INIT_ARGUMENTS_OPTIONNAME);
|
3149
|
+
var initParam = [];
|
3150
|
+
if (onCreate) {
|
3151
|
+
initParam = ScriptUtils.evalReturn(onCreate, _this._domRender_proxy);
|
3152
|
+
if (!Array.isArray(initParam)) {
|
3153
|
+
initParam = [initParam];
|
3154
|
+
}
|
3036
3155
|
}
|
3037
|
-
|
3038
|
-
|
3156
|
+
(_d = (_c = _this._domRender_proxy) === null || _c === void 0 ? void 0 : _c.onInitRender) === null || _d === void 0 ? void 0 : _d.call.apply(_d, __spreadArray([_c], initParam, false));
|
3157
|
+
});
|
3039
3158
|
};
|
3040
3159
|
DomRenderProxy.prototype.getRawSets = function () {
|
3041
3160
|
var set = new Set();
|
@@ -3070,11 +3189,11 @@ var DomRenderProxy = /** @class */ (function () {
|
|
3070
3189
|
switch (_e.label) {
|
3071
3190
|
case 0:
|
3072
3191
|
it_1.getUsingTriggerVariables(this_1.config).forEach(function (path) { return _this.addRawSet(path, it_1); });
|
3073
|
-
if (!it_1.isConnected) return [3 /*break*/,
|
3192
|
+
if (!it_1.isConnected) return [3 /*break*/, 6];
|
3074
3193
|
targetAttrMap = (_b = (_a = it_1.point.node) === null || _a === void 0 ? void 0 : _a.getAttribute) === null || _b === void 0 ? void 0 : _b.call(_a, EventManager.normalAttrMapAttrName);
|
3075
3194
|
if (!((_c = it_1.detect) === null || _c === void 0 ? void 0 : _c.action)) return [3 /*break*/, 1];
|
3076
3195
|
it_1.detect.action();
|
3077
|
-
return [3 /*break*/,
|
3196
|
+
return [3 /*break*/, 5];
|
3078
3197
|
case 1:
|
3079
3198
|
if (!(it_1.type === exports.RawSetType.TARGET_ELEMENT && it_1.data && fullPathStr && targetAttrMap && it_1.fragment.render)) return [3 /*break*/, 2];
|
3080
3199
|
new Map(JSON.parse(targetAttrMap)).forEach(function (v, k) {
|
@@ -3090,20 +3209,20 @@ var DomRenderProxy = /** @class */ (function () {
|
|
3090
3209
|
}
|
3091
3210
|
// console.log('---?', v, fullPathStr, isUsing);
|
3092
3211
|
});
|
3093
|
-
return [3 /*break*/,
|
3212
|
+
return [3 /*break*/, 5];
|
3094
3213
|
case 2: return [4 /*yield*/, it_1.render(this_1._domRender_proxy, this_1.config)];
|
3095
3214
|
case 3:
|
3096
3215
|
rawSets_2 = _e.sent();
|
3097
|
-
|
3098
|
-
|
3099
|
-
|
3100
|
-
|
3101
|
-
_e.label =
|
3102
|
-
case
|
3103
|
-
case
|
3216
|
+
if (!(rawSets_2 && rawSets_2.length > 0)) return [3 /*break*/, 5];
|
3217
|
+
return [4 /*yield*/, this_1.render(rawSets_2)];
|
3218
|
+
case 4:
|
3219
|
+
_e.sent();
|
3220
|
+
_e.label = 5;
|
3221
|
+
case 5: return [3 /*break*/, 7];
|
3222
|
+
case 6:
|
3104
3223
|
removeRawSets.push(it_1);
|
3105
|
-
_e.label =
|
3106
|
-
case
|
3224
|
+
_e.label = 7;
|
3225
|
+
case 7: return [2 /*return*/];
|
3107
3226
|
}
|
3108
3227
|
});
|
3109
3228
|
};
|
@@ -3153,33 +3272,88 @@ var DomRenderProxy = /** @class */ (function () {
|
|
3153
3272
|
});
|
3154
3273
|
}
|
3155
3274
|
else {
|
3275
|
+
// const firstPathStr = paths.slice(1).reverse().join('.');
|
3156
3276
|
var strings = paths.reverse();
|
3157
3277
|
// array같은경우도 키값으로 접근하기때문에 특정 인덱스를 찾아서 그부분만 바꿔줄수 있다.
|
3158
3278
|
var fullPathStr_1 = strings.map(function (it) { return isNaN(Number(it)) ? '.' + it : "[".concat(it, "]"); }).join('').slice(1);
|
3279
|
+
// console.log('-------fullPathStr', fullPathStr, lastDoneExecute);
|
3159
3280
|
if (lastDoneExecute) {
|
3160
|
-
|
3161
|
-
// console.log('
|
3281
|
+
// const firstData = ScriptUtils.evalReturn('this.' + firstPathStr, this._domRender_proxy);
|
3282
|
+
// console.log('-------', firstPathStr, firstData);
|
3283
|
+
// if (firstData instanceof Dictionary) {
|
3284
|
+
// }
|
3285
|
+
var iterable_1 = this._rawSets.get(fullPathStr_1);
|
3162
3286
|
// array check
|
3163
|
-
var
|
3164
|
-
var
|
3165
|
-
var
|
3166
|
-
|
3167
|
-
|
3168
|
-
|
3169
|
-
|
3287
|
+
var front_1 = strings.slice(0, strings.length - 1).map(function (it) { return isNaN(Number(it)) ? '.' + it : "[".concat(it, "]"); }).join('');
|
3288
|
+
var last_1 = strings[strings.length - 1];
|
3289
|
+
var data_1 = ScriptUtils.evalReturn('this' + front_1, this._domRender_proxy);
|
3290
|
+
// console.log('-------!!!!!', fullPathStr, iterable, data, front, last);
|
3291
|
+
new Promise(function (resolve) {
|
3292
|
+
var firstPathStr = front_1.slice(1);
|
3293
|
+
// console.log('-promise-------', firstPathStr, this)
|
3294
|
+
var firstTargets = _this._rawSets.get(firstPathStr);
|
3295
|
+
var firstTargetDictionary = [];
|
3296
|
+
firstTargets === null || firstTargets === void 0 ? void 0 : firstTargets.forEach(function (it) {
|
3297
|
+
var _a, _b;
|
3298
|
+
// console.log('----forEach---', it);
|
3299
|
+
var type = (_b = (_a = it.point.start).getAttribute) === null || _b === void 0 ? void 0 : _b.call(_a, 'type');
|
3300
|
+
if (type === 'dictionary') {
|
3301
|
+
firstTargetDictionary.push(it);
|
3302
|
+
}
|
3303
|
+
});
|
3304
|
+
if (firstTargetDictionary.length > 0) {
|
3305
|
+
// console.log('ddddddddddd', firstTargetDictionary);
|
3306
|
+
var rawSets_3 = [];
|
3307
|
+
var skip_1 = false;
|
3308
|
+
firstTargetDictionary.forEach(function (it) {
|
3309
|
+
var _a, _b;
|
3310
|
+
var keys = (_b = (_a = it.point.start.getAttribute('dictionary-keys')) === null || _a === void 0 ? void 0 : _a.split(',')) !== null && _b !== void 0 ? _b : [];
|
3311
|
+
if (!keys.includes(last_1)) {
|
3312
|
+
var raws = DrDictionary.append(_this._domRender_proxy, fullPathStr_1, last_1, it, _this.config);
|
3313
|
+
// console.log('----append---', raws);
|
3314
|
+
if (raws) {
|
3315
|
+
rawSets_3.push.apply(rawSets_3, raws);
|
3316
|
+
}
|
3317
|
+
}
|
3318
|
+
else {
|
3319
|
+
skip_1 = true;
|
3320
|
+
}
|
3321
|
+
});
|
3322
|
+
if (skip_1 === false || rawSets_3.length > 0) {
|
3323
|
+
return _this.render(rawSets_3);
|
3324
|
+
}
|
3325
|
+
// console.log('rawSets-->#$$$$$$$$$$$', this._rawSets);
|
3326
|
+
// rawSets.forEach(it => this.addRawSet(fullPathStr, it));
|
3327
|
+
// DrDictionary.append(this._domRender_proxy, fullPathStr, it, this.config);
|
3328
|
+
// it.render(this._domRender_proxy, this.config);
|
3170
3329
|
}
|
3171
|
-
|
3172
|
-
|
3173
|
-
|
3174
|
-
|
3175
|
-
|
3176
|
-
|
3177
|
-
|
3178
|
-
if (
|
3179
|
-
var
|
3180
|
-
|
3181
|
-
|
3330
|
+
/* if (data instanceof Dictionary) {
|
3331
|
+
const a = this._rawSets.get(firstPathStr);
|
3332
|
+
// a?.forEach(it => {
|
3333
|
+
// if (it.type === RawSetType.TARGET_ATTR)
|
3334
|
+
// })
|
3335
|
+
console.log('dictionary-->', data, last, value, this._rawSets, a);
|
3336
|
+
} else */
|
3337
|
+
if (last_1 === 'length' && Array.isArray(data_1)) {
|
3338
|
+
var aIterable = _this._rawSets.get(firstPathStr);
|
3339
|
+
if (aIterable) {
|
3340
|
+
return _this.render(Array.from(aIterable));
|
3341
|
+
}
|
3342
|
+
}
|
3343
|
+
else if (iterable_1) {
|
3344
|
+
return _this.render(Array.from(iterable_1), fullPathStr_1);
|
3182
3345
|
}
|
3346
|
+
}).then(function (it) {
|
3347
|
+
console.log('target1------->,', it);
|
3348
|
+
_this._targets.forEach(function (it) {
|
3349
|
+
console.log('target2------->,', it);
|
3350
|
+
// return;
|
3351
|
+
if (it.nodeType === Node.DOCUMENT_FRAGMENT_NODE || it.nodeType === Node.ELEMENT_NODE) {
|
3352
|
+
var targets = eventManager.findAttrElements(it, _this.config);
|
3353
|
+
// console.log('------>', targets);
|
3354
|
+
eventManager.changeVar(_this._domRender_proxy, targets, "this.".concat(fullPathStr_1), _this.config);
|
3355
|
+
}
|
3356
|
+
});
|
3183
3357
|
});
|
3184
3358
|
}
|
3185
3359
|
fullPaths.push(fullPathStr_1);
|
@@ -3188,6 +3362,7 @@ var DomRenderProxy = /** @class */ (function () {
|
|
3188
3362
|
};
|
3189
3363
|
DomRenderProxy.prototype.set = function (target, p, value, receiver) {
|
3190
3364
|
var _a, _b;
|
3365
|
+
// console.log('set-->', p, value, target, receiver);
|
3191
3366
|
if (typeof p === 'string' && p !== '__domrender_components' && excludeGetSetPropertys.includes(p)) {
|
3192
3367
|
target[p] = value;
|
3193
3368
|
return true;
|
@@ -3249,6 +3424,13 @@ var DomRenderProxy = /** @class */ (function () {
|
|
3249
3424
|
return it_2;
|
3250
3425
|
}
|
3251
3426
|
};
|
3427
|
+
DomRenderProxy.prototype.deleteProperty = function (target, p) {
|
3428
|
+
delete target[p];
|
3429
|
+
if (typeof p === 'string') {
|
3430
|
+
this.root([p]);
|
3431
|
+
}
|
3432
|
+
return true;
|
3433
|
+
};
|
3252
3434
|
DomRenderProxy.prototype.has = function (target, p) {
|
3253
3435
|
return p === '_DomRender_isProxy' || p in target;
|
3254
3436
|
};
|
@@ -3880,7 +4062,7 @@ var Appender = /** @class */ (function () {
|
|
3880
4062
|
for (var _i = 0; _i < arguments.length; _i++) {
|
3881
4063
|
items[_i] = arguments[_i];
|
3882
4064
|
}
|
3883
|
-
// console.log('----2>', this.length)
|
4065
|
+
// console.log('----2>', items, this.length);
|
3884
4066
|
items.index = this.length;
|
3885
4067
|
this[this.length++] = items;
|
3886
4068
|
// console.log('---22->', this.length)
|
@@ -3888,6 +4070,14 @@ var Appender = /** @class */ (function () {
|
|
3888
4070
|
// appender.values = items;
|
3889
4071
|
// this.childs.push(new Appender(appender.index + 1));
|
3890
4072
|
};
|
4073
|
+
// delete(idx: number): void {
|
4074
|
+
// // if (idx in this) {
|
4075
|
+
// // console.log('---------dele',idx)
|
4076
|
+
// // delete this[idx];
|
4077
|
+
// // this.length = this.length - 1;
|
4078
|
+
// // }
|
4079
|
+
// this.length = this.length - 1;
|
4080
|
+
// }
|
3891
4081
|
Appender.prototype.clear = function () {
|
3892
4082
|
// console.log('length', this.length);
|
3893
4083
|
for (var i = 0; i < this.length; i++) {
|
@@ -3911,18 +4101,18 @@ var AllUnCheckedValidatorArray = /** @class */ (function (_super) {
|
|
3911
4101
|
return AllUnCheckedValidatorArray;
|
3912
4102
|
}(ValidatorArray));
|
3913
4103
|
|
3914
|
-
var
|
3915
|
-
__extends(
|
3916
|
-
function
|
4104
|
+
var AllCheckedValidatorArray = /** @class */ (function (_super) {
|
4105
|
+
__extends(AllCheckedValidatorArray, _super);
|
4106
|
+
function AllCheckedValidatorArray(value, target, event, autoValid) {
|
3917
4107
|
if (autoValid === void 0) { autoValid = true; }
|
3918
4108
|
return _super.call(this, value, target, event, autoValid) || this;
|
3919
4109
|
}
|
3920
|
-
|
3921
|
-
var _a
|
3922
|
-
return (
|
4110
|
+
AllCheckedValidatorArray.prototype.valid = function () {
|
4111
|
+
var _a;
|
4112
|
+
return !(((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length > 0);
|
3923
4113
|
};
|
3924
|
-
return
|
3925
|
-
}(
|
4114
|
+
return AllCheckedValidatorArray;
|
4115
|
+
}(ValidatorArray));
|
3926
4116
|
|
3927
4117
|
var CountEqualsCheckedValidatorArray = /** @class */ (function (_super) {
|
3928
4118
|
__extends(CountEqualsCheckedValidatorArray, _super);
|
@@ -3939,18 +4129,18 @@ var CountEqualsCheckedValidatorArray = /** @class */ (function (_super) {
|
|
3939
4129
|
return CountEqualsCheckedValidatorArray;
|
3940
4130
|
}(ValidatorArray));
|
3941
4131
|
|
3942
|
-
var
|
3943
|
-
__extends(
|
3944
|
-
function
|
4132
|
+
var CheckedValidator = /** @class */ (function (_super) {
|
4133
|
+
__extends(CheckedValidator, _super);
|
4134
|
+
function CheckedValidator(value, target, event, autoValid) {
|
3945
4135
|
if (autoValid === void 0) { autoValid = true; }
|
3946
4136
|
return _super.call(this, value, target, event, autoValid) || this;
|
3947
4137
|
}
|
3948
|
-
|
3949
|
-
var _a;
|
3950
|
-
return
|
4138
|
+
CheckedValidator.prototype.valid = function () {
|
4139
|
+
var _a, _b;
|
4140
|
+
return (_b = (_a = this.getTarget()) === null || _a === void 0 ? void 0 : _a.checked) !== null && _b !== void 0 ? _b : false;
|
3951
4141
|
};
|
3952
|
-
return
|
3953
|
-
}(
|
4142
|
+
return CheckedValidator;
|
4143
|
+
}(Validator));
|
3954
4144
|
|
3955
4145
|
var CountEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
|
3956
4146
|
__extends(CountEqualsUnCheckedValidatorArray, _super);
|
@@ -3982,79 +4172,64 @@ var CountGreaterThanEqualsCheckedValidatorArray = /** @class */ (function (_supe
|
|
3982
4172
|
return CountGreaterThanEqualsCheckedValidatorArray;
|
3983
4173
|
}(ValidatorArray));
|
3984
4174
|
|
3985
|
-
var
|
3986
|
-
__extends(
|
3987
|
-
function
|
3988
|
-
if (autoValid === void 0) { autoValid = true; }
|
3989
|
-
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3990
|
-
_this.count = count;
|
3991
|
-
return _this;
|
3992
|
-
}
|
3993
|
-
CountGreaterThanEqualsUnCheckedValidatorArray.prototype.valid = function () {
|
3994
|
-
var _a;
|
3995
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length >= this.count;
|
3996
|
-
};
|
3997
|
-
return CountGreaterThanEqualsUnCheckedValidatorArray;
|
3998
|
-
}(ValidatorArray));
|
3999
|
-
|
4000
|
-
var CountGreaterThanUnCheckedValidatorArray = /** @class */ (function (_super) {
|
4001
|
-
__extends(CountGreaterThanUnCheckedValidatorArray, _super);
|
4002
|
-
function CountGreaterThanUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
4175
|
+
var CountGreaterThanCheckedValidatorArray = /** @class */ (function (_super) {
|
4176
|
+
__extends(CountGreaterThanCheckedValidatorArray, _super);
|
4177
|
+
function CountGreaterThanCheckedValidatorArray(count, value, target, event, autoValid) {
|
4003
4178
|
if (autoValid === void 0) { autoValid = true; }
|
4004
4179
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4005
4180
|
_this.count = count;
|
4006
4181
|
return _this;
|
4007
4182
|
}
|
4008
|
-
|
4183
|
+
CountGreaterThanCheckedValidatorArray.prototype.valid = function () {
|
4009
4184
|
var _a;
|
4010
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return
|
4185
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length > this.count;
|
4011
4186
|
};
|
4012
|
-
return
|
4187
|
+
return CountGreaterThanCheckedValidatorArray;
|
4013
4188
|
}(ValidatorArray));
|
4014
4189
|
|
4015
|
-
var
|
4016
|
-
__extends(
|
4017
|
-
function
|
4190
|
+
var CountLessThanEqualsCheckedValidatorArray = /** @class */ (function (_super) {
|
4191
|
+
__extends(CountLessThanEqualsCheckedValidatorArray, _super);
|
4192
|
+
function CountLessThanEqualsCheckedValidatorArray(count, value, target, event, autoValid) {
|
4018
4193
|
if (autoValid === void 0) { autoValid = true; }
|
4019
4194
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4020
4195
|
_this.count = count;
|
4021
4196
|
return _this;
|
4022
4197
|
}
|
4023
|
-
|
4198
|
+
CountLessThanEqualsCheckedValidatorArray.prototype.valid = function () {
|
4024
4199
|
var _a;
|
4025
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length
|
4200
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length <= this.count;
|
4026
4201
|
};
|
4027
|
-
return
|
4202
|
+
return CountLessThanEqualsCheckedValidatorArray;
|
4028
4203
|
}(ValidatorArray));
|
4029
4204
|
|
4030
|
-
var
|
4031
|
-
__extends(
|
4032
|
-
function
|
4205
|
+
var CountGreaterThanEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
|
4206
|
+
__extends(CountGreaterThanEqualsUnCheckedValidatorArray, _super);
|
4207
|
+
function CountGreaterThanEqualsUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
4033
4208
|
if (autoValid === void 0) { autoValid = true; }
|
4034
4209
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4035
4210
|
_this.count = count;
|
4036
4211
|
return _this;
|
4037
4212
|
}
|
4038
|
-
|
4213
|
+
CountGreaterThanEqualsUnCheckedValidatorArray.prototype.valid = function () {
|
4039
4214
|
var _a;
|
4040
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length
|
4215
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length >= this.count;
|
4041
4216
|
};
|
4042
|
-
return
|
4217
|
+
return CountGreaterThanEqualsUnCheckedValidatorArray;
|
4043
4218
|
}(ValidatorArray));
|
4044
4219
|
|
4045
|
-
var
|
4046
|
-
__extends(
|
4047
|
-
function
|
4220
|
+
var CountGreaterThanUnCheckedValidatorArray = /** @class */ (function (_super) {
|
4221
|
+
__extends(CountGreaterThanUnCheckedValidatorArray, _super);
|
4222
|
+
function CountGreaterThanUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
4048
4223
|
if (autoValid === void 0) { autoValid = true; }
|
4049
4224
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4050
4225
|
_this.count = count;
|
4051
4226
|
return _this;
|
4052
4227
|
}
|
4053
|
-
|
4228
|
+
CountGreaterThanUnCheckedValidatorArray.prototype.valid = function () {
|
4054
4229
|
var _a;
|
4055
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length
|
4230
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length > this.count;
|
4056
4231
|
};
|
4057
|
-
return
|
4232
|
+
return CountGreaterThanUnCheckedValidatorArray;
|
4058
4233
|
}(ValidatorArray));
|
4059
4234
|
|
4060
4235
|
var CountLessThanEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
|
@@ -4072,58 +4247,21 @@ var CountLessThanEqualsUnCheckedValidatorArray = /** @class */ (function (_super
|
|
4072
4247
|
return CountLessThanEqualsUnCheckedValidatorArray;
|
4073
4248
|
}(ValidatorArray));
|
4074
4249
|
|
4075
|
-
var
|
4076
|
-
__extends(
|
4077
|
-
function
|
4250
|
+
var CountLessThanUnCheckedValidatorArray = /** @class */ (function (_super) {
|
4251
|
+
__extends(CountLessThanUnCheckedValidatorArray, _super);
|
4252
|
+
function CountLessThanUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
4078
4253
|
if (autoValid === void 0) { autoValid = true; }
|
4079
4254
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4080
4255
|
_this.count = count;
|
4081
4256
|
return _this;
|
4082
4257
|
}
|
4083
|
-
|
4084
|
-
var _a;
|
4085
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length <= this.count;
|
4086
|
-
};
|
4087
|
-
return CountLessThanEqualsCheckedValidatorArray;
|
4088
|
-
}(ValidatorArray));
|
4089
|
-
|
4090
|
-
var ExcludeCheckedValidatorArray = /** @class */ (function (_super) {
|
4091
|
-
__extends(ExcludeCheckedValidatorArray, _super);
|
4092
|
-
function ExcludeCheckedValidatorArray(include, allRequired, value, target, event, autoValid) {
|
4093
|
-
if (allRequired === void 0) { allRequired = false; }
|
4094
|
-
if (autoValid === void 0) { autoValid = true; }
|
4095
|
-
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4096
|
-
_this.include = include;
|
4097
|
-
_this.allRequired = allRequired;
|
4098
|
-
return _this;
|
4099
|
-
}
|
4100
|
-
ExcludeCheckedValidatorArray.prototype.valid = function () {
|
4101
|
-
var _this = this;
|
4258
|
+
CountLessThanUnCheckedValidatorArray.prototype.valid = function () {
|
4102
4259
|
var _a;
|
4103
|
-
|
4104
|
-
var unCheckedValue = valus.filter(function (it) { return !it.checked; }).map(function (it) { return it.value; });
|
4105
|
-
return unCheckedValue.length > 0 &&
|
4106
|
-
(!(unCheckedValue.filter(function (it) { return !_this.include.includes(it); }).length > 0)) &&
|
4107
|
-
(this.allRequired ? unCheckedValue.filter(function (it) { return _this.include.includes(it); }).length === this.include.length : true);
|
4260
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length < this.count;
|
4108
4261
|
};
|
4109
|
-
return
|
4262
|
+
return CountLessThanUnCheckedValidatorArray;
|
4110
4263
|
}(ValidatorArray));
|
4111
4264
|
|
4112
|
-
var NotEmptyValidator = /** @class */ (function (_super) {
|
4113
|
-
__extends(NotEmptyValidator, _super);
|
4114
|
-
function NotEmptyValidator(value, target, event, autoValid) {
|
4115
|
-
if (autoValid === void 0) { autoValid = true; }
|
4116
|
-
return _super.call(this, value, target, event, autoValid) || this;
|
4117
|
-
}
|
4118
|
-
NotEmptyValidator.prototype.valid = function () {
|
4119
|
-
var _a;
|
4120
|
-
var value = this.value;
|
4121
|
-
// console.log('NotEmptyValidator', value, value !== undefined && value !== null && ((value as any)?.length ?? 0) > 0)
|
4122
|
-
return value !== undefined && value !== null && ((_a = value === null || value === void 0 ? void 0 : value.length) !== null && _a !== void 0 ? _a : 0) > 0;
|
4123
|
-
};
|
4124
|
-
return NotEmptyValidator;
|
4125
|
-
}(Validator));
|
4126
|
-
|
4127
4265
|
var EmptyValidator = /** @class */ (function (_super) {
|
4128
4266
|
__extends(EmptyValidator, _super);
|
4129
4267
|
function EmptyValidator(value, target, event, autoValid) {
|
@@ -4153,9 +4291,9 @@ var CountUnCheckedValidatorArray = /** @class */ (function (_super) {
|
|
4153
4291
|
return CountUnCheckedValidatorArray;
|
4154
4292
|
}(ValidatorArray));
|
4155
4293
|
|
4156
|
-
var
|
4157
|
-
__extends(
|
4158
|
-
function
|
4294
|
+
var ExcludeCheckedValidatorArray = /** @class */ (function (_super) {
|
4295
|
+
__extends(ExcludeCheckedValidatorArray, _super);
|
4296
|
+
function ExcludeCheckedValidatorArray(include, allRequired, value, target, event, autoValid) {
|
4159
4297
|
if (allRequired === void 0) { allRequired = false; }
|
4160
4298
|
if (autoValid === void 0) { autoValid = true; }
|
4161
4299
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
@@ -4163,28 +4301,49 @@ var IncludeCheckedValidatorArray = /** @class */ (function (_super) {
|
|
4163
4301
|
_this.allRequired = allRequired;
|
4164
4302
|
return _this;
|
4165
4303
|
}
|
4166
|
-
|
4304
|
+
ExcludeCheckedValidatorArray.prototype.valid = function () {
|
4167
4305
|
var _this = this;
|
4168
4306
|
var _a;
|
4169
4307
|
var valus = (_a = this.value) !== null && _a !== void 0 ? _a : [];
|
4170
|
-
var
|
4171
|
-
return
|
4172
|
-
(!(
|
4173
|
-
(this.allRequired ?
|
4308
|
+
var unCheckedValue = valus.filter(function (it) { return !it.checked; }).map(function (it) { return it.value; });
|
4309
|
+
return unCheckedValue.length > 0 &&
|
4310
|
+
(!(unCheckedValue.filter(function (it) { return !_this.include.includes(it); }).length > 0)) &&
|
4311
|
+
(this.allRequired ? unCheckedValue.filter(function (it) { return _this.include.includes(it); }).length === this.include.length : true);
|
4174
4312
|
};
|
4175
|
-
return
|
4313
|
+
return ExcludeCheckedValidatorArray;
|
4176
4314
|
}(ValidatorArray));
|
4177
4315
|
|
4178
|
-
var
|
4179
|
-
__extends(
|
4180
|
-
function
|
4316
|
+
var CountLessThanCheckedValidatorArray = /** @class */ (function (_super) {
|
4317
|
+
__extends(CountLessThanCheckedValidatorArray, _super);
|
4318
|
+
function CountLessThanCheckedValidatorArray(count, value, target, event, autoValid) {
|
4181
4319
|
if (autoValid === void 0) { autoValid = true; }
|
4182
|
-
|
4320
|
+
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4321
|
+
_this.count = count;
|
4322
|
+
return _this;
|
4183
4323
|
}
|
4184
|
-
|
4185
|
-
|
4324
|
+
CountLessThanCheckedValidatorArray.prototype.valid = function () {
|
4325
|
+
var _a;
|
4326
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length < this.count;
|
4186
4327
|
};
|
4187
|
-
return
|
4328
|
+
return CountLessThanCheckedValidatorArray;
|
4329
|
+
}(ValidatorArray));
|
4330
|
+
|
4331
|
+
var FormValidator = /** @class */ (function (_super) {
|
4332
|
+
__extends(FormValidator, _super);
|
4333
|
+
function FormValidator(target, event, autoValid) {
|
4334
|
+
if (autoValid === void 0) { autoValid = true; }
|
4335
|
+
return _super.call(this, undefined, target, event, autoValid) || this;
|
4336
|
+
}
|
4337
|
+
FormValidator.prototype.validAction = function () {
|
4338
|
+
return _super.prototype.childValidAction.call(this);
|
4339
|
+
};
|
4340
|
+
FormValidator.prototype.valid = function () {
|
4341
|
+
return this.childValid();
|
4342
|
+
};
|
4343
|
+
FormValidator.prototype.reset = function () {
|
4344
|
+
this.targetReset();
|
4345
|
+
};
|
4346
|
+
return FormValidator;
|
4188
4347
|
}(Validator));
|
4189
4348
|
|
4190
4349
|
var NotRegExpTestValidator = /** @class */ (function (_super) {
|
@@ -4209,59 +4368,27 @@ var NotRegExpTestValidator = /** @class */ (function (_super) {
|
|
4209
4368
|
return NotRegExpTestValidator;
|
4210
4369
|
}(Validator));
|
4211
4370
|
|
4212
|
-
var
|
4213
|
-
__extends(
|
4214
|
-
function
|
4371
|
+
var IncludeCheckedValidatorArray = /** @class */ (function (_super) {
|
4372
|
+
__extends(IncludeCheckedValidatorArray, _super);
|
4373
|
+
function IncludeCheckedValidatorArray(include, allRequired, value, target, event, autoValid) {
|
4374
|
+
if (allRequired === void 0) { allRequired = false; }
|
4215
4375
|
if (autoValid === void 0) { autoValid = true; }
|
4216
4376
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4217
|
-
_this.
|
4377
|
+
_this.include = include;
|
4378
|
+
_this.allRequired = allRequired;
|
4218
4379
|
return _this;
|
4219
4380
|
}
|
4220
|
-
|
4381
|
+
IncludeCheckedValidatorArray.prototype.valid = function () {
|
4382
|
+
var _this = this;
|
4221
4383
|
var _a;
|
4222
|
-
var
|
4223
|
-
var
|
4224
|
-
|
4225
|
-
|
4226
|
-
return
|
4227
|
-
}
|
4228
|
-
else {
|
4229
|
-
return false;
|
4230
|
-
}
|
4231
|
-
};
|
4232
|
-
return RegExpTestValidator;
|
4233
|
-
}(Validator));
|
4234
|
-
|
4235
|
-
var FormValidator = /** @class */ (function (_super) {
|
4236
|
-
__extends(FormValidator, _super);
|
4237
|
-
function FormValidator(target, event, autoValid) {
|
4238
|
-
if (autoValid === void 0) { autoValid = true; }
|
4239
|
-
return _super.call(this, undefined, target, event, autoValid) || this;
|
4240
|
-
}
|
4241
|
-
FormValidator.prototype.validAction = function () {
|
4242
|
-
return _super.prototype.childValidAction.call(this);
|
4243
|
-
};
|
4244
|
-
FormValidator.prototype.valid = function () {
|
4245
|
-
return this.childValid();
|
4246
|
-
};
|
4247
|
-
FormValidator.prototype.reset = function () {
|
4248
|
-
this.targetReset();
|
4249
|
-
};
|
4250
|
-
return FormValidator;
|
4251
|
-
}(Validator));
|
4252
|
-
|
4253
|
-
var UnCheckedValidator = /** @class */ (function (_super) {
|
4254
|
-
__extends(UnCheckedValidator, _super);
|
4255
|
-
function UnCheckedValidator(value, target, event, autoValid) {
|
4256
|
-
if (autoValid === void 0) { autoValid = true; }
|
4257
|
-
return _super.call(this, value, target, event, autoValid) || this;
|
4258
|
-
}
|
4259
|
-
UnCheckedValidator.prototype.valid = function () {
|
4260
|
-
var _a, _b;
|
4261
|
-
return !((_b = (_a = this.getTarget()) === null || _a === void 0 ? void 0 : _a.checked) !== null && _b !== void 0 ? _b : false);
|
4384
|
+
var valus = (_a = this.value) !== null && _a !== void 0 ? _a : [];
|
4385
|
+
var checkedValue = valus.filter(function (it) { return it.checked; }).map(function (it) { return it.value; });
|
4386
|
+
return checkedValue.length > 0 &&
|
4387
|
+
(!(checkedValue.filter(function (it) { return !_this.include.includes(it); }).length > 0)) &&
|
4388
|
+
(this.allRequired ? checkedValue.filter(function (it) { return _this.include.includes(it); }).length === this.include.length : true);
|
4262
4389
|
};
|
4263
|
-
return
|
4264
|
-
}(
|
4390
|
+
return IncludeCheckedValidatorArray;
|
4391
|
+
}(ValidatorArray));
|
4265
4392
|
|
4266
4393
|
var MultipleValidator = /** @class */ (function (_super) {
|
4267
4394
|
__extends(MultipleValidator, _super);
|
@@ -4292,32 +4419,39 @@ var MultipleValidator = /** @class */ (function (_super) {
|
|
4292
4419
|
return MultipleValidator;
|
4293
4420
|
}(Validator));
|
4294
4421
|
|
4295
|
-
var
|
4296
|
-
__extends(
|
4297
|
-
function
|
4422
|
+
var PassValidator = /** @class */ (function (_super) {
|
4423
|
+
__extends(PassValidator, _super);
|
4424
|
+
function PassValidator(value, target, event, autoValid) {
|
4298
4425
|
if (autoValid === void 0) { autoValid = true; }
|
4299
|
-
|
4300
|
-
_this.validCallBack = validCallBack;
|
4301
|
-
return _this;
|
4426
|
+
return _super.call(this, value, target, event, autoValid) || this;
|
4302
4427
|
}
|
4303
|
-
|
4304
|
-
return
|
4428
|
+
PassValidator.prototype.valid = function () {
|
4429
|
+
return true;
|
4305
4430
|
};
|
4306
|
-
return
|
4307
|
-
}(
|
4431
|
+
return PassValidator;
|
4432
|
+
}(Validator));
|
4308
4433
|
|
4309
|
-
var
|
4310
|
-
__extends(
|
4311
|
-
function
|
4434
|
+
var RegExpTestValidator = /** @class */ (function (_super) {
|
4435
|
+
__extends(RegExpTestValidator, _super);
|
4436
|
+
function RegExpTestValidator(regexp, value, target, event, autoValid) {
|
4312
4437
|
if (autoValid === void 0) { autoValid = true; }
|
4313
4438
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4314
|
-
_this.
|
4439
|
+
_this.regexp = DomRenderProxy.final(regexp);
|
4315
4440
|
return _this;
|
4316
4441
|
}
|
4317
|
-
|
4318
|
-
|
4442
|
+
RegExpTestValidator.prototype.valid = function () {
|
4443
|
+
var _a;
|
4444
|
+
var value = this.value;
|
4445
|
+
var regExp = (_a = this.regexp._DomRender_origin) !== null && _a !== void 0 ? _a : this.regexp;
|
4446
|
+
// console.log('regexp-->', value, this.regexp, regExp.test(value))
|
4447
|
+
if (value) {
|
4448
|
+
return regExp.test(value);
|
4449
|
+
}
|
4450
|
+
else {
|
4451
|
+
return false;
|
4452
|
+
}
|
4319
4453
|
};
|
4320
|
-
return
|
4454
|
+
return RegExpTestValidator;
|
4321
4455
|
}(Validator));
|
4322
4456
|
|
4323
4457
|
var RequiredValidator = /** @class */ (function (_super) {
|
@@ -4334,6 +4468,21 @@ var RequiredValidator = /** @class */ (function (_super) {
|
|
4334
4468
|
return RequiredValidator;
|
4335
4469
|
}(Validator));
|
4336
4470
|
|
4471
|
+
var NotEmptyValidator = /** @class */ (function (_super) {
|
4472
|
+
__extends(NotEmptyValidator, _super);
|
4473
|
+
function NotEmptyValidator(value, target, event, autoValid) {
|
4474
|
+
if (autoValid === void 0) { autoValid = true; }
|
4475
|
+
return _super.call(this, value, target, event, autoValid) || this;
|
4476
|
+
}
|
4477
|
+
NotEmptyValidator.prototype.valid = function () {
|
4478
|
+
var _a;
|
4479
|
+
var value = this.value;
|
4480
|
+
// console.log('NotEmptyValidator', value, value !== undefined && value !== null && ((value as any)?.length ?? 0) > 0)
|
4481
|
+
return value !== undefined && value !== null && ((_a = value === null || value === void 0 ? void 0 : value.length) !== null && _a !== void 0 ? _a : 0) > 0;
|
4482
|
+
};
|
4483
|
+
return NotEmptyValidator;
|
4484
|
+
}(Validator));
|
4485
|
+
|
4337
4486
|
var ValidMultipleValidator = /** @class */ (function (_super) {
|
4338
4487
|
__extends(ValidMultipleValidator, _super);
|
4339
4488
|
function ValidMultipleValidator(validMultipleCallback, validators, value, target, event, autoValid) {
|
@@ -4349,6 +4498,47 @@ var ValidMultipleValidator = /** @class */ (function (_super) {
|
|
4349
4498
|
return ValidMultipleValidator;
|
4350
4499
|
}(MultipleValidator));
|
4351
4500
|
|
4501
|
+
var UnCheckedValidator = /** @class */ (function (_super) {
|
4502
|
+
__extends(UnCheckedValidator, _super);
|
4503
|
+
function UnCheckedValidator(value, target, event, autoValid) {
|
4504
|
+
if (autoValid === void 0) { autoValid = true; }
|
4505
|
+
return _super.call(this, value, target, event, autoValid) || this;
|
4506
|
+
}
|
4507
|
+
UnCheckedValidator.prototype.valid = function () {
|
4508
|
+
var _a, _b;
|
4509
|
+
return !((_b = (_a = this.getTarget()) === null || _a === void 0 ? void 0 : _a.checked) !== null && _b !== void 0 ? _b : false);
|
4510
|
+
};
|
4511
|
+
return UnCheckedValidator;
|
4512
|
+
}(Validator));
|
4513
|
+
|
4514
|
+
var ValidValidator = /** @class */ (function (_super) {
|
4515
|
+
__extends(ValidValidator, _super);
|
4516
|
+
function ValidValidator(validCallBack, value, target, event, autoValid) {
|
4517
|
+
if (autoValid === void 0) { autoValid = true; }
|
4518
|
+
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4519
|
+
_this.validCallBack = validCallBack;
|
4520
|
+
return _this;
|
4521
|
+
}
|
4522
|
+
ValidValidator.prototype.valid = function (value, target, event) {
|
4523
|
+
return this.validCallBack(value, target, event);
|
4524
|
+
};
|
4525
|
+
return ValidValidator;
|
4526
|
+
}(Validator));
|
4527
|
+
|
4528
|
+
var ValidValidatorArray = /** @class */ (function (_super) {
|
4529
|
+
__extends(ValidValidatorArray, _super);
|
4530
|
+
function ValidValidatorArray(validCallBack, value, target, event, autoValid) {
|
4531
|
+
if (autoValid === void 0) { autoValid = true; }
|
4532
|
+
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4533
|
+
_this.validCallBack = validCallBack;
|
4534
|
+
return _this;
|
4535
|
+
}
|
4536
|
+
ValidValidatorArray.prototype.valid = function () {
|
4537
|
+
return this.validCallBack(this.value, this.getTarget(), this.getEvent());
|
4538
|
+
};
|
4539
|
+
return ValidValidatorArray;
|
4540
|
+
}(ValidatorArray));
|
4541
|
+
|
4352
4542
|
var ValueEqualsValidator = /** @class */ (function (_super) {
|
4353
4543
|
__extends(ValueEqualsValidator, _super);
|
4354
4544
|
function ValueEqualsValidator(equalsValue, value, target, event, autoValid) {
|
@@ -4399,30 +4589,6 @@ var ClipBoardUtils = /** @class */ (function () {
|
|
4399
4589
|
return ClipBoardUtils;
|
4400
4590
|
}());
|
4401
4591
|
|
4402
|
-
var NodeUtils = /** @class */ (function () {
|
4403
|
-
function NodeUtils() {
|
4404
|
-
}
|
4405
|
-
// https://stackoverflow.com/questions/3955229/remove-all-child-elements-of-a-dom-node-in-javascript
|
4406
|
-
NodeUtils.removeAllChildNode = function (node) {
|
4407
|
-
while (node === null || node === void 0 ? void 0 : node.firstChild) {
|
4408
|
-
node.firstChild.remove();
|
4409
|
-
}
|
4410
|
-
};
|
4411
|
-
NodeUtils.appendChild = function (parentNode, childNode) {
|
4412
|
-
return parentNode.appendChild(childNode);
|
4413
|
-
};
|
4414
|
-
NodeUtils.replaceNode = function (targetNode, newNode) {
|
4415
|
-
var _a;
|
4416
|
-
// console.log('repalceNode', targetNode, newNode, targetNode.parentNode)
|
4417
|
-
return (_a = targetNode.parentNode) === null || _a === void 0 ? void 0 : _a.replaceChild(newNode, targetNode);
|
4418
|
-
};
|
4419
|
-
NodeUtils.addNode = function (targetNode, newNode) {
|
4420
|
-
var _a;
|
4421
|
-
return (_a = targetNode.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(newNode, targetNode.nextSibling);
|
4422
|
-
};
|
4423
|
-
return NodeUtils;
|
4424
|
-
}());
|
4425
|
-
|
4426
4592
|
var StorageUtils = /** @class */ (function () {
|
4427
4593
|
function StorageUtils() {
|
4428
4594
|
}
|
@@ -4468,6 +4634,30 @@ var StorageUtils = /** @class */ (function () {
|
|
4468
4634
|
return StorageUtils;
|
4469
4635
|
}());
|
4470
4636
|
|
4637
|
+
var NodeUtils = /** @class */ (function () {
|
4638
|
+
function NodeUtils() {
|
4639
|
+
}
|
4640
|
+
// https://stackoverflow.com/questions/3955229/remove-all-child-elements-of-a-dom-node-in-javascript
|
4641
|
+
NodeUtils.removeAllChildNode = function (node) {
|
4642
|
+
while (node === null || node === void 0 ? void 0 : node.firstChild) {
|
4643
|
+
node.firstChild.remove();
|
4644
|
+
}
|
4645
|
+
};
|
4646
|
+
NodeUtils.appendChild = function (parentNode, childNode) {
|
4647
|
+
return parentNode.appendChild(childNode);
|
4648
|
+
};
|
4649
|
+
NodeUtils.replaceNode = function (targetNode, newNode) {
|
4650
|
+
var _a;
|
4651
|
+
// console.log('repalceNode', targetNode, newNode, targetNode.parentNode)
|
4652
|
+
return (_a = targetNode.parentNode) === null || _a === void 0 ? void 0 : _a.replaceChild(newNode, targetNode);
|
4653
|
+
};
|
4654
|
+
NodeUtils.addNode = function (targetNode, newNode) {
|
4655
|
+
var _a;
|
4656
|
+
return (_a = targetNode.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(newNode, targetNode.nextSibling);
|
4657
|
+
};
|
4658
|
+
return NodeUtils;
|
4659
|
+
}());
|
4660
|
+
|
4471
4661
|
exports.AllCheckedValidatorArray = AllCheckedValidatorArray;
|
4472
4662
|
exports.AllUnCheckedValidatorArray = AllUnCheckedValidatorArray;
|
4473
4663
|
exports.Appender = Appender;
|
@@ -4495,6 +4685,7 @@ exports.DomRenderProxy = DomRenderProxy;
|
|
4495
4685
|
exports.DomUtils = DomUtils;
|
4496
4686
|
exports.Dr = Dr;
|
4497
4687
|
exports.DrAppender = DrAppender;
|
4688
|
+
exports.DrDictionary = DrDictionary;
|
4498
4689
|
exports.DrFor = DrFor;
|
4499
4690
|
exports.DrForOf = DrForOf;
|
4500
4691
|
exports.DrForm = DrForm;
|