dom-render 1.0.75 → 1.0.78
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.d.ts +1 -1
- package/DomRenderProxy.js +46 -14
- package/README.MD +31 -1
- package/RawSet.d.ts +13 -3
- package/RawSet.js +110 -51
- package/dist/bundle.js +398 -247
- package/events/EventManager.d.ts +2 -1
- package/events/EventManager.js +41 -7
- package/lifecycle/OnChangeAttrRender.d.ts +3 -0
- package/lifecycle/OnChangeAttrRender.js +2 -0
- package/operators/AttrExpresion.d.ts +0 -0
- package/operators/AttrExpresion.js +44 -0
- package/operators/DrAppender.js +1 -1
- package/operators/DrTargetElement.js +26 -0
- package/package.json +1 -1
- package/validators/EmptyValidator.js +2 -2
- package/validators/NotEmptyValidator.js +2 -2
package/dist/bundle.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
try{if(!exports){exports = {};} }catch(e){var exports = {}};
|
4
4
|
|
5
|
-
|
5
|
+
/*! *****************************************************************************
|
6
6
|
Copyright (c) Microsoft Corporation.
|
7
7
|
|
8
8
|
Permission to use, copy, modify, and/or distribute this software for any
|
@@ -454,6 +454,7 @@ var EventManager = /** @class */ (function () {
|
|
454
454
|
EventManager.valueAttrName,
|
455
455
|
EventManager.valueLinkAttrName,
|
456
456
|
EventManager.attrAttrName,
|
457
|
+
EventManager.normalAttrMapAttrName,
|
457
458
|
EventManager.styleAttrName,
|
458
459
|
EventManager.classAttrName,
|
459
460
|
EventManager.attrPrefix + 'window-event-' + EventManager.WINDOW_EVENT_POPSTATE,
|
@@ -495,6 +496,7 @@ var EventManager = /** @class */ (function () {
|
|
495
496
|
// (obj as any)._DomRender_isFinal = true;
|
496
497
|
// return obj;
|
497
498
|
// }
|
499
|
+
// 중요 이벤트에 대상이될 Elements를 찾는다.
|
498
500
|
EventManager.prototype.findAttrElements = function (fragment, config) {
|
499
501
|
var _a, _b;
|
500
502
|
// const datas: {name: string, value: string | null, element: Element}[] = [];
|
@@ -507,6 +509,7 @@ var EventManager = /** @class */ (function () {
|
|
507
509
|
});
|
508
510
|
return elements;
|
509
511
|
};
|
512
|
+
// 중요 처음 이벤트 처리
|
510
513
|
// eslint-disable-next-line no-undef
|
511
514
|
EventManager.prototype.applyEvent = function (obj, childNodes, config) {
|
512
515
|
var _this = this;
|
@@ -532,6 +535,18 @@ var EventManager = /** @class */ (function () {
|
|
532
535
|
}
|
533
536
|
}
|
534
537
|
});
|
538
|
+
// normal-attr-map
|
539
|
+
this.procAttr(childNodes, EventManager.normalAttrMapAttrName, function (it, attribute) {
|
540
|
+
var map = new Map(JSON.parse(attribute));
|
541
|
+
map.forEach(function (v, k) {
|
542
|
+
var data = ScriptUtils.eval("const $element = this.element; return ".concat(v, " "), Object.assign(obj, {
|
543
|
+
__render: Object.freeze({
|
544
|
+
element: it
|
545
|
+
})
|
546
|
+
}));
|
547
|
+
it.setAttribute(k, data);
|
548
|
+
});
|
549
|
+
});
|
535
550
|
// window event
|
536
551
|
EventManager.WINDOW_EVENTS.forEach(function (it) {
|
537
552
|
_this.procAttr(childNodes, EventManager.attrPrefix + 'window-event-' + it, function (it, attribute) {
|
@@ -569,7 +584,7 @@ var EventManager = /** @class */ (function () {
|
|
569
584
|
bindObj_1 = ScriptUtils.evalReturn(ownerVariablePathName, obj);
|
570
585
|
}
|
571
586
|
var getValue = _this.getValue(obj, varName, bindObj_1);
|
572
|
-
// 아래 나중에 리팩토링 필요함
|
587
|
+
// TODO: 아래 나중에 리팩토링 필요함
|
573
588
|
if (typeof getValue === 'function' && getValue) {
|
574
589
|
var setValue = it.value;
|
575
590
|
if (mapScript_1) {
|
@@ -632,7 +647,7 @@ var EventManager = /** @class */ (function () {
|
|
632
647
|
// eslint-disable-next-line no-undef
|
633
648
|
EventManager.prototype.changeVar = function (obj, elements, varName, config) {
|
634
649
|
var _this = this;
|
635
|
-
// console.log('-changeVar-->', obj, elements, varName)
|
650
|
+
// console.log('-changeVar-->', obj, elements, varName);
|
636
651
|
// value-link event
|
637
652
|
this.procAttr(elements, EventManager.valueLinkAttrName, function (it, attribute) {
|
638
653
|
var ownerVariablePathName = it.getAttribute(EventManager.ownerVariablePathAttrName);
|
@@ -665,7 +680,7 @@ var EventManager = /** @class */ (function () {
|
|
665
680
|
if (script) {
|
666
681
|
script = 'return ' + script;
|
667
682
|
}
|
668
|
-
if (
|
683
|
+
if (EventManager.isUsingThisVar(script, varName) || varName === undefined) {
|
669
684
|
var data = ScriptUtils.eval("const $element = this.__render.element; ".concat(script, " "), Object.assign(obj, {
|
670
685
|
__render: Object.freeze({
|
671
686
|
element: it
|
@@ -716,7 +731,7 @@ var EventManager = /** @class */ (function () {
|
|
716
731
|
if (script) {
|
717
732
|
script = 'return ' + script;
|
718
733
|
}
|
719
|
-
if (
|
734
|
+
if (EventManager.isUsingThisVar(script, varName) || varName === undefined) {
|
720
735
|
var data = ScriptUtils.eval("const $element = this.__render.element; ".concat(script, " "), Object.assign(obj, {
|
721
736
|
__render: Object.freeze({
|
722
737
|
element: it
|
@@ -744,7 +759,7 @@ var EventManager = /** @class */ (function () {
|
|
744
759
|
if (script) {
|
745
760
|
script = 'return ' + script;
|
746
761
|
}
|
747
|
-
if (
|
762
|
+
if (EventManager.isUsingThisVar(script, varName) || varName === undefined) {
|
748
763
|
var data = ScriptUtils.eval("const $element = this.element; ".concat(script, " "), Object.assign(obj, {
|
749
764
|
__render: Object.freeze({
|
750
765
|
element: it
|
@@ -771,6 +786,23 @@ var EventManager = /** @class */ (function () {
|
|
771
786
|
}
|
772
787
|
}
|
773
788
|
});
|
789
|
+
// 중요 변수값 바꼈을때 이벤트 타겟 찾는것 normal-attr-map
|
790
|
+
this.procAttr(elements, EventManager.normalAttrMapAttrName, function (it, attribute) {
|
791
|
+
var map = new Map(JSON.parse(attribute));
|
792
|
+
map.forEach(function (v, k) {
|
793
|
+
// console.log('--->', v, k)
|
794
|
+
var isUsing = EventManager.isUsingThisVar(v, varName);
|
795
|
+
// console.log('---isUsing--> varName:', varName, 'k:', k, 'v:', v, 'isUsing:', isUsing);
|
796
|
+
if (isUsing) {
|
797
|
+
var data = ScriptUtils.eval("const $element = this.element; return ".concat(v, " "), Object.assign(obj, {
|
798
|
+
__render: Object.freeze({
|
799
|
+
element: it
|
800
|
+
})
|
801
|
+
}));
|
802
|
+
it.setAttribute(k, data);
|
803
|
+
}
|
804
|
+
});
|
805
|
+
});
|
774
806
|
};
|
775
807
|
// eslint-disable-next-line no-undef
|
776
808
|
EventManager.prototype.addDrEvents = function (obj, eventName, elements, config) {
|
@@ -802,6 +834,7 @@ var EventManager = /** @class */ (function () {
|
|
802
834
|
});
|
803
835
|
});
|
804
836
|
};
|
837
|
+
// eslint-disable-next-line no-undef
|
805
838
|
EventManager.prototype.addDrEventPram = function (obj, attr, elements, config) {
|
806
839
|
var _this = this;
|
807
840
|
this.procAttr(elements, attr, function (it, attribute, attributes) {
|
@@ -875,7 +908,7 @@ var EventManager = /** @class */ (function () {
|
|
875
908
|
value: value
|
876
909
|
});
|
877
910
|
};
|
878
|
-
EventManager.
|
911
|
+
EventManager.isUsingThisVar = function (raws, varName) {
|
879
912
|
// console.log('isUsingV', raws)
|
880
913
|
// console.log('isUsingV', raws, varName, ScriptUtils.getVariablePaths(raws ?? ''))
|
881
914
|
if (varName && raws) {
|
@@ -911,6 +944,7 @@ var EventManager = /** @class */ (function () {
|
|
911
944
|
EventManager.valueAttrName = EventManager.attrPrefix + 'value';
|
912
945
|
EventManager.valueLinkAttrName = EventManager.attrPrefix + 'value-link';
|
913
946
|
EventManager.attrAttrName = EventManager.attrPrefix + 'attr';
|
947
|
+
EventManager.normalAttrMapAttrName = EventManager.attrPrefix + 'normal-attr-map';
|
914
948
|
EventManager.styleAttrName = EventManager.attrPrefix + 'style';
|
915
949
|
EventManager.classAttrName = EventManager.attrPrefix + 'class';
|
916
950
|
EventManager.VALUE_VARNAME = '$value';
|
@@ -1602,7 +1636,7 @@ var DrAppender = /** @class */ (function (_super) {
|
|
1602
1636
|
var itRandom = RawSet.drItOtherEncoding(this.elementSource.element);
|
1603
1637
|
var vars = RawSet.drVarEncoding(this.elementSource.element, (_b = this.elementSource.attrs.drVarOption) !== null && _b !== void 0 ? _b : '');
|
1604
1638
|
var newTemp = this.source.config.window.document.createElement('temp');
|
1605
|
-
ScriptUtils.eval("\n try{\n ".concat(this.render.bindScript, "\n ").concat((_c = this.elementSource.attrs.drBeforeOption) !== null && _c !== void 0 ? _c : '', "\n const ifWrap = document.createElement('div');\n ifWrap.setAttribute('dr-strip', 'true');\n ifWrap.setAttribute('dr-if', '").concat(this.elementSource.attrs.drAppender, " && ").concat(this.elementSource.attrs.drAppender, ".length > 0');\n
|
1639
|
+
ScriptUtils.eval("\n try{\n ".concat(this.render.bindScript, "\n ").concat((_c = this.elementSource.attrs.drBeforeOption) !== null && _c !== void 0 ? _c : '', "\n const ifWrap = document.createElement('div');\n ifWrap.setAttribute('dr-strip', 'true');\n ifWrap.setAttribute('dr-if', '").concat(this.elementSource.attrs.drAppender, " && ").concat(this.elementSource.attrs.drAppender, ".length > 0');\n const n = this.__render.element.cloneNode(true);\n Object.entries(this.__render.drAttr).filter(([k,v]) => k !== 'drAppender' && v).forEach(([k, v]) => n.setAttribute(this.__render.drAttrsOriginName[k], v));\n n.setAttribute('dr-for-of', '").concat(this.elementSource.attrs.drAppender, "[' + (").concat(this.elementSource.attrs.drAppender, ".length-1) + ']');\n n.setAttribute('dr-next', '").concat(this.elementSource.attrs.drAppender, ",' + ").concat(this.elementSource.attrs.drAppender, ".length);\n ifWrap.append(n);\n \n // n.getAttributeNames().forEach(it => n.setAttribute(it, n.getAttribute(it).replace(/\\#it\\#/g, destIt).replace(/\\#nearForOfIt\\#/g, destIt).replace(/\\#it\\#/g, destIt).replace(/\\#nearForOfIndex\\#/g, i)))\n // n.innerHTML = n.innerHTML.replace(/\\#it\\#/g, destIt).replace(/\\#index\\#/g, i);\n // if (this.__render.drStripOption === 'true') {\n // Array.from(n.childNodes).forEach(it => this.__render.fag.append(it));\n // } else {\n // this.__render.fag.append(n);\n // }\n this.__render.fag.append(ifWrap);\n ").concat((_d = this.elementSource.attrs.drAfterOption) !== null && _d !== void 0 ? _d : '', "\n }catch(e){}\n "), Object.assign(this.source.obj, {
|
1606
1640
|
__render: Object.freeze(__assign({ drStripOption: this.elementSource.attrs.drStripOption, drAttr: this.elementSource.attrs, drAttrsOriginName: RawSet.drAttrsOriginName, fag: newTemp }, this.render
|
1607
1641
|
// eslint-disable-next-line no-use-before-define
|
1608
1642
|
))
|
@@ -1666,8 +1700,34 @@ var DrTargetElement = /** @class */ (function (_super) {
|
|
1666
1700
|
if (targetElement) {
|
1667
1701
|
var documentFragment = targetElement.callBack(this.elementSource.element, this.source.obj, this.rawSet, this.elementSource.attrs);
|
1668
1702
|
if (documentFragment) {
|
1703
|
+
// const targetAttrMap = this.elementSource.element.getAttribute(EventManager.normalAttrMapAttrName);
|
1669
1704
|
var detectAction_1 = this.elementSource.element.getAttribute(RawSet.DR_DETECT_NAME);
|
1670
1705
|
var render_1 = documentFragment.render;
|
1706
|
+
// console.log('-------drTargetElement->', render, targetAttrMap);
|
1707
|
+
this.rawSet.fragment = documentFragment;
|
1708
|
+
this.rawSet.data = render_1.component;
|
1709
|
+
// const targetAttrs = this.elementSource.element.getAttributeNames()
|
1710
|
+
// .filter(it => RawSet.isExporesion(this.elementSource.element.getAttribute(it)))
|
1711
|
+
// .map(it => ({name: it, expresion: RawSet.exporesionGrouops(this.elementSource.element.getAttribute(it))[0][1]}))
|
1712
|
+
// .filter(it => it.name.length > 0 && it.expresion.length > 0)
|
1713
|
+
// .map(it => {
|
1714
|
+
// return `n.setAttribute('${it.name}', ${it.expresion})`;
|
1715
|
+
// });
|
1716
|
+
// if (targetAttrMap) {
|
1717
|
+
// ScriptUtils.eval(`
|
1718
|
+
// ${this.render.bindScript}
|
1719
|
+
// //const n = $element.cloneNode(true);
|
1720
|
+
// const n = $element;
|
1721
|
+
// ${targetAttrMap.join(';')};
|
1722
|
+
// // this.__render.fag.append(n);
|
1723
|
+
// `, Object.assign(this.source.obj, {
|
1724
|
+
// __render: Object.freeze({
|
1725
|
+
// fag: newTemp,
|
1726
|
+
// targetAttrs: targetAttrMap,
|
1727
|
+
// ...this.render
|
1728
|
+
// } as Render)
|
1729
|
+
// }));
|
1730
|
+
// }
|
1671
1731
|
if (detectAction_1 && render_1) {
|
1672
1732
|
this.rawSet.detect = {
|
1673
1733
|
action: function () {
|
@@ -1737,14 +1797,22 @@ exports.DestroyOptionType = void 0;
|
|
1737
1797
|
DestroyOptionType["NO_DESTROY"] = "NO_DESTROY";
|
1738
1798
|
DestroyOptionType["NO_MESSENGER_DESTROY"] = "NO_MESSENGER_DESTROY";
|
1739
1799
|
})(exports.DestroyOptionType || (exports.DestroyOptionType = {}));
|
1800
|
+
exports.RawSetType = void 0;
|
1801
|
+
(function (RawSetType) {
|
1802
|
+
RawSetType["TEXT"] = "TEXT";
|
1803
|
+
RawSetType["TARGET_ELEMENT"] = "TARGET_ELEMENT";
|
1804
|
+
RawSetType["TARGET_ATTR"] = "TARGET_ATTR";
|
1805
|
+
RawSetType["UNKOWN"] = "UNKOWN";
|
1806
|
+
})(exports.RawSetType || (exports.RawSetType = {}));
|
1740
1807
|
var RawSet = /** @class */ (function () {
|
1741
|
-
function RawSet(uuid, point, fragment, detect, data) {
|
1742
|
-
if (data === void 0) { data = {}; }
|
1808
|
+
function RawSet(uuid, type, point, fragment, detect, data) {
|
1743
1809
|
this.uuid = uuid;
|
1810
|
+
this.type = type;
|
1744
1811
|
this.point = point;
|
1745
1812
|
this.fragment = fragment;
|
1746
1813
|
this.detect = detect;
|
1747
1814
|
this.data = data;
|
1815
|
+
// console.log('rawset constructor->', (this.point.node as Element).getAttributeNames());
|
1748
1816
|
}
|
1749
1817
|
Object.defineProperty(RawSet.prototype, "isConnected", {
|
1750
1818
|
get: function () {
|
@@ -1753,6 +1821,7 @@ var RawSet = /** @class */ (function () {
|
|
1753
1821
|
enumerable: false,
|
1754
1822
|
configurable: true
|
1755
1823
|
});
|
1824
|
+
// 중요
|
1756
1825
|
RawSet.prototype.getUsingTriggerVariables = function (config) {
|
1757
1826
|
var usingTriggerVariables = new Set();
|
1758
1827
|
this.fragment.childNodes.forEach(function (cNode, key) {
|
@@ -1760,11 +1829,28 @@ var RawSet = /** @class */ (function () {
|
|
1760
1829
|
var script = '';
|
1761
1830
|
if (cNode.nodeType === Node.TEXT_NODE) {
|
1762
1831
|
script = "`".concat((_a = cNode.textContent) !== null && _a !== void 0 ? _a : '', "`");
|
1832
|
+
// console.log('???????', script)
|
1763
1833
|
}
|
1764
1834
|
else if (cNode.nodeType === Node.ELEMENT_NODE) {
|
1765
1835
|
var element_1 = cNode;
|
1766
|
-
var targetAttrNames = ((_c = (_b = config === null || config === void 0 ? void 0 : config.targetAttrs) === null || _b === void 0 ? void 0 : _b.map(function (it) { return it.name; })) !== null && _c !== void 0 ? _c : []).concat(RawSet.DR_ATTRIBUTES);
|
1767
|
-
|
1836
|
+
var targetAttrNames = ((_c = (_b = config === null || config === void 0 ? void 0 : config.targetAttrs) === null || _b === void 0 ? void 0 : _b.map(function (it) { return it.name; })) !== null && _c !== void 0 ? _c : []).concat(RawSet.DR_ATTRIBUTES); // .concat(EventManager.normalAttrMapAttrName);
|
1837
|
+
var targetScripts_1 = targetAttrNames.map(function (it) { return element_1.getAttribute(it); }).filter(function (it) { return it; });
|
1838
|
+
var targetAttrMap = element_1.getAttribute(EventManager.normalAttrMapAttrName);
|
1839
|
+
if (targetAttrMap) {
|
1840
|
+
// console.log('----->', targetAttr);
|
1841
|
+
new Map(JSON.parse(targetAttrMap)).forEach(function (v, k) {
|
1842
|
+
targetScripts_1.push(v);
|
1843
|
+
});
|
1844
|
+
}
|
1845
|
+
script = targetScripts_1.join(';');
|
1846
|
+
// attribute쪽 체크하는거 추가
|
1847
|
+
// console.log('----!!!!!-->', targetAttrNames)
|
1848
|
+
// const otherAttrs = element.getAttributeNames()
|
1849
|
+
// .filter(it => !targetAttrNames.includes(it.toLowerCase()) && RawSet.isExporesion(element.getAttribute(it)))
|
1850
|
+
// .map(it => {
|
1851
|
+
// return `\`${element.getAttribute(it) ?? ''}\``;
|
1852
|
+
// }).join(';');
|
1853
|
+
// script += ';' + otherAttrs
|
1768
1854
|
}
|
1769
1855
|
if (script) {
|
1770
1856
|
// script = script.replace('}$','}');
|
@@ -1782,6 +1868,7 @@ var RawSet = /** @class */ (function () {
|
|
1782
1868
|
// console.log('usingTriggerVariable----------->', usingTriggerVariables)
|
1783
1869
|
return usingTriggerVariables;
|
1784
1870
|
};
|
1871
|
+
// 중요 render
|
1785
1872
|
RawSet.prototype.render = function (obj, config) {
|
1786
1873
|
var _this = this;
|
1787
1874
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
@@ -1811,7 +1898,7 @@ var RawSet = /** @class */ (function () {
|
|
1811
1898
|
if (cNode.nodeType === Node.TEXT_NODE && cNode.textContent) {
|
1812
1899
|
var textContent = cNode.textContent;
|
1813
1900
|
var runText = RawSet.exporesionGrouops(textContent)[0][1];
|
1814
|
-
// console.log('--->', textContent,runText, runText[0][1])
|
1901
|
+
// console.log('--->', RawSet.exporesionGrouops(textContent), textContent,runText, runText[0][1])
|
1815
1902
|
var n = void 0;
|
1816
1903
|
if (textContent === null || textContent === void 0 ? void 0 : textContent.startsWith('#')) {
|
1817
1904
|
var r = ScriptUtils.eval("".concat(__render.bindScript, " return ").concat(runText), Object.assign(obj, { __render: __render }));
|
@@ -1827,6 +1914,7 @@ var RawSet = /** @class */ (function () {
|
|
1827
1914
|
}
|
1828
1915
|
else if (cNode.nodeType === Node.ELEMENT_NODE) {
|
1829
1916
|
var element = cNode;
|
1917
|
+
// console.log('target-->', element)
|
1830
1918
|
var drAttr = {
|
1831
1919
|
dr: this.getAttributeAndDelete(element, RawSet.DR),
|
1832
1920
|
drIf: this.getAttributeAndDelete(element, RawSet.DR_IF_NAME),
|
@@ -1912,8 +2000,8 @@ var RawSet = /** @class */ (function () {
|
|
1912
2000
|
var rawSet = domrenderComponentNew === null || domrenderComponentNew === void 0 ? void 0 : domrenderComponentNew.rawSet;
|
1913
2001
|
var drAttrs = domrenderComponentNew === null || domrenderComponentNew === void 0 ? void 0 : domrenderComponentNew.drAttrs;
|
1914
2002
|
if (rawSet && !rawSet.isConnected) {
|
1915
|
-
|
1916
|
-
console.log('component destroy--->', key, rawSet, rawSet.isConnected, domrenderComponent.name, domrenderComponent);
|
2003
|
+
// const domrenderComponent = obj.__domrender_components[key];
|
2004
|
+
// console.log('component destroy--->', key, rawSet, rawSet.isConnected, domrenderComponent.name, domrenderComponent);
|
1917
2005
|
var destroyOptions = (_c = (_b = drAttrs === null || drAttrs === void 0 ? void 0 : drAttrs.drDestroyOption) === null || _b === void 0 ? void 0 : _b.split(',')) !== null && _c !== void 0 ? _c : [];
|
1918
2006
|
RawSet.destroy(obj.__domrender_components[key], [domrenderComponentNew], config, destroyOptions);
|
1919
2007
|
delete obj.__domrender_components[key];
|
@@ -1964,8 +2052,9 @@ var RawSet = /** @class */ (function () {
|
|
1964
2052
|
this.childAllRemove();
|
1965
2053
|
(_a = this.point.start.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(genNode, this.point.start.nextSibling);
|
1966
2054
|
};
|
2055
|
+
// 중요 important
|
1967
2056
|
RawSet.checkPointCreates = function (element, config) {
|
1968
|
-
var _a, _b, _c, _d;
|
2057
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
1969
2058
|
var thisVariableName = element.__domrender_this_variable_name;
|
1970
2059
|
// console.log('checkPointCreates thisVariableName', thisVariableName);
|
1971
2060
|
var nodeIterator = config.window.document.createNodeIterator(element, NodeFilter.SHOW_ALL, {
|
@@ -1974,7 +2063,7 @@ var RawSet = /** @class */ (function () {
|
|
1974
2063
|
if (node.nodeType === Node.TEXT_NODE) {
|
1975
2064
|
// console.log('????????', node.parentElement, node.parentElement?.getAttribute('dr-pre'));
|
1976
2065
|
// console.log('???????/',node.textContent, node.parentElement?.getAttribute('dr-pre'))
|
1977
|
-
// 나중에
|
2066
|
+
// TODO: 나중에
|
1978
2067
|
// const between = StringUtils.betweenRegexpStr('[$#]\\{', '\\}', StringUtils.deleteEnter((node as Text).data ?? ''))
|
1979
2068
|
var between = RawSet.exporesionGrouops(StringUtils.deleteEnter((_a = node.data) !== null && _a !== void 0 ? _a : ''));
|
1980
2069
|
// console.log('bbbb', between)
|
@@ -1984,9 +2073,23 @@ var RawSet = /** @class */ (function () {
|
|
1984
2073
|
}
|
1985
2074
|
else if (node.nodeType === Node.ELEMENT_NODE) {
|
1986
2075
|
var element_2 = node;
|
2076
|
+
// console.log('------>', element);
|
1987
2077
|
var isElement = ((_c = (_b = config.targetElements) === null || _b === void 0 ? void 0 : _b.map(function (it) { return it.name.toLowerCase(); })) !== null && _c !== void 0 ? _c : []).includes(element_2.tagName.toLowerCase());
|
1988
2078
|
var targetAttrNames_1 = ((_e = (_d = config.targetAttrs) === null || _d === void 0 ? void 0 : _d.map(function (it) { return it.name; })) !== null && _e !== void 0 ? _e : []).concat(RawSet.DR_ATTRIBUTES);
|
1989
|
-
var
|
2079
|
+
var normalAttrs_1 = new Map();
|
2080
|
+
var isAttr = element_2.getAttributeNames().filter(function (it) {
|
2081
|
+
var value = element_2.getAttribute(it);
|
2082
|
+
if (value && RawSet.isExporesion(value)) {
|
2083
|
+
normalAttrs_1.set(it, RawSet.exporesionGrouops(value)[0][1]);
|
2084
|
+
}
|
2085
|
+
// console.log(element.getAttribute(it), attrExpresion);
|
2086
|
+
var isTargetAttr = targetAttrNames_1.includes(it.toLowerCase());
|
2087
|
+
return isTargetAttr;
|
2088
|
+
}).length > 0;
|
2089
|
+
// 기본 attribute를 처리하기위해
|
2090
|
+
if (normalAttrs_1.size) {
|
2091
|
+
element_2.setAttribute(EventManager.normalAttrMapAttrName, JSON.stringify(Array.from(normalAttrs_1.entries())));
|
2092
|
+
}
|
1990
2093
|
return (isAttr || isElement) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT;
|
1991
2094
|
}
|
1992
2095
|
return NodeFilter.FILTER_REJECT;
|
@@ -1997,52 +2100,53 @@ var RawSet = /** @class */ (function () {
|
|
1997
2100
|
var _loop_1 = function () {
|
1998
2101
|
if (currentNode.nodeType === Node.TEXT_NODE) {
|
1999
2102
|
var text = (_a = currentNode.textContent) !== null && _a !== void 0 ? _a : '';
|
2000
|
-
var
|
2103
|
+
var template = config.window.document.createElement('template');
|
2001
2104
|
// const a = StringUtils.regexExec(/\$\{.*?\}/g, text);
|
2002
2105
|
// const a = StringUtils.regexExec(/[$#]\{.*?\}/g, text);
|
2003
|
-
// const a = StringUtils.betweenRegexpStr('[$#]\\{', '\\}', text); //
|
2004
|
-
var
|
2005
|
-
var map =
|
2006
|
-
|
2007
|
-
|
2008
|
-
|
2009
|
-
|
2010
|
-
|
2011
|
-
|
2012
|
-
|
2013
|
-
map.forEach(function (it) {
|
2014
|
-
var regexArr = it.regexArr;
|
2015
|
-
var preparedText = regexArr.input.substring(lasterIndex_1, regexArr.index);
|
2016
|
-
var start = config.window.document.createComment("start text ".concat(it.uuid));
|
2017
|
-
var end = config.window.document.createComment("end text ".concat(it.uuid));
|
2106
|
+
// const a = StringUtils.betweenRegexpStr('[$#]\\{', '\\}', text); // <--TODO: 나중에..
|
2107
|
+
var groups = RawSet.exporesionGrouops(text);
|
2108
|
+
var map = groups.map(function (it) { return ({ uuid: RandomUtils.uuid(), content: it[0], regexArr: it }); });
|
2109
|
+
var lasterIndex = 0;
|
2110
|
+
for (var i = 0; i < map.length; i++) {
|
2111
|
+
var it_4 = map[i];
|
2112
|
+
var regexArr = it_4.regexArr;
|
2113
|
+
var preparedText = regexArr.input.substring(lasterIndex, regexArr.index);
|
2114
|
+
var start = config.window.document.createComment("start text ".concat(it_4.uuid));
|
2115
|
+
var end = config.window.document.createComment("end text ".concat(it_4.uuid));
|
2018
2116
|
// layout setting
|
2019
|
-
|
2020
|
-
|
2021
|
-
|
2117
|
+
template.content.append(document.createTextNode(preparedText)); // 사이사이값.
|
2118
|
+
template.content.append(start);
|
2119
|
+
template.content.append(end);
|
2022
2120
|
// content
|
2023
2121
|
var fragment = config.window.document.createDocumentFragment();
|
2024
|
-
fragment.append(config.window.document.createTextNode(
|
2025
|
-
pars.push(new RawSet(
|
2122
|
+
fragment.append(config.window.document.createTextNode(it_4.content));
|
2123
|
+
pars.push(new RawSet(it_4.uuid, exports.RawSetType.TEXT, {
|
2026
2124
|
start: start,
|
2125
|
+
node: currentNode,
|
2027
2126
|
end: end,
|
2028
2127
|
thisVariableName: thisVariableName
|
2029
2128
|
}, fragment));
|
2030
|
-
|
2031
|
-
}
|
2032
|
-
|
2033
|
-
(_b = currentNode === null || currentNode === void 0 ? void 0 : currentNode.parentNode) === null || _b === void 0 ? void 0 : _b.replaceChild(
|
2129
|
+
lasterIndex = regexArr.index + it_4.content.length;
|
2130
|
+
}
|
2131
|
+
template.content.append(config.window.document.createTextNode(text.substring(lasterIndex, text.length)));
|
2132
|
+
(_b = currentNode === null || currentNode === void 0 ? void 0 : currentNode.parentNode) === null || _b === void 0 ? void 0 : _b.replaceChild(template.content, currentNode);
|
2034
2133
|
}
|
2035
|
-
else {
|
2134
|
+
else if (currentNode.nodeType === Node.ELEMENT_NODE) {
|
2036
2135
|
var uuid = RandomUtils.uuid();
|
2136
|
+
var element_3 = currentNode;
|
2037
2137
|
var fragment = config.window.document.createDocumentFragment();
|
2038
2138
|
var start = config.window.document.createComment("start ".concat(uuid));
|
2039
2139
|
var end = config.window.document.createComment("end ".concat(uuid));
|
2040
2140
|
// console.log('start--', uuid)
|
2041
|
-
(_c =
|
2042
|
-
(
|
2141
|
+
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());
|
2142
|
+
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);
|
2143
|
+
var isAttr = element_3.getAttributeNames().filter(function (it) { return targetAttrNames_2.includes(it.toLowerCase()); }).length > 0;
|
2144
|
+
(_g = currentNode === null || currentNode === void 0 ? void 0 : currentNode.parentNode) === null || _g === void 0 ? void 0 : _g.insertBefore(start, currentNode);
|
2145
|
+
(_h = currentNode === null || currentNode === void 0 ? void 0 : currentNode.parentNode) === null || _h === void 0 ? void 0 : _h.insertBefore(end, currentNode.nextSibling);
|
2043
2146
|
fragment.append(currentNode);
|
2044
|
-
pars.push(new RawSet(uuid, {
|
2147
|
+
pars.push(new RawSet(uuid, isElement ? exports.RawSetType.TARGET_ELEMENT : (isAttr ? exports.RawSetType.TARGET_ATTR : exports.RawSetType.UNKOWN), {
|
2045
2148
|
start: start,
|
2149
|
+
node: currentNode,
|
2046
2150
|
end: end,
|
2047
2151
|
thisVariableName: thisVariableName
|
2048
2152
|
}, fragment));
|
@@ -2120,8 +2224,8 @@ var RawSet = /** @class */ (function () {
|
|
2120
2224
|
var nodeIterator = config.window.document.createNodeIterator(subElement, NodeFilter.SHOW_ELEMENT, {
|
2121
2225
|
acceptNode: function (node) {
|
2122
2226
|
if (node.nodeType === Node.ELEMENT_NODE) {
|
2123
|
-
var
|
2124
|
-
return
|
2227
|
+
var element_4 = node;
|
2228
|
+
return element_4.hasAttribute(as) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT;
|
2125
2229
|
}
|
2126
2230
|
else {
|
2127
2231
|
return NodeFilter.FILTER_REJECT;
|
@@ -2131,9 +2235,9 @@ var RawSet = /** @class */ (function () {
|
|
2131
2235
|
var node;
|
2132
2236
|
// eslint-disable-next-line no-cond-assign
|
2133
2237
|
while (node = nodeIterator.nextNode()) {
|
2134
|
-
var
|
2135
|
-
|
2136
|
-
|
2238
|
+
var element_5 = node;
|
2239
|
+
element_5.setAttribute(to, (_a = element_5.getAttribute(as)) !== null && _a !== void 0 ? _a : '');
|
2240
|
+
element_5.removeAttribute(as);
|
2137
2241
|
}
|
2138
2242
|
});
|
2139
2243
|
};
|
@@ -2243,7 +2347,7 @@ var RawSet = /** @class */ (function () {
|
|
2243
2347
|
template: template,
|
2244
2348
|
callBack: function (element, obj, rawSet, attrs) {
|
2245
2349
|
var _a, _b, _c, _d;
|
2246
|
-
// console.log('callback------->')
|
2350
|
+
// console.log('callback------->', element)
|
2247
2351
|
if (!obj.__domrender_components) {
|
2248
2352
|
obj.__domrender_components = {};
|
2249
2353
|
}
|
@@ -2252,6 +2356,7 @@ var RawSet = /** @class */ (function () {
|
|
2252
2356
|
var attribute = DomUtils.getAttributeToObject(element);
|
2253
2357
|
var renderScript = 'var $component = this.__render.component; var $element = this.__render.element; var $router = this.__render.router; var $innerHTML = this.__render.innerHTML; var $attribute = this.__render.attribute; var $creatorMetaData = this.__render.creatorMetaData;';
|
2254
2358
|
var render = Object.freeze({
|
2359
|
+
renderScript: renderScript,
|
2255
2360
|
element: element,
|
2256
2361
|
innerHTML: element.innerHTML,
|
2257
2362
|
attribute: attribute,
|
@@ -2287,6 +2392,16 @@ var RawSet = /** @class */ (function () {
|
|
2287
2392
|
i.creator = new Proxy(rawSet.point.thisVariableName ? ScriptUtils.evalReturn(rawSet.point.thisVariableName, obj) : obj, new DomRenderFinalProxy());
|
2288
2393
|
this.__creatorMetaData = i;
|
2289
2394
|
render = __assign({ component: instance, creatorMetaData: i }, render);
|
2395
|
+
// 중요 dr-normal-attr-map
|
2396
|
+
var normalAttrMap = element.getAttribute(EventManager.normalAttrMapAttrName);
|
2397
|
+
if (instance.onChangeAttrRender && normalAttrMap) {
|
2398
|
+
new Map(JSON.parse(normalAttrMap)).forEach(function (value, key) {
|
2399
|
+
var script = "".concat(renderScript, " return ").concat(value, " ");
|
2400
|
+
var cval = ScriptUtils.eval(script, Object.assign(obj, { __render: render }));
|
2401
|
+
// element.setAttribute(key, cval);
|
2402
|
+
instance.onChangeAttrRender(key, cval);
|
2403
|
+
});
|
2404
|
+
}
|
2290
2405
|
// dr-on-create onCreateRender
|
2291
2406
|
var onCreate = element.getAttribute("".concat(EventManager.attrPrefix, "on-create"));
|
2292
2407
|
this.__render = render;
|
@@ -2324,10 +2439,10 @@ var RawSet = /** @class */ (function () {
|
|
2324
2439
|
var data = RawSet.drThisCreate(element, "this.__domrender_components.".concat(componentKey), '', true, obj, config);
|
2325
2440
|
// 넘어온 innerHTML에 this가 있는걸 다시 복호화해서 제대로 작동하도록한다.
|
2326
2441
|
if (innerHTMLThisRandom) {
|
2327
|
-
var
|
2328
|
-
|
2329
|
-
|
2330
|
-
data =
|
2442
|
+
var template_1 = config.window.document.createElement('template');
|
2443
|
+
template_1.content.append(data);
|
2444
|
+
template_1.innerHTML = template_1.innerHTML.replace(RegExp(innerHTMLThisRandom, 'g'), 'this.');
|
2445
|
+
data = template_1.content;
|
2331
2446
|
}
|
2332
2447
|
data.render = render;
|
2333
2448
|
return data;
|
@@ -2336,10 +2451,14 @@ var RawSet = /** @class */ (function () {
|
|
2336
2451
|
};
|
2337
2452
|
return targetElement;
|
2338
2453
|
};
|
2454
|
+
RawSet.isExporesion = function (data) {
|
2455
|
+
var reg = /(?:[$#]\{(?:(([$#]\{)??[^$#]?[^{]*?)\}[$#]))/g;
|
2456
|
+
return reg.test(data !== null && data !== void 0 ? data : '');
|
2457
|
+
};
|
2339
2458
|
RawSet.exporesionGrouops = function (data) {
|
2340
2459
|
// const reg = /(?:[$#]\{(?:(([$#]\{)??[^$#]*?)\}[$#]))/g;
|
2341
2460
|
var reg = /(?:[$#]\{(?:(([$#]\{)??[^$#]?[^{]*?)\}[$#]))/g;
|
2342
|
-
return StringUtils.regexExec(reg, data);
|
2461
|
+
return StringUtils.regexExec(reg, data !== null && data !== void 0 ? data : '');
|
2343
2462
|
};
|
2344
2463
|
RawSet.styleTransformLocal = function (styleBody, id, styleTagWrap, locale) {
|
2345
2464
|
if (styleTagWrap === void 0) { styleTagWrap = true; }
|
@@ -2450,9 +2569,9 @@ var DomRenderProxy = /** @class */ (function () {
|
|
2450
2569
|
};
|
2451
2570
|
DomRenderProxy.prototype.run = function (objProxy) {
|
2452
2571
|
var _this = this;
|
2453
|
-
var _a;
|
2572
|
+
var _a, _b;
|
2454
2573
|
this._domRender_proxy = objProxy;
|
2455
|
-
(_a = objProxy === null ||
|
2574
|
+
(_b = (_a = objProxy) === null || _a === void 0 ? void 0 : _a.onProxyDomRender) === null || _b === void 0 ? void 0 : _b.call(_a, this.config);
|
2456
2575
|
var obj = objProxy._DomRender_origin;
|
2457
2576
|
if (obj) {
|
2458
2577
|
Object.keys(obj).forEach(function (it) {
|
@@ -2478,8 +2597,8 @@ var DomRenderProxy = /** @class */ (function () {
|
|
2478
2597
|
DomRenderProxy.prototype.initRender = function (target) {
|
2479
2598
|
var _this = this;
|
2480
2599
|
var _a, _b, _c, _d, _e, _f, _g;
|
2481
|
-
var onCreate = (_b = (_a = target).getAttribute) === null || _b === void 0 ? void 0 : _b.call(_a,
|
2482
|
-
var createParam
|
2600
|
+
var onCreate = (_b = (_a = target).getAttribute) === null || _b === void 0 ? void 0 : _b.call(_a, "".concat(EventManager.attrPrefix, "on-create"));
|
2601
|
+
var createParam;
|
2483
2602
|
if (onCreate) {
|
2484
2603
|
createParam = ScriptUtils.evalReturn(onCreate, this._domRender_proxy);
|
2485
2604
|
}
|
@@ -2487,6 +2606,8 @@ var DomRenderProxy = /** @class */ (function () {
|
|
2487
2606
|
var innerHTML = (_e = target.innerHTML) !== null && _e !== void 0 ? _e : '';
|
2488
2607
|
this._targets.add(target);
|
2489
2608
|
var rawSets = RawSet.checkPointCreates(target, this.config);
|
2609
|
+
// console.log('initRender -------rawSet', rawSets)
|
2610
|
+
// 중요 초기에 한번 튕겨줘야함.
|
2490
2611
|
eventManager.applyEvent(this._domRender_proxy, eventManager.findAttrElements(target, this.config), this.config);
|
2491
2612
|
rawSets.forEach(function (it) {
|
2492
2613
|
var variables = it.getUsingTriggerVariables(_this.config);
|
@@ -2515,7 +2636,8 @@ var DomRenderProxy = /** @class */ (function () {
|
|
2515
2636
|
});
|
2516
2637
|
return Array.from(set);
|
2517
2638
|
};
|
2518
|
-
|
2639
|
+
// 중요 important
|
2640
|
+
DomRenderProxy.prototype.render = function (raws, fullPathStr) {
|
2519
2641
|
var _this = this;
|
2520
2642
|
if (typeof raws === 'string') {
|
2521
2643
|
var iter = this._rawSets.get(raws);
|
@@ -2528,15 +2650,40 @@ var DomRenderProxy = /** @class */ (function () {
|
|
2528
2650
|
}
|
2529
2651
|
var removeRawSets = [];
|
2530
2652
|
(raws !== null && raws !== void 0 ? raws : this.getRawSets()).forEach(function (it) {
|
2531
|
-
var _a;
|
2653
|
+
var _a, _b, _c;
|
2532
2654
|
it.getUsingTriggerVariables(_this.config).forEach(function (path) { return _this.addRawSet(path, it); });
|
2533
|
-
// console.log('------->', it, it.isConnected)
|
2655
|
+
// console.log('------->', it, it.isConnected);
|
2534
2656
|
if (it.isConnected) {
|
2535
|
-
|
2657
|
+
// 중요 render될때 targetAttribute 체크 해야함.
|
2658
|
+
var targetAttrMap = (_b = (_a = it.point.node) === null || _a === void 0 ? void 0 : _a.getAttribute) === null || _b === void 0 ? void 0 : _b.call(_a, EventManager.normalAttrMapAttrName);
|
2659
|
+
if ((_c = it.detect) === null || _c === void 0 ? void 0 : _c.action) {
|
2536
2660
|
it.detect.action();
|
2537
2661
|
}
|
2662
|
+
else if (it.type === exports.RawSetType.TARGET_ELEMENT && it.data && fullPathStr && targetAttrMap && it.fragment.render) {
|
2663
|
+
new Map(JSON.parse(targetAttrMap)).forEach(function (v, k) {
|
2664
|
+
// it?.data.onChangeAttrRender(k, null, v);
|
2665
|
+
var isUsing = EventManager.isUsingThisVar(v, "this.".concat(fullPathStr));
|
2666
|
+
if (isUsing) {
|
2667
|
+
var render = it.fragment.render;
|
2668
|
+
// console.log('render-->', (it.fragment as any).render)
|
2669
|
+
var script = "".concat(render.renderScript, " return ").concat(v, " ");
|
2670
|
+
var cval = ScriptUtils.eval(script, Object.assign(_this._domRender_proxy, { __render: render }));
|
2671
|
+
it.data.onChangeAttrRender(k, cval);
|
2672
|
+
}
|
2673
|
+
// console.log('---?', v, fullPathStr, isUsing);
|
2674
|
+
});
|
2675
|
+
// ------------------->
|
2676
|
+
}
|
2538
2677
|
else {
|
2539
2678
|
var rawSets = it.render(_this._domRender_proxy, _this.config);
|
2679
|
+
// 대상 attribute 있으면
|
2680
|
+
// const targetAttrs = (it.point.node as Element).getAttribute(EventManager.normalAttrMapAttrName);
|
2681
|
+
// if (it?.data.onChangeAttrRender && it.type === RawSetType.TARGET_ELEMENT && targetAttrs) {
|
2682
|
+
// new Map<string, string>(JSON.parse(targetAttrs)).forEach((v, k) => {
|
2683
|
+
// it?.data.onChangeAttrRender(k, null, v);
|
2684
|
+
// });
|
2685
|
+
// }
|
2686
|
+
// 그외 자식들 render
|
2540
2687
|
if (rawSets && rawSets.length > 0) {
|
2541
2688
|
_this.render(rawSets);
|
2542
2689
|
}
|
@@ -2579,6 +2726,7 @@ var DomRenderProxy = /** @class */ (function () {
|
|
2579
2726
|
var fullPathStr_1 = strings.map(function (it) { return isNaN(Number(it)) ? '.' + it : "[".concat(it, "]"); }).join('').slice(1);
|
2580
2727
|
if (lastDoneExecute) {
|
2581
2728
|
var iterable = this._rawSets.get(fullPathStr_1);
|
2729
|
+
// console.log('----->', iterable);
|
2582
2730
|
// array check
|
2583
2731
|
var front = strings.slice(0, strings.length - 1).map(function (it) { return isNaN(Number(it)) ? '.' + it : "[".concat(it, "]"); }).join('');
|
2584
2732
|
var last = strings[strings.length - 1];
|
@@ -2590,11 +2738,14 @@ var DomRenderProxy = /** @class */ (function () {
|
|
2590
2738
|
}
|
2591
2739
|
}
|
2592
2740
|
else if (iterable) {
|
2593
|
-
this.render(Array.from(iterable));
|
2741
|
+
this.render(Array.from(iterable), fullPathStr_1);
|
2594
2742
|
}
|
2595
2743
|
this._targets.forEach(function (it) {
|
2744
|
+
// console.log('target------->,', it)
|
2745
|
+
// return;
|
2596
2746
|
if (it.nodeType === Node.DOCUMENT_FRAGMENT_NODE || it.nodeType === Node.ELEMENT_NODE) {
|
2597
2747
|
var targets = eventManager.findAttrElements(it, _this.config);
|
2748
|
+
// console.log('------>', targets);
|
2598
2749
|
eventManager.changeVar(_this._domRender_proxy, targets, "this.".concat(fullPathStr_1), _this.config);
|
2599
2750
|
}
|
2600
2751
|
});
|
@@ -2604,7 +2755,7 @@ var DomRenderProxy = /** @class */ (function () {
|
|
2604
2755
|
return fullPaths;
|
2605
2756
|
};
|
2606
2757
|
DomRenderProxy.prototype.set = function (target, p, value, receiver) {
|
2607
|
-
var _a, _b;
|
2758
|
+
var _a, _b, _c;
|
2608
2759
|
if (typeof p === 'string' && p !== '__domrender_components' && excludeGetSetPropertys.includes(p)) {
|
2609
2760
|
target[p] = value;
|
2610
2761
|
return true;
|
@@ -2625,12 +2776,12 @@ var DomRenderProxy = /** @class */ (function () {
|
|
2625
2776
|
}
|
2626
2777
|
// console.log('full path:', fullPath);
|
2627
2778
|
if (('onBeforeReturnSet' in receiver) && typeof p === 'string' && !((_a = this.config.proxyExcludeOnBeforeReturnSets) !== null && _a !== void 0 ? _a : []).concat(excludeGetSetPropertys).includes(p)) {
|
2628
|
-
(_b = receiver === null ||
|
2779
|
+
(_c = (_b = receiver) === null || _b === void 0 ? void 0 : _b.onBeforeReturnSet) === null || _c === void 0 ? void 0 : _c.call(_b, p, value, fullPath);
|
2629
2780
|
}
|
2630
2781
|
return true;
|
2631
2782
|
};
|
2632
2783
|
DomRenderProxy.prototype.get = function (target, p, receiver) {
|
2633
|
-
var _a, _b;
|
2784
|
+
var _a, _b, _c;
|
2634
2785
|
// console.log('get-->', target, p, receiver);
|
2635
2786
|
if (p === '_DomRender_origin') {
|
2636
2787
|
return this._domRender_origin;
|
@@ -2661,7 +2812,7 @@ var DomRenderProxy = /** @class */ (function () {
|
|
2661
2812
|
it_1 = it_1._DomRender_origin;
|
2662
2813
|
}
|
2663
2814
|
if (('onBeforeReturnGet' in receiver) && typeof p === 'string' && !((_a = this.config.proxyExcludeOnBeforeReturnGets) !== null && _a !== void 0 ? _a : []).concat(excludeGetSetPropertys).includes(p)) {
|
2664
|
-
(_b = receiver === null ||
|
2815
|
+
(_c = (_b = receiver) === null || _b === void 0 ? void 0 : _b.onBeforeReturnGet) === null || _c === void 0 ? void 0 : _c.call(_b, p, it_1, this.root([p], it_1, false));
|
2665
2816
|
}
|
2666
2817
|
return it_1;
|
2667
2818
|
}
|
@@ -2701,7 +2852,7 @@ var DomRenderProxy = /** @class */ (function () {
|
|
2701
2852
|
};
|
2702
2853
|
DomRenderProxy.prototype.addRawSet = function (path, rawSet) {
|
2703
2854
|
var _a;
|
2704
|
-
// console.log('addRawSet-->', path, rawSet)
|
2855
|
+
// console.log('addRawSet--> path:', path, 'rawSet:', rawSet)
|
2705
2856
|
if (!this._rawSets.get(path)) {
|
2706
2857
|
this._rawSets.set(path, new Set());
|
2707
2858
|
}
|
@@ -3319,6 +3470,19 @@ var AllUnCheckedValidatorArray = /** @class */ (function (_super) {
|
|
3319
3470
|
return AllUnCheckedValidatorArray;
|
3320
3471
|
}(ValidatorArray));
|
3321
3472
|
|
3473
|
+
var CheckedValidator = /** @class */ (function (_super) {
|
3474
|
+
__extends(CheckedValidator, _super);
|
3475
|
+
function CheckedValidator(value, target, event, autoValid) {
|
3476
|
+
if (autoValid === void 0) { autoValid = true; }
|
3477
|
+
return _super.call(this, value, target, event, autoValid) || this;
|
3478
|
+
}
|
3479
|
+
CheckedValidator.prototype.valid = function () {
|
3480
|
+
var _a, _b;
|
3481
|
+
return (_b = (_a = this.getTarget()) === null || _a === void 0 ? void 0 : _a.checked) !== null && _b !== void 0 ? _b : false;
|
3482
|
+
};
|
3483
|
+
return CheckedValidator;
|
3484
|
+
}(Validator));
|
3485
|
+
|
3322
3486
|
var CountEqualsCheckedValidatorArray = /** @class */ (function (_super) {
|
3323
3487
|
__extends(CountEqualsCheckedValidatorArray, _super);
|
3324
3488
|
function CountEqualsCheckedValidatorArray(count, value, target, event, autoValid) {
|
@@ -3364,34 +3528,6 @@ var CountGreaterThanCheckedValidatorArray = /** @class */ (function (_super) {
|
|
3364
3528
|
return CountGreaterThanCheckedValidatorArray;
|
3365
3529
|
}(ValidatorArray));
|
3366
3530
|
|
3367
|
-
var CountGreaterThanUnCheckedValidatorArray = /** @class */ (function (_super) {
|
3368
|
-
__extends(CountGreaterThanUnCheckedValidatorArray, _super);
|
3369
|
-
function CountGreaterThanUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
3370
|
-
if (autoValid === void 0) { autoValid = true; }
|
3371
|
-
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3372
|
-
_this.count = count;
|
3373
|
-
return _this;
|
3374
|
-
}
|
3375
|
-
CountGreaterThanUnCheckedValidatorArray.prototype.valid = function () {
|
3376
|
-
var _a;
|
3377
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length > this.count;
|
3378
|
-
};
|
3379
|
-
return CountGreaterThanUnCheckedValidatorArray;
|
3380
|
-
}(ValidatorArray));
|
3381
|
-
|
3382
|
-
var CheckedValidator = /** @class */ (function (_super) {
|
3383
|
-
__extends(CheckedValidator, _super);
|
3384
|
-
function CheckedValidator(value, target, event, autoValid) {
|
3385
|
-
if (autoValid === void 0) { autoValid = true; }
|
3386
|
-
return _super.call(this, value, target, event, autoValid) || this;
|
3387
|
-
}
|
3388
|
-
CheckedValidator.prototype.valid = function () {
|
3389
|
-
var _a, _b;
|
3390
|
-
return (_b = (_a = this.getTarget()) === null || _a === void 0 ? void 0 : _a.checked) !== null && _b !== void 0 ? _b : false;
|
3391
|
-
};
|
3392
|
-
return CheckedValidator;
|
3393
|
-
}(Validator));
|
3394
|
-
|
3395
3531
|
var CountGreaterThanEqualsCheckedValidatorArray = /** @class */ (function (_super) {
|
3396
3532
|
__extends(CountGreaterThanEqualsCheckedValidatorArray, _super);
|
3397
3533
|
function CountGreaterThanEqualsCheckedValidatorArray(count, value, target, event, autoValid) {
|
@@ -3422,49 +3558,34 @@ var CountGreaterThanEqualsUnCheckedValidatorArray = /** @class */ (function (_su
|
|
3422
3558
|
return CountGreaterThanEqualsUnCheckedValidatorArray;
|
3423
3559
|
}(ValidatorArray));
|
3424
3560
|
|
3425
|
-
var
|
3426
|
-
__extends(
|
3427
|
-
function
|
3428
|
-
if (autoValid === void 0) { autoValid = true; }
|
3429
|
-
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3430
|
-
_this.count = count;
|
3431
|
-
return _this;
|
3432
|
-
}
|
3433
|
-
CountLessThanEqualsCheckedValidatorArray.prototype.valid = function () {
|
3434
|
-
var _a;
|
3435
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length <= this.count;
|
3436
|
-
};
|
3437
|
-
return CountLessThanEqualsCheckedValidatorArray;
|
3438
|
-
}(ValidatorArray));
|
3439
|
-
|
3440
|
-
var CountLessThanCheckedValidatorArray = /** @class */ (function (_super) {
|
3441
|
-
__extends(CountLessThanCheckedValidatorArray, _super);
|
3442
|
-
function CountLessThanCheckedValidatorArray(count, value, target, event, autoValid) {
|
3561
|
+
var CountGreaterThanUnCheckedValidatorArray = /** @class */ (function (_super) {
|
3562
|
+
__extends(CountGreaterThanUnCheckedValidatorArray, _super);
|
3563
|
+
function CountGreaterThanUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
3443
3564
|
if (autoValid === void 0) { autoValid = true; }
|
3444
3565
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3445
3566
|
_this.count = count;
|
3446
3567
|
return _this;
|
3447
3568
|
}
|
3448
|
-
|
3569
|
+
CountGreaterThanUnCheckedValidatorArray.prototype.valid = function () {
|
3449
3570
|
var _a;
|
3450
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length
|
3571
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length > this.count;
|
3451
3572
|
};
|
3452
|
-
return
|
3573
|
+
return CountGreaterThanUnCheckedValidatorArray;
|
3453
3574
|
}(ValidatorArray));
|
3454
3575
|
|
3455
|
-
var
|
3456
|
-
__extends(
|
3457
|
-
function
|
3576
|
+
var CountLessThanEqualsCheckedValidatorArray = /** @class */ (function (_super) {
|
3577
|
+
__extends(CountLessThanEqualsCheckedValidatorArray, _super);
|
3578
|
+
function CountLessThanEqualsCheckedValidatorArray(count, value, target, event, autoValid) {
|
3458
3579
|
if (autoValid === void 0) { autoValid = true; }
|
3459
3580
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3460
3581
|
_this.count = count;
|
3461
3582
|
return _this;
|
3462
3583
|
}
|
3463
|
-
|
3584
|
+
CountLessThanEqualsCheckedValidatorArray.prototype.valid = function () {
|
3464
3585
|
var _a;
|
3465
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return
|
3586
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length <= this.count;
|
3466
3587
|
};
|
3467
|
-
return
|
3588
|
+
return CountLessThanEqualsCheckedValidatorArray;
|
3468
3589
|
}(ValidatorArray));
|
3469
3590
|
|
3470
3591
|
var CountLessThanUnCheckedValidatorArray = /** @class */ (function (_super) {
|
@@ -3482,19 +3603,19 @@ var CountLessThanUnCheckedValidatorArray = /** @class */ (function (_super) {
|
|
3482
3603
|
return CountLessThanUnCheckedValidatorArray;
|
3483
3604
|
}(ValidatorArray));
|
3484
3605
|
|
3485
|
-
var
|
3486
|
-
__extends(
|
3487
|
-
function
|
3606
|
+
var CountLessThanCheckedValidatorArray = /** @class */ (function (_super) {
|
3607
|
+
__extends(CountLessThanCheckedValidatorArray, _super);
|
3608
|
+
function CountLessThanCheckedValidatorArray(count, value, target, event, autoValid) {
|
3488
3609
|
if (autoValid === void 0) { autoValid = true; }
|
3489
3610
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3490
3611
|
_this.count = count;
|
3491
3612
|
return _this;
|
3492
3613
|
}
|
3493
|
-
|
3614
|
+
CountLessThanCheckedValidatorArray.prototype.valid = function () {
|
3494
3615
|
var _a;
|
3495
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return
|
3616
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length < this.count;
|
3496
3617
|
};
|
3497
|
-
return
|
3618
|
+
return CountLessThanCheckedValidatorArray;
|
3498
3619
|
}(ValidatorArray));
|
3499
3620
|
|
3500
3621
|
var ExcludeCheckedValidatorArray = /** @class */ (function (_super) {
|
@@ -3526,34 +3647,41 @@ var EmptyValidator = /** @class */ (function (_super) {
|
|
3526
3647
|
return _super.call(this, value, target, event, autoValid) || this;
|
3527
3648
|
}
|
3528
3649
|
EmptyValidator.prototype.valid = function () {
|
3529
|
-
var _a;
|
3650
|
+
var _a, _b;
|
3530
3651
|
var value = this.value;
|
3531
|
-
return value === undefined || value === null || ((_a = value === null ||
|
3652
|
+
return value === undefined || value === null || ((_b = (_a = value) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) <= 0;
|
3532
3653
|
};
|
3533
3654
|
return EmptyValidator;
|
3534
3655
|
}(Validator));
|
3535
3656
|
|
3536
|
-
var
|
3537
|
-
__extends(
|
3538
|
-
function
|
3539
|
-
if (allRequired === void 0) { allRequired = false; }
|
3657
|
+
var MultipleValidator = /** @class */ (function (_super) {
|
3658
|
+
__extends(MultipleValidator, _super);
|
3659
|
+
function MultipleValidator(validators, value, target, event, autoValid) {
|
3540
3660
|
if (autoValid === void 0) { autoValid = true; }
|
3541
3661
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3542
|
-
_this.
|
3543
|
-
|
3662
|
+
_this.validators = validators.map(function (it) {
|
3663
|
+
it.setAutoValid(false);
|
3664
|
+
it.setAutoValidAction(false);
|
3665
|
+
return it;
|
3666
|
+
});
|
3667
|
+
_this.validators.forEach(function (it) {
|
3668
|
+
it.set(_this.value, _this.getTarget(), _this.getEvent());
|
3669
|
+
});
|
3544
3670
|
return _this;
|
3545
3671
|
}
|
3546
|
-
|
3672
|
+
MultipleValidator.prototype.changeValue = function (value) {
|
3547
3673
|
var _this = this;
|
3548
|
-
|
3549
|
-
var valus = (_a = this.value) !== null && _a !== void 0 ? _a : [];
|
3550
|
-
var checkedValue = valus.filter(function (it) { return it.checked; }).map(function (it) { return it.value; });
|
3551
|
-
return checkedValue.length > 0 &&
|
3552
|
-
(!(checkedValue.filter(function (it) { return !_this.include.includes(it); }).length > 0)) &&
|
3553
|
-
(this.allRequired ? checkedValue.filter(function (it) { return _this.include.includes(it); }).length === this.include.length : true);
|
3674
|
+
this.validators.forEach(function (it) { return it.set(_this.value, _this.getTarget(), _this.getEvent()); });
|
3554
3675
|
};
|
3555
|
-
|
3556
|
-
|
3676
|
+
MultipleValidator.prototype.validAction = function () {
|
3677
|
+
return !(this.validators.filter(function (it) { return !it.validAction(); }).length > 0);
|
3678
|
+
};
|
3679
|
+
MultipleValidator.prototype.valid = function () {
|
3680
|
+
// console.log('mm', this.validators)
|
3681
|
+
return !(this.validators.filter(function (it) { return !it.valid(); }).length > 0);
|
3682
|
+
};
|
3683
|
+
return MultipleValidator;
|
3684
|
+
}(Validator));
|
3557
3685
|
|
3558
3686
|
var FormValidator = /** @class */ (function (_super) {
|
3559
3687
|
__extends(FormValidator, _super);
|
@@ -3573,34 +3701,42 @@ var FormValidator = /** @class */ (function (_super) {
|
|
3573
3701
|
return FormValidator;
|
3574
3702
|
}(Validator));
|
3575
3703
|
|
3576
|
-
var
|
3577
|
-
__extends(
|
3578
|
-
function
|
3704
|
+
var IncludeCheckedValidatorArray = /** @class */ (function (_super) {
|
3705
|
+
__extends(IncludeCheckedValidatorArray, _super);
|
3706
|
+
function IncludeCheckedValidatorArray(include, allRequired, value, target, event, autoValid) {
|
3707
|
+
if (allRequired === void 0) { allRequired = false; }
|
3579
3708
|
if (autoValid === void 0) { autoValid = true; }
|
3580
3709
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3581
|
-
_this.
|
3582
|
-
|
3583
|
-
it.setAutoValidAction(false);
|
3584
|
-
return it;
|
3585
|
-
});
|
3586
|
-
_this.validators.forEach(function (it) {
|
3587
|
-
it.set(_this.value, _this.getTarget(), _this.getEvent());
|
3588
|
-
});
|
3710
|
+
_this.include = include;
|
3711
|
+
_this.allRequired = allRequired;
|
3589
3712
|
return _this;
|
3590
3713
|
}
|
3591
|
-
|
3714
|
+
IncludeCheckedValidatorArray.prototype.valid = function () {
|
3592
3715
|
var _this = this;
|
3593
|
-
|
3594
|
-
|
3595
|
-
|
3596
|
-
return
|
3716
|
+
var _a;
|
3717
|
+
var valus = (_a = this.value) !== null && _a !== void 0 ? _a : [];
|
3718
|
+
var checkedValue = valus.filter(function (it) { return it.checked; }).map(function (it) { return it.value; });
|
3719
|
+
return checkedValue.length > 0 &&
|
3720
|
+
(!(checkedValue.filter(function (it) { return !_this.include.includes(it); }).length > 0)) &&
|
3721
|
+
(this.allRequired ? checkedValue.filter(function (it) { return _this.include.includes(it); }).length === this.include.length : true);
|
3597
3722
|
};
|
3598
|
-
|
3599
|
-
|
3600
|
-
|
3723
|
+
return IncludeCheckedValidatorArray;
|
3724
|
+
}(ValidatorArray));
|
3725
|
+
|
3726
|
+
var CountLessThanEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
|
3727
|
+
__extends(CountLessThanEqualsUnCheckedValidatorArray, _super);
|
3728
|
+
function CountLessThanEqualsUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
3729
|
+
if (autoValid === void 0) { autoValid = true; }
|
3730
|
+
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3731
|
+
_this.count = count;
|
3732
|
+
return _this;
|
3733
|
+
}
|
3734
|
+
CountLessThanEqualsUnCheckedValidatorArray.prototype.valid = function () {
|
3735
|
+
var _a;
|
3736
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length <= this.count;
|
3601
3737
|
};
|
3602
|
-
return
|
3603
|
-
}(
|
3738
|
+
return CountLessThanEqualsUnCheckedValidatorArray;
|
3739
|
+
}(ValidatorArray));
|
3604
3740
|
|
3605
3741
|
var NotEmptyValidator = /** @class */ (function (_super) {
|
3606
3742
|
__extends(NotEmptyValidator, _super);
|
@@ -3609,71 +3745,89 @@ var NotEmptyValidator = /** @class */ (function (_super) {
|
|
3609
3745
|
return _super.call(this, value, target, event, autoValid) || this;
|
3610
3746
|
}
|
3611
3747
|
NotEmptyValidator.prototype.valid = function () {
|
3612
|
-
var _a;
|
3748
|
+
var _a, _b;
|
3613
3749
|
var value = this.value;
|
3614
3750
|
// console.log('NotEmptyValidator', value, value !== undefined && value !== null && ((value as any)?.length ?? 0) > 0)
|
3615
|
-
return value !== undefined && value !== null && ((_a = value === null ||
|
3751
|
+
return value !== undefined && value !== null && ((_b = (_a = value) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0;
|
3616
3752
|
};
|
3617
3753
|
return NotEmptyValidator;
|
3618
3754
|
}(Validator));
|
3619
3755
|
|
3620
|
-
var
|
3621
|
-
__extends(
|
3622
|
-
function
|
3756
|
+
var CountUnCheckedValidatorArray = /** @class */ (function (_super) {
|
3757
|
+
__extends(CountUnCheckedValidatorArray, _super);
|
3758
|
+
function CountUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
3623
3759
|
if (autoValid === void 0) { autoValid = true; }
|
3624
|
-
|
3760
|
+
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3761
|
+
_this.count = count;
|
3762
|
+
return _this;
|
3625
3763
|
}
|
3626
|
-
|
3627
|
-
|
3764
|
+
CountUnCheckedValidatorArray.prototype.valid = function () {
|
3765
|
+
var _a;
|
3766
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length >= this.count;
|
3628
3767
|
};
|
3629
|
-
return
|
3630
|
-
}(
|
3768
|
+
return CountUnCheckedValidatorArray;
|
3769
|
+
}(ValidatorArray));
|
3631
3770
|
|
3632
|
-
var
|
3633
|
-
__extends(
|
3634
|
-
function
|
3771
|
+
var NotRegExpTestValidator = /** @class */ (function (_super) {
|
3772
|
+
__extends(NotRegExpTestValidator, _super);
|
3773
|
+
function NotRegExpTestValidator(regexp, value, target, event, autoValid) {
|
3635
3774
|
if (autoValid === void 0) { autoValid = true; }
|
3636
3775
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3637
3776
|
_this.regexp = DomRenderProxy.final(regexp);
|
3638
3777
|
return _this;
|
3639
3778
|
}
|
3640
|
-
|
3779
|
+
NotRegExpTestValidator.prototype.valid = function () {
|
3641
3780
|
var _a;
|
3642
3781
|
var value = this.value;
|
3643
3782
|
var regExp = (_a = this.regexp._DomRender_origin) !== null && _a !== void 0 ? _a : this.regexp;
|
3644
|
-
// console.log('regexp-->', value, this.regexp, regExp.test(value))
|
3645
3783
|
if (value) {
|
3646
|
-
return regExp.test(value);
|
3784
|
+
return !regExp.test(value);
|
3647
3785
|
}
|
3648
3786
|
else {
|
3649
|
-
return
|
3787
|
+
return true;
|
3650
3788
|
}
|
3651
3789
|
};
|
3652
|
-
return
|
3790
|
+
return NotRegExpTestValidator;
|
3653
3791
|
}(Validator));
|
3654
3792
|
|
3655
|
-
var
|
3656
|
-
__extends(
|
3657
|
-
function
|
3793
|
+
var RegExpTestValidator = /** @class */ (function (_super) {
|
3794
|
+
__extends(RegExpTestValidator, _super);
|
3795
|
+
function RegExpTestValidator(regexp, value, target, event, autoValid) {
|
3658
3796
|
if (autoValid === void 0) { autoValid = true; }
|
3659
3797
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3660
3798
|
_this.regexp = DomRenderProxy.final(regexp);
|
3661
3799
|
return _this;
|
3662
3800
|
}
|
3663
|
-
|
3801
|
+
RegExpTestValidator.prototype.valid = function () {
|
3664
3802
|
var _a;
|
3665
3803
|
var value = this.value;
|
3666
3804
|
var regExp = (_a = this.regexp._DomRender_origin) !== null && _a !== void 0 ? _a : this.regexp;
|
3805
|
+
// console.log('regexp-->', value, this.regexp, regExp.test(value))
|
3667
3806
|
if (value) {
|
3668
|
-
return
|
3807
|
+
return regExp.test(value);
|
3669
3808
|
}
|
3670
3809
|
else {
|
3671
|
-
return
|
3810
|
+
return false;
|
3672
3811
|
}
|
3673
3812
|
};
|
3674
|
-
return
|
3813
|
+
return RegExpTestValidator;
|
3675
3814
|
}(Validator));
|
3676
3815
|
|
3816
|
+
var ValidMultipleValidator = /** @class */ (function (_super) {
|
3817
|
+
__extends(ValidMultipleValidator, _super);
|
3818
|
+
function ValidMultipleValidator(validMultipleCallback, validators, value, target, event, autoValid) {
|
3819
|
+
if (autoValid === void 0) { autoValid = true; }
|
3820
|
+
var _this = _super.call(this, validators, value, target, event, autoValid) || this;
|
3821
|
+
_this.validMultipleCallback = validMultipleCallback;
|
3822
|
+
_this.validators = validators;
|
3823
|
+
return _this;
|
3824
|
+
}
|
3825
|
+
ValidMultipleValidator.prototype.valid = function () {
|
3826
|
+
return this.validMultipleCallback(this.validators, this.value, this.getTarget(), this.getEvent());
|
3827
|
+
};
|
3828
|
+
return ValidMultipleValidator;
|
3829
|
+
}(MultipleValidator));
|
3830
|
+
|
3677
3831
|
var RequiredValidator = /** @class */ (function (_super) {
|
3678
3832
|
__extends(RequiredValidator, _super);
|
3679
3833
|
function RequiredValidator(value, target, event, autoValid) {
|
@@ -3701,35 +3855,6 @@ var UnCheckedValidator = /** @class */ (function (_super) {
|
|
3701
3855
|
return UnCheckedValidator;
|
3702
3856
|
}(Validator));
|
3703
3857
|
|
3704
|
-
var ValidMultipleValidator = /** @class */ (function (_super) {
|
3705
|
-
__extends(ValidMultipleValidator, _super);
|
3706
|
-
function ValidMultipleValidator(validMultipleCallback, validators, value, target, event, autoValid) {
|
3707
|
-
if (autoValid === void 0) { autoValid = true; }
|
3708
|
-
var _this = _super.call(this, validators, value, target, event, autoValid) || this;
|
3709
|
-
_this.validMultipleCallback = validMultipleCallback;
|
3710
|
-
_this.validators = validators;
|
3711
|
-
return _this;
|
3712
|
-
}
|
3713
|
-
ValidMultipleValidator.prototype.valid = function () {
|
3714
|
-
return this.validMultipleCallback(this.validators, this.value, this.getTarget(), this.getEvent());
|
3715
|
-
};
|
3716
|
-
return ValidMultipleValidator;
|
3717
|
-
}(MultipleValidator));
|
3718
|
-
|
3719
|
-
var ValidValidator = /** @class */ (function (_super) {
|
3720
|
-
__extends(ValidValidator, _super);
|
3721
|
-
function ValidValidator(validCallBack, value, target, event, autoValid) {
|
3722
|
-
if (autoValid === void 0) { autoValid = true; }
|
3723
|
-
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3724
|
-
_this.validCallBack = validCallBack;
|
3725
|
-
return _this;
|
3726
|
-
}
|
3727
|
-
ValidValidator.prototype.valid = function (value, target, event) {
|
3728
|
-
return this.validCallBack(value, target, event);
|
3729
|
-
};
|
3730
|
-
return ValidValidator;
|
3731
|
-
}(Validator));
|
3732
|
-
|
3733
3858
|
var ValidValidatorArray = /** @class */ (function (_super) {
|
3734
3859
|
__extends(ValidValidatorArray, _super);
|
3735
3860
|
function ValidValidatorArray(validCallBack, value, target, event, autoValid) {
|
@@ -3744,6 +3869,18 @@ var ValidValidatorArray = /** @class */ (function (_super) {
|
|
3744
3869
|
return ValidValidatorArray;
|
3745
3870
|
}(ValidatorArray));
|
3746
3871
|
|
3872
|
+
var PassValidator = /** @class */ (function (_super) {
|
3873
|
+
__extends(PassValidator, _super);
|
3874
|
+
function PassValidator(value, target, event, autoValid) {
|
3875
|
+
if (autoValid === void 0) { autoValid = true; }
|
3876
|
+
return _super.call(this, value, target, event, autoValid) || this;
|
3877
|
+
}
|
3878
|
+
PassValidator.prototype.valid = function () {
|
3879
|
+
return true;
|
3880
|
+
};
|
3881
|
+
return PassValidator;
|
3882
|
+
}(Validator));
|
3883
|
+
|
3747
3884
|
var ValueEqualsValidator = /** @class */ (function (_super) {
|
3748
3885
|
__extends(ValueEqualsValidator, _super);
|
3749
3886
|
function ValueEqualsValidator(equalsValue, value, target, event, autoValid) {
|
@@ -3772,6 +3909,20 @@ var ValueNotEqualsValidator = /** @class */ (function (_super) {
|
|
3772
3909
|
return ValueNotEqualsValidator;
|
3773
3910
|
}(Validator));
|
3774
3911
|
|
3912
|
+
var ValidValidator = /** @class */ (function (_super) {
|
3913
|
+
__extends(ValidValidator, _super);
|
3914
|
+
function ValidValidator(validCallBack, value, target, event, autoValid) {
|
3915
|
+
if (autoValid === void 0) { autoValid = true; }
|
3916
|
+
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3917
|
+
_this.validCallBack = validCallBack;
|
3918
|
+
return _this;
|
3919
|
+
}
|
3920
|
+
ValidValidator.prototype.valid = function (value, target, event) {
|
3921
|
+
return this.validCallBack(value, target, event);
|
3922
|
+
};
|
3923
|
+
return ValidValidator;
|
3924
|
+
}(Validator));
|
3925
|
+
|
3775
3926
|
var NodeUtils = /** @class */ (function () {
|
3776
3927
|
function NodeUtils() {
|
3777
3928
|
}
|
@@ -3796,28 +3947,6 @@ var NodeUtils = /** @class */ (function () {
|
|
3796
3947
|
return NodeUtils;
|
3797
3948
|
}());
|
3798
3949
|
|
3799
|
-
var ClipBoardUtils = /** @class */ (function () {
|
3800
|
-
function ClipBoardUtils() {
|
3801
|
-
}
|
3802
|
-
ClipBoardUtils.readText = function (clipboard) {
|
3803
|
-
if (clipboard === void 0) { clipboard = navigator.clipboard; }
|
3804
|
-
return clipboard.readText();
|
3805
|
-
};
|
3806
|
-
ClipBoardUtils.read = function (clipboard) {
|
3807
|
-
if (clipboard === void 0) { clipboard = navigator.clipboard; }
|
3808
|
-
return clipboard.read();
|
3809
|
-
};
|
3810
|
-
ClipBoardUtils.writeText = function (data, clipboard) {
|
3811
|
-
if (clipboard === void 0) { clipboard = navigator.clipboard; }
|
3812
|
-
return clipboard.writeText(data);
|
3813
|
-
};
|
3814
|
-
ClipBoardUtils.write = function (data, clipboard) {
|
3815
|
-
if (clipboard === void 0) { clipboard = navigator.clipboard; }
|
3816
|
-
return clipboard.write(data);
|
3817
|
-
};
|
3818
|
-
return ClipBoardUtils;
|
3819
|
-
}());
|
3820
|
-
|
3821
3950
|
var StorageUtils = /** @class */ (function () {
|
3822
3951
|
function StorageUtils() {
|
3823
3952
|
}
|
@@ -3863,6 +3992,28 @@ var StorageUtils = /** @class */ (function () {
|
|
3863
3992
|
return StorageUtils;
|
3864
3993
|
}());
|
3865
3994
|
|
3995
|
+
var ClipBoardUtils = /** @class */ (function () {
|
3996
|
+
function ClipBoardUtils() {
|
3997
|
+
}
|
3998
|
+
ClipBoardUtils.readText = function (clipboard) {
|
3999
|
+
if (clipboard === void 0) { clipboard = navigator.clipboard; }
|
4000
|
+
return clipboard.readText();
|
4001
|
+
};
|
4002
|
+
ClipBoardUtils.read = function (clipboard) {
|
4003
|
+
if (clipboard === void 0) { clipboard = navigator.clipboard; }
|
4004
|
+
return clipboard.read();
|
4005
|
+
};
|
4006
|
+
ClipBoardUtils.writeText = function (data, clipboard) {
|
4007
|
+
if (clipboard === void 0) { clipboard = navigator.clipboard; }
|
4008
|
+
return clipboard.writeText(data);
|
4009
|
+
};
|
4010
|
+
ClipBoardUtils.write = function (data, clipboard) {
|
4011
|
+
if (clipboard === void 0) { clipboard = navigator.clipboard; }
|
4012
|
+
return clipboard.write(data);
|
4013
|
+
};
|
4014
|
+
return ClipBoardUtils;
|
4015
|
+
}());
|
4016
|
+
|
3866
4017
|
exports.AllCheckedValidatorArray = AllCheckedValidatorArray;
|
3867
4018
|
exports.AllUnCheckedValidatorArray = AllUnCheckedValidatorArray;
|
3868
4019
|
exports.Appender = Appender;
|