dom-render 1.0.86 → 1.0.87
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/RawSet.d.ts +10 -2
- package/RawSet.js +67 -58
- package/dist/bundle.js +265 -256
- package/package.json +1 -1
package/RawSet.d.ts
CHANGED
@@ -120,13 +120,22 @@ export declare class RawSet {
|
|
120
120
|
get isConnected(): boolean;
|
121
121
|
getUsingTriggerVariables(config?: Config): Set<string>;
|
122
122
|
render(obj: any, config: Config): RawSet[];
|
123
|
-
|
123
|
+
static generateStyleSheetsLocal(): void;
|
124
|
+
static generateCSS(id: string, cssRule: CSSRule): void;
|
125
|
+
static generateStyleTransform(styleBody: string | string[], id: string, styleTagWrap?: boolean): string;
|
124
126
|
applyEvent(obj: any, fragment?: DocumentFragment, config?: Config): void;
|
125
127
|
getAttribute(element: Element, attr: string): string | null;
|
126
128
|
getAttributeAndDelete(element: Element, attr: string): string | null;
|
127
129
|
getDrAppendAttributeAndDelete(element: Element, obj: any): string | null;
|
128
130
|
replaceBody(genNode: Node): void;
|
129
131
|
static checkPointCreates(element: Node, obj: any, config: Config): RawSet[];
|
132
|
+
static createStartEndPoint(id: string, type: RawSetType, config: Config): {
|
133
|
+
start: HTMLMetaElement;
|
134
|
+
end: HTMLMetaElement;
|
135
|
+
} | {
|
136
|
+
start: Comment;
|
137
|
+
end: Comment;
|
138
|
+
};
|
130
139
|
childAllRemove(): void;
|
131
140
|
static drItOtherEncoding(element: Element | DocumentFragment): string;
|
132
141
|
static drItOtherDecoding(element: Element | DocumentFragment, random: string): void;
|
@@ -150,6 +159,5 @@ export declare class RawSet {
|
|
150
159
|
static createComponentTargetElement(name: string, objFactory: (element: Element, obj: any, rawSet: RawSet, counstructorParam: any[]) => any, template?: string, styles?: string[]): TargetElement;
|
151
160
|
static isExporesion(data: string | null): boolean;
|
152
161
|
static exporesionGrouops(data: string | null): RegExpExecArray[];
|
153
|
-
static styleTransformLocal(styleBody: string | string[], id: string, styleTagWrap?: boolean): string;
|
154
162
|
static destroy(obj: any | undefined, parameter: any[], config: Config, destroyOptions?: (DestroyOptionType | string)[]): void;
|
155
163
|
}
|
package/RawSet.js
CHANGED
@@ -237,18 +237,9 @@ var RawSet = /** @class */ (function () {
|
|
237
237
|
}
|
238
238
|
});
|
239
239
|
// 중요 style isolation 나중에 :scope로 대체 가능할듯.
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
var id = (_a = styleElement.getAttribute('id')) === null || _a === void 0 ? void 0 : _a.split('-')[0];
|
244
|
-
if (id) {
|
245
|
-
// console.log('------->', id)
|
246
|
-
Array.from(it.cssRules).forEach(function (it) {
|
247
|
-
_this.generateCSS(id, it);
|
248
|
-
});
|
249
|
-
}
|
250
|
-
it.ownerNode.setAttribute('completed', 'true');
|
251
|
-
});
|
240
|
+
RawSet.generateStyleSheetsLocal();
|
241
|
+
// console.log('-22222-')
|
242
|
+
// alert(1);
|
252
243
|
for (var _p = 0, onThisComponentSetCallBacks_1 = onThisComponentSetCallBacks; _p < onThisComponentSetCallBacks_1.length; _p++) {
|
253
244
|
var it_1 = onThisComponentSetCallBacks_1[_p];
|
254
245
|
(_c = (_b = it_1.obj).onInitRender) === null || _c === void 0 ? void 0 : _c.call(_b);
|
@@ -281,7 +272,23 @@ var RawSet = /** @class */ (function () {
|
|
281
272
|
}
|
282
273
|
return raws;
|
283
274
|
};
|
284
|
-
RawSet.
|
275
|
+
RawSet.generateStyleSheetsLocal = function () {
|
276
|
+
Array.from(window.document.styleSheets).filter(function (it) { return it.ownerNode && it.ownerNode instanceof Element && it.ownerNode.hasAttribute('domstyle') && it.ownerNode.getAttribute('id') && !it.ownerNode.getAttribute('completed'); }).forEach(function (it) {
|
277
|
+
var _a;
|
278
|
+
var styleElement = it.ownerNode;
|
279
|
+
var split = (_a = styleElement.getAttribute('id')) === null || _a === void 0 ? void 0 : _a.split('-');
|
280
|
+
split === null || split === void 0 ? void 0 : split.pop();
|
281
|
+
var id = split === null || split === void 0 ? void 0 : split.join('-');
|
282
|
+
if (id) {
|
283
|
+
// console.log('------->', id)
|
284
|
+
Array.from(it.cssRules).forEach(function (it) {
|
285
|
+
RawSet.generateCSS(id, it);
|
286
|
+
});
|
287
|
+
}
|
288
|
+
it.ownerNode.setAttribute('completed', 'true');
|
289
|
+
});
|
290
|
+
};
|
291
|
+
RawSet.generateCSS = function (id, cssRule) {
|
285
292
|
var _this = this;
|
286
293
|
var start = "#".concat(id, "-start");
|
287
294
|
var end = "#".concat(id, "-end");
|
@@ -314,6 +321,17 @@ var RawSet = /** @class */ (function () {
|
|
314
321
|
});
|
315
322
|
}
|
316
323
|
};
|
324
|
+
// 중요 스타일 적용 부분
|
325
|
+
RawSet.generateStyleTransform = function (styleBody, id, styleTagWrap) {
|
326
|
+
if (styleTagWrap === void 0) { styleTagWrap = true; }
|
327
|
+
if (Array.isArray(styleBody)) {
|
328
|
+
styleBody = styleBody.join('\n');
|
329
|
+
}
|
330
|
+
if (styleTagWrap) {
|
331
|
+
styleBody = "<style id='".concat(id, "-style' domstyle>").concat(styleBody, "</style>");
|
332
|
+
}
|
333
|
+
return styleBody;
|
334
|
+
};
|
317
335
|
RawSet.prototype.applyEvent = function (obj, fragment, config) {
|
318
336
|
if (fragment === void 0) { fragment = this.fragment; }
|
319
337
|
EventManager_1.eventManager.applyEvent(obj, EventManager_1.eventManager.findAttrElements(fragment, config), config);
|
@@ -421,30 +439,25 @@ var RawSet = /** @class */ (function () {
|
|
421
439
|
// start.setAttribute('id', `${it.uuid}-start`);
|
422
440
|
// const end = config.window.document.createElement('meta');
|
423
441
|
// end.setAttribute('id', `${it.uuid}-end`);
|
424
|
-
var start = void 0;
|
425
|
-
var end = void 0;
|
426
442
|
var type = void 0;
|
427
443
|
if (currentNode.parentNode && currentNode.parentNode.nodeName.toUpperCase() === 'STYLE') {
|
428
444
|
type = RawSetType.STYLE_TEXT;
|
429
|
-
start = config.window.document.createTextNode("/*start text ".concat(it_4.uuid, "*/"));
|
430
|
-
end = config.window.document.createTextNode("/*end text ".concat(it_4.uuid, "*/"));
|
431
445
|
}
|
432
446
|
else {
|
433
447
|
type = RawSetType.TEXT;
|
434
|
-
start = config.window.document.createComment("start text ".concat(it_4.uuid));
|
435
|
-
end = config.window.document.createComment("end text ".concat(it_4.uuid));
|
436
448
|
}
|
449
|
+
var startEndPoint = RawSet.createStartEndPoint(it_4.uuid, type, config);
|
437
450
|
// layout setting
|
438
451
|
template.content.append(document.createTextNode(preparedText)); // 앞 부분 넣고
|
439
|
-
template.content.append(start); // add start checkpoint
|
440
|
-
template.content.append(end); // add end checkpoint
|
452
|
+
template.content.append(startEndPoint.start); // add start checkpoint
|
453
|
+
template.content.append(startEndPoint.end); // add end checkpoint
|
441
454
|
// content 안쪽 RawSet render 할때 start 와 end 사이에 fragment 연산해서 들어간다.
|
442
455
|
var fragment = config.window.document.createDocumentFragment();
|
443
456
|
fragment.append(config.window.document.createTextNode(it_4.content));
|
444
457
|
pars.push(new RawSet(it_4.uuid, type, {
|
445
|
-
start: start,
|
458
|
+
start: startEndPoint.start,
|
446
459
|
node: currentNode,
|
447
|
-
end: end,
|
460
|
+
end: startEndPoint.end,
|
448
461
|
parent: currentNode.parentNode,
|
449
462
|
thisVariableName: thisVariableName
|
450
463
|
}, fragment));
|
@@ -457,21 +470,18 @@ var RawSet = /** @class */ (function () {
|
|
457
470
|
var uuid = RandomUtils_1.RandomUtils.getRandomString(40);
|
458
471
|
var element_3 = currentNode;
|
459
472
|
var fragment = config.window.document.createDocumentFragment();
|
460
|
-
var start = config.window.document.createElement('meta');
|
461
|
-
var end = config.window.document.createElement('meta');
|
462
|
-
start.setAttribute('id', "".concat(uuid, "-start"));
|
463
|
-
end.setAttribute('id', "".concat(uuid, "-end"));
|
464
473
|
var type = RawSetType.TARGET_ELEMENT;
|
474
|
+
var startEndPoint = RawSet.createStartEndPoint(uuid, type, config);
|
465
475
|
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());
|
466
476
|
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);
|
467
477
|
var isAttr = element_3.getAttributeNames().filter(function (it) { return targetAttrNames_2.includes(it.toLowerCase()); }).length > 0;
|
468
|
-
(_g = currentNode === null || currentNode === void 0 ? void 0 : currentNode.parentNode) === null || _g === void 0 ? void 0 : _g.insertBefore(start, currentNode);
|
469
|
-
(_h = currentNode === null || currentNode === void 0 ? void 0 : currentNode.parentNode) === null || _h === void 0 ? void 0 : _h.insertBefore(end, currentNode.nextSibling);
|
478
|
+
(_g = currentNode === null || currentNode === void 0 ? void 0 : currentNode.parentNode) === null || _g === void 0 ? void 0 : _g.insertBefore(startEndPoint.start, currentNode);
|
479
|
+
(_h = currentNode === null || currentNode === void 0 ? void 0 : currentNode.parentNode) === null || _h === void 0 ? void 0 : _h.insertBefore(startEndPoint.end, currentNode.nextSibling);
|
470
480
|
fragment.append(currentNode);
|
471
481
|
pars.push(new RawSet(uuid, isElement ? type : (isAttr ? RawSetType.TARGET_ATTR : RawSetType.UNKOWN), {
|
472
|
-
start: start,
|
482
|
+
start: startEndPoint.start,
|
473
483
|
node: currentNode,
|
474
|
-
end: end,
|
484
|
+
end: startEndPoint.end,
|
475
485
|
parent: currentNode.parentNode,
|
476
486
|
thisVariableName: thisVariableName
|
477
487
|
}, fragment));
|
@@ -484,6 +494,30 @@ var RawSet = /** @class */ (function () {
|
|
484
494
|
// console.log('check-->', pars)
|
485
495
|
return pars;
|
486
496
|
};
|
497
|
+
RawSet.createStartEndPoint = function (id, type, config) {
|
498
|
+
if (type === RawSetType.TARGET_ELEMENT) {
|
499
|
+
var start = config.window.document.createElement('meta');
|
500
|
+
var end = config.window.document.createElement('meta');
|
501
|
+
start.setAttribute('id', "".concat(id, "-start"));
|
502
|
+
end.setAttribute('id', "".concat(id, "-end"));
|
503
|
+
return {
|
504
|
+
start: start,
|
505
|
+
end: end,
|
506
|
+
};
|
507
|
+
}
|
508
|
+
else if (type === RawSetType.STYLE_TEXT) {
|
509
|
+
return {
|
510
|
+
start: config.window.document.createTextNode("/*start text ".concat(id, "*/")),
|
511
|
+
end: config.window.document.createTextNode("/*end text ".concat(id, "*/"))
|
512
|
+
};
|
513
|
+
}
|
514
|
+
else { // text
|
515
|
+
return {
|
516
|
+
start: config.window.document.createComment("start text ".concat(id)),
|
517
|
+
end: config.window.document.createComment("end text ".concat(id))
|
518
|
+
};
|
519
|
+
}
|
520
|
+
};
|
487
521
|
RawSet.prototype.childAllRemove = function () {
|
488
522
|
var next = this.point.start.nextSibling;
|
489
523
|
while (next) {
|
@@ -606,7 +640,7 @@ var RawSet = /** @class */ (function () {
|
|
606
640
|
// console.log('--------',n, n.innerHTML)
|
607
641
|
if (set) {
|
608
642
|
// const id = RandomUtils.getRandomString(20);
|
609
|
-
var style = RawSet.
|
643
|
+
var style = RawSet.generateStyleTransform((_a = set.styles) !== null && _a !== void 0 ? _a : [], rawSet.uuid, true);
|
610
644
|
n.innerHTML = style + ((_b = set.template) !== null && _b !== void 0 ? _b : '');
|
611
645
|
// const metaStart = RawSet.metaStart(id);
|
612
646
|
// const metaEnd = RawSet.metaEnd(id);
|
@@ -767,7 +801,7 @@ var RawSet = /** @class */ (function () {
|
|
767
801
|
__render: render
|
768
802
|
}));
|
769
803
|
}
|
770
|
-
var style = RawSet.
|
804
|
+
var style = RawSet.generateStyleTransform(styles, componentKey, true);
|
771
805
|
element.innerHTML = style + (applayTemplate !== null && applayTemplate !== void 0 ? applayTemplate : '');
|
772
806
|
// const metaStart = RawSet.metaStart(componentKey);
|
773
807
|
// const metaEnd = RawSet.metaEnd(componentKey);
|
@@ -797,31 +831,6 @@ var RawSet = /** @class */ (function () {
|
|
797
831
|
var reg = /(?:[$#]\{(?:(([$#]\{)??[^$#]?[^{]*?)\}[$#]))/g;
|
798
832
|
return StringUtils_1.StringUtils.regexExec(reg, data !== null && data !== void 0 ? data : '');
|
799
833
|
};
|
800
|
-
// 중요 스타일 적용 부분
|
801
|
-
RawSet.styleTransformLocal = function (styleBody, id, styleTagWrap) {
|
802
|
-
if (styleTagWrap === void 0) { styleTagWrap = true; }
|
803
|
-
// <style id="first">
|
804
|
-
// #first ~ *:not(#first ~ style[domstyle] ~ *) {
|
805
|
-
// font-size: 30px;
|
806
|
-
// color: blue;
|
807
|
-
// }
|
808
|
-
// </style>
|
809
|
-
if (Array.isArray(styleBody)) {
|
810
|
-
styleBody = styleBody.join('\n');
|
811
|
-
}
|
812
|
-
// if (locale) {
|
813
|
-
// styleBody = styleBody.replace(/([^}]+){/gm, function (a, b) {
|
814
|
-
// if (typeof b === 'string') {
|
815
|
-
// b = b.trim();
|
816
|
-
// }
|
817
|
-
// return `#${id} ~ ${b}:not(#${id} ~ style[domstyle] ~ *), #${id} ~ * ${b} {`;
|
818
|
-
// });
|
819
|
-
// }
|
820
|
-
if (styleTagWrap) {
|
821
|
-
styleBody = "<style id='".concat(id, "-style' domstyle>").concat(styleBody, "</style>");
|
822
|
-
}
|
823
|
-
return styleBody;
|
824
|
-
};
|
825
834
|
// public static metaStart(id: string) {
|
826
835
|
// return `<meta id='${id}-start' />`;
|
827
836
|
// }
|
package/dist/bundle.js
CHANGED
@@ -1995,18 +1995,9 @@ var RawSet = /** @class */ (function () {
|
|
1995
1995
|
}
|
1996
1996
|
});
|
1997
1997
|
// 중요 style isolation 나중에 :scope로 대체 가능할듯.
|
1998
|
-
|
1999
|
-
|
2000
|
-
|
2001
|
-
var id = (_a = styleElement.getAttribute('id')) === null || _a === void 0 ? void 0 : _a.split('-')[0];
|
2002
|
-
if (id) {
|
2003
|
-
// console.log('------->', id)
|
2004
|
-
Array.from(it.cssRules).forEach(function (it) {
|
2005
|
-
_this.generateCSS(id, it);
|
2006
|
-
});
|
2007
|
-
}
|
2008
|
-
it.ownerNode.setAttribute('completed', 'true');
|
2009
|
-
});
|
1998
|
+
RawSet.generateStyleSheetsLocal();
|
1999
|
+
// console.log('-22222-')
|
2000
|
+
// alert(1);
|
2010
2001
|
for (var _p = 0, onThisComponentSetCallBacks_1 = onThisComponentSetCallBacks; _p < onThisComponentSetCallBacks_1.length; _p++) {
|
2011
2002
|
var it_1 = onThisComponentSetCallBacks_1[_p];
|
2012
2003
|
(_c = (_b = it_1.obj).onInitRender) === null || _c === void 0 ? void 0 : _c.call(_b);
|
@@ -2039,7 +2030,23 @@ var RawSet = /** @class */ (function () {
|
|
2039
2030
|
}
|
2040
2031
|
return raws;
|
2041
2032
|
};
|
2042
|
-
RawSet.
|
2033
|
+
RawSet.generateStyleSheetsLocal = function () {
|
2034
|
+
Array.from(window.document.styleSheets).filter(function (it) { return it.ownerNode && it.ownerNode instanceof Element && it.ownerNode.hasAttribute('domstyle') && it.ownerNode.getAttribute('id') && !it.ownerNode.getAttribute('completed'); }).forEach(function (it) {
|
2035
|
+
var _a;
|
2036
|
+
var styleElement = it.ownerNode;
|
2037
|
+
var split = (_a = styleElement.getAttribute('id')) === null || _a === void 0 ? void 0 : _a.split('-');
|
2038
|
+
split === null || split === void 0 ? void 0 : split.pop();
|
2039
|
+
var id = split === null || split === void 0 ? void 0 : split.join('-');
|
2040
|
+
if (id) {
|
2041
|
+
// console.log('------->', id)
|
2042
|
+
Array.from(it.cssRules).forEach(function (it) {
|
2043
|
+
RawSet.generateCSS(id, it);
|
2044
|
+
});
|
2045
|
+
}
|
2046
|
+
it.ownerNode.setAttribute('completed', 'true');
|
2047
|
+
});
|
2048
|
+
};
|
2049
|
+
RawSet.generateCSS = function (id, cssRule) {
|
2043
2050
|
var _this = this;
|
2044
2051
|
var start = "#".concat(id, "-start");
|
2045
2052
|
var end = "#".concat(id, "-end");
|
@@ -2072,6 +2079,17 @@ var RawSet = /** @class */ (function () {
|
|
2072
2079
|
});
|
2073
2080
|
}
|
2074
2081
|
};
|
2082
|
+
// 중요 스타일 적용 부분
|
2083
|
+
RawSet.generateStyleTransform = function (styleBody, id, styleTagWrap) {
|
2084
|
+
if (styleTagWrap === void 0) { styleTagWrap = true; }
|
2085
|
+
if (Array.isArray(styleBody)) {
|
2086
|
+
styleBody = styleBody.join('\n');
|
2087
|
+
}
|
2088
|
+
if (styleTagWrap) {
|
2089
|
+
styleBody = "<style id='".concat(id, "-style' domstyle>").concat(styleBody, "</style>");
|
2090
|
+
}
|
2091
|
+
return styleBody;
|
2092
|
+
};
|
2075
2093
|
RawSet.prototype.applyEvent = function (obj, fragment, config) {
|
2076
2094
|
if (fragment === void 0) { fragment = this.fragment; }
|
2077
2095
|
eventManager.applyEvent(obj, eventManager.findAttrElements(fragment, config), config);
|
@@ -2179,30 +2197,25 @@ var RawSet = /** @class */ (function () {
|
|
2179
2197
|
// start.setAttribute('id', `${it.uuid}-start`);
|
2180
2198
|
// const end = config.window.document.createElement('meta');
|
2181
2199
|
// end.setAttribute('id', `${it.uuid}-end`);
|
2182
|
-
var start = void 0;
|
2183
|
-
var end = void 0;
|
2184
2200
|
var type = void 0;
|
2185
2201
|
if (currentNode.parentNode && currentNode.parentNode.nodeName.toUpperCase() === 'STYLE') {
|
2186
2202
|
type = exports.RawSetType.STYLE_TEXT;
|
2187
|
-
start = config.window.document.createTextNode("/*start text ".concat(it_4.uuid, "*/"));
|
2188
|
-
end = config.window.document.createTextNode("/*end text ".concat(it_4.uuid, "*/"));
|
2189
2203
|
}
|
2190
2204
|
else {
|
2191
2205
|
type = exports.RawSetType.TEXT;
|
2192
|
-
start = config.window.document.createComment("start text ".concat(it_4.uuid));
|
2193
|
-
end = config.window.document.createComment("end text ".concat(it_4.uuid));
|
2194
2206
|
}
|
2207
|
+
var startEndPoint = RawSet.createStartEndPoint(it_4.uuid, type, config);
|
2195
2208
|
// layout setting
|
2196
2209
|
template.content.append(document.createTextNode(preparedText)); // 앞 부분 넣고
|
2197
|
-
template.content.append(start); // add start checkpoint
|
2198
|
-
template.content.append(end); // add end checkpoint
|
2210
|
+
template.content.append(startEndPoint.start); // add start checkpoint
|
2211
|
+
template.content.append(startEndPoint.end); // add end checkpoint
|
2199
2212
|
// content 안쪽 RawSet render 할때 start 와 end 사이에 fragment 연산해서 들어간다.
|
2200
2213
|
var fragment = config.window.document.createDocumentFragment();
|
2201
2214
|
fragment.append(config.window.document.createTextNode(it_4.content));
|
2202
2215
|
pars.push(new RawSet(it_4.uuid, type, {
|
2203
|
-
start: start,
|
2216
|
+
start: startEndPoint.start,
|
2204
2217
|
node: currentNode,
|
2205
|
-
end: end,
|
2218
|
+
end: startEndPoint.end,
|
2206
2219
|
parent: currentNode.parentNode,
|
2207
2220
|
thisVariableName: thisVariableName
|
2208
2221
|
}, fragment));
|
@@ -2215,21 +2228,18 @@ var RawSet = /** @class */ (function () {
|
|
2215
2228
|
var uuid = RandomUtils.getRandomString(40);
|
2216
2229
|
var element_3 = currentNode;
|
2217
2230
|
var fragment = config.window.document.createDocumentFragment();
|
2218
|
-
var start = config.window.document.createElement('meta');
|
2219
|
-
var end = config.window.document.createElement('meta');
|
2220
|
-
start.setAttribute('id', "".concat(uuid, "-start"));
|
2221
|
-
end.setAttribute('id', "".concat(uuid, "-end"));
|
2222
2231
|
var type = exports.RawSetType.TARGET_ELEMENT;
|
2232
|
+
var startEndPoint = RawSet.createStartEndPoint(uuid, type, config);
|
2223
2233
|
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());
|
2224
2234
|
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);
|
2225
2235
|
var isAttr = element_3.getAttributeNames().filter(function (it) { return targetAttrNames_2.includes(it.toLowerCase()); }).length > 0;
|
2226
|
-
(_g = currentNode === null || currentNode === void 0 ? void 0 : currentNode.parentNode) === null || _g === void 0 ? void 0 : _g.insertBefore(start, currentNode);
|
2227
|
-
(_h = currentNode === null || currentNode === void 0 ? void 0 : currentNode.parentNode) === null || _h === void 0 ? void 0 : _h.insertBefore(end, currentNode.nextSibling);
|
2236
|
+
(_g = currentNode === null || currentNode === void 0 ? void 0 : currentNode.parentNode) === null || _g === void 0 ? void 0 : _g.insertBefore(startEndPoint.start, currentNode);
|
2237
|
+
(_h = currentNode === null || currentNode === void 0 ? void 0 : currentNode.parentNode) === null || _h === void 0 ? void 0 : _h.insertBefore(startEndPoint.end, currentNode.nextSibling);
|
2228
2238
|
fragment.append(currentNode);
|
2229
2239
|
pars.push(new RawSet(uuid, isElement ? type : (isAttr ? exports.RawSetType.TARGET_ATTR : exports.RawSetType.UNKOWN), {
|
2230
|
-
start: start,
|
2240
|
+
start: startEndPoint.start,
|
2231
2241
|
node: currentNode,
|
2232
|
-
end: end,
|
2242
|
+
end: startEndPoint.end,
|
2233
2243
|
parent: currentNode.parentNode,
|
2234
2244
|
thisVariableName: thisVariableName
|
2235
2245
|
}, fragment));
|
@@ -2242,6 +2252,30 @@ var RawSet = /** @class */ (function () {
|
|
2242
2252
|
// console.log('check-->', pars)
|
2243
2253
|
return pars;
|
2244
2254
|
};
|
2255
|
+
RawSet.createStartEndPoint = function (id, type, config) {
|
2256
|
+
if (type === exports.RawSetType.TARGET_ELEMENT) {
|
2257
|
+
var start = config.window.document.createElement('meta');
|
2258
|
+
var end = config.window.document.createElement('meta');
|
2259
|
+
start.setAttribute('id', "".concat(id, "-start"));
|
2260
|
+
end.setAttribute('id', "".concat(id, "-end"));
|
2261
|
+
return {
|
2262
|
+
start: start,
|
2263
|
+
end: end,
|
2264
|
+
};
|
2265
|
+
}
|
2266
|
+
else if (type === exports.RawSetType.STYLE_TEXT) {
|
2267
|
+
return {
|
2268
|
+
start: config.window.document.createTextNode("/*start text ".concat(id, "*/")),
|
2269
|
+
end: config.window.document.createTextNode("/*end text ".concat(id, "*/"))
|
2270
|
+
};
|
2271
|
+
}
|
2272
|
+
else { // text
|
2273
|
+
return {
|
2274
|
+
start: config.window.document.createComment("start text ".concat(id)),
|
2275
|
+
end: config.window.document.createComment("end text ".concat(id))
|
2276
|
+
};
|
2277
|
+
}
|
2278
|
+
};
|
2245
2279
|
RawSet.prototype.childAllRemove = function () {
|
2246
2280
|
var next = this.point.start.nextSibling;
|
2247
2281
|
while (next) {
|
@@ -2364,7 +2398,7 @@ var RawSet = /** @class */ (function () {
|
|
2364
2398
|
// console.log('--------',n, n.innerHTML)
|
2365
2399
|
if (set) {
|
2366
2400
|
// const id = RandomUtils.getRandomString(20);
|
2367
|
-
var style = RawSet.
|
2401
|
+
var style = RawSet.generateStyleTransform((_a = set.styles) !== null && _a !== void 0 ? _a : [], rawSet.uuid, true);
|
2368
2402
|
n.innerHTML = style + ((_b = set.template) !== null && _b !== void 0 ? _b : '');
|
2369
2403
|
// const metaStart = RawSet.metaStart(id);
|
2370
2404
|
// const metaEnd = RawSet.metaEnd(id);
|
@@ -2525,7 +2559,7 @@ var RawSet = /** @class */ (function () {
|
|
2525
2559
|
__render: render
|
2526
2560
|
}));
|
2527
2561
|
}
|
2528
|
-
var style = RawSet.
|
2562
|
+
var style = RawSet.generateStyleTransform(styles, componentKey, true);
|
2529
2563
|
element.innerHTML = style + (applayTemplate !== null && applayTemplate !== void 0 ? applayTemplate : '');
|
2530
2564
|
// const metaStart = RawSet.metaStart(componentKey);
|
2531
2565
|
// const metaEnd = RawSet.metaEnd(componentKey);
|
@@ -2555,31 +2589,6 @@ var RawSet = /** @class */ (function () {
|
|
2555
2589
|
var reg = /(?:[$#]\{(?:(([$#]\{)??[^$#]?[^{]*?)\}[$#]))/g;
|
2556
2590
|
return StringUtils.regexExec(reg, data !== null && data !== void 0 ? data : '');
|
2557
2591
|
};
|
2558
|
-
// 중요 스타일 적용 부분
|
2559
|
-
RawSet.styleTransformLocal = function (styleBody, id, styleTagWrap) {
|
2560
|
-
if (styleTagWrap === void 0) { styleTagWrap = true; }
|
2561
|
-
// <style id="first">
|
2562
|
-
// #first ~ *:not(#first ~ style[domstyle] ~ *) {
|
2563
|
-
// font-size: 30px;
|
2564
|
-
// color: blue;
|
2565
|
-
// }
|
2566
|
-
// </style>
|
2567
|
-
if (Array.isArray(styleBody)) {
|
2568
|
-
styleBody = styleBody.join('\n');
|
2569
|
-
}
|
2570
|
-
// if (locale) {
|
2571
|
-
// styleBody = styleBody.replace(/([^}]+){/gm, function (a, b) {
|
2572
|
-
// if (typeof b === 'string') {
|
2573
|
-
// b = b.trim();
|
2574
|
-
// }
|
2575
|
-
// return `#${id} ~ ${b}:not(#${id} ~ style[domstyle] ~ *), #${id} ~ * ${b} {`;
|
2576
|
-
// });
|
2577
|
-
// }
|
2578
|
-
if (styleTagWrap) {
|
2579
|
-
styleBody = "<style id='".concat(id, "-style' domstyle>").concat(styleBody, "</style>");
|
2580
|
-
}
|
2581
|
-
return styleBody;
|
2582
|
-
};
|
2583
2592
|
// public static metaStart(id: string) {
|
2584
2593
|
// return `<meta id='${id}-start' />`;
|
2585
2594
|
// }
|
@@ -3564,19 +3573,34 @@ var AllUnCheckedValidatorArray = /** @class */ (function (_super) {
|
|
3564
3573
|
return AllUnCheckedValidatorArray;
|
3565
3574
|
}(ValidatorArray));
|
3566
3575
|
|
3567
|
-
var
|
3568
|
-
__extends(
|
3569
|
-
function
|
3576
|
+
var CountGreaterThanCheckedValidatorArray = /** @class */ (function (_super) {
|
3577
|
+
__extends(CountGreaterThanCheckedValidatorArray, _super);
|
3578
|
+
function CountGreaterThanCheckedValidatorArray(count, value, target, event, autoValid) {
|
3570
3579
|
if (autoValid === void 0) { autoValid = true; }
|
3571
|
-
|
3580
|
+
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3581
|
+
_this.count = count;
|
3582
|
+
return _this;
|
3572
3583
|
}
|
3573
|
-
|
3584
|
+
CountGreaterThanCheckedValidatorArray.prototype.valid = function () {
|
3574
3585
|
var _a;
|
3575
|
-
return
|
3586
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length > this.count;
|
3576
3587
|
};
|
3577
|
-
return
|
3588
|
+
return CountGreaterThanCheckedValidatorArray;
|
3578
3589
|
}(ValidatorArray));
|
3579
3590
|
|
3591
|
+
var CheckedValidator = /** @class */ (function (_super) {
|
3592
|
+
__extends(CheckedValidator, _super);
|
3593
|
+
function CheckedValidator(value, target, event, autoValid) {
|
3594
|
+
if (autoValid === void 0) { autoValid = true; }
|
3595
|
+
return _super.call(this, value, target, event, autoValid) || this;
|
3596
|
+
}
|
3597
|
+
CheckedValidator.prototype.valid = function () {
|
3598
|
+
var _a, _b;
|
3599
|
+
return (_b = (_a = this.getTarget()) === null || _a === void 0 ? void 0 : _a.checked) !== null && _b !== void 0 ? _b : false;
|
3600
|
+
};
|
3601
|
+
return CheckedValidator;
|
3602
|
+
}(Validator));
|
3603
|
+
|
3580
3604
|
var CountEqualsCheckedValidatorArray = /** @class */ (function (_super) {
|
3581
3605
|
__extends(CountEqualsCheckedValidatorArray, _super);
|
3582
3606
|
function CountEqualsCheckedValidatorArray(count, value, target, event, autoValid) {
|
@@ -3607,62 +3631,32 @@ var CountEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
|
|
3607
3631
|
return CountEqualsUnCheckedValidatorArray;
|
3608
3632
|
}(ValidatorArray));
|
3609
3633
|
|
3610
|
-
var
|
3611
|
-
__extends(
|
3612
|
-
function
|
3634
|
+
var AllCheckedValidatorArray = /** @class */ (function (_super) {
|
3635
|
+
__extends(AllCheckedValidatorArray, _super);
|
3636
|
+
function AllCheckedValidatorArray(value, target, event, autoValid) {
|
3613
3637
|
if (autoValid === void 0) { autoValid = true; }
|
3614
3638
|
return _super.call(this, value, target, event, autoValid) || this;
|
3615
3639
|
}
|
3616
|
-
|
3617
|
-
var _a, _b;
|
3618
|
-
return (_b = (_a = this.getTarget()) === null || _a === void 0 ? void 0 : _a.checked) !== null && _b !== void 0 ? _b : false;
|
3619
|
-
};
|
3620
|
-
return CheckedValidator;
|
3621
|
-
}(Validator));
|
3622
|
-
|
3623
|
-
var CountGreaterThanCheckedValidatorArray = /** @class */ (function (_super) {
|
3624
|
-
__extends(CountGreaterThanCheckedValidatorArray, _super);
|
3625
|
-
function CountGreaterThanCheckedValidatorArray(count, value, target, event, autoValid) {
|
3626
|
-
if (autoValid === void 0) { autoValid = true; }
|
3627
|
-
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3628
|
-
_this.count = count;
|
3629
|
-
return _this;
|
3630
|
-
}
|
3631
|
-
CountGreaterThanCheckedValidatorArray.prototype.valid = function () {
|
3632
|
-
var _a;
|
3633
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length > this.count;
|
3634
|
-
};
|
3635
|
-
return CountGreaterThanCheckedValidatorArray;
|
3636
|
-
}(ValidatorArray));
|
3637
|
-
|
3638
|
-
var CountGreaterThanEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
|
3639
|
-
__extends(CountGreaterThanEqualsUnCheckedValidatorArray, _super);
|
3640
|
-
function CountGreaterThanEqualsUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
3641
|
-
if (autoValid === void 0) { autoValid = true; }
|
3642
|
-
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3643
|
-
_this.count = count;
|
3644
|
-
return _this;
|
3645
|
-
}
|
3646
|
-
CountGreaterThanEqualsUnCheckedValidatorArray.prototype.valid = function () {
|
3640
|
+
AllCheckedValidatorArray.prototype.valid = function () {
|
3647
3641
|
var _a;
|
3648
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length
|
3642
|
+
return !(((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length > 0);
|
3649
3643
|
};
|
3650
|
-
return
|
3644
|
+
return AllCheckedValidatorArray;
|
3651
3645
|
}(ValidatorArray));
|
3652
3646
|
|
3653
|
-
var
|
3654
|
-
__extends(
|
3655
|
-
function
|
3647
|
+
var CountLessThanCheckedValidatorArray = /** @class */ (function (_super) {
|
3648
|
+
__extends(CountLessThanCheckedValidatorArray, _super);
|
3649
|
+
function CountLessThanCheckedValidatorArray(count, value, target, event, autoValid) {
|
3656
3650
|
if (autoValid === void 0) { autoValid = true; }
|
3657
3651
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3658
3652
|
_this.count = count;
|
3659
3653
|
return _this;
|
3660
3654
|
}
|
3661
|
-
|
3655
|
+
CountLessThanCheckedValidatorArray.prototype.valid = function () {
|
3662
3656
|
var _a;
|
3663
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length
|
3657
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length < this.count;
|
3664
3658
|
};
|
3665
|
-
return
|
3659
|
+
return CountLessThanCheckedValidatorArray;
|
3666
3660
|
}(ValidatorArray));
|
3667
3661
|
|
3668
3662
|
var CountGreaterThanUnCheckedValidatorArray = /** @class */ (function (_super) {
|
@@ -3680,34 +3674,19 @@ var CountGreaterThanUnCheckedValidatorArray = /** @class */ (function (_super) {
|
|
3680
3674
|
return CountGreaterThanUnCheckedValidatorArray;
|
3681
3675
|
}(ValidatorArray));
|
3682
3676
|
|
3683
|
-
var
|
3684
|
-
__extends(
|
3685
|
-
function
|
3686
|
-
if (autoValid === void 0) { autoValid = true; }
|
3687
|
-
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3688
|
-
_this.count = count;
|
3689
|
-
return _this;
|
3690
|
-
}
|
3691
|
-
CountLessThanCheckedValidatorArray.prototype.valid = function () {
|
3692
|
-
var _a;
|
3693
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length < this.count;
|
3694
|
-
};
|
3695
|
-
return CountLessThanCheckedValidatorArray;
|
3696
|
-
}(ValidatorArray));
|
3697
|
-
|
3698
|
-
var CountLessThanEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
|
3699
|
-
__extends(CountLessThanEqualsUnCheckedValidatorArray, _super);
|
3700
|
-
function CountLessThanEqualsUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
3677
|
+
var CountGreaterThanEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
|
3678
|
+
__extends(CountGreaterThanEqualsUnCheckedValidatorArray, _super);
|
3679
|
+
function CountGreaterThanEqualsUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
3701
3680
|
if (autoValid === void 0) { autoValid = true; }
|
3702
3681
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3703
3682
|
_this.count = count;
|
3704
3683
|
return _this;
|
3705
3684
|
}
|
3706
|
-
|
3685
|
+
CountGreaterThanEqualsUnCheckedValidatorArray.prototype.valid = function () {
|
3707
3686
|
var _a;
|
3708
|
-
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length
|
3687
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length >= this.count;
|
3709
3688
|
};
|
3710
|
-
return
|
3689
|
+
return CountGreaterThanEqualsUnCheckedValidatorArray;
|
3711
3690
|
}(ValidatorArray));
|
3712
3691
|
|
3713
3692
|
var CountLessThanEqualsCheckedValidatorArray = /** @class */ (function (_super) {
|
@@ -3725,20 +3704,6 @@ var CountLessThanEqualsCheckedValidatorArray = /** @class */ (function (_super)
|
|
3725
3704
|
return CountLessThanEqualsCheckedValidatorArray;
|
3726
3705
|
}(ValidatorArray));
|
3727
3706
|
|
3728
|
-
var EmptyValidator = /** @class */ (function (_super) {
|
3729
|
-
__extends(EmptyValidator, _super);
|
3730
|
-
function EmptyValidator(value, target, event, autoValid) {
|
3731
|
-
if (autoValid === void 0) { autoValid = true; }
|
3732
|
-
return _super.call(this, value, target, event, autoValid) || this;
|
3733
|
-
}
|
3734
|
-
EmptyValidator.prototype.valid = function () {
|
3735
|
-
var _a, _b;
|
3736
|
-
var value = this.value;
|
3737
|
-
return value === undefined || value === null || ((_b = (_a = value) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) <= 0;
|
3738
|
-
};
|
3739
|
-
return EmptyValidator;
|
3740
|
-
}(Validator));
|
3741
|
-
|
3742
3707
|
var CountUnCheckedValidatorArray = /** @class */ (function (_super) {
|
3743
3708
|
__extends(CountUnCheckedValidatorArray, _super);
|
3744
3709
|
function CountUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
@@ -3754,9 +3719,24 @@ var CountUnCheckedValidatorArray = /** @class */ (function (_super) {
|
|
3754
3719
|
return CountUnCheckedValidatorArray;
|
3755
3720
|
}(ValidatorArray));
|
3756
3721
|
|
3757
|
-
var
|
3758
|
-
__extends(
|
3759
|
-
function
|
3722
|
+
var CountGreaterThanEqualsCheckedValidatorArray = /** @class */ (function (_super) {
|
3723
|
+
__extends(CountGreaterThanEqualsCheckedValidatorArray, _super);
|
3724
|
+
function CountGreaterThanEqualsCheckedValidatorArray(count, value, target, event, autoValid) {
|
3725
|
+
if (autoValid === void 0) { autoValid = true; }
|
3726
|
+
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3727
|
+
_this.count = count;
|
3728
|
+
return _this;
|
3729
|
+
}
|
3730
|
+
CountGreaterThanEqualsCheckedValidatorArray.prototype.valid = function () {
|
3731
|
+
var _a;
|
3732
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length >= this.count;
|
3733
|
+
};
|
3734
|
+
return CountGreaterThanEqualsCheckedValidatorArray;
|
3735
|
+
}(ValidatorArray));
|
3736
|
+
|
3737
|
+
var IncludeCheckedValidatorArray = /** @class */ (function (_super) {
|
3738
|
+
__extends(IncludeCheckedValidatorArray, _super);
|
3739
|
+
function IncludeCheckedValidatorArray(include, allRequired, value, target, event, autoValid) {
|
3760
3740
|
if (allRequired === void 0) { allRequired = false; }
|
3761
3741
|
if (autoValid === void 0) { autoValid = true; }
|
3762
3742
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
@@ -3764,16 +3744,16 @@ var ExcludeCheckedValidatorArray = /** @class */ (function (_super) {
|
|
3764
3744
|
_this.allRequired = allRequired;
|
3765
3745
|
return _this;
|
3766
3746
|
}
|
3767
|
-
|
3747
|
+
IncludeCheckedValidatorArray.prototype.valid = function () {
|
3768
3748
|
var _this = this;
|
3769
3749
|
var _a;
|
3770
3750
|
var valus = (_a = this.value) !== null && _a !== void 0 ? _a : [];
|
3771
|
-
var
|
3772
|
-
return
|
3773
|
-
(!(
|
3774
|
-
(this.allRequired ?
|
3751
|
+
var checkedValue = valus.filter(function (it) { return it.checked; }).map(function (it) { return it.value; });
|
3752
|
+
return checkedValue.length > 0 &&
|
3753
|
+
(!(checkedValue.filter(function (it) { return !_this.include.includes(it); }).length > 0)) &&
|
3754
|
+
(this.allRequired ? checkedValue.filter(function (it) { return _this.include.includes(it); }).length === this.include.length : true);
|
3775
3755
|
};
|
3776
|
-
return
|
3756
|
+
return IncludeCheckedValidatorArray;
|
3777
3757
|
}(ValidatorArray));
|
3778
3758
|
|
3779
3759
|
var FormValidator = /** @class */ (function (_super) {
|
@@ -3794,38 +3774,24 @@ var FormValidator = /** @class */ (function (_super) {
|
|
3794
3774
|
return FormValidator;
|
3795
3775
|
}(Validator));
|
3796
3776
|
|
3797
|
-
var
|
3798
|
-
__extends(
|
3799
|
-
function
|
3777
|
+
var CountLessThanUnCheckedValidatorArray = /** @class */ (function (_super) {
|
3778
|
+
__extends(CountLessThanUnCheckedValidatorArray, _super);
|
3779
|
+
function CountLessThanUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
3800
3780
|
if (autoValid === void 0) { autoValid = true; }
|
3801
3781
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3802
|
-
_this.
|
3803
|
-
it.setAutoValid(false);
|
3804
|
-
it.setAutoValidAction(false);
|
3805
|
-
return it;
|
3806
|
-
});
|
3807
|
-
_this.validators.forEach(function (it) {
|
3808
|
-
it.set(_this.value, _this.getTarget(), _this.getEvent());
|
3809
|
-
});
|
3782
|
+
_this.count = count;
|
3810
3783
|
return _this;
|
3811
3784
|
}
|
3812
|
-
|
3813
|
-
var
|
3814
|
-
this.
|
3815
|
-
};
|
3816
|
-
MultipleValidator.prototype.validAction = function () {
|
3817
|
-
return !(this.validators.filter(function (it) { return !it.validAction(); }).length > 0);
|
3818
|
-
};
|
3819
|
-
MultipleValidator.prototype.valid = function () {
|
3820
|
-
// console.log('mm', this.validators)
|
3821
|
-
return !(this.validators.filter(function (it) { return !it.valid(); }).length > 0);
|
3785
|
+
CountLessThanUnCheckedValidatorArray.prototype.valid = function () {
|
3786
|
+
var _a;
|
3787
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length < this.count;
|
3822
3788
|
};
|
3823
|
-
return
|
3824
|
-
}(
|
3789
|
+
return CountLessThanUnCheckedValidatorArray;
|
3790
|
+
}(ValidatorArray));
|
3825
3791
|
|
3826
|
-
var
|
3827
|
-
__extends(
|
3828
|
-
function
|
3792
|
+
var ExcludeCheckedValidatorArray = /** @class */ (function (_super) {
|
3793
|
+
__extends(ExcludeCheckedValidatorArray, _super);
|
3794
|
+
function ExcludeCheckedValidatorArray(include, allRequired, value, target, event, autoValid) {
|
3829
3795
|
if (allRequired === void 0) { allRequired = false; }
|
3830
3796
|
if (autoValid === void 0) { autoValid = true; }
|
3831
3797
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
@@ -3833,18 +3799,47 @@ var IncludeCheckedValidatorArray = /** @class */ (function (_super) {
|
|
3833
3799
|
_this.allRequired = allRequired;
|
3834
3800
|
return _this;
|
3835
3801
|
}
|
3836
|
-
|
3802
|
+
ExcludeCheckedValidatorArray.prototype.valid = function () {
|
3837
3803
|
var _this = this;
|
3838
3804
|
var _a;
|
3839
3805
|
var valus = (_a = this.value) !== null && _a !== void 0 ? _a : [];
|
3840
|
-
var
|
3841
|
-
return
|
3842
|
-
(!(
|
3843
|
-
(this.allRequired ?
|
3806
|
+
var unCheckedValue = valus.filter(function (it) { return !it.checked; }).map(function (it) { return it.value; });
|
3807
|
+
return unCheckedValue.length > 0 &&
|
3808
|
+
(!(unCheckedValue.filter(function (it) { return !_this.include.includes(it); }).length > 0)) &&
|
3809
|
+
(this.allRequired ? unCheckedValue.filter(function (it) { return _this.include.includes(it); }).length === this.include.length : true);
|
3844
3810
|
};
|
3845
|
-
return
|
3811
|
+
return ExcludeCheckedValidatorArray;
|
3812
|
+
}(ValidatorArray));
|
3813
|
+
|
3814
|
+
var CountLessThanEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
|
3815
|
+
__extends(CountLessThanEqualsUnCheckedValidatorArray, _super);
|
3816
|
+
function CountLessThanEqualsUnCheckedValidatorArray(count, value, target, event, autoValid) {
|
3817
|
+
if (autoValid === void 0) { autoValid = true; }
|
3818
|
+
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3819
|
+
_this.count = count;
|
3820
|
+
return _this;
|
3821
|
+
}
|
3822
|
+
CountLessThanEqualsUnCheckedValidatorArray.prototype.valid = function () {
|
3823
|
+
var _a;
|
3824
|
+
return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length <= this.count;
|
3825
|
+
};
|
3826
|
+
return CountLessThanEqualsUnCheckedValidatorArray;
|
3846
3827
|
}(ValidatorArray));
|
3847
3828
|
|
3829
|
+
var EmptyValidator = /** @class */ (function (_super) {
|
3830
|
+
__extends(EmptyValidator, _super);
|
3831
|
+
function EmptyValidator(value, target, event, autoValid) {
|
3832
|
+
if (autoValid === void 0) { autoValid = true; }
|
3833
|
+
return _super.call(this, value, target, event, autoValid) || this;
|
3834
|
+
}
|
3835
|
+
EmptyValidator.prototype.valid = function () {
|
3836
|
+
var _a, _b;
|
3837
|
+
var value = this.value;
|
3838
|
+
return value === undefined || value === null || ((_b = (_a = value) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) <= 0;
|
3839
|
+
};
|
3840
|
+
return EmptyValidator;
|
3841
|
+
}(Validator));
|
3842
|
+
|
3848
3843
|
var NotEmptyValidator = /** @class */ (function (_super) {
|
3849
3844
|
__extends(NotEmptyValidator, _super);
|
3850
3845
|
function NotEmptyValidator(value, target, event, autoValid) {
|
@@ -3860,27 +3855,33 @@ var NotEmptyValidator = /** @class */ (function (_super) {
|
|
3860
3855
|
return NotEmptyValidator;
|
3861
3856
|
}(Validator));
|
3862
3857
|
|
3863
|
-
var
|
3864
|
-
__extends(
|
3865
|
-
function
|
3858
|
+
var MultipleValidator = /** @class */ (function (_super) {
|
3859
|
+
__extends(MultipleValidator, _super);
|
3860
|
+
function MultipleValidator(validators, value, target, event, autoValid) {
|
3866
3861
|
if (autoValid === void 0) { autoValid = true; }
|
3867
3862
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3868
|
-
_this.
|
3863
|
+
_this.validators = validators.map(function (it) {
|
3864
|
+
it.setAutoValid(false);
|
3865
|
+
it.setAutoValidAction(false);
|
3866
|
+
return it;
|
3867
|
+
});
|
3868
|
+
_this.validators.forEach(function (it) {
|
3869
|
+
it.set(_this.value, _this.getTarget(), _this.getEvent());
|
3870
|
+
});
|
3869
3871
|
return _this;
|
3870
3872
|
}
|
3871
|
-
|
3872
|
-
var
|
3873
|
-
|
3874
|
-
var regExp = (_a = this.regexp._DomRender_origin) !== null && _a !== void 0 ? _a : this.regexp;
|
3875
|
-
// console.log('regexp-->', value, this.regexp, regExp.test(value))
|
3876
|
-
if (value) {
|
3877
|
-
return regExp.test(value);
|
3878
|
-
}
|
3879
|
-
else {
|
3880
|
-
return false;
|
3881
|
-
}
|
3873
|
+
MultipleValidator.prototype.changeValue = function (value) {
|
3874
|
+
var _this = this;
|
3875
|
+
this.validators.forEach(function (it) { return it.set(_this.value, _this.getTarget(), _this.getEvent()); });
|
3882
3876
|
};
|
3883
|
-
|
3877
|
+
MultipleValidator.prototype.validAction = function () {
|
3878
|
+
return !(this.validators.filter(function (it) { return !it.validAction(); }).length > 0);
|
3879
|
+
};
|
3880
|
+
MultipleValidator.prototype.valid = function () {
|
3881
|
+
// console.log('mm', this.validators)
|
3882
|
+
return !(this.validators.filter(function (it) { return !it.valid(); }).length > 0);
|
3883
|
+
};
|
3884
|
+
return MultipleValidator;
|
3884
3885
|
}(Validator));
|
3885
3886
|
|
3886
3887
|
var PassValidator = /** @class */ (function (_super) {
|
@@ -3895,6 +3896,20 @@ var PassValidator = /** @class */ (function (_super) {
|
|
3895
3896
|
return PassValidator;
|
3896
3897
|
}(Validator));
|
3897
3898
|
|
3899
|
+
var RequiredValidator = /** @class */ (function (_super) {
|
3900
|
+
__extends(RequiredValidator, _super);
|
3901
|
+
function RequiredValidator(value, target, event, autoValid) {
|
3902
|
+
if (autoValid === void 0) { autoValid = true; }
|
3903
|
+
return _super.call(this, value, target, event, autoValid) || this;
|
3904
|
+
}
|
3905
|
+
RequiredValidator.prototype.valid = function () {
|
3906
|
+
var value = this.value;
|
3907
|
+
// console.log('required', value, value !== undefined && value !== null)
|
3908
|
+
return value !== undefined && value !== null;
|
3909
|
+
};
|
3910
|
+
return RequiredValidator;
|
3911
|
+
}(Validator));
|
3912
|
+
|
3898
3913
|
var NotRegExpTestValidator = /** @class */ (function (_super) {
|
3899
3914
|
__extends(NotRegExpTestValidator, _super);
|
3900
3915
|
function NotRegExpTestValidator(regexp, value, target, event, autoValid) {
|
@@ -3945,20 +3960,6 @@ var ValidMultipleValidator = /** @class */ (function (_super) {
|
|
3945
3960
|
return ValidMultipleValidator;
|
3946
3961
|
}(MultipleValidator));
|
3947
3962
|
|
3948
|
-
var RequiredValidator = /** @class */ (function (_super) {
|
3949
|
-
__extends(RequiredValidator, _super);
|
3950
|
-
function RequiredValidator(value, target, event, autoValid) {
|
3951
|
-
if (autoValid === void 0) { autoValid = true; }
|
3952
|
-
return _super.call(this, value, target, event, autoValid) || this;
|
3953
|
-
}
|
3954
|
-
RequiredValidator.prototype.valid = function () {
|
3955
|
-
var value = this.value;
|
3956
|
-
// console.log('required', value, value !== undefined && value !== null)
|
3957
|
-
return value !== undefined && value !== null;
|
3958
|
-
};
|
3959
|
-
return RequiredValidator;
|
3960
|
-
}(Validator));
|
3961
|
-
|
3962
3963
|
var ValidValidator = /** @class */ (function (_super) {
|
3963
3964
|
__extends(ValidValidator, _super);
|
3964
3965
|
function ValidValidator(validCallBack, value, target, event, autoValid) {
|
@@ -3973,33 +3974,27 @@ var ValidValidator = /** @class */ (function (_super) {
|
|
3973
3974
|
return ValidValidator;
|
3974
3975
|
}(Validator));
|
3975
3976
|
|
3976
|
-
var
|
3977
|
-
__extends(
|
3978
|
-
function
|
3977
|
+
var RegExpTestValidator = /** @class */ (function (_super) {
|
3978
|
+
__extends(RegExpTestValidator, _super);
|
3979
|
+
function RegExpTestValidator(regexp, value, target, event, autoValid) {
|
3979
3980
|
if (autoValid === void 0) { autoValid = true; }
|
3980
3981
|
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3981
|
-
_this.
|
3982
|
+
_this.regexp = DomRenderProxy.final(regexp);
|
3982
3983
|
return _this;
|
3983
3984
|
}
|
3984
|
-
|
3985
|
+
RegExpTestValidator.prototype.valid = function () {
|
3985
3986
|
var _a;
|
3986
|
-
|
3987
|
-
|
3988
|
-
|
3989
|
-
|
3990
|
-
|
3991
|
-
|
3992
|
-
|
3993
|
-
|
3994
|
-
|
3995
|
-
var _this = _super.call(this, value, target, event, autoValid) || this;
|
3996
|
-
_this.equalsValue = equalsValue;
|
3997
|
-
return _this;
|
3998
|
-
}
|
3999
|
-
ValueEqualsValidator.prototype.valid = function () {
|
4000
|
-
return this.value === this.equalsValue;
|
3987
|
+
var value = this.value;
|
3988
|
+
var regExp = (_a = this.regexp._DomRender_origin) !== null && _a !== void 0 ? _a : this.regexp;
|
3989
|
+
// console.log('regexp-->', value, this.regexp, regExp.test(value))
|
3990
|
+
if (value) {
|
3991
|
+
return regExp.test(value);
|
3992
|
+
}
|
3993
|
+
else {
|
3994
|
+
return false;
|
3995
|
+
}
|
4001
3996
|
};
|
4002
|
-
return
|
3997
|
+
return RegExpTestValidator;
|
4003
3998
|
}(Validator));
|
4004
3999
|
|
4005
4000
|
var ValidValidatorArray = /** @class */ (function (_super) {
|
@@ -4030,6 +4025,42 @@ var ValueNotEqualsValidator = /** @class */ (function (_super) {
|
|
4030
4025
|
return ValueNotEqualsValidator;
|
4031
4026
|
}(Validator));
|
4032
4027
|
|
4028
|
+
var ValueEqualsValidator = /** @class */ (function (_super) {
|
4029
|
+
__extends(ValueEqualsValidator, _super);
|
4030
|
+
function ValueEqualsValidator(equalsValue, value, target, event, autoValid) {
|
4031
|
+
if (autoValid === void 0) { autoValid = true; }
|
4032
|
+
var _this = _super.call(this, value, target, event, autoValid) || this;
|
4033
|
+
_this.equalsValue = equalsValue;
|
4034
|
+
return _this;
|
4035
|
+
}
|
4036
|
+
ValueEqualsValidator.prototype.valid = function () {
|
4037
|
+
return this.value === this.equalsValue;
|
4038
|
+
};
|
4039
|
+
return ValueEqualsValidator;
|
4040
|
+
}(Validator));
|
4041
|
+
|
4042
|
+
var ClipBoardUtils = /** @class */ (function () {
|
4043
|
+
function ClipBoardUtils() {
|
4044
|
+
}
|
4045
|
+
ClipBoardUtils.readText = function (clipboard) {
|
4046
|
+
if (clipboard === void 0) { clipboard = navigator.clipboard; }
|
4047
|
+
return clipboard.readText();
|
4048
|
+
};
|
4049
|
+
ClipBoardUtils.read = function (clipboard) {
|
4050
|
+
if (clipboard === void 0) { clipboard = navigator.clipboard; }
|
4051
|
+
return clipboard.read();
|
4052
|
+
};
|
4053
|
+
ClipBoardUtils.writeText = function (data, clipboard) {
|
4054
|
+
if (clipboard === void 0) { clipboard = navigator.clipboard; }
|
4055
|
+
return clipboard.writeText(data);
|
4056
|
+
};
|
4057
|
+
ClipBoardUtils.write = function (data, clipboard) {
|
4058
|
+
if (clipboard === void 0) { clipboard = navigator.clipboard; }
|
4059
|
+
return clipboard.write(data);
|
4060
|
+
};
|
4061
|
+
return ClipBoardUtils;
|
4062
|
+
}());
|
4063
|
+
|
4033
4064
|
var NodeUtils = /** @class */ (function () {
|
4034
4065
|
function NodeUtils() {
|
4035
4066
|
}
|
@@ -4099,28 +4130,6 @@ var StorageUtils = /** @class */ (function () {
|
|
4099
4130
|
return StorageUtils;
|
4100
4131
|
}());
|
4101
4132
|
|
4102
|
-
var ClipBoardUtils = /** @class */ (function () {
|
4103
|
-
function ClipBoardUtils() {
|
4104
|
-
}
|
4105
|
-
ClipBoardUtils.readText = function (clipboard) {
|
4106
|
-
if (clipboard === void 0) { clipboard = navigator.clipboard; }
|
4107
|
-
return clipboard.readText();
|
4108
|
-
};
|
4109
|
-
ClipBoardUtils.read = function (clipboard) {
|
4110
|
-
if (clipboard === void 0) { clipboard = navigator.clipboard; }
|
4111
|
-
return clipboard.read();
|
4112
|
-
};
|
4113
|
-
ClipBoardUtils.writeText = function (data, clipboard) {
|
4114
|
-
if (clipboard === void 0) { clipboard = navigator.clipboard; }
|
4115
|
-
return clipboard.writeText(data);
|
4116
|
-
};
|
4117
|
-
ClipBoardUtils.write = function (data, clipboard) {
|
4118
|
-
if (clipboard === void 0) { clipboard = navigator.clipboard; }
|
4119
|
-
return clipboard.write(data);
|
4120
|
-
};
|
4121
|
-
return ClipBoardUtils;
|
4122
|
-
}());
|
4123
|
-
|
4124
4133
|
exports.AllCheckedValidatorArray = AllCheckedValidatorArray;
|
4125
4134
|
exports.AllUnCheckedValidatorArray = AllUnCheckedValidatorArray;
|
4126
4135
|
exports.Appender = Appender;
|