dom-render 1.0.95 → 1.0.96
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/DomRenderProxy.js +12 -16
- package/dist/bundle.js +264 -258
- package/operators/{DrDictionary.d.ts → DrThisProperty.d.ts} +1 -2
- package/operators/{DrDictionary.js → DrThisProperty.js} +15 -40
- package/package.json +1 -1
- package/rawsets/Attrs.d.ts +3 -2
- package/rawsets/RawSet.d.ts +13 -5
- package/rawsets/RawSet.js +51 -19
- package/rawsets/RawSetOperatorType.d.ts +3 -0
- package/rawsets/RawSetOperatorType.js +7 -0
package/dist/bundle.js
CHANGED
@@ -1975,13 +1975,13 @@ exports.RawSetType = void 0;
|
|
1975
1975
|
RawSetType["UNKOWN"] = "UNKOWN";
|
1976
1976
|
})(exports.RawSetType || (exports.RawSetType = {}));
|
1977
1977
|
|
1978
|
-
var
|
1979
|
-
__extends(
|
1980
|
-
function
|
1978
|
+
var DrThisProperty = /** @class */ (function (_super) {
|
1979
|
+
__extends(DrThisProperty, _super);
|
1980
|
+
function DrThisProperty(rawSet, render, returnContainer, elementSource, source, afterCallBack) {
|
1981
1981
|
source.operatorAround = undefined;
|
1982
1982
|
return _super.call(this, rawSet, render, returnContainer, elementSource, source, afterCallBack, false) || this;
|
1983
1983
|
}
|
1984
|
-
|
1984
|
+
DrThisProperty.prototype.executeAttrRequire = function (attr) {
|
1985
1985
|
var _a, _b, _c, _d, _e;
|
1986
1986
|
return __awaiter(this, void 0, void 0, function () {
|
1987
1987
|
var itRandom, vars, newTemp, dictionaryKey, tempalte, rr;
|
@@ -1991,14 +1991,14 @@ var DrDictionary = /** @class */ (function (_super) {
|
|
1991
1991
|
vars = RawSet.drVarEncoding(this.elementSource.element, (_a = this.elementSource.attrs.drVarOption) !== null && _a !== void 0 ? _a : '');
|
1992
1992
|
newTemp = this.source.config.window.document.createElement('temp');
|
1993
1993
|
ScriptUtils.evalReturn(attr, this.source.obj);
|
1994
|
-
dictionaryKey = (_b = this.elementSource.attrs.
|
1994
|
+
dictionaryKey = (_b = this.elementSource.attrs.drKeyOption) !== null && _b !== void 0 ? _b : '';
|
1995
1995
|
// console.log('--->', attr, dictionaryKey)
|
1996
1996
|
// if (!(dictioanry instanceof Dictionary)) {
|
1997
1997
|
// return ExecuteState.STOP;
|
1998
1998
|
// }
|
1999
1999
|
// await new Promise(resolve => setTimeout(resolve, 1000));
|
2000
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
|
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 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, {
|
2002
2002
|
__render: Object.freeze(__assign({ drStripOption: this.elementSource.attrs.drStripOption, drAttr: this.elementSource.attrs, drAttrsOriginName: RawSet.drAttrsOriginName, fag: newTemp }, this.render))
|
2003
2003
|
}));
|
2004
2004
|
RawSet.drVarDecoding(newTemp, vars);
|
@@ -2014,29 +2014,7 @@ var DrDictionary = /** @class */ (function (_super) {
|
|
2014
2014
|
});
|
2015
2015
|
});
|
2016
2016
|
};
|
2017
|
-
|
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) {
|
2017
|
+
DrThisProperty.append = function (obj, fullPath, key, rawSet, config) {
|
2040
2018
|
var _this = this;
|
2041
2019
|
var _a, _b;
|
2042
2020
|
var genNode = config.window.document.importNode(rawSet.fragment, true);
|
@@ -2045,33 +2023,35 @@ var DrDictionary = /** @class */ (function (_super) {
|
|
2045
2023
|
for (var _i = 0, _c = Array.from(genNode.childNodes.values()); _i < _c.length; _i++) {
|
2046
2024
|
var cNode = _c[_i];
|
2047
2025
|
var element = cNode.cloneNode(true);
|
2048
|
-
element.removeAttribute(
|
2049
|
-
element.setAttribute(
|
2026
|
+
element.removeAttribute(RawSet.DR_THIS_PROPERTY_NAME);
|
2027
|
+
element.setAttribute(RawSet.DR_THIS_NAME, "this.".concat(fullPath));
|
2028
|
+
element.setAttribute(RawSet.DR_KEY_OPTIONNAME, key);
|
2050
2029
|
// rawSet.point.end.after(element);
|
2051
2030
|
var fg = config.window.document.createDocumentFragment();
|
2052
2031
|
fg.append(element);
|
2053
2032
|
rawSets.push.apply(rawSets, RawSet.checkPointCreates(fg, obj, config));
|
2054
2033
|
rawSet.point.end.before(fg);
|
2055
2034
|
var start = rawSet.point.start;
|
2056
|
-
var keys = (_b = (_a = start.getAttribute(
|
2035
|
+
var keys = (_b = (_a = start.getAttribute(RawSet.DR_HAS_KEYS_OPTIONNAME)) === null || _a === void 0 ? void 0 : _a.split(',')) !== null && _b !== void 0 ? _b : [];
|
2057
2036
|
keys.push(key);
|
2058
|
-
start.setAttribute(
|
2037
|
+
start.setAttribute(RawSet.DR_HAS_KEYS_OPTIONNAME, keys.join(','));
|
2059
2038
|
rawSets.forEach(function (it) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
|
2060
2039
|
switch (_a.label) {
|
2061
2040
|
case 0: return [4 /*yield*/, it.render(obj, config)];
|
2062
2041
|
case 1: return [2 /*return*/, _a.sent()];
|
2063
2042
|
}
|
2064
2043
|
}); }); });
|
2065
|
-
// console.log('WWW', fg, Array.from(fg.childNodes));
|
2066
|
-
// console.log('--------------------------rawSets', rawSets);
|
2067
2044
|
}
|
2068
2045
|
return rawSets;
|
2069
|
-
// rawSet.
|
2070
|
-
// rawSet.point.end.before()
|
2071
2046
|
};
|
2072
|
-
return
|
2047
|
+
return DrThisProperty;
|
2073
2048
|
}(OperatorExecuterAttrRequire));
|
2074
2049
|
|
2050
|
+
exports.RawSetOperatorType = void 0;
|
2051
|
+
(function (RawSetOperatorType) {
|
2052
|
+
RawSetOperatorType["DR_THIS_PROPERTY"] = "this-property";
|
2053
|
+
})(exports.RawSetOperatorType || (exports.RawSetOperatorType = {}));
|
2054
|
+
|
2075
2055
|
var RawSet = /** @class */ (function () {
|
2076
2056
|
function RawSet(uuid, type, point, fragment, detect, data) {
|
2077
2057
|
this.uuid = uuid;
|
@@ -2080,6 +2060,7 @@ var RawSet = /** @class */ (function () {
|
|
2080
2060
|
this.fragment = fragment;
|
2081
2061
|
this.detect = detect;
|
2082
2062
|
this.data = data;
|
2063
|
+
point.start.rawSet = this;
|
2083
2064
|
// console.log('rawset constructor->', (this.point.node as Element).getAttributeNames());
|
2084
2065
|
}
|
2085
2066
|
Object.defineProperty(RawSet.prototype, "isConnected", {
|
@@ -2199,7 +2180,7 @@ var RawSet = /** @class */ (function () {
|
|
2199
2180
|
drIf: this.getAttributeAndDelete(element, RawSet.DR_IF_NAME),
|
2200
2181
|
drFor: this.getAttributeAndDelete(element, RawSet.DR_FOR_NAME),
|
2201
2182
|
drForOf: this.getAttributeAndDelete(element, RawSet.DR_FOR_OF_NAME),
|
2202
|
-
|
2183
|
+
drThisProperty: this.getAttributeAndDelete(element, RawSet.DR_THIS_PROPERTY_NAME),
|
2203
2184
|
drAppender: this.getAttributeAndDelete(element, RawSet.DR_APPENDER_NAME),
|
2204
2185
|
drRepeat: this.getAttributeAndDelete(element, RawSet.DR_REPEAT_NAME),
|
2205
2186
|
drThis: this.getAttributeAndDelete(element, RawSet.DR_THIS_NAME),
|
@@ -2215,7 +2196,7 @@ var RawSet = /** @class */ (function () {
|
|
2215
2196
|
drCompleteOption: this.getAttributeAndDelete(element, RawSet.DR_COMPLETE_OPTIONNAME),
|
2216
2197
|
drStripOption: this.getAttributeAndDelete(element, RawSet.DR_STRIP_OPTIONNAME),
|
2217
2198
|
drDestroyOption: this.getAttributeAndDelete(element, RawSet.DR_DESTROY_OPTIONNAME),
|
2218
|
-
|
2199
|
+
drKeyOption: this.getAttributeAndDelete(element, RawSet.DR_KEY_OPTIONNAME)
|
2219
2200
|
};
|
2220
2201
|
drAttrs.push(drAttr);
|
2221
2202
|
operators = [
|
@@ -2228,7 +2209,7 @@ var RawSet = /** @class */ (function () {
|
|
2228
2209
|
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 }),
|
2229
2210
|
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 }),
|
2230
2211
|
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 }),
|
2231
|
-
new
|
2212
|
+
new DrThisProperty(this, __render, { raws: raws, fag: fag }, { element: element, attrName: RawSet.DR_THIS_PROPERTY_NAME, attr: drAttr.drThisProperty, attrs: drAttr }, { config: config, obj: obj, operatorAround: (_l = config.operatorAround) === null || _l === void 0 ? void 0 : _l.drThisProperty }, { onAttrInitCallBacks: onAttrInitCallBacks, onElementInitCallBacks: onElementInitCallBacks, onThisComponentSetCallBacks: onThisComponentSetCallBacks }),
|
2232
2213
|
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
2214
|
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 }),
|
2234
2215
|
new DrTargetElement(this, __render, { raws: raws, fag: fag }, { element: element, attrs: drAttr }, { config: config, obj: obj }, { onAttrInitCallBacks: onAttrInitCallBacks, onElementInitCallBacks: onElementInitCallBacks, onThisComponentSetCallBacks: onThisComponentSetCallBacks }),
|
@@ -2549,19 +2530,17 @@ var RawSet = /** @class */ (function () {
|
|
2549
2530
|
var start = config.window.document.createElement('meta');
|
2550
2531
|
var end = config.window.document.createElement('meta');
|
2551
2532
|
start.setAttribute('id', "".concat(id, "-start"));
|
2552
|
-
var
|
2553
|
-
var
|
2554
|
-
if (
|
2555
|
-
start.setAttribute('type',
|
2533
|
+
var keys = element.getAttribute(RawSet.DR_KEY_OPTIONNAME);
|
2534
|
+
var thisPropertyType = element.getAttribute(RawSet.DR_THIS_PROPERTY_NAME);
|
2535
|
+
if (thisPropertyType) {
|
2536
|
+
start.setAttribute('type', exports.RawSetOperatorType.DR_THIS_PROPERTY);
|
2556
2537
|
}
|
2557
|
-
if (
|
2558
|
-
|
2538
|
+
if (keys) {
|
2539
|
+
element.removeAttribute(RawSet.DR_KEY_OPTIONNAME);
|
2540
|
+
start.setAttribute(RawSet.DR_KEY_OPTIONNAME, keys);
|
2559
2541
|
}
|
2560
2542
|
end.setAttribute('id', "".concat(id, "-end"));
|
2561
|
-
return {
|
2562
|
-
start: start,
|
2563
|
-
end: end
|
2564
|
-
};
|
2543
|
+
return { start: start, end: end };
|
2565
2544
|
}
|
2566
2545
|
else if (type === exports.RawSetType.STYLE_TEXT) {
|
2567
2546
|
return {
|
@@ -2576,6 +2555,11 @@ var RawSet = /** @class */ (function () {
|
|
2576
2555
|
};
|
2577
2556
|
}
|
2578
2557
|
};
|
2558
|
+
RawSet.prototype.remove = function () {
|
2559
|
+
this.childAllRemove();
|
2560
|
+
this.point.end.remove();
|
2561
|
+
this.point.start.remove();
|
2562
|
+
};
|
2579
2563
|
RawSet.prototype.childAllRemove = function () {
|
2580
2564
|
var next = this.point.start.nextSibling;
|
2581
2565
|
while (next) {
|
@@ -2586,6 +2570,31 @@ var RawSet = /** @class */ (function () {
|
|
2586
2570
|
next = this.point.start.nextSibling;
|
2587
2571
|
}
|
2588
2572
|
};
|
2573
|
+
RawSet.prototype.childs = function (stopNext) {
|
2574
|
+
var childs = [];
|
2575
|
+
var next = this.point.start.nextSibling;
|
2576
|
+
while (next && next !== this.point.end) {
|
2577
|
+
if (stopNext === null || stopNext === void 0 ? void 0 : stopNext(next)) {
|
2578
|
+
return;
|
2579
|
+
}
|
2580
|
+
childs.push(next);
|
2581
|
+
next = next.nextSibling;
|
2582
|
+
}
|
2583
|
+
return childs;
|
2584
|
+
};
|
2585
|
+
RawSet.prototype.getHasRawSet = function (key) {
|
2586
|
+
var rawSet;
|
2587
|
+
this.childs(function (node) {
|
2588
|
+
var _a, _b;
|
2589
|
+
var drKey = (_b = (_a = node).getAttribute) === null || _b === void 0 ? void 0 : _b.call(_a, 'dr-key');
|
2590
|
+
if (drKey && drKey === key) {
|
2591
|
+
rawSet = node.rawSet;
|
2592
|
+
return true;
|
2593
|
+
}
|
2594
|
+
return false;
|
2595
|
+
});
|
2596
|
+
return rawSet;
|
2597
|
+
};
|
2589
2598
|
RawSet.drItOtherEncoding = function (element) {
|
2590
2599
|
var random = RandomUtils.uuid();
|
2591
2600
|
var regex = /#it#/g;
|
@@ -3007,7 +3016,7 @@ var RawSet = /** @class */ (function () {
|
|
3007
3016
|
RawSet.DR_IF_NAME = 'dr-if';
|
3008
3017
|
RawSet.DR_FOR_NAME = 'dr-for';
|
3009
3018
|
RawSet.DR_FOR_OF_NAME = 'dr-for-of';
|
3010
|
-
RawSet.
|
3019
|
+
RawSet.DR_THIS_PROPERTY_NAME = 'dr-this-property';
|
3011
3020
|
RawSet.DR_REPEAT_NAME = 'dr-repeat';
|
3012
3021
|
RawSet.DR_THIS_NAME = 'dr-this';
|
3013
3022
|
RawSet.DR_FORM_NAME = 'dr-form';
|
@@ -3026,7 +3035,8 @@ var RawSet = /** @class */ (function () {
|
|
3026
3035
|
RawSet.DR_DESTROY_OPTIONNAME = 'dr-destroy';
|
3027
3036
|
RawSet.DR_COMPONENT_NAME_OPTIONNAME = 'dr-component-name';
|
3028
3037
|
RawSet.DR_COMPONENT_INNER_HTML_NAME_OPTIONNAME = 'dr-component-inner-html-name';
|
3029
|
-
RawSet.
|
3038
|
+
RawSet.DR_KEY_OPTIONNAME = 'dr-key';
|
3039
|
+
RawSet.DR_HAS_KEYS_OPTIONNAME = 'dr-has-keys';
|
3030
3040
|
RawSet.DR_ON_CREATE_ARGUMENTS_OPTIONNAME = 'dr-on-create:arguments';
|
3031
3041
|
RawSet.DR_ON_CREATED_CALLBACK_OPTIONNAME = 'dr-on-create:callback';
|
3032
3042
|
RawSet.DR_ON_INIT_ARGUMENTS_OPTIONNAME = 'dr-on-init:arguments';
|
@@ -3036,7 +3046,7 @@ var RawSet = /** @class */ (function () {
|
|
3036
3046
|
drIf: RawSet.DR_IF_NAME,
|
3037
3047
|
drFor: RawSet.DR_FOR_NAME,
|
3038
3048
|
drForOf: RawSet.DR_FOR_OF_NAME,
|
3039
|
-
|
3049
|
+
drThisProperty: RawSet.DR_THIS_PROPERTY_NAME,
|
3040
3050
|
drAppender: RawSet.DR_APPENDER_NAME,
|
3041
3051
|
drRepeat: RawSet.DR_REPEAT_NAME,
|
3042
3052
|
drThis: RawSet.DR_THIS_NAME,
|
@@ -3052,10 +3062,11 @@ var RawSet = /** @class */ (function () {
|
|
3052
3062
|
drCompleteOption: RawSet.DR_COMPLETE_OPTIONNAME,
|
3053
3063
|
drStripOption: RawSet.DR_STRIP_OPTIONNAME,
|
3054
3064
|
drDestroyOption: RawSet.DR_DESTROY_OPTIONNAME,
|
3055
|
-
|
3065
|
+
drHasKeysOption: RawSet.DR_HAS_KEYS_OPTIONNAME,
|
3066
|
+
drKeyOption: RawSet.DR_KEY_OPTIONNAME
|
3056
3067
|
};
|
3057
3068
|
RawSet.DR_TAGS = [];
|
3058
|
-
RawSet.DR_ATTRIBUTES = [RawSet.DR_NAME, RawSet.DR_APPENDER_NAME, RawSet.DR_IF_NAME, RawSet.DR_FOR_OF_NAME, RawSet.
|
3069
|
+
RawSet.DR_ATTRIBUTES = [RawSet.DR_NAME, RawSet.DR_APPENDER_NAME, RawSet.DR_IF_NAME, RawSet.DR_FOR_OF_NAME, RawSet.DR_THIS_PROPERTY_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];
|
3059
3070
|
return RawSet;
|
3060
3071
|
}());
|
3061
3072
|
|
@@ -3290,6 +3301,7 @@ var DomRenderProxy = /** @class */ (function () {
|
|
3290
3301
|
// console.log('-------!!!!!', fullPathStr, iterable, data, front, last);
|
3291
3302
|
new Promise(function (resolve) {
|
3292
3303
|
var firstPathStr = front_1.slice(1);
|
3304
|
+
// check dictionary
|
3293
3305
|
// console.log('-promise-------', firstPathStr, this)
|
3294
3306
|
var firstTargets = _this._rawSets.get(firstPathStr);
|
3295
3307
|
var firstTargetDictionary = [];
|
@@ -3297,7 +3309,7 @@ var DomRenderProxy = /** @class */ (function () {
|
|
3297
3309
|
var _a, _b;
|
3298
3310
|
// console.log('----forEach---', it);
|
3299
3311
|
var type = (_b = (_a = it.point.start).getAttribute) === null || _b === void 0 ? void 0 : _b.call(_a, 'type');
|
3300
|
-
if (type ===
|
3312
|
+
if (type === exports.RawSetOperatorType.DR_THIS_PROPERTY) {
|
3301
3313
|
firstTargetDictionary.push(it);
|
3302
3314
|
}
|
3303
3315
|
});
|
@@ -3307,10 +3319,15 @@ var DomRenderProxy = /** @class */ (function () {
|
|
3307
3319
|
var skip_1 = false;
|
3308
3320
|
firstTargetDictionary.forEach(function (it) {
|
3309
3321
|
var _a, _b;
|
3310
|
-
var
|
3322
|
+
var startElement = it.point.start;
|
3323
|
+
var keys = (_b = (_a = startElement.getAttribute(RawSet.DR_HAS_KEYS_OPTIONNAME)) === null || _a === void 0 ? void 0 : _a.split(',')) !== null && _b !== void 0 ? _b : [];
|
3324
|
+
if (value === undefined) {
|
3325
|
+
var rawSet = it.getHasRawSet(last_1);
|
3326
|
+
rawSet === null || rawSet === void 0 ? void 0 : rawSet.remove();
|
3327
|
+
startElement.setAttribute(RawSet.DR_HAS_KEYS_OPTIONNAME, keys.filter(function (it) { return it !== last_1; }).join(','));
|
3328
|
+
}
|
3311
3329
|
if (!keys.includes(last_1)) {
|
3312
|
-
var raws =
|
3313
|
-
// console.log('----append---', raws);
|
3330
|
+
var raws = DrThisProperty.append(_this._domRender_proxy, fullPathStr_1, last_1, it, _this.config);
|
3314
3331
|
if (raws) {
|
3315
3332
|
rawSets_3.push.apply(rawSets_3, raws);
|
3316
3333
|
}
|
@@ -3322,18 +3339,7 @@ var DomRenderProxy = /** @class */ (function () {
|
|
3322
3339
|
if (skip_1 === false || rawSets_3.length > 0) {
|
3323
3340
|
return _this.render(rawSets_3);
|
3324
3341
|
}
|
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);
|
3329
3342
|
}
|
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
3343
|
if (last_1 === 'length' && Array.isArray(data_1)) {
|
3338
3344
|
var aIterable = _this._rawSets.get(firstPathStr);
|
3339
3345
|
if (aIterable) {
|
@@ -4088,6 +4094,19 @@ var Appender = /** @class */ (function () {
|
|
4088
4094
|
return Appender;
|
4089
4095
|
}());
|
4090
4096
|
|
4097
|
+
var AllCheckedValidatorArray = /** @class */ (function (_super) {
|
4098
|
+
__extends(AllCheckedValidatorArray, _super);
|
4099
|
+
function AllCheckedValidatorArray(value, target, event, autoValid) {
|
4100
|
+
if (autoValid === void 0) { autoValid = true; }
|
4101
|
+
return _super.call(this, value, target, event, autoValid) || this;
|
4102
|
+
}
|
4103
|
+
AllCheckedValidatorArray.prototype.valid = function () {
|
4104
|
+
var _a;
|
4105
|
+
return !(((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length > 0);
|
4106
|
+
};
|
4107
|
+
return AllCheckedValidatorArray;
|
4108
|
+
}(ValidatorArray));
|
4109
|
+
|
4091
4110
|
var AllUnCheckedValidatorArray = /** @class */ (function (_super) {
|
4092
4111
|
__extends(AllUnCheckedValidatorArray, _super);
|
4093
4112
|
function AllUnCheckedValidatorArray(value, target, event, autoValid) {
|
@@ -4101,18 +4120,18 @@ var AllUnCheckedValidatorArray = /** @class */ (function (_super) {
|
|
4101
4120
|
return AllUnCheckedValidatorArray;
|
4102
4121
|
}(ValidatorArray));
|
4103
4122
|
|
4104
|
-
var
|
4105
|
-
__extends(
|
4106
|
-
function
|
4123
|
+
var CheckedValidator = /** @class */ (function (_super) {
|
4124
|
+
__extends(CheckedValidator, _super);
|
4125
|
+
function CheckedValidator(value, target, event, autoValid) {
|
4107
4126
|
if (autoValid === void 0) { autoValid = true; }
|
4108
4127
|
return _super.call(this, value, target, event, autoValid) || this;
|
4109
4128
|
}
|
4110
|
-
|
4111
|
-
var _a;
|
4112
|
-
return
|
4129
|
+
CheckedValidator.prototype.valid = function () {
|
4130
|
+
var _a, _b;
|
4131
|
+
return (_b = (_a = this.getTarget()) === null || _a === void 0 ? void 0 : _a.checked) !== null && _b !== void 0 ? _b : false;
|
4113
4132
|
};
|
4114
|
-
return
|
4115
|
-
}(
|
4133
|
+
return CheckedValidator;
|
4134
|
+
}(Validator));
|
4116
4135
|
|
4117
4136
|
var CountEqualsCheckedValidatorArray = /** @class */ (function (_super) {
|
4118
4137
|
__extends(CountEqualsCheckedValidatorArray, _super);
|
@@ -4129,19 +4148,6 @@ var CountEqualsCheckedValidatorArray = /** @class */ (function (_super) {
|
|
4129
4148
|
return CountEqualsCheckedValidatorArray;
|
4130
4149
|
}(ValidatorArray));
|
4131
4150
|
|
4132
|
-
var CheckedValidator = /** @class */ (function (_super) {
|
4133
|
-
__extends(CheckedValidator, _super);
|
4134
|
-
function CheckedValidator(value, target, event, autoValid) {
|
4135
|
-
if (autoValid === void 0) { autoValid = true; }
|
4136
|
-
return _super.call(this, value, target, event, autoValid) || this;
|
4137
|
-
}
|
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;
|
4141
|
-
};
|
4142
|
-
return CheckedValidator;
|
4143
|
-
}(Validator));
|
4144
|
-
|
4145
4151
|
var CountEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
|
4146
4152
|
__extends(CountEqualsUnCheckedValidatorArray, _super);
|
4147
4153
|
function CountEqualsUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
@@ -4172,36 +4178,6 @@ var CountGreaterThanEqualsCheckedValidatorArray = /** @class */ (function (_supe
|
|
4172
4178
|
return CountGreaterThanEqualsCheckedValidatorArray;
|
4173
4179
|
}(ValidatorArray));
|
4174
4180
|
|
4175
|
-
var CountGreaterThanCheckedValidatorArray = /** @class */ (function (_super) {
|
4176
|
-
__extends(CountGreaterThanCheckedValidatorArray, _super);
|
4177
|
-
function CountGreaterThanCheckedValidatorArray(count, value, target, event, autoValid) {
|
4178
|
-
if (autoValid === void 0) { autoValid = true; }
|
4179
|
-
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4180
|
-
_this.count = count;
|
4181
|
-
return _this;
|
4182
|
-
}
|
4183
|
-
CountGreaterThanCheckedValidatorArray.prototype.valid = function () {
|
4184
|
-
var _a;
|
4185
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length > this.count;
|
4186
|
-
};
|
4187
|
-
return CountGreaterThanCheckedValidatorArray;
|
4188
|
-
}(ValidatorArray));
|
4189
|
-
|
4190
|
-
var CountLessThanEqualsCheckedValidatorArray = /** @class */ (function (_super) {
|
4191
|
-
__extends(CountLessThanEqualsCheckedValidatorArray, _super);
|
4192
|
-
function CountLessThanEqualsCheckedValidatorArray(count, value, target, event, autoValid) {
|
4193
|
-
if (autoValid === void 0) { autoValid = true; }
|
4194
|
-
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4195
|
-
_this.count = count;
|
4196
|
-
return _this;
|
4197
|
-
}
|
4198
|
-
CountLessThanEqualsCheckedValidatorArray.prototype.valid = function () {
|
4199
|
-
var _a;
|
4200
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length <= this.count;
|
4201
|
-
};
|
4202
|
-
return CountLessThanEqualsCheckedValidatorArray;
|
4203
|
-
}(ValidatorArray));
|
4204
|
-
|
4205
4181
|
var CountGreaterThanEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
|
4206
4182
|
__extends(CountGreaterThanEqualsUnCheckedValidatorArray, _super);
|
4207
4183
|
function CountGreaterThanEqualsUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
@@ -4232,34 +4208,34 @@ var CountGreaterThanUnCheckedValidatorArray = /** @class */ (function (_super) {
|
|
4232
4208
|
return CountGreaterThanUnCheckedValidatorArray;
|
4233
4209
|
}(ValidatorArray));
|
4234
4210
|
|
4235
|
-
var
|
4236
|
-
__extends(
|
4237
|
-
function
|
4211
|
+
var CountGreaterThanCheckedValidatorArray = /** @class */ (function (_super) {
|
4212
|
+
__extends(CountGreaterThanCheckedValidatorArray, _super);
|
4213
|
+
function CountGreaterThanCheckedValidatorArray(count, value, target, event, autoValid) {
|
4238
4214
|
if (autoValid === void 0) { autoValid = true; }
|
4239
4215
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4240
4216
|
_this.count = count;
|
4241
4217
|
return _this;
|
4242
4218
|
}
|
4243
|
-
|
4219
|
+
CountGreaterThanCheckedValidatorArray.prototype.valid = function () {
|
4244
4220
|
var _a;
|
4245
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return
|
4221
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length > this.count;
|
4246
4222
|
};
|
4247
|
-
return
|
4223
|
+
return CountGreaterThanCheckedValidatorArray;
|
4248
4224
|
}(ValidatorArray));
|
4249
4225
|
|
4250
|
-
var
|
4251
|
-
__extends(
|
4252
|
-
function
|
4226
|
+
var CountLessThanCheckedValidatorArray = /** @class */ (function (_super) {
|
4227
|
+
__extends(CountLessThanCheckedValidatorArray, _super);
|
4228
|
+
function CountLessThanCheckedValidatorArray(count, value, target, event, autoValid) {
|
4253
4229
|
if (autoValid === void 0) { autoValid = true; }
|
4254
4230
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4255
4231
|
_this.count = count;
|
4256
4232
|
return _this;
|
4257
4233
|
}
|
4258
|
-
|
4234
|
+
CountLessThanCheckedValidatorArray.prototype.valid = function () {
|
4259
4235
|
var _a;
|
4260
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return
|
4236
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length < this.count;
|
4261
4237
|
};
|
4262
|
-
return
|
4238
|
+
return CountLessThanCheckedValidatorArray;
|
4263
4239
|
}(ValidatorArray));
|
4264
4240
|
|
4265
4241
|
var EmptyValidator = /** @class */ (function (_super) {
|
@@ -4276,6 +4252,21 @@ var EmptyValidator = /** @class */ (function (_super) {
|
|
4276
4252
|
return EmptyValidator;
|
4277
4253
|
}(Validator));
|
4278
4254
|
|
4255
|
+
var CountLessThanUnCheckedValidatorArray = /** @class */ (function (_super) {
|
4256
|
+
__extends(CountLessThanUnCheckedValidatorArray, _super);
|
4257
|
+
function CountLessThanUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
4258
|
+
if (autoValid === void 0) { autoValid = true; }
|
4259
|
+
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4260
|
+
_this.count = count;
|
4261
|
+
return _this;
|
4262
|
+
}
|
4263
|
+
CountLessThanUnCheckedValidatorArray.prototype.valid = function () {
|
4264
|
+
var _a;
|
4265
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length < this.count;
|
4266
|
+
};
|
4267
|
+
return CountLessThanUnCheckedValidatorArray;
|
4268
|
+
}(ValidatorArray));
|
4269
|
+
|
4279
4270
|
var CountUnCheckedValidatorArray = /** @class */ (function (_super) {
|
4280
4271
|
__extends(CountUnCheckedValidatorArray, _super);
|
4281
4272
|
function CountUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
@@ -4313,19 +4304,55 @@ var ExcludeCheckedValidatorArray = /** @class */ (function (_super) {
|
|
4313
4304
|
return ExcludeCheckedValidatorArray;
|
4314
4305
|
}(ValidatorArray));
|
4315
4306
|
|
4316
|
-
var
|
4317
|
-
__extends(
|
4318
|
-
function
|
4307
|
+
var MultipleValidator = /** @class */ (function (_super) {
|
4308
|
+
__extends(MultipleValidator, _super);
|
4309
|
+
function MultipleValidator(validators, value, target, event, autoValid) {
|
4319
4310
|
if (autoValid === void 0) { autoValid = true; }
|
4320
4311
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4321
|
-
_this.
|
4312
|
+
_this.validators = validators.map(function (it) {
|
4313
|
+
it.setAutoValid(false);
|
4314
|
+
it.setAutoValidAction(false);
|
4315
|
+
return it;
|
4316
|
+
});
|
4317
|
+
_this.validators.forEach(function (it) {
|
4318
|
+
it.set(_this.value, _this.getTarget(), _this.getEvent());
|
4319
|
+
});
|
4322
4320
|
return _this;
|
4323
4321
|
}
|
4324
|
-
|
4322
|
+
MultipleValidator.prototype.changeValue = function (value) {
|
4323
|
+
var _this = this;
|
4324
|
+
this.validators.forEach(function (it) { return it.set(_this.value, _this.getTarget(), _this.getEvent()); });
|
4325
|
+
};
|
4326
|
+
MultipleValidator.prototype.validAction = function () {
|
4327
|
+
return !(this.validators.filter(function (it) { return !it.validAction(); }).length > 0);
|
4328
|
+
};
|
4329
|
+
MultipleValidator.prototype.valid = function () {
|
4330
|
+
// console.log('mm', this.validators)
|
4331
|
+
return !(this.validators.filter(function (it) { return !it.valid(); }).length > 0);
|
4332
|
+
};
|
4333
|
+
return MultipleValidator;
|
4334
|
+
}(Validator));
|
4335
|
+
|
4336
|
+
var IncludeCheckedValidatorArray = /** @class */ (function (_super) {
|
4337
|
+
__extends(IncludeCheckedValidatorArray, _super);
|
4338
|
+
function IncludeCheckedValidatorArray(include, allRequired, value, target, event, autoValid) {
|
4339
|
+
if (allRequired === void 0) { allRequired = false; }
|
4340
|
+
if (autoValid === void 0) { autoValid = true; }
|
4341
|
+
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4342
|
+
_this.include = include;
|
4343
|
+
_this.allRequired = allRequired;
|
4344
|
+
return _this;
|
4345
|
+
}
|
4346
|
+
IncludeCheckedValidatorArray.prototype.valid = function () {
|
4347
|
+
var _this = this;
|
4325
4348
|
var _a;
|
4326
|
-
|
4349
|
+
var valus = (_a = this.value) !== null && _a !== void 0 ? _a : [];
|
4350
|
+
var checkedValue = valus.filter(function (it) { return it.checked; }).map(function (it) { return it.value; });
|
4351
|
+
return checkedValue.length > 0 &&
|
4352
|
+
(!(checkedValue.filter(function (it) { return !_this.include.includes(it); }).length > 0)) &&
|
4353
|
+
(this.allRequired ? checkedValue.filter(function (it) { return _this.include.includes(it); }).length === this.include.length : true);
|
4327
4354
|
};
|
4328
|
-
return
|
4355
|
+
return IncludeCheckedValidatorArray;
|
4329
4356
|
}(ValidatorArray));
|
4330
4357
|
|
4331
4358
|
var FormValidator = /** @class */ (function (_super) {
|
@@ -4346,77 +4373,71 @@ var FormValidator = /** @class */ (function (_super) {
|
|
4346
4373
|
return FormValidator;
|
4347
4374
|
}(Validator));
|
4348
4375
|
|
4349
|
-
var
|
4350
|
-
__extends(
|
4351
|
-
function
|
4376
|
+
var NotEmptyValidator = /** @class */ (function (_super) {
|
4377
|
+
__extends(NotEmptyValidator, _super);
|
4378
|
+
function NotEmptyValidator(value, target, event, autoValid) {
|
4352
4379
|
if (autoValid === void 0) { autoValid = true; }
|
4353
|
-
|
4354
|
-
_this.regexp = DomRenderProxy.final(regexp);
|
4355
|
-
return _this;
|
4380
|
+
return _super.call(this, value, target, event, autoValid) || this;
|
4356
4381
|
}
|
4357
|
-
|
4382
|
+
NotEmptyValidator.prototype.valid = function () {
|
4358
4383
|
var _a;
|
4359
4384
|
var value = this.value;
|
4360
|
-
|
4361
|
-
|
4362
|
-
return !regExp.test(value);
|
4363
|
-
}
|
4364
|
-
else {
|
4365
|
-
return true;
|
4366
|
-
}
|
4385
|
+
// console.log('NotEmptyValidator', value, value !== undefined && value !== null && ((value as any)?.length ?? 0) > 0)
|
4386
|
+
return value !== undefined && value !== null && ((_a = value === null || value === void 0 ? void 0 : value.length) !== null && _a !== void 0 ? _a : 0) > 0;
|
4367
4387
|
};
|
4368
|
-
return
|
4388
|
+
return NotEmptyValidator;
|
4369
4389
|
}(Validator));
|
4370
4390
|
|
4371
|
-
var
|
4372
|
-
__extends(
|
4373
|
-
function
|
4374
|
-
if (allRequired === void 0) { allRequired = false; }
|
4391
|
+
var CountLessThanEqualsCheckedValidatorArray = /** @class */ (function (_super) {
|
4392
|
+
__extends(CountLessThanEqualsCheckedValidatorArray, _super);
|
4393
|
+
function CountLessThanEqualsCheckedValidatorArray(count, value, target, event, autoValid) {
|
4375
4394
|
if (autoValid === void 0) { autoValid = true; }
|
4376
4395
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4377
|
-
_this.
|
4378
|
-
_this.allRequired = allRequired;
|
4396
|
+
_this.count = count;
|
4379
4397
|
return _this;
|
4380
4398
|
}
|
4381
|
-
|
4382
|
-
var _this = this;
|
4399
|
+
CountLessThanEqualsCheckedValidatorArray.prototype.valid = function () {
|
4383
4400
|
var _a;
|
4384
|
-
|
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);
|
4401
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length <= this.count;
|
4389
4402
|
};
|
4390
|
-
return
|
4403
|
+
return CountLessThanEqualsCheckedValidatorArray;
|
4391
4404
|
}(ValidatorArray));
|
4392
4405
|
|
4393
|
-
var
|
4394
|
-
__extends(
|
4395
|
-
function
|
4406
|
+
var CountLessThanEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
|
4407
|
+
__extends(CountLessThanEqualsUnCheckedValidatorArray, _super);
|
4408
|
+
function CountLessThanEqualsUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
4396
4409
|
if (autoValid === void 0) { autoValid = true; }
|
4397
4410
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4398
|
-
_this.
|
4399
|
-
it.setAutoValid(false);
|
4400
|
-
it.setAutoValidAction(false);
|
4401
|
-
return it;
|
4402
|
-
});
|
4403
|
-
_this.validators.forEach(function (it) {
|
4404
|
-
it.set(_this.value, _this.getTarget(), _this.getEvent());
|
4405
|
-
});
|
4411
|
+
_this.count = count;
|
4406
4412
|
return _this;
|
4407
4413
|
}
|
4408
|
-
|
4409
|
-
var
|
4410
|
-
this.
|
4411
|
-
};
|
4412
|
-
MultipleValidator.prototype.validAction = function () {
|
4413
|
-
return !(this.validators.filter(function (it) { return !it.validAction(); }).length > 0);
|
4414
|
+
CountLessThanEqualsUnCheckedValidatorArray.prototype.valid = function () {
|
4415
|
+
var _a;
|
4416
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length <= this.count;
|
4414
4417
|
};
|
4415
|
-
|
4416
|
-
|
4417
|
-
|
4418
|
+
return CountLessThanEqualsUnCheckedValidatorArray;
|
4419
|
+
}(ValidatorArray));
|
4420
|
+
|
4421
|
+
var NotRegExpTestValidator = /** @class */ (function (_super) {
|
4422
|
+
__extends(NotRegExpTestValidator, _super);
|
4423
|
+
function NotRegExpTestValidator(regexp, value, target, event, autoValid) {
|
4424
|
+
if (autoValid === void 0) { autoValid = true; }
|
4425
|
+
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4426
|
+
_this.regexp = DomRenderProxy.final(regexp);
|
4427
|
+
return _this;
|
4428
|
+
}
|
4429
|
+
NotRegExpTestValidator.prototype.valid = function () {
|
4430
|
+
var _a;
|
4431
|
+
var value = this.value;
|
4432
|
+
var regExp = (_a = this.regexp._DomRender_origin) !== null && _a !== void 0 ? _a : this.regexp;
|
4433
|
+
if (value) {
|
4434
|
+
return !regExp.test(value);
|
4435
|
+
}
|
4436
|
+
else {
|
4437
|
+
return true;
|
4438
|
+
}
|
4418
4439
|
};
|
4419
|
-
return
|
4440
|
+
return NotRegExpTestValidator;
|
4420
4441
|
}(Validator));
|
4421
4442
|
|
4422
4443
|
var PassValidator = /** @class */ (function (_super) {
|
@@ -4454,33 +4475,17 @@ var RegExpTestValidator = /** @class */ (function (_super) {
|
|
4454
4475
|
return RegExpTestValidator;
|
4455
4476
|
}(Validator));
|
4456
4477
|
|
4457
|
-
var
|
4458
|
-
__extends(
|
4459
|
-
function
|
4460
|
-
if (autoValid === void 0) { autoValid = true; }
|
4461
|
-
return _super.call(this, value, target, event, autoValid) || this;
|
4462
|
-
}
|
4463
|
-
RequiredValidator.prototype.valid = function () {
|
4464
|
-
var value = this.value;
|
4465
|
-
// console.log('required', value, value !== undefined && value !== null)
|
4466
|
-
return value !== undefined && value !== null;
|
4467
|
-
};
|
4468
|
-
return RequiredValidator;
|
4469
|
-
}(Validator));
|
4470
|
-
|
4471
|
-
var NotEmptyValidator = /** @class */ (function (_super) {
|
4472
|
-
__extends(NotEmptyValidator, _super);
|
4473
|
-
function NotEmptyValidator(value, target, event, autoValid) {
|
4478
|
+
var UnCheckedValidator = /** @class */ (function (_super) {
|
4479
|
+
__extends(UnCheckedValidator, _super);
|
4480
|
+
function UnCheckedValidator(value, target, event, autoValid) {
|
4474
4481
|
if (autoValid === void 0) { autoValid = true; }
|
4475
4482
|
return _super.call(this, value, target, event, autoValid) || this;
|
4476
4483
|
}
|
4477
|
-
|
4478
|
-
var _a;
|
4479
|
-
|
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;
|
4484
|
+
UnCheckedValidator.prototype.valid = function () {
|
4485
|
+
var _a, _b;
|
4486
|
+
return !((_b = (_a = this.getTarget()) === null || _a === void 0 ? void 0 : _a.checked) !== null && _b !== void 0 ? _b : false);
|
4482
4487
|
};
|
4483
|
-
return
|
4488
|
+
return UnCheckedValidator;
|
4484
4489
|
}(Validator));
|
4485
4490
|
|
4486
4491
|
var ValidMultipleValidator = /** @class */ (function (_super) {
|
@@ -4498,17 +4503,18 @@ var ValidMultipleValidator = /** @class */ (function (_super) {
|
|
4498
4503
|
return ValidMultipleValidator;
|
4499
4504
|
}(MultipleValidator));
|
4500
4505
|
|
4501
|
-
var
|
4502
|
-
__extends(
|
4503
|
-
function
|
4506
|
+
var RequiredValidator = /** @class */ (function (_super) {
|
4507
|
+
__extends(RequiredValidator, _super);
|
4508
|
+
function RequiredValidator(value, target, event, autoValid) {
|
4504
4509
|
if (autoValid === void 0) { autoValid = true; }
|
4505
4510
|
return _super.call(this, value, target, event, autoValid) || this;
|
4506
4511
|
}
|
4507
|
-
|
4508
|
-
var
|
4509
|
-
|
4512
|
+
RequiredValidator.prototype.valid = function () {
|
4513
|
+
var value = this.value;
|
4514
|
+
// console.log('required', value, value !== undefined && value !== null)
|
4515
|
+
return value !== undefined && value !== null;
|
4510
4516
|
};
|
4511
|
-
return
|
4517
|
+
return RequiredValidator;
|
4512
4518
|
}(Validator));
|
4513
4519
|
|
4514
4520
|
var ValidValidator = /** @class */ (function (_super) {
|
@@ -4539,32 +4545,32 @@ var ValidValidatorArray = /** @class */ (function (_super) {
|
|
4539
4545
|
return ValidValidatorArray;
|
4540
4546
|
}(ValidatorArray));
|
4541
4547
|
|
4542
|
-
var
|
4543
|
-
__extends(
|
4544
|
-
function
|
4548
|
+
var ValueNotEqualsValidator = /** @class */ (function (_super) {
|
4549
|
+
__extends(ValueNotEqualsValidator, _super);
|
4550
|
+
function ValueNotEqualsValidator(equalsValue, value, target, event, autoValid) {
|
4545
4551
|
if (autoValid === void 0) { autoValid = true; }
|
4546
4552
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4547
4553
|
_this.equalsValue = equalsValue;
|
4548
4554
|
return _this;
|
4549
4555
|
}
|
4550
|
-
|
4551
|
-
return this.value
|
4556
|
+
ValueNotEqualsValidator.prototype.valid = function () {
|
4557
|
+
return this.value !== this.equalsValue;
|
4552
4558
|
};
|
4553
|
-
return
|
4559
|
+
return ValueNotEqualsValidator;
|
4554
4560
|
}(Validator));
|
4555
4561
|
|
4556
|
-
var
|
4557
|
-
__extends(
|
4558
|
-
function
|
4562
|
+
var ValueEqualsValidator = /** @class */ (function (_super) {
|
4563
|
+
__extends(ValueEqualsValidator, _super);
|
4564
|
+
function ValueEqualsValidator(equalsValue, value, target, event, autoValid) {
|
4559
4565
|
if (autoValid === void 0) { autoValid = true; }
|
4560
4566
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4561
4567
|
_this.equalsValue = equalsValue;
|
4562
4568
|
return _this;
|
4563
4569
|
}
|
4564
|
-
|
4565
|
-
return this.value
|
4570
|
+
ValueEqualsValidator.prototype.valid = function () {
|
4571
|
+
return this.value === this.equalsValue;
|
4566
4572
|
};
|
4567
|
-
return
|
4573
|
+
return ValueEqualsValidator;
|
4568
4574
|
}(Validator));
|
4569
4575
|
|
4570
4576
|
var ClipBoardUtils = /** @class */ (function () {
|
@@ -4589,6 +4595,30 @@ var ClipBoardUtils = /** @class */ (function () {
|
|
4589
4595
|
return ClipBoardUtils;
|
4590
4596
|
}());
|
4591
4597
|
|
4598
|
+
var NodeUtils = /** @class */ (function () {
|
4599
|
+
function NodeUtils() {
|
4600
|
+
}
|
4601
|
+
// https://stackoverflow.com/questions/3955229/remove-all-child-elements-of-a-dom-node-in-javascript
|
4602
|
+
NodeUtils.removeAllChildNode = function (node) {
|
4603
|
+
while (node === null || node === void 0 ? void 0 : node.firstChild) {
|
4604
|
+
node.firstChild.remove();
|
4605
|
+
}
|
4606
|
+
};
|
4607
|
+
NodeUtils.appendChild = function (parentNode, childNode) {
|
4608
|
+
return parentNode.appendChild(childNode);
|
4609
|
+
};
|
4610
|
+
NodeUtils.replaceNode = function (targetNode, newNode) {
|
4611
|
+
var _a;
|
4612
|
+
// console.log('repalceNode', targetNode, newNode, targetNode.parentNode)
|
4613
|
+
return (_a = targetNode.parentNode) === null || _a === void 0 ? void 0 : _a.replaceChild(newNode, targetNode);
|
4614
|
+
};
|
4615
|
+
NodeUtils.addNode = function (targetNode, newNode) {
|
4616
|
+
var _a;
|
4617
|
+
return (_a = targetNode.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(newNode, targetNode.nextSibling);
|
4618
|
+
};
|
4619
|
+
return NodeUtils;
|
4620
|
+
}());
|
4621
|
+
|
4592
4622
|
var StorageUtils = /** @class */ (function () {
|
4593
4623
|
function StorageUtils() {
|
4594
4624
|
}
|
@@ -4634,30 +4664,6 @@ var StorageUtils = /** @class */ (function () {
|
|
4634
4664
|
return StorageUtils;
|
4635
4665
|
}());
|
4636
4666
|
|
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
|
-
|
4661
4667
|
exports.AllCheckedValidatorArray = AllCheckedValidatorArray;
|
4662
4668
|
exports.AllUnCheckedValidatorArray = AllUnCheckedValidatorArray;
|
4663
4669
|
exports.Appender = Appender;
|
@@ -4685,7 +4691,6 @@ exports.DomRenderProxy = DomRenderProxy;
|
|
4685
4691
|
exports.DomUtils = DomUtils;
|
4686
4692
|
exports.Dr = Dr;
|
4687
4693
|
exports.DrAppender = DrAppender;
|
4688
|
-
exports.DrDictionary = DrDictionary;
|
4689
4694
|
exports.DrFor = DrFor;
|
4690
4695
|
exports.DrForOf = DrForOf;
|
4691
4696
|
exports.DrForm = DrForm;
|
@@ -4697,6 +4702,7 @@ exports.DrRepeat = DrRepeat;
|
|
4697
4702
|
exports.DrTargetAttr = DrTargetAttr;
|
4698
4703
|
exports.DrTargetElement = DrTargetElement;
|
4699
4704
|
exports.DrThis = DrThis;
|
4705
|
+
exports.DrThisProperty = DrThisProperty;
|
4700
4706
|
exports.EmptyValidator = EmptyValidator;
|
4701
4707
|
exports.EventManager = EventManager;
|
4702
4708
|
exports.ExcludeCheckedValidatorArray = ExcludeCheckedValidatorArray;
|