dom-render 1.0.96 → 1.0.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundle.js CHANGED
@@ -304,6 +304,23 @@ var StringUtils = /** @class */ (function () {
304
304
  }
305
305
  return usingVars;
306
306
  };
307
+ StringUtils.regexExecArrayReplace = function (origin, regexpExecArrayOrRegex, replace) {
308
+ var regexpExecArrays = Array.isArray(regexpExecArrayOrRegex) ? regexpExecArrayOrRegex : StringUtils.regexExec(regexpExecArrayOrRegex, origin);
309
+ regexpExecArrays.reverse().forEach(function (it) {
310
+ var r = typeof replace === 'string' ? replace : replace(it);
311
+ origin = origin.substr(0, it.index) + origin.substr(it.index).replace(it[0], r);
312
+ });
313
+ return origin;
314
+ };
315
+ // public static regexGroups(regex: RegExp, text: string) {
316
+ // const usingVars = [];
317
+ // let varExec = regex.exec(text)
318
+ // while (varExec) {
319
+ // usingVars.push(varExec)
320
+ // varExec = regex.exec(varExec.input)
321
+ // }
322
+ // return usingVars;
323
+ // }
307
324
  // public static betweenRegexpStr(start: string, end: string, data: string, flag = 'gm') {
308
325
  // const startEspace = StringUtils.escapeSpecialCharacterRegExp(start);
309
326
  // const reg = RegExp(`(${start}(?:(${start})??[^${startEspace}]*?${end}))`,flag);
@@ -478,10 +495,22 @@ var RangeIterator = /** @class */ (function () {
478
495
  r = new RangeResult(this._current, false);
479
496
  this._current += this._step;
480
497
  }
498
+ else if (this._first < this._last && this._current === this._last) {
499
+ r = new RangeResult(this._current, false);
500
+ this._current += this._step;
501
+ }
481
502
  else if (this._first > this._last && this._current > this._last) {
482
503
  r = new RangeResult(this._current, false);
483
504
  this._current -= this._step;
484
505
  }
506
+ else if (this._first > this._last && this._current === this._last) {
507
+ r = new RangeResult(this._current, false);
508
+ this._current -= this._step;
509
+ }
510
+ else if (this._current === this._last) {
511
+ r = new RangeResult(this._current, false);
512
+ this._current -= this._step;
513
+ }
485
514
  else {
486
515
  r = new RangeResult(undefined, true);
487
516
  }
@@ -500,6 +529,9 @@ var Range = /** @class */ (function () {
500
529
  Range.prototype[Symbol.iterator] = function () {
501
530
  return new RangeIterator(this.first, this.last, this.step);
502
531
  };
532
+ Range.prototype.map = function (callbackfn, thisArg) {
533
+ return Array.from(this).map(callbackfn);
534
+ };
503
535
  Range.range = function (first, last, step) {
504
536
  if (step === void 0) { step = 1; }
505
537
  if (typeof first === 'number' && last === undefined) {
@@ -2052,6 +2084,593 @@ exports.RawSetOperatorType = void 0;
2052
2084
  RawSetOperatorType["DR_THIS_PROPERTY"] = "this-property";
2053
2085
  })(exports.RawSetOperatorType || (exports.RawSetOperatorType = {}));
2054
2086
 
2087
+ // http://www.w3.org/TR/CSS21/grammar.html
2088
+ // https://github.com/visionmedia/css-parse/pull/49#issuecomment-30088027
2089
+ var commentre = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
2090
+ function cssParse (css, options) {
2091
+ options = options || {};
2092
+
2093
+ /**
2094
+ * Positional.
2095
+ */
2096
+
2097
+ var lineno = 1;
2098
+ var column = 1;
2099
+
2100
+ /**
2101
+ * Update lineno and column based on `str`.
2102
+ */
2103
+
2104
+ function updatePosition(str) {
2105
+ var lines = str.match(/\n/g);
2106
+ if (lines) lineno += lines.length;
2107
+ var i = str.lastIndexOf('\n');
2108
+ column = ~i ? str.length - i : column + str.length;
2109
+ }
2110
+
2111
+ /**
2112
+ * Mark position and patch `node.position`.
2113
+ */
2114
+
2115
+ function position() {
2116
+ var start = {
2117
+ line: lineno,
2118
+ column: column
2119
+ };
2120
+ return function (node) {
2121
+ node.position = new Position(start);
2122
+ whitespace();
2123
+ return node;
2124
+ };
2125
+ }
2126
+
2127
+ /**
2128
+ * Store position information for a node
2129
+ */
2130
+
2131
+ function Position(start) {
2132
+ this.start = start;
2133
+ this.end = {
2134
+ line: lineno,
2135
+ column: column
2136
+ };
2137
+ this.source = options.source;
2138
+ }
2139
+
2140
+ /**
2141
+ * Non-enumerable source string
2142
+ */
2143
+
2144
+ Position.prototype.content = css;
2145
+
2146
+ /**
2147
+ * Error `msg`.
2148
+ */
2149
+
2150
+ var errorsList = [];
2151
+ function error(msg) {
2152
+ var err = new Error(options.source + ':' + lineno + ':' + column + ': ' + msg);
2153
+ err.reason = msg;
2154
+ err.filename = options.source;
2155
+ err.line = lineno;
2156
+ err.column = column;
2157
+ err.source = css;
2158
+ if (options.silent) {
2159
+ errorsList.push(err);
2160
+ } else {
2161
+ throw err;
2162
+ }
2163
+ }
2164
+
2165
+ /**
2166
+ * Parse stylesheet.
2167
+ */
2168
+
2169
+ function stylesheet() {
2170
+ var rulesList = rules();
2171
+ return {
2172
+ type: 'stylesheet',
2173
+ stylesheet: {
2174
+ source: options.source,
2175
+ rules: rulesList,
2176
+ parsingErrors: errorsList
2177
+ }
2178
+ };
2179
+ }
2180
+
2181
+ /**
2182
+ * Opening brace.
2183
+ */
2184
+
2185
+ function open() {
2186
+ return match(/^{\s*/);
2187
+ }
2188
+
2189
+ /**
2190
+ * Closing brace.
2191
+ */
2192
+
2193
+ function close() {
2194
+ return match(/^}/);
2195
+ }
2196
+
2197
+ /**
2198
+ * Parse ruleset.
2199
+ */
2200
+
2201
+ function rules() {
2202
+ var node;
2203
+ var rules = [];
2204
+ whitespace();
2205
+ comments(rules);
2206
+ while (css.length && css.charAt(0) != '}' && (node = atrule() || rule())) {
2207
+ if (node !== false) {
2208
+ rules.push(node);
2209
+ comments(rules);
2210
+ }
2211
+ }
2212
+ return rules;
2213
+ }
2214
+
2215
+ /**
2216
+ * Match `re` and return captures.
2217
+ */
2218
+
2219
+ function match(re) {
2220
+ var m = re.exec(css);
2221
+ if (!m) return;
2222
+ var str = m[0];
2223
+ updatePosition(str);
2224
+ css = css.slice(str.length);
2225
+ return m;
2226
+ }
2227
+
2228
+ /**
2229
+ * Parse whitespace.
2230
+ */
2231
+
2232
+ function whitespace() {
2233
+ match(/^\s*/);
2234
+ }
2235
+
2236
+ /**
2237
+ * Parse comments;
2238
+ */
2239
+
2240
+ function comments(rules) {
2241
+ var c;
2242
+ rules = rules || [];
2243
+ while (c = comment()) {
2244
+ if (c !== false) {
2245
+ rules.push(c);
2246
+ }
2247
+ }
2248
+ return rules;
2249
+ }
2250
+
2251
+ /**
2252
+ * Parse comment.
2253
+ */
2254
+
2255
+ function comment() {
2256
+ var pos = position();
2257
+ if ('/' != css.charAt(0) || '*' != css.charAt(1)) return;
2258
+ var i = 2;
2259
+ while ("" != css.charAt(i) && ('*' != css.charAt(i) || '/' != css.charAt(i + 1))) ++i;
2260
+ i += 2;
2261
+ if ("" === css.charAt(i - 1)) {
2262
+ return error('End of comment missing');
2263
+ }
2264
+ var str = css.slice(2, i - 2);
2265
+ column += 2;
2266
+ updatePosition(str);
2267
+ css = css.slice(i);
2268
+ column += 2;
2269
+ return pos({
2270
+ type: 'comment',
2271
+ comment: str
2272
+ });
2273
+ }
2274
+
2275
+ /**
2276
+ * Parse selector.
2277
+ */
2278
+
2279
+ function selector() {
2280
+ var m = match(/^([^{]+)/);
2281
+ if (!m) return;
2282
+ /* @fix Remove all comments from selectors
2283
+ * http://ostermiller.org/findcomment.html */
2284
+ return trim(m[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g, '').replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g, function (m) {
2285
+ return m.replace(/,/g, '\u200C');
2286
+ }).split(/\s*(?![^(]*\)),\s*/).map(function (s) {
2287
+ return s.replace(/\u200C/g, ',');
2288
+ });
2289
+ }
2290
+
2291
+ /**
2292
+ * Parse declaration.
2293
+ */
2294
+
2295
+ function declaration() {
2296
+ var pos = position();
2297
+
2298
+ // prop
2299
+ var prop = match(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);
2300
+ if (!prop) return;
2301
+ prop = trim(prop[0]);
2302
+
2303
+ // :
2304
+ if (!match(/^:\s*/)) return error("property missing ':'");
2305
+
2306
+ // val
2307
+ var val = match(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/);
2308
+ var ret = pos({
2309
+ type: 'declaration',
2310
+ property: prop.replace(commentre, ''),
2311
+ value: val ? trim(val[0]).replace(commentre, '') : ''
2312
+ });
2313
+
2314
+ // ;
2315
+ match(/^[;\s]*/);
2316
+ return ret;
2317
+ }
2318
+
2319
+ /**
2320
+ * Parse declarations.
2321
+ */
2322
+
2323
+ function declarations() {
2324
+ var decls = [];
2325
+ if (!open()) return error("missing '{'");
2326
+ comments(decls);
2327
+
2328
+ // declarations
2329
+ var decl;
2330
+ while (decl = declaration()) {
2331
+ if (decl !== false) {
2332
+ decls.push(decl);
2333
+ comments(decls);
2334
+ }
2335
+ }
2336
+ if (!close()) return error("missing '}'");
2337
+ return decls;
2338
+ }
2339
+
2340
+ /**
2341
+ * Parse keyframe.
2342
+ */
2343
+
2344
+ function keyframe() {
2345
+ var m;
2346
+ var vals = [];
2347
+ var pos = position();
2348
+ while (m = match(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/)) {
2349
+ vals.push(m[1]);
2350
+ match(/^,\s*/);
2351
+ }
2352
+ if (!vals.length) return;
2353
+ return pos({
2354
+ type: 'keyframe',
2355
+ values: vals,
2356
+ declarations: declarations()
2357
+ });
2358
+ }
2359
+
2360
+ /**
2361
+ * Parse keyframes.
2362
+ */
2363
+
2364
+ function atkeyframes() {
2365
+ var pos = position();
2366
+ var m = match(/^@([-\w]+)?keyframes\s*/);
2367
+ if (!m) return;
2368
+ var vendor = m[1];
2369
+
2370
+ // identifier
2371
+ var m = match(/^([-\w]+)\s*/);
2372
+ if (!m) return error("@keyframes missing name");
2373
+ var name = m[1];
2374
+ if (!open()) return error("@keyframes missing '{'");
2375
+ var frame;
2376
+ var frames = comments();
2377
+ while (frame = keyframe()) {
2378
+ frames.push(frame);
2379
+ frames = frames.concat(comments());
2380
+ }
2381
+ if (!close()) return error("@keyframes missing '}'");
2382
+ return pos({
2383
+ type: 'keyframes',
2384
+ name: name,
2385
+ vendor: vendor,
2386
+ keyframes: frames
2387
+ });
2388
+ }
2389
+
2390
+ /**
2391
+ * Parse supports.
2392
+ */
2393
+
2394
+ function atsupports() {
2395
+ var pos = position();
2396
+ var m = match(/^@supports *([^{]+)/);
2397
+ if (!m) return;
2398
+ var supports = trim(m[1]);
2399
+ if (!open()) return error("@supports missing '{'");
2400
+ var style = comments().concat(rules());
2401
+ if (!close()) return error("@supports missing '}'");
2402
+ return pos({
2403
+ type: 'supports',
2404
+ supports: supports,
2405
+ rules: style
2406
+ });
2407
+ }
2408
+
2409
+ /**
2410
+ * Parse host.
2411
+ */
2412
+
2413
+ function athost() {
2414
+ var pos = position();
2415
+ var m = match(/^@host\s*/);
2416
+ if (!m) return;
2417
+ if (!open()) return error("@host missing '{'");
2418
+ var style = comments().concat(rules());
2419
+ if (!close()) return error("@host missing '}'");
2420
+ return pos({
2421
+ type: 'host',
2422
+ rules: style
2423
+ });
2424
+ }
2425
+
2426
+ /**
2427
+ * Parse media.
2428
+ */
2429
+
2430
+ function atmedia() {
2431
+ var pos = position();
2432
+ var m = match(/^@media *([^{]+)/);
2433
+ if (!m) return;
2434
+ var media = trim(m[1]);
2435
+ if (!open()) return error("@media missing '{'");
2436
+ var style = comments().concat(rules());
2437
+ if (!close()) return error("@media missing '}'");
2438
+ return pos({
2439
+ type: 'media',
2440
+ media: media,
2441
+ rules: style
2442
+ });
2443
+ }
2444
+
2445
+ /**
2446
+ * Parse custom-media.
2447
+ */
2448
+
2449
+ function atcustommedia() {
2450
+ var pos = position();
2451
+ var m = match(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);
2452
+ if (!m) return;
2453
+ return pos({
2454
+ type: 'custom-media',
2455
+ name: trim(m[1]),
2456
+ media: trim(m[2])
2457
+ });
2458
+ }
2459
+
2460
+ /**
2461
+ * Parse paged media.
2462
+ */
2463
+
2464
+ function atpage() {
2465
+ var pos = position();
2466
+ var m = match(/^@page */);
2467
+ if (!m) return;
2468
+ var sel = selector() || [];
2469
+ if (!open()) return error("@page missing '{'");
2470
+ var decls = comments();
2471
+
2472
+ // declarations
2473
+ var decl;
2474
+ while (decl = declaration()) {
2475
+ decls.push(decl);
2476
+ decls = decls.concat(comments());
2477
+ }
2478
+ if (!close()) return error("@page missing '}'");
2479
+ return pos({
2480
+ type: 'page',
2481
+ selectors: sel,
2482
+ declarations: decls
2483
+ });
2484
+ }
2485
+
2486
+ /**
2487
+ * Parse document.
2488
+ */
2489
+
2490
+ function atdocument() {
2491
+ var pos = position();
2492
+ var m = match(/^@([-\w]+)?document *([^{]+)/);
2493
+ if (!m) return;
2494
+ var vendor = trim(m[1]);
2495
+ var doc = trim(m[2]);
2496
+ if (!open()) return error("@document missing '{'");
2497
+ var style = comments().concat(rules());
2498
+ if (!close()) return error("@document missing '}'");
2499
+ return pos({
2500
+ type: 'document',
2501
+ document: doc,
2502
+ vendor: vendor,
2503
+ rules: style
2504
+ });
2505
+ }
2506
+
2507
+ /**
2508
+ * Parse font-face.
2509
+ */
2510
+
2511
+ function atfontface() {
2512
+ var pos = position();
2513
+ var m = match(/^@font-face\s*/);
2514
+ if (!m) return;
2515
+ if (!open()) return error("@font-face missing '{'");
2516
+ var decls = comments();
2517
+
2518
+ // declarations
2519
+ var decl;
2520
+ while (decl = declaration()) {
2521
+ decls.push(decl);
2522
+ decls = decls.concat(comments());
2523
+ }
2524
+ if (!close()) return error("@font-face missing '}'");
2525
+ return pos({
2526
+ type: 'font-face',
2527
+ declarations: decls
2528
+ });
2529
+ }
2530
+
2531
+ /**
2532
+ * Parse import
2533
+ */
2534
+
2535
+ var atimport = _compileAtrule('import');
2536
+
2537
+ /**
2538
+ * Parse charset
2539
+ */
2540
+
2541
+ var atcharset = _compileAtrule('charset');
2542
+
2543
+ /**
2544
+ * Parse namespace
2545
+ */
2546
+
2547
+ var atnamespace = _compileAtrule('namespace');
2548
+
2549
+ /**
2550
+ * Parse non-block at-rules
2551
+ */
2552
+
2553
+ function _compileAtrule(name) {
2554
+ var re = new RegExp('^@' + name + '\\s*([^;]+);');
2555
+ return function () {
2556
+ var pos = position();
2557
+ var m = match(re);
2558
+ if (!m) return;
2559
+ var ret = {
2560
+ type: name
2561
+ };
2562
+ ret[name] = m[1].trim();
2563
+ return pos(ret);
2564
+ };
2565
+ }
2566
+
2567
+ /**
2568
+ * Parse at rule.
2569
+ */
2570
+
2571
+ function atrule() {
2572
+ if (css[0] != '@') return;
2573
+ return atkeyframes() || atmedia() || atcustommedia() || atsupports() || atimport() || atcharset() || atnamespace() || atdocument() || atpage() || athost() || atfontface();
2574
+ }
2575
+
2576
+ /**
2577
+ * Parse rule.
2578
+ */
2579
+
2580
+ function rule() {
2581
+ var pos = position();
2582
+ var sel = selector();
2583
+ if (!sel) return error('selector missing');
2584
+ comments();
2585
+ return pos({
2586
+ type: 'rule',
2587
+ selectors: sel,
2588
+ declarations: declarations()
2589
+ });
2590
+ }
2591
+ return addParent(stylesheet());
2592
+ }
2593
+
2594
+ /**
2595
+ * Trim `str`.
2596
+ */
2597
+
2598
+ function trim(str) {
2599
+ return str ? str.replace(/^\s+|\s+$/g, '') : '';
2600
+ }
2601
+
2602
+ /**
2603
+ * Adds non-enumerable parent node reference to each node.
2604
+ */
2605
+
2606
+ function addParent(obj, parent) {
2607
+ var isNode = obj && typeof obj.type === 'string';
2608
+ var childParent = isNode ? obj : parent;
2609
+ for (var k in obj) {
2610
+ var value = obj[k];
2611
+ if (Array.isArray(value)) {
2612
+ value.forEach(function (v) {
2613
+ addParent(v, childParent);
2614
+ });
2615
+ } else if (value && typeof value === 'object') {
2616
+ addParent(value, childParent);
2617
+ }
2618
+ }
2619
+ if (isNode) {
2620
+ Object.defineProperty(obj, 'parent', {
2621
+ configurable: true,
2622
+ writable: true,
2623
+ enumerable: false,
2624
+ value: parent || null
2625
+ });
2626
+ }
2627
+ return obj;
2628
+ }
2629
+
2630
+ /**
2631
+ * Module dependencies.
2632
+ */
2633
+
2634
+ var Compressed = require('./compress');
2635
+ var Identity = require('./identity');
2636
+
2637
+ /**
2638
+ * Stringfy the given AST `node`.
2639
+ *
2640
+ * Options:
2641
+ *
2642
+ * - `compress` space-optimized output
2643
+ * - `sourcemap` return an object with `.code` and `.map`
2644
+ *
2645
+ * @param {Object} node
2646
+ * @param {Object} [options]
2647
+ * @return {String}
2648
+ * @api public
2649
+ */
2650
+
2651
+ function cssStringify (node, options) {
2652
+ options = options || {};
2653
+ var compiler = options.compress ? new Compressed(options) : new Identity(options);
2654
+
2655
+ // source maps
2656
+ // if (options.sourcemap) {
2657
+ // var sourcemaps = require('./source-map-support');
2658
+ // sourcemaps(compiler);
2659
+ //
2660
+ // var code = compiler.compile(node);
2661
+ // compiler.applySourceMaps();
2662
+ //
2663
+ // var map = options.sourcemap === 'generator'
2664
+ // ? compiler.map
2665
+ // : compiler.map.toJSON();
2666
+ //
2667
+ // return { code: code, map: map };
2668
+ // }
2669
+
2670
+ var code = compiler.compile(node);
2671
+ return code;
2672
+ }
2673
+
2055
2674
  var RawSet = /** @class */ (function () {
2056
2675
  function RawSet(uuid, type, point, fragment, detect, data) {
2057
2676
  this.uuid = uuid;
@@ -2251,7 +2870,8 @@ var RawSet = /** @class */ (function () {
2251
2870
  }
2252
2871
  });
2253
2872
  // 중요 style isolation 나중에 :scope로 대체 가능할듯.
2254
- RawSet.generateStyleSheetsLocal();
2873
+ // 2023.9.4일 없앰 style 처음들어올때 처리하는걸로 바꿈
2874
+ // RawSet.generateStyleSheetsLocal(config);
2255
2875
  for (_1 = 0, onThisComponentSetCallBacks_1 = onThisComponentSetCallBacks; _1 < onThisComponentSetCallBacks_1.length; _1++) {
2256
2876
  it_1 = onThisComponentSetCallBacks_1[_1];
2257
2877
  (_q = (_p = it_1.obj) === null || _p === void 0 ? void 0 : _p.onInitRender) === null || _q === void 0 ? void 0 : _q.call(_p);
@@ -2301,8 +2921,13 @@ var RawSet = /** @class */ (function () {
2301
2921
  });
2302
2922
  });
2303
2923
  };
2304
- RawSet.generateStyleSheetsLocal = function () {
2305
- 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) {
2924
+ /**
2925
+ * @deprecated
2926
+ * @param config
2927
+ */
2928
+ RawSet.generateStyleSheetsLocal = function (config) {
2929
+ // console.log('config.window.document.styleSheets---------', config.window.document.styleSheets);
2930
+ Array.from(config.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) {
2306
2931
  var _a;
2307
2932
  var styleElement = it.ownerNode;
2308
2933
  var split = (_a = styleElement.getAttribute('id')) === null || _a === void 0 ? void 0 : _a.split('-');
@@ -2351,13 +2976,40 @@ var RawSet = /** @class */ (function () {
2351
2976
  }
2352
2977
  };
2353
2978
  // 중요 스타일 적용 부분
2354
- RawSet.generateStyleTransform = function (styleBody, id, styleTagWrap) {
2979
+ RawSet.generateStyleTransform = function (styleBody, componentKey, styleTagWrap) {
2980
+ var _a;
2355
2981
  if (styleTagWrap === void 0) { styleTagWrap = true; }
2356
2982
  if (Array.isArray(styleBody)) {
2357
2983
  styleBody = styleBody.join('\n');
2358
2984
  }
2985
+ var start = "#".concat(componentKey, "-start");
2986
+ var end = "#".concat(componentKey, "-end");
2987
+ var before = StringUtils.regexExecArrayReplace(styleBody, /(\$\{.*?\}\$)/g, function (data) {
2988
+ return "var(--domrender-".concat(data[0], ")");
2989
+ });
2990
+ var cssobject = cssParse(before);
2991
+ (_a = cssobject.stylesheet) === null || _a === void 0 ? void 0 : _a.rules.forEach(function (rule) {
2992
+ var _a, _b;
2993
+ var isRoot = (_a = rule.selectors) === null || _a === void 0 ? void 0 : _a.find(function (it) { return it.startsWith(':root'); });
2994
+ if (rule.type === 'rule' && !isRoot) { // && !!isRoot
2995
+ rule.selectors = (_b = rule.selectors) === null || _b === void 0 ? void 0 : _b.map(function (sit) {
2996
+ var selectorText = ":is(".concat(start, " ~ *:not(").concat(start, " ~ ").concat(end, " ~ *))");
2997
+ if (sit.startsWith('.')) {
2998
+ return "".concat(selectorText).concat(sit, ", ").concat(selectorText, " ").concat(sit);
2999
+ }
3000
+ else {
3001
+ var divText = "".concat(start, " ~ ").concat(sit, ":not(").concat(start, " ~ ").concat(end, " ~ *)");
3002
+ return "".concat(selectorText, " ").concat(sit, ", ").concat(divText);
3003
+ }
3004
+ });
3005
+ }
3006
+ });
3007
+ var stringify = cssStringify(cssobject);
3008
+ var after = StringUtils.regexExecArrayReplace(stringify, /(var\(--domrender-(\$\{.*?\}\$)?\))/g, function (data) {
3009
+ return data[2];
3010
+ });
2359
3011
  if (styleTagWrap) {
2360
- styleBody = "<style id='".concat(id, "-style' domstyle>").concat(styleBody, "</style>");
3012
+ styleBody = "<style id='".concat(componentKey, "-style' domstyle>").concat(after, "</style>");
2361
3013
  }
2362
3014
  return styleBody;
2363
3015
  };
@@ -2406,9 +3058,8 @@ var RawSet = /** @class */ (function () {
2406
3058
  // 중요 important
2407
3059
  RawSet.checkPointCreates = function (element, obj, config) {
2408
3060
  var _a, _b, _c, _d, _e, _f, _g, _h;
2409
- // console.log('start==========')
3061
+ // const NodeFilter = (config.window as any).NodeFilter;
2410
3062
  var thisVariableName = element.__domrender_this_variable_name;
2411
- // console.log('checkPointCreates thisVariableName', thisVariableName);
2412
3063
  var nodeIterator = config.window.document.createNodeIterator(element, NodeFilter.SHOW_ALL, {
2413
3064
  acceptNode: function (node) {
2414
3065
  var _a, _b, _c, _d, _e;
@@ -2618,18 +3269,19 @@ var RawSet = /** @class */ (function () {
2618
3269
  // let message = it.innerHTML;
2619
3270
  // })
2620
3271
  element.querySelectorAll("[".concat(RawSet.DR_PRE_NAME, "]")).forEach(function (it) {
2621
- it.innerHTML = it.innerHTML.replace(/this/g, thisRandom);
3272
+ it.innerHTML = it.innerHTML.replace(/@this@/g, thisRandom);
2622
3273
  });
2623
3274
  element.querySelectorAll("[".concat(RawSet.DR_THIS_NAME, "]")).forEach(function (it) {
2624
3275
  var message = it.innerHTML;
2625
- StringUtils.regexExec(/([^(dr\-)])?this(?=.?)/g, message).reverse().forEach(function (it) {
3276
+ // StringUtils.regexExec(/([^(dr\-)])?this(?=.?)/g, message).reverse().forEach(it => {
3277
+ StringUtils.regexExec(/@this@/g, message).reverse().forEach(function (it) {
2626
3278
  var _a;
2627
3279
  message = message.substr(0, it.index) + message.substr(it.index).replace(it[0], "".concat((_a = it[1]) !== null && _a !== void 0 ? _a : '').concat(drThis));
2628
3280
  });
2629
3281
  it.innerHTML = message;
2630
3282
  });
2631
3283
  var message = element.innerHTML;
2632
- StringUtils.regexExec(/([^(dr\-)])?this(?=.?)/g, message).reverse().forEach(function (it) {
3284
+ StringUtils.regexExec(/@this@/g, message).reverse().forEach(function (it) {
2633
3285
  var _a;
2634
3286
  message = message.substr(0, it.index) + message.substr(it.index).replace(it[0], "".concat((_a = it[1]) !== null && _a !== void 0 ? _a : '').concat(drThis));
2635
3287
  });
@@ -2638,10 +3290,10 @@ var RawSet = /** @class */ (function () {
2638
3290
  };
2639
3291
  RawSet.drThisDecoding = function (element, thisRandom) {
2640
3292
  element.querySelectorAll("[".concat(RawSet.DR_PRE_NAME, "]")).forEach(function (it) {
2641
- it.innerHTML = it.innerHTML.replace(RegExp(thisRandom, 'g'), 'this');
3293
+ it.innerHTML = it.innerHTML.replace(RegExp(thisRandom, 'g'), '@this@');
2642
3294
  });
2643
3295
  element.querySelectorAll("[".concat(RawSet.DR_THIS_NAME, "]")).forEach(function (it) {
2644
- it.innerHTML = it.innerHTML.replace(RegExp(thisRandom, 'g'), 'this');
3296
+ it.innerHTML = it.innerHTML.replace(RegExp(thisRandom, 'g'), '@this@');
2645
3297
  });
2646
3298
  };
2647
3299
  RawSet.drFormOtherMoveAttr = function (element, as, to, config) {
@@ -2773,6 +3425,8 @@ var RawSet = /** @class */ (function () {
2773
3425
  n.querySelectorAll(eventManager.attrNames.map(function (it) { return "[".concat(it, "]"); }).join(',')).forEach(function (it) {
2774
3426
  it.setAttribute(EventManager.ownerVariablePathAttrName, 'this');
2775
3427
  });
3428
+ // attribute
3429
+ n.getAttributeNames().forEach(function (it) { return n.setAttribute(it, n.getAttribute(it).replace(/#this#/g, drThis)); });
2776
3430
  thisRandom = this.drThisEncoding(n, drThis);
2777
3431
  vars = this.drVarEncoding(n, drVarOption);
2778
3432
  this.drVarDecoding(n, vars);
@@ -2822,10 +3476,11 @@ var RawSet = /** @class */ (function () {
2822
3476
  callBack: function (element, obj, rawSet, attrs, config) {
2823
3477
  var _a, _b, _c, _d, _e, _f, _g;
2824
3478
  return __awaiter(this, void 0, void 0, function () {
2825
- var stylePromises, templatePromise, _h, i_1, it_6, _j, _k, _l, _m, _o, domrenderComponents, componentKey, attribute, renderScript, render, constructor, constructorParam, script, param, instance, i, normalAttrMap, onCreate, createParam, script, applayTemplate, innerHTMLThisRandom, componentName, innerHTMLName, oninit, script, style, data, template_1;
3479
+ var componentKey, stylePromises, templatePromise, _h, i_1, it_6, _j, _k, _l, _m, _o, domrenderComponents, attribute, renderScript, render, constructor, constructorParam, script, param, instance, i, normalAttrMap, onCreate, createParam, script, applayTemplate, innerHTMLThisRandom, componentName, innerHTMLName, oninit, script, style, data, template_1;
2826
3480
  return __generator(this, function (_p) {
2827
3481
  switch (_p.label) {
2828
3482
  case 0:
3483
+ componentKey = rawSet.uuid;
2829
3484
  stylePromises = [];
2830
3485
  if (!(this.template && this.template.startsWith('lazy://'))) return [3 /*break*/, 2];
2831
3486
  return [4 /*yield*/, fetch(this.template.substring(6))];
@@ -2878,7 +3533,6 @@ var RawSet = /** @class */ (function () {
2878
3533
  obj.__domrender_components = {};
2879
3534
  }
2880
3535
  domrenderComponents = obj.__domrender_components;
2881
- componentKey = rawSet.uuid;
2882
3536
  attribute = DomUtils.getAttributeToObject(element);
2883
3537
  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;';
2884
3538
  render = Object.freeze({
@@ -3121,7 +3775,10 @@ var DomRenderProxy = /** @class */ (function () {
3121
3775
  };
3122
3776
  DomRenderProxy.prototype.initRender = function (target) {
3123
3777
  var _this = this;
3124
- var _a, _b, _c, _d, _e;
3778
+ var _a, _b, _c, _d;
3779
+ if (target instanceof Element) {
3780
+ target.innerHTML = target.innerHTML.replace(/@this@/g, 'this');
3781
+ }
3125
3782
  var onCreate = (_b = (_a = target).getAttribute) === null || _b === void 0 ? void 0 : _b.call(_a, RawSet.DR_ON_CREATE_ARGUMENTS_OPTIONNAME);
3126
3783
  var createParam = [];
3127
3784
  if (onCreate) {
@@ -3131,7 +3788,7 @@ var DomRenderProxy = /** @class */ (function () {
3131
3788
  }
3132
3789
  }
3133
3790
  (_d = (_c = this._domRender_proxy) === null || _c === void 0 ? void 0 : _c.onCreateRender) === null || _d === void 0 ? void 0 : _d.call.apply(_d, __spreadArray([_c], createParam, false));
3134
- (_e = target.innerHTML) !== null && _e !== void 0 ? _e : '';
3791
+ // const innerHTML = (target as any).innerHTML ?? '';
3135
3792
  this._targets.add(target);
3136
3793
  var rawSets = RawSet.checkPointCreates(target, this._domRender_proxy, this.config);
3137
3794
  // console.log('initRender -------rawSet', rawSets)
@@ -4120,6 +4777,21 @@ var AllUnCheckedValidatorArray = /** @class */ (function (_super) {
4120
4777
  return AllUnCheckedValidatorArray;
4121
4778
  }(ValidatorArray));
4122
4779
 
4780
+ var CountEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
4781
+ __extends(CountEqualsUnCheckedValidatorArray, _super);
4782
+ function CountEqualsUnCheckedValidatorArray(count, value, target, event, autoValid) {
4783
+ if (autoValid === void 0) { autoValid = true; }
4784
+ var _this = _super.call(this, value, target, event, autoValid) || this;
4785
+ _this.count = count;
4786
+ return _this;
4787
+ }
4788
+ CountEqualsUnCheckedValidatorArray.prototype.valid = function () {
4789
+ var _a;
4790
+ return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length === this.count;
4791
+ };
4792
+ return CountEqualsUnCheckedValidatorArray;
4793
+ }(ValidatorArray));
4794
+
4123
4795
  var CheckedValidator = /** @class */ (function (_super) {
4124
4796
  __extends(CheckedValidator, _super);
4125
4797
  function CheckedValidator(value, target, event, autoValid) {
@@ -4133,34 +4805,19 @@ var CheckedValidator = /** @class */ (function (_super) {
4133
4805
  return CheckedValidator;
4134
4806
  }(Validator));
4135
4807
 
4136
- var CountEqualsCheckedValidatorArray = /** @class */ (function (_super) {
4137
- __extends(CountEqualsCheckedValidatorArray, _super);
4138
- function CountEqualsCheckedValidatorArray(count, value, target, event, autoValid) {
4139
- if (autoValid === void 0) { autoValid = true; }
4140
- var _this = _super.call(this, value, target, event, autoValid) || this;
4141
- _this.count = count;
4142
- return _this;
4143
- }
4144
- CountEqualsCheckedValidatorArray.prototype.valid = function () {
4145
- var _a;
4146
- return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length === this.count;
4147
- };
4148
- return CountEqualsCheckedValidatorArray;
4149
- }(ValidatorArray));
4150
-
4151
- var CountEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
4152
- __extends(CountEqualsUnCheckedValidatorArray, _super);
4153
- function CountEqualsUnCheckedValidatorArray(count, value, target, event, autoValid) {
4808
+ var CountGreaterThanCheckedValidatorArray = /** @class */ (function (_super) {
4809
+ __extends(CountGreaterThanCheckedValidatorArray, _super);
4810
+ function CountGreaterThanCheckedValidatorArray(count, value, target, event, autoValid) {
4154
4811
  if (autoValid === void 0) { autoValid = true; }
4155
4812
  var _this = _super.call(this, value, target, event, autoValid) || this;
4156
4813
  _this.count = count;
4157
4814
  return _this;
4158
4815
  }
4159
- CountEqualsUnCheckedValidatorArray.prototype.valid = function () {
4816
+ CountGreaterThanCheckedValidatorArray.prototype.valid = function () {
4160
4817
  var _a;
4161
- return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length === this.count;
4818
+ return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length > this.count;
4162
4819
  };
4163
- return CountEqualsUnCheckedValidatorArray;
4820
+ return CountGreaterThanCheckedValidatorArray;
4164
4821
  }(ValidatorArray));
4165
4822
 
4166
4823
  var CountGreaterThanEqualsCheckedValidatorArray = /** @class */ (function (_super) {
@@ -4193,78 +4850,64 @@ var CountGreaterThanEqualsUnCheckedValidatorArray = /** @class */ (function (_su
4193
4850
  return CountGreaterThanEqualsUnCheckedValidatorArray;
4194
4851
  }(ValidatorArray));
4195
4852
 
4196
- var CountGreaterThanUnCheckedValidatorArray = /** @class */ (function (_super) {
4197
- __extends(CountGreaterThanUnCheckedValidatorArray, _super);
4198
- function CountGreaterThanUnCheckedValidatorArray(count, value, target, event, autoValid) {
4853
+ var CountLessThanEqualsCheckedValidatorArray = /** @class */ (function (_super) {
4854
+ __extends(CountLessThanEqualsCheckedValidatorArray, _super);
4855
+ function CountLessThanEqualsCheckedValidatorArray(count, value, target, event, autoValid) {
4199
4856
  if (autoValid === void 0) { autoValid = true; }
4200
4857
  var _this = _super.call(this, value, target, event, autoValid) || this;
4201
4858
  _this.count = count;
4202
4859
  return _this;
4203
4860
  }
4204
- CountGreaterThanUnCheckedValidatorArray.prototype.valid = function () {
4861
+ CountLessThanEqualsCheckedValidatorArray.prototype.valid = function () {
4205
4862
  var _a;
4206
- return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length > this.count;
4863
+ return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length <= this.count;
4207
4864
  };
4208
- return CountGreaterThanUnCheckedValidatorArray;
4865
+ return CountLessThanEqualsCheckedValidatorArray;
4209
4866
  }(ValidatorArray));
4210
4867
 
4211
- var CountGreaterThanCheckedValidatorArray = /** @class */ (function (_super) {
4212
- __extends(CountGreaterThanCheckedValidatorArray, _super);
4213
- function CountGreaterThanCheckedValidatorArray(count, value, target, event, autoValid) {
4868
+ var CountLessThanCheckedValidatorArray = /** @class */ (function (_super) {
4869
+ __extends(CountLessThanCheckedValidatorArray, _super);
4870
+ function CountLessThanCheckedValidatorArray(count, value, target, event, autoValid) {
4214
4871
  if (autoValid === void 0) { autoValid = true; }
4215
4872
  var _this = _super.call(this, value, target, event, autoValid) || this;
4216
4873
  _this.count = count;
4217
4874
  return _this;
4218
4875
  }
4219
- CountGreaterThanCheckedValidatorArray.prototype.valid = function () {
4876
+ CountLessThanCheckedValidatorArray.prototype.valid = function () {
4220
4877
  var _a;
4221
- return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length > this.count;
4878
+ return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length < this.count;
4222
4879
  };
4223
- return CountGreaterThanCheckedValidatorArray;
4880
+ return CountLessThanCheckedValidatorArray;
4224
4881
  }(ValidatorArray));
4225
4882
 
4226
- var CountLessThanCheckedValidatorArray = /** @class */ (function (_super) {
4227
- __extends(CountLessThanCheckedValidatorArray, _super);
4228
- function CountLessThanCheckedValidatorArray(count, value, target, event, autoValid) {
4883
+ var CountLessThanEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
4884
+ __extends(CountLessThanEqualsUnCheckedValidatorArray, _super);
4885
+ function CountLessThanEqualsUnCheckedValidatorArray(count, value, target, event, autoValid) {
4229
4886
  if (autoValid === void 0) { autoValid = true; }
4230
4887
  var _this = _super.call(this, value, target, event, autoValid) || this;
4231
4888
  _this.count = count;
4232
4889
  return _this;
4233
4890
  }
4234
- CountLessThanCheckedValidatorArray.prototype.valid = function () {
4891
+ CountLessThanEqualsUnCheckedValidatorArray.prototype.valid = function () {
4235
4892
  var _a;
4236
- return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length < this.count;
4893
+ return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length <= this.count;
4237
4894
  };
4238
- return CountLessThanCheckedValidatorArray;
4895
+ return CountLessThanEqualsUnCheckedValidatorArray;
4239
4896
  }(ValidatorArray));
4240
4897
 
4241
- var EmptyValidator = /** @class */ (function (_super) {
4242
- __extends(EmptyValidator, _super);
4243
- function EmptyValidator(value, target, event, autoValid) {
4244
- if (autoValid === void 0) { autoValid = true; }
4245
- return _super.call(this, value, target, event, autoValid) || this;
4246
- }
4247
- EmptyValidator.prototype.valid = function () {
4248
- var _a;
4249
- var value = this.value;
4250
- return value === undefined || value === null || ((_a = value === null || value === void 0 ? void 0 : value.length) !== null && _a !== void 0 ? _a : 0) <= 0;
4251
- };
4252
- return EmptyValidator;
4253
- }(Validator));
4254
-
4255
- var CountLessThanUnCheckedValidatorArray = /** @class */ (function (_super) {
4256
- __extends(CountLessThanUnCheckedValidatorArray, _super);
4257
- function CountLessThanUnCheckedValidatorArray(count, value, target, event, autoValid) {
4898
+ var CountEqualsCheckedValidatorArray = /** @class */ (function (_super) {
4899
+ __extends(CountEqualsCheckedValidatorArray, _super);
4900
+ function CountEqualsCheckedValidatorArray(count, value, target, event, autoValid) {
4258
4901
  if (autoValid === void 0) { autoValid = true; }
4259
4902
  var _this = _super.call(this, value, target, event, autoValid) || this;
4260
4903
  _this.count = count;
4261
4904
  return _this;
4262
4905
  }
4263
- CountLessThanUnCheckedValidatorArray.prototype.valid = function () {
4906
+ CountEqualsCheckedValidatorArray.prototype.valid = function () {
4264
4907
  var _a;
4265
- return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length < this.count;
4908
+ return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length === this.count;
4266
4909
  };
4267
- return CountLessThanUnCheckedValidatorArray;
4910
+ return CountEqualsCheckedValidatorArray;
4268
4911
  }(ValidatorArray));
4269
4912
 
4270
4913
  var CountUnCheckedValidatorArray = /** @class */ (function (_super) {
@@ -4282,6 +4925,21 @@ var CountUnCheckedValidatorArray = /** @class */ (function (_super) {
4282
4925
  return CountUnCheckedValidatorArray;
4283
4926
  }(ValidatorArray));
4284
4927
 
4928
+ var CountGreaterThanUnCheckedValidatorArray = /** @class */ (function (_super) {
4929
+ __extends(CountGreaterThanUnCheckedValidatorArray, _super);
4930
+ function CountGreaterThanUnCheckedValidatorArray(count, value, target, event, autoValid) {
4931
+ if (autoValid === void 0) { autoValid = true; }
4932
+ var _this = _super.call(this, value, target, event, autoValid) || this;
4933
+ _this.count = count;
4934
+ return _this;
4935
+ }
4936
+ CountGreaterThanUnCheckedValidatorArray.prototype.valid = function () {
4937
+ var _a;
4938
+ return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length > this.count;
4939
+ };
4940
+ return CountGreaterThanUnCheckedValidatorArray;
4941
+ }(ValidatorArray));
4942
+
4285
4943
  var ExcludeCheckedValidatorArray = /** @class */ (function (_super) {
4286
4944
  __extends(ExcludeCheckedValidatorArray, _super);
4287
4945
  function ExcludeCheckedValidatorArray(include, allRequired, value, target, event, autoValid) {
@@ -4304,6 +4962,42 @@ var ExcludeCheckedValidatorArray = /** @class */ (function (_super) {
4304
4962
  return ExcludeCheckedValidatorArray;
4305
4963
  }(ValidatorArray));
4306
4964
 
4965
+ var EmptyValidator = /** @class */ (function (_super) {
4966
+ __extends(EmptyValidator, _super);
4967
+ function EmptyValidator(value, target, event, autoValid) {
4968
+ if (autoValid === void 0) { autoValid = true; }
4969
+ return _super.call(this, value, target, event, autoValid) || this;
4970
+ }
4971
+ EmptyValidator.prototype.valid = function () {
4972
+ var _a;
4973
+ var value = this.value;
4974
+ return value === undefined || value === null || ((_a = value === null || value === void 0 ? void 0 : value.length) !== null && _a !== void 0 ? _a : 0) <= 0;
4975
+ };
4976
+ return EmptyValidator;
4977
+ }(Validator));
4978
+
4979
+ var IncludeCheckedValidatorArray = /** @class */ (function (_super) {
4980
+ __extends(IncludeCheckedValidatorArray, _super);
4981
+ function IncludeCheckedValidatorArray(include, allRequired, value, target, event, autoValid) {
4982
+ if (allRequired === void 0) { allRequired = false; }
4983
+ if (autoValid === void 0) { autoValid = true; }
4984
+ var _this = _super.call(this, value, target, event, autoValid) || this;
4985
+ _this.include = include;
4986
+ _this.allRequired = allRequired;
4987
+ return _this;
4988
+ }
4989
+ IncludeCheckedValidatorArray.prototype.valid = function () {
4990
+ var _this = this;
4991
+ var _a;
4992
+ var valus = (_a = this.value) !== null && _a !== void 0 ? _a : [];
4993
+ var checkedValue = valus.filter(function (it) { return it.checked; }).map(function (it) { return it.value; });
4994
+ return checkedValue.length > 0 &&
4995
+ (!(checkedValue.filter(function (it) { return !_this.include.includes(it); }).length > 0)) &&
4996
+ (this.allRequired ? checkedValue.filter(function (it) { return _this.include.includes(it); }).length === this.include.length : true);
4997
+ };
4998
+ return IncludeCheckedValidatorArray;
4999
+ }(ValidatorArray));
5000
+
4307
5001
  var MultipleValidator = /** @class */ (function (_super) {
4308
5002
  __extends(MultipleValidator, _super);
4309
5003
  function MultipleValidator(validators, value, target, event, autoValid) {
@@ -4333,28 +5027,6 @@ var MultipleValidator = /** @class */ (function (_super) {
4333
5027
  return MultipleValidator;
4334
5028
  }(Validator));
4335
5029
 
4336
- var IncludeCheckedValidatorArray = /** @class */ (function (_super) {
4337
- __extends(IncludeCheckedValidatorArray, _super);
4338
- function IncludeCheckedValidatorArray(include, allRequired, value, target, event, autoValid) {
4339
- if (allRequired === void 0) { allRequired = false; }
4340
- if (autoValid === void 0) { autoValid = true; }
4341
- var _this = _super.call(this, value, target, event, autoValid) || this;
4342
- _this.include = include;
4343
- _this.allRequired = allRequired;
4344
- return _this;
4345
- }
4346
- IncludeCheckedValidatorArray.prototype.valid = function () {
4347
- var _this = this;
4348
- var _a;
4349
- var valus = (_a = this.value) !== null && _a !== void 0 ? _a : [];
4350
- var checkedValue = valus.filter(function (it) { return it.checked; }).map(function (it) { return it.value; });
4351
- return checkedValue.length > 0 &&
4352
- (!(checkedValue.filter(function (it) { return !_this.include.includes(it); }).length > 0)) &&
4353
- (this.allRequired ? checkedValue.filter(function (it) { return _this.include.includes(it); }).length === this.include.length : true);
4354
- };
4355
- return IncludeCheckedValidatorArray;
4356
- }(ValidatorArray));
4357
-
4358
5030
  var FormValidator = /** @class */ (function (_super) {
4359
5031
  __extends(FormValidator, _super);
4360
5032
  function FormValidator(target, event, autoValid) {
@@ -4388,36 +5060,6 @@ var NotEmptyValidator = /** @class */ (function (_super) {
4388
5060
  return NotEmptyValidator;
4389
5061
  }(Validator));
4390
5062
 
4391
- var CountLessThanEqualsCheckedValidatorArray = /** @class */ (function (_super) {
4392
- __extends(CountLessThanEqualsCheckedValidatorArray, _super);
4393
- function CountLessThanEqualsCheckedValidatorArray(count, value, target, event, autoValid) {
4394
- if (autoValid === void 0) { autoValid = true; }
4395
- var _this = _super.call(this, value, target, event, autoValid) || this;
4396
- _this.count = count;
4397
- return _this;
4398
- }
4399
- CountLessThanEqualsCheckedValidatorArray.prototype.valid = function () {
4400
- var _a;
4401
- return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return it.checked; }).length <= this.count;
4402
- };
4403
- return CountLessThanEqualsCheckedValidatorArray;
4404
- }(ValidatorArray));
4405
-
4406
- var CountLessThanEqualsUnCheckedValidatorArray = /** @class */ (function (_super) {
4407
- __extends(CountLessThanEqualsUnCheckedValidatorArray, _super);
4408
- function CountLessThanEqualsUnCheckedValidatorArray(count, value, target, event, autoValid) {
4409
- if (autoValid === void 0) { autoValid = true; }
4410
- var _this = _super.call(this, value, target, event, autoValid) || this;
4411
- _this.count = count;
4412
- return _this;
4413
- }
4414
- CountLessThanEqualsUnCheckedValidatorArray.prototype.valid = function () {
4415
- var _a;
4416
- return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length <= this.count;
4417
- };
4418
- return CountLessThanEqualsUnCheckedValidatorArray;
4419
- }(ValidatorArray));
4420
-
4421
5063
  var NotRegExpTestValidator = /** @class */ (function (_super) {
4422
5064
  __extends(NotRegExpTestValidator, _super);
4423
5065
  function NotRegExpTestValidator(regexp, value, target, event, autoValid) {
@@ -4440,18 +5082,6 @@ var NotRegExpTestValidator = /** @class */ (function (_super) {
4440
5082
  return NotRegExpTestValidator;
4441
5083
  }(Validator));
4442
5084
 
4443
- var PassValidator = /** @class */ (function (_super) {
4444
- __extends(PassValidator, _super);
4445
- function PassValidator(value, target, event, autoValid) {
4446
- if (autoValid === void 0) { autoValid = true; }
4447
- return _super.call(this, value, target, event, autoValid) || this;
4448
- }
4449
- PassValidator.prototype.valid = function () {
4450
- return true;
4451
- };
4452
- return PassValidator;
4453
- }(Validator));
4454
-
4455
5085
  var RegExpTestValidator = /** @class */ (function (_super) {
4456
5086
  __extends(RegExpTestValidator, _super);
4457
5087
  function RegExpTestValidator(regexp, value, target, event, autoValid) {
@@ -4475,17 +5105,32 @@ var RegExpTestValidator = /** @class */ (function (_super) {
4475
5105
  return RegExpTestValidator;
4476
5106
  }(Validator));
4477
5107
 
4478
- var UnCheckedValidator = /** @class */ (function (_super) {
4479
- __extends(UnCheckedValidator, _super);
4480
- function UnCheckedValidator(value, target, event, autoValid) {
5108
+ var ValidValidator = /** @class */ (function (_super) {
5109
+ __extends(ValidValidator, _super);
5110
+ function ValidValidator(validCallBack, value, target, event, autoValid) {
5111
+ if (autoValid === void 0) { autoValid = true; }
5112
+ var _this = _super.call(this, value, target, event, autoValid) || this;
5113
+ _this.validCallBack = validCallBack;
5114
+ return _this;
5115
+ }
5116
+ ValidValidator.prototype.valid = function (value, target, event) {
5117
+ return this.validCallBack(value, target, event);
5118
+ };
5119
+ return ValidValidator;
5120
+ }(Validator));
5121
+
5122
+ var RequiredValidator = /** @class */ (function (_super) {
5123
+ __extends(RequiredValidator, _super);
5124
+ function RequiredValidator(value, target, event, autoValid) {
4481
5125
  if (autoValid === void 0) { autoValid = true; }
4482
5126
  return _super.call(this, value, target, event, autoValid) || this;
4483
5127
  }
4484
- UnCheckedValidator.prototype.valid = function () {
4485
- var _a, _b;
4486
- return !((_b = (_a = this.getTarget()) === null || _a === void 0 ? void 0 : _a.checked) !== null && _b !== void 0 ? _b : false);
5128
+ RequiredValidator.prototype.valid = function () {
5129
+ var value = this.value;
5130
+ // console.log('required', value, value !== undefined && value !== null)
5131
+ return value !== undefined && value !== null;
4487
5132
  };
4488
- return UnCheckedValidator;
5133
+ return RequiredValidator;
4489
5134
  }(Validator));
4490
5135
 
4491
5136
  var ValidMultipleValidator = /** @class */ (function (_super) {
@@ -4503,34 +5148,48 @@ var ValidMultipleValidator = /** @class */ (function (_super) {
4503
5148
  return ValidMultipleValidator;
4504
5149
  }(MultipleValidator));
4505
5150
 
4506
- var RequiredValidator = /** @class */ (function (_super) {
4507
- __extends(RequiredValidator, _super);
4508
- function RequiredValidator(value, target, event, autoValid) {
5151
+ var UnCheckedValidator = /** @class */ (function (_super) {
5152
+ __extends(UnCheckedValidator, _super);
5153
+ function UnCheckedValidator(value, target, event, autoValid) {
4509
5154
  if (autoValid === void 0) { autoValid = true; }
4510
5155
  return _super.call(this, value, target, event, autoValid) || this;
4511
5156
  }
4512
- RequiredValidator.prototype.valid = function () {
4513
- var value = this.value;
4514
- // console.log('required', value, value !== undefined && value !== null)
4515
- return value !== undefined && value !== null;
5157
+ UnCheckedValidator.prototype.valid = function () {
5158
+ var _a, _b;
5159
+ return !((_b = (_a = this.getTarget()) === null || _a === void 0 ? void 0 : _a.checked) !== null && _b !== void 0 ? _b : false);
4516
5160
  };
4517
- return RequiredValidator;
5161
+ return UnCheckedValidator;
4518
5162
  }(Validator));
4519
5163
 
4520
- var ValidValidator = /** @class */ (function (_super) {
4521
- __extends(ValidValidator, _super);
4522
- function ValidValidator(validCallBack, value, target, event, autoValid) {
5164
+ var ValueEqualsValidator = /** @class */ (function (_super) {
5165
+ __extends(ValueEqualsValidator, _super);
5166
+ function ValueEqualsValidator(equalsValue, value, target, event, autoValid) {
4523
5167
  if (autoValid === void 0) { autoValid = true; }
4524
5168
  var _this = _super.call(this, value, target, event, autoValid) || this;
4525
- _this.validCallBack = validCallBack;
5169
+ _this.equalsValue = equalsValue;
4526
5170
  return _this;
4527
5171
  }
4528
- ValidValidator.prototype.valid = function (value, target, event) {
4529
- return this.validCallBack(value, target, event);
5172
+ ValueEqualsValidator.prototype.valid = function () {
5173
+ return this.value === this.equalsValue;
4530
5174
  };
4531
- return ValidValidator;
5175
+ return ValueEqualsValidator;
4532
5176
  }(Validator));
4533
5177
 
5178
+ var CountLessThanUnCheckedValidatorArray = /** @class */ (function (_super) {
5179
+ __extends(CountLessThanUnCheckedValidatorArray, _super);
5180
+ function CountLessThanUnCheckedValidatorArray(count, value, target, event, autoValid) {
5181
+ if (autoValid === void 0) { autoValid = true; }
5182
+ var _this = _super.call(this, value, target, event, autoValid) || this;
5183
+ _this.count = count;
5184
+ return _this;
5185
+ }
5186
+ CountLessThanUnCheckedValidatorArray.prototype.valid = function () {
5187
+ var _a;
5188
+ return ((_a = this.value) !== null && _a !== void 0 ? _a : []).filter(function (it) { return !it.checked; }).length < this.count;
5189
+ };
5190
+ return CountLessThanUnCheckedValidatorArray;
5191
+ }(ValidatorArray));
5192
+
4534
5193
  var ValidValidatorArray = /** @class */ (function (_super) {
4535
5194
  __extends(ValidValidatorArray, _super);
4536
5195
  function ValidValidatorArray(validCallBack, value, target, event, autoValid) {
@@ -4545,6 +5204,18 @@ var ValidValidatorArray = /** @class */ (function (_super) {
4545
5204
  return ValidValidatorArray;
4546
5205
  }(ValidatorArray));
4547
5206
 
5207
+ var PassValidator = /** @class */ (function (_super) {
5208
+ __extends(PassValidator, _super);
5209
+ function PassValidator(value, target, event, autoValid) {
5210
+ if (autoValid === void 0) { autoValid = true; }
5211
+ return _super.call(this, value, target, event, autoValid) || this;
5212
+ }
5213
+ PassValidator.prototype.valid = function () {
5214
+ return true;
5215
+ };
5216
+ return PassValidator;
5217
+ }(Validator));
5218
+
4548
5219
  var ValueNotEqualsValidator = /** @class */ (function (_super) {
4549
5220
  __extends(ValueNotEqualsValidator, _super);
4550
5221
  function ValueNotEqualsValidator(equalsValue, value, target, event, autoValid) {
@@ -4559,66 +5230,6 @@ var ValueNotEqualsValidator = /** @class */ (function (_super) {
4559
5230
  return ValueNotEqualsValidator;
4560
5231
  }(Validator));
4561
5232
 
4562
- var ValueEqualsValidator = /** @class */ (function (_super) {
4563
- __extends(ValueEqualsValidator, _super);
4564
- function ValueEqualsValidator(equalsValue, value, target, event, autoValid) {
4565
- if (autoValid === void 0) { autoValid = true; }
4566
- var _this = _super.call(this, value, target, event, autoValid) || this;
4567
- _this.equalsValue = equalsValue;
4568
- return _this;
4569
- }
4570
- ValueEqualsValidator.prototype.valid = function () {
4571
- return this.value === this.equalsValue;
4572
- };
4573
- return ValueEqualsValidator;
4574
- }(Validator));
4575
-
4576
- var ClipBoardUtils = /** @class */ (function () {
4577
- function ClipBoardUtils() {
4578
- }
4579
- ClipBoardUtils.readText = function (clipboard) {
4580
- if (clipboard === void 0) { clipboard = navigator.clipboard; }
4581
- return clipboard.readText();
4582
- };
4583
- ClipBoardUtils.read = function (clipboard) {
4584
- if (clipboard === void 0) { clipboard = navigator.clipboard; }
4585
- return clipboard.read();
4586
- };
4587
- ClipBoardUtils.writeText = function (data, clipboard) {
4588
- if (clipboard === void 0) { clipboard = navigator.clipboard; }
4589
- return clipboard.writeText(data);
4590
- };
4591
- ClipBoardUtils.write = function (data, clipboard) {
4592
- if (clipboard === void 0) { clipboard = navigator.clipboard; }
4593
- return clipboard.write(data);
4594
- };
4595
- return ClipBoardUtils;
4596
- }());
4597
-
4598
- var NodeUtils = /** @class */ (function () {
4599
- function NodeUtils() {
4600
- }
4601
- // https://stackoverflow.com/questions/3955229/remove-all-child-elements-of-a-dom-node-in-javascript
4602
- NodeUtils.removeAllChildNode = function (node) {
4603
- while (node === null || node === void 0 ? void 0 : node.firstChild) {
4604
- node.firstChild.remove();
4605
- }
4606
- };
4607
- NodeUtils.appendChild = function (parentNode, childNode) {
4608
- return parentNode.appendChild(childNode);
4609
- };
4610
- NodeUtils.replaceNode = function (targetNode, newNode) {
4611
- var _a;
4612
- // console.log('repalceNode', targetNode, newNode, targetNode.parentNode)
4613
- return (_a = targetNode.parentNode) === null || _a === void 0 ? void 0 : _a.replaceChild(newNode, targetNode);
4614
- };
4615
- NodeUtils.addNode = function (targetNode, newNode) {
4616
- var _a;
4617
- return (_a = targetNode.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(newNode, targetNode.nextSibling);
4618
- };
4619
- return NodeUtils;
4620
- }());
4621
-
4622
5233
  var StorageUtils = /** @class */ (function () {
4623
5234
  function StorageUtils() {
4624
5235
  }
@@ -4628,17 +5239,34 @@ var StorageUtils = /** @class */ (function () {
4628
5239
  }
4629
5240
  window.localStorage.setItem(k, v);
4630
5241
  };
5242
+ StorageUtils.setSessionStorageItem = function (k, v, window) {
5243
+ if (typeof v === 'object') {
5244
+ v = JSON.stringify(v);
5245
+ }
5246
+ window.sessionStorage.setItem(k, v);
5247
+ };
4631
5248
  StorageUtils.getLocalStorageItem = function (k, window) {
4632
5249
  return window.localStorage.getItem(k);
4633
5250
  };
5251
+ StorageUtils.getSessionStorageItem = function (k, window) {
5252
+ return window.sessionStorage.getItem(k);
5253
+ };
4634
5254
  StorageUtils.cutLocalStorageItem = function (k, window) {
4635
5255
  var data = StorageUtils.getLocalStorageItem(k, window);
4636
5256
  StorageUtils.removeLocalStorageItem(k, window);
4637
5257
  return data;
4638
5258
  };
5259
+ StorageUtils.cutSessionStorageItem = function (k, window) {
5260
+ var data = StorageUtils.getSessionStorageItem(k, window);
5261
+ StorageUtils.removeSessionStorageItem(k, window);
5262
+ return data;
5263
+ };
4639
5264
  StorageUtils.removeLocalStorageItem = function (k, window) {
4640
5265
  return window.localStorage.removeItem(k);
4641
5266
  };
5267
+ StorageUtils.removeSessionStorageItem = function (k, window) {
5268
+ return window.sessionStorage.removeItem(k);
5269
+ };
4642
5270
  StorageUtils.getLocalStorageJsonItem = function (k, window) {
4643
5271
  var item = window.localStorage.getItem(k);
4644
5272
  if (item) {
@@ -4653,17 +5281,85 @@ var StorageUtils = /** @class */ (function () {
4653
5281
  return undefined;
4654
5282
  }
4655
5283
  };
5284
+ StorageUtils.getSessionStorageJsonItem = function (k, window) {
5285
+ var item = window.sessionStorage.getItem(k);
5286
+ if (item) {
5287
+ try {
5288
+ return JSON.parse(item);
5289
+ }
5290
+ catch (e) {
5291
+ return undefined;
5292
+ }
5293
+ }
5294
+ else {
5295
+ return undefined;
5296
+ }
5297
+ };
4656
5298
  StorageUtils.cutLocalStorageJsonItem = function (k, window) {
4657
5299
  var item = StorageUtils.getLocalStorageJsonItem(k, window);
4658
5300
  StorageUtils.removeLocalStorageItem(k, window);
4659
5301
  return item;
4660
5302
  };
5303
+ StorageUtils.cutSessionStorageJsonItem = function (k, window) {
5304
+ var item = StorageUtils.getSessionStorageJsonItem(k, window);
5305
+ StorageUtils.removeSessionStorageItem(k, window);
5306
+ return item;
5307
+ };
4661
5308
  StorageUtils.clearLocalStorage = function (window) {
4662
5309
  window.localStorage.clear();
4663
5310
  };
5311
+ StorageUtils.clearSessionStorage = function (window) {
5312
+ window.sessionStorage.clear();
5313
+ };
4664
5314
  return StorageUtils;
4665
5315
  }());
4666
5316
 
5317
+ var NodeUtils = /** @class */ (function () {
5318
+ function NodeUtils() {
5319
+ }
5320
+ // https://stackoverflow.com/questions/3955229/remove-all-child-elements-of-a-dom-node-in-javascript
5321
+ NodeUtils.removeAllChildNode = function (node) {
5322
+ while (node === null || node === void 0 ? void 0 : node.firstChild) {
5323
+ node.firstChild.remove();
5324
+ }
5325
+ };
5326
+ NodeUtils.appendChild = function (parentNode, childNode) {
5327
+ return parentNode.appendChild(childNode);
5328
+ };
5329
+ NodeUtils.replaceNode = function (targetNode, newNode) {
5330
+ var _a;
5331
+ // console.log('repalceNode', targetNode, newNode, targetNode.parentNode)
5332
+ return (_a = targetNode.parentNode) === null || _a === void 0 ? void 0 : _a.replaceChild(newNode, targetNode);
5333
+ };
5334
+ NodeUtils.addNode = function (targetNode, newNode) {
5335
+ var _a;
5336
+ return (_a = targetNode.parentNode) === null || _a === void 0 ? void 0 : _a.insertBefore(newNode, targetNode.nextSibling);
5337
+ };
5338
+ return NodeUtils;
5339
+ }());
5340
+
5341
+ var ClipBoardUtils = /** @class */ (function () {
5342
+ function ClipBoardUtils() {
5343
+ }
5344
+ ClipBoardUtils.readText = function (clipboard) {
5345
+ if (clipboard === void 0) { clipboard = navigator.clipboard; }
5346
+ return clipboard.readText();
5347
+ };
5348
+ ClipBoardUtils.read = function (clipboard) {
5349
+ if (clipboard === void 0) { clipboard = navigator.clipboard; }
5350
+ return clipboard.read();
5351
+ };
5352
+ ClipBoardUtils.writeText = function (data, clipboard) {
5353
+ if (clipboard === void 0) { clipboard = navigator.clipboard; }
5354
+ return clipboard.writeText(data);
5355
+ };
5356
+ ClipBoardUtils.write = function (data, clipboard) {
5357
+ if (clipboard === void 0) { clipboard = navigator.clipboard; }
5358
+ return clipboard.write(data);
5359
+ };
5360
+ return ClipBoardUtils;
5361
+ }());
5362
+
4667
5363
  exports.AllCheckedValidatorArray = AllCheckedValidatorArray;
4668
5364
  exports.AllUnCheckedValidatorArray = AllUnCheckedValidatorArray;
4669
5365
  exports.Appender = Appender;