@whitesev/domutils 1.5.6 → 1.5.8
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/index.amd.js +166 -41
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +166 -41
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +166 -41
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +166 -41
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +166 -41
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +166 -41
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/DOMUtils.d.ts +0 -5
- package/dist/types/src/DOMUtilsCommonUtils.d.ts +5 -0
- package/dist/types/src/DOMUtilsEvent.d.ts +47 -2
- package/package.json +1 -1
- package/src/DOMUtils.ts +25 -33
- package/src/DOMUtilsCommonUtils.ts +7 -0
- package/src/DOMUtilsEvent.ts +178 -13
package/dist/index.system.js
CHANGED
|
@@ -463,6 +463,13 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
463
463
|
globalThis.clearInterval(timeId);
|
|
464
464
|
}
|
|
465
465
|
},
|
|
466
|
+
/**
|
|
467
|
+
* 判断是否是元素列表
|
|
468
|
+
* @param $ele
|
|
469
|
+
*/
|
|
470
|
+
isNodeList($ele) {
|
|
471
|
+
return Array.isArray($ele) || $ele instanceof NodeList;
|
|
472
|
+
},
|
|
466
473
|
};
|
|
467
474
|
|
|
468
475
|
/* 数据 */
|
|
@@ -589,12 +596,12 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
589
596
|
: elementItem;
|
|
590
597
|
let findValue = selectorList.find((selectorItem) => {
|
|
591
598
|
// 判断目标元素是否匹配选择器
|
|
592
|
-
if (
|
|
599
|
+
if (DOMUtilsContext.matches(eventTarget, selectorItem)) {
|
|
593
600
|
/* 当前目标可以被selector所匹配到 */
|
|
594
601
|
return true;
|
|
595
602
|
}
|
|
596
603
|
/* 在上层与主元素之间寻找可以被selector所匹配到的 */
|
|
597
|
-
let $closestMatches =
|
|
604
|
+
let $closestMatches = DOMUtilsContext.closest(eventTarget, selectorItem);
|
|
598
605
|
if ($closestMatches && totalParent?.contains($closestMatches)) {
|
|
599
606
|
eventTarget = $closestMatches;
|
|
600
607
|
return true;
|
|
@@ -976,7 +983,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
976
983
|
if (element == null) {
|
|
977
984
|
return;
|
|
978
985
|
}
|
|
979
|
-
if (isNodeList(element)) {
|
|
986
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
980
987
|
// 设置
|
|
981
988
|
element.forEach(($ele) => {
|
|
982
989
|
DOMUtilsContext.click($ele, handler, details, useDispatchToTriggerEvent);
|
|
@@ -1012,7 +1019,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
1012
1019
|
if (element == null) {
|
|
1013
1020
|
return;
|
|
1014
1021
|
}
|
|
1015
|
-
if (isNodeList(element)) {
|
|
1022
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1016
1023
|
// 设置
|
|
1017
1024
|
element.forEach(($ele) => {
|
|
1018
1025
|
DOMUtilsContext.focus($ele, handler, details, useDispatchToTriggerEvent);
|
|
@@ -1048,7 +1055,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
1048
1055
|
if (element == null) {
|
|
1049
1056
|
return;
|
|
1050
1057
|
}
|
|
1051
|
-
if (isNodeList(element)) {
|
|
1058
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1052
1059
|
// 设置
|
|
1053
1060
|
element.forEach(($ele) => {
|
|
1054
1061
|
DOMUtilsContext.focus($ele, handler, details, useDispatchToTriggerEvent);
|
|
@@ -1084,7 +1091,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
1084
1091
|
if (element == null) {
|
|
1085
1092
|
return;
|
|
1086
1093
|
}
|
|
1087
|
-
if (isNodeList(element)) {
|
|
1094
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1088
1095
|
// 设置
|
|
1089
1096
|
element.forEach(($ele) => {
|
|
1090
1097
|
DOMUtilsContext.hover($ele, handler, option);
|
|
@@ -1117,7 +1124,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
1117
1124
|
if (typeof element === "string") {
|
|
1118
1125
|
element = DOMUtilsContext.selectorAll(element);
|
|
1119
1126
|
}
|
|
1120
|
-
if (isNodeList(element)) {
|
|
1127
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1121
1128
|
// 设置
|
|
1122
1129
|
element.forEach(($ele) => {
|
|
1123
1130
|
DOMUtilsContext.keyup($ele, handler, option);
|
|
@@ -1149,7 +1156,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
1149
1156
|
if (typeof element === "string") {
|
|
1150
1157
|
element = DOMUtilsContext.selectorAll(element);
|
|
1151
1158
|
}
|
|
1152
|
-
if (isNodeList(element)) {
|
|
1159
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1153
1160
|
// 设置
|
|
1154
1161
|
element.forEach(($ele) => {
|
|
1155
1162
|
DOMUtilsContext.keydown($ele, handler, option);
|
|
@@ -1181,7 +1188,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
1181
1188
|
if (typeof element === "string") {
|
|
1182
1189
|
element = DOMUtilsContext.selectorAll(element);
|
|
1183
1190
|
}
|
|
1184
|
-
if (isNodeList(element)) {
|
|
1191
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1185
1192
|
// 设置
|
|
1186
1193
|
element.forEach(($ele) => {
|
|
1187
1194
|
DOMUtilsContext.keypress($ele, handler, option);
|
|
@@ -1335,21 +1342,139 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
1335
1342
|
return Array.from(context.windowApi.document.querySelectorAll(selector));
|
|
1336
1343
|
}
|
|
1337
1344
|
}
|
|
1345
|
+
/**
|
|
1346
|
+
* 匹配元素,可使用以下的额外语法
|
|
1347
|
+
*
|
|
1348
|
+
* + :contains([text]) 作用: 找到包含指定文本内容的指定元素
|
|
1349
|
+
* + :empty 作用:找到既没有文本内容也没有子元素的指定元素
|
|
1350
|
+
* + :regexp([text]) 作用: 找到符合正则表达式的内容的指定元素
|
|
1351
|
+
* @param $el 元素
|
|
1352
|
+
* @param selector 选择器
|
|
1353
|
+
* @example
|
|
1354
|
+
* DOMUtils.matches("div:contains('测试')")
|
|
1355
|
+
* > true
|
|
1356
|
+
* @example
|
|
1357
|
+
* DOMUtils.matches("div:empty")
|
|
1358
|
+
* > true
|
|
1359
|
+
* @example
|
|
1360
|
+
* DOMUtils.matches("div:regexp('^xxxx$')")
|
|
1361
|
+
* > true
|
|
1362
|
+
* @example
|
|
1363
|
+
* DOMUtils.matches("div:regexp(/^xxx/ig)")
|
|
1364
|
+
* > false
|
|
1365
|
+
*/
|
|
1366
|
+
matches($el, selector) {
|
|
1367
|
+
selector = selector.trim();
|
|
1368
|
+
if ($el == null) {
|
|
1369
|
+
return false;
|
|
1370
|
+
}
|
|
1371
|
+
if (selector.match(/[^\s]{1}:empty$/gi)) {
|
|
1372
|
+
// empty 语法
|
|
1373
|
+
selector = selector.replace(/:empty$/gi, "");
|
|
1374
|
+
return $el.matches(selector) && $el?.innerHTML?.trim() === "";
|
|
1375
|
+
}
|
|
1376
|
+
else if (selector.match(/[^\s]{1}:contains\("(.*)"\)$/i) ||
|
|
1377
|
+
selector.match(/[^\s]{1}:contains\('(.*)'\)$/i)) {
|
|
1378
|
+
// contains 语法
|
|
1379
|
+
let textMatch = selector.match(/:contains\(("|')(.*)("|')\)$/i);
|
|
1380
|
+
let text = textMatch[2];
|
|
1381
|
+
selector = selector.replace(/:contains\(("|')(.*)("|')\)$/gi, "");
|
|
1382
|
+
// @ts-ignore
|
|
1383
|
+
let content = $el?.textContent || $el?.innerText;
|
|
1384
|
+
if (typeof content !== "string") {
|
|
1385
|
+
content = "";
|
|
1386
|
+
}
|
|
1387
|
+
return $el.matches(selector) && content?.includes(text);
|
|
1388
|
+
}
|
|
1389
|
+
else if (selector.match(/[^\s]{1}:regexp\("(.*)"\)$/i) ||
|
|
1390
|
+
selector.match(/[^\s]{1}:regexp\('(.*)'\)$/i)) {
|
|
1391
|
+
// regexp 语法
|
|
1392
|
+
let textMatch = selector.match(/:regexp\(("|')(.*)("|')\)$/i);
|
|
1393
|
+
let pattern = textMatch[2];
|
|
1394
|
+
let flagMatch = pattern.match(/("|'),[\s]*("|')([igm]{0,3})$/i);
|
|
1395
|
+
let flags = "";
|
|
1396
|
+
if (flagMatch) {
|
|
1397
|
+
pattern = pattern.replace(/("|'),[\s]*("|')([igm]{0,3})$/gi, "");
|
|
1398
|
+
flags = flagMatch[3];
|
|
1399
|
+
}
|
|
1400
|
+
let regexp = new RegExp(pattern, flags);
|
|
1401
|
+
selector = selector.replace(/:regexp\(("|')(.*)("|')\)$/gi, "");
|
|
1402
|
+
// @ts-ignore
|
|
1403
|
+
let content = $el?.textContent || $el?.innerText;
|
|
1404
|
+
if (typeof content !== "string") {
|
|
1405
|
+
content = "";
|
|
1406
|
+
}
|
|
1407
|
+
return $el.matches(selector) && Boolean(content?.match(regexp));
|
|
1408
|
+
}
|
|
1409
|
+
else {
|
|
1410
|
+
// 普通语法
|
|
1411
|
+
return $el.matches(selector);
|
|
1412
|
+
}
|
|
1413
|
+
}
|
|
1414
|
+
closest($el, selector) {
|
|
1415
|
+
selector = selector.trim();
|
|
1416
|
+
if (selector.match(/[^\s]{1}:empty$/gi)) {
|
|
1417
|
+
// empty 语法
|
|
1418
|
+
selector = selector.replace(/:empty$/gi, "");
|
|
1419
|
+
let $closest = $el?.closest(selector);
|
|
1420
|
+
if ($closest && $closest?.innerHTML?.trim() === "") {
|
|
1421
|
+
return $closest;
|
|
1422
|
+
}
|
|
1423
|
+
return null;
|
|
1424
|
+
}
|
|
1425
|
+
else if (selector.match(/[^\s]{1}:contains\("(.*)"\)$/i) ||
|
|
1426
|
+
selector.match(/[^\s]{1}:contains\('(.*)'\)$/i)) {
|
|
1427
|
+
// contains 语法
|
|
1428
|
+
let textMatch = selector.match(/:contains\(("|')(.*)("|')\)$/i);
|
|
1429
|
+
let text = textMatch[2];
|
|
1430
|
+
selector = selector.replace(/:contains\(("|')(.*)("|')\)$/gi, "");
|
|
1431
|
+
let $closest = $el?.closest(selector);
|
|
1432
|
+
if ($closest) {
|
|
1433
|
+
// @ts-ignore
|
|
1434
|
+
let content = $el?.textContent || $el?.innerText;
|
|
1435
|
+
if (typeof content === "string" && content.includes(text)) {
|
|
1436
|
+
return $closest;
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
return null;
|
|
1440
|
+
}
|
|
1441
|
+
else if (selector.match(/[^\s]{1}:regexp\("(.*)"\)$/i) ||
|
|
1442
|
+
selector.match(/[^\s]{1}:regexp\('(.*)'\)$/i)) {
|
|
1443
|
+
// regexp 语法
|
|
1444
|
+
let textMatch = selector.match(/:regexp\(("|')(.*)("|')\)$/i);
|
|
1445
|
+
let pattern = textMatch[2];
|
|
1446
|
+
let flagMatch = pattern.match(/("|'),[\s]*("|')([igm]{0,3})$/i);
|
|
1447
|
+
let flags = "";
|
|
1448
|
+
if (flagMatch) {
|
|
1449
|
+
pattern = pattern.replace(/("|'),[\s]*("|')([igm]{0,3})$/gi, "");
|
|
1450
|
+
flags = flagMatch[3];
|
|
1451
|
+
}
|
|
1452
|
+
let regexp = new RegExp(pattern, flags);
|
|
1453
|
+
selector = selector.replace(/:regexp\(("|')(.*)("|')\)$/gi, "");
|
|
1454
|
+
let $closest = $el?.closest(selector);
|
|
1455
|
+
if ($closest) {
|
|
1456
|
+
// @ts-ignore
|
|
1457
|
+
let content = $el?.textContent || $el?.innerText;
|
|
1458
|
+
if (typeof content === "string" && content.match(regexp)) {
|
|
1459
|
+
return $closest;
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
return null;
|
|
1463
|
+
}
|
|
1464
|
+
else {
|
|
1465
|
+
// 普通语法
|
|
1466
|
+
let $closest = $el?.closest(selector);
|
|
1467
|
+
return $closest;
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1338
1470
|
}
|
|
1339
1471
|
|
|
1340
|
-
/**
|
|
1341
|
-
* 判断是否是元素列表
|
|
1342
|
-
* @param $ele
|
|
1343
|
-
*/
|
|
1344
|
-
const isNodeList = ($ele) => {
|
|
1345
|
-
return Array.isArray($ele) || $ele instanceof NodeList;
|
|
1346
|
-
};
|
|
1347
1472
|
class DOMUtils extends DOMUtilsEvent {
|
|
1348
1473
|
constructor(option) {
|
|
1349
1474
|
super(option);
|
|
1350
1475
|
}
|
|
1351
1476
|
/** 版本号 */
|
|
1352
|
-
version = "2025.5.
|
|
1477
|
+
version = "2025.5.30";
|
|
1353
1478
|
attr(element, attrName, attrValue) {
|
|
1354
1479
|
let DOMUtilsContext = this;
|
|
1355
1480
|
if (typeof element === "string") {
|
|
@@ -1358,7 +1483,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
1358
1483
|
if (element == null) {
|
|
1359
1484
|
return;
|
|
1360
1485
|
}
|
|
1361
|
-
if (isNodeList(element)) {
|
|
1486
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1362
1487
|
if (attrValue == null) {
|
|
1363
1488
|
// 获取属性
|
|
1364
1489
|
return DOMUtilsContext.attr(element[0], attrName, attrValue);
|
|
@@ -1468,7 +1593,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
1468
1593
|
if (element == null) {
|
|
1469
1594
|
return;
|
|
1470
1595
|
}
|
|
1471
|
-
if (isNodeList(element)) {
|
|
1596
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1472
1597
|
if (typeof property === "string") {
|
|
1473
1598
|
if (value == null) {
|
|
1474
1599
|
// 获取属性
|
|
@@ -1535,7 +1660,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
1535
1660
|
if (element == null) {
|
|
1536
1661
|
return;
|
|
1537
1662
|
}
|
|
1538
|
-
if (isNodeList(element)) {
|
|
1663
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1539
1664
|
if (text == null) {
|
|
1540
1665
|
// 获取
|
|
1541
1666
|
return DOMUtilsContext.text(element[0]);
|
|
@@ -1571,7 +1696,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
1571
1696
|
if (element == null) {
|
|
1572
1697
|
return;
|
|
1573
1698
|
}
|
|
1574
|
-
if (isNodeList(element)) {
|
|
1699
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1575
1700
|
if (html == null) {
|
|
1576
1701
|
// 获取
|
|
1577
1702
|
return DOMUtilsContext.html(element[0]);
|
|
@@ -1641,7 +1766,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
1641
1766
|
if (element == null) {
|
|
1642
1767
|
return;
|
|
1643
1768
|
}
|
|
1644
|
-
if (isNodeList(element)) {
|
|
1769
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1645
1770
|
if (value == null) {
|
|
1646
1771
|
// 获取
|
|
1647
1772
|
return DOMUtilsContext.val(element[0]);
|
|
@@ -1683,7 +1808,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
1683
1808
|
if (element == null) {
|
|
1684
1809
|
return;
|
|
1685
1810
|
}
|
|
1686
|
-
if (isNodeList(element)) {
|
|
1811
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1687
1812
|
if (propValue == null) {
|
|
1688
1813
|
// 获取
|
|
1689
1814
|
return DOMUtilsContext.prop(element[0], propName);
|
|
@@ -1725,7 +1850,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
1725
1850
|
if (element == null) {
|
|
1726
1851
|
return;
|
|
1727
1852
|
}
|
|
1728
|
-
if (isNodeList(element)) {
|
|
1853
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1729
1854
|
// 设置
|
|
1730
1855
|
element.forEach(($ele) => {
|
|
1731
1856
|
DOMUtilsContext.removeAttr($ele, attrName);
|
|
@@ -1751,7 +1876,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
1751
1876
|
if (element == null) {
|
|
1752
1877
|
return;
|
|
1753
1878
|
}
|
|
1754
|
-
if (isNodeList(element)) {
|
|
1879
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1755
1880
|
// 设置
|
|
1756
1881
|
element.forEach(($ele) => {
|
|
1757
1882
|
DOMUtilsContext.removeClass($ele, className);
|
|
@@ -1788,7 +1913,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
1788
1913
|
if (element == null) {
|
|
1789
1914
|
return;
|
|
1790
1915
|
}
|
|
1791
|
-
if (isNodeList(element)) {
|
|
1916
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1792
1917
|
// 设置
|
|
1793
1918
|
element.forEach(($ele) => {
|
|
1794
1919
|
DOMUtilsContext.removeProp($ele, propName);
|
|
@@ -1814,7 +1939,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
1814
1939
|
if (element == null) {
|
|
1815
1940
|
return;
|
|
1816
1941
|
}
|
|
1817
|
-
if (isNodeList(element)) {
|
|
1942
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1818
1943
|
// 设置
|
|
1819
1944
|
element.forEach(($ele) => {
|
|
1820
1945
|
DOMUtilsContext.replaceWith($ele, newElement);
|
|
@@ -1843,7 +1968,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
1843
1968
|
if (element == null) {
|
|
1844
1969
|
return;
|
|
1845
1970
|
}
|
|
1846
|
-
if (isNodeList(element)) {
|
|
1971
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1847
1972
|
// 设置
|
|
1848
1973
|
element.forEach(($ele) => {
|
|
1849
1974
|
DOMUtilsContext.addClass($ele, className);
|
|
@@ -1873,7 +1998,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
1873
1998
|
if (element == null) {
|
|
1874
1999
|
return false;
|
|
1875
2000
|
}
|
|
1876
|
-
if (isNodeList(element)) {
|
|
2001
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1877
2002
|
let flag = true;
|
|
1878
2003
|
for (let index = 0; index < element.length; index++) {
|
|
1879
2004
|
const $ele = element[index];
|
|
@@ -1912,7 +2037,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
1912
2037
|
if (element == null) {
|
|
1913
2038
|
return;
|
|
1914
2039
|
}
|
|
1915
|
-
if (isNodeList(element)) {
|
|
2040
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1916
2041
|
// 设置
|
|
1917
2042
|
element.forEach(($ele) => {
|
|
1918
2043
|
DOMUtilsContext.append($ele, content);
|
|
@@ -1959,7 +2084,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
1959
2084
|
if (element == null) {
|
|
1960
2085
|
return;
|
|
1961
2086
|
}
|
|
1962
|
-
if (isNodeList(element)) {
|
|
2087
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1963
2088
|
// 设置
|
|
1964
2089
|
element.forEach(($ele) => {
|
|
1965
2090
|
DOMUtilsContext.prepend($ele, content);
|
|
@@ -1996,7 +2121,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
1996
2121
|
if (element == null) {
|
|
1997
2122
|
return;
|
|
1998
2123
|
}
|
|
1999
|
-
if (isNodeList(element)) {
|
|
2124
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
2000
2125
|
// 设置
|
|
2001
2126
|
element.forEach(($ele) => {
|
|
2002
2127
|
DOMUtilsContext.after($ele, content);
|
|
@@ -2035,7 +2160,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
2035
2160
|
if (element == null) {
|
|
2036
2161
|
return;
|
|
2037
2162
|
}
|
|
2038
|
-
if (isNodeList(element)) {
|
|
2163
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
2039
2164
|
// 设置
|
|
2040
2165
|
element.forEach(($ele) => {
|
|
2041
2166
|
DOMUtilsContext.before($ele, content);
|
|
@@ -2072,7 +2197,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
2072
2197
|
if (element == null) {
|
|
2073
2198
|
return;
|
|
2074
2199
|
}
|
|
2075
|
-
if (isNodeList(element)) {
|
|
2200
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
2076
2201
|
element.forEach(($ele) => {
|
|
2077
2202
|
DOMUtilsContext.remove($ele);
|
|
2078
2203
|
});
|
|
@@ -2096,7 +2221,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
2096
2221
|
if (element == null) {
|
|
2097
2222
|
return;
|
|
2098
2223
|
}
|
|
2099
|
-
if (isNodeList(element)) {
|
|
2224
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
2100
2225
|
// 设置
|
|
2101
2226
|
element.forEach(($ele) => {
|
|
2102
2227
|
DOMUtilsContext.empty($ele);
|
|
@@ -2303,7 +2428,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
2303
2428
|
if (element == null) {
|
|
2304
2429
|
return;
|
|
2305
2430
|
}
|
|
2306
|
-
if (isNodeList(element)) {
|
|
2431
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
2307
2432
|
// 设置
|
|
2308
2433
|
element.forEach(($ele) => {
|
|
2309
2434
|
DOMUtilsContext.animate($ele, styles, duration, callback);
|
|
@@ -2365,7 +2490,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
2365
2490
|
if (element == null) {
|
|
2366
2491
|
return;
|
|
2367
2492
|
}
|
|
2368
|
-
if (isNodeList(element)) {
|
|
2493
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
2369
2494
|
// 设置
|
|
2370
2495
|
element.forEach(($ele) => {
|
|
2371
2496
|
DOMUtilsContext.wrap($ele, wrapperHTML);
|
|
@@ -2445,7 +2570,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
2445
2570
|
if (element == null) {
|
|
2446
2571
|
return;
|
|
2447
2572
|
}
|
|
2448
|
-
if (isNodeList(element)) {
|
|
2573
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
2449
2574
|
let resultArray = [];
|
|
2450
2575
|
element.forEach(($ele) => {
|
|
2451
2576
|
resultArray.push(DOMUtilsContext.parent($ele));
|
|
@@ -2624,7 +2749,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
2624
2749
|
if (typeof element === "string") {
|
|
2625
2750
|
element = DOMUtilsContext.selectorAll(element);
|
|
2626
2751
|
}
|
|
2627
|
-
if (isNodeList(element)) {
|
|
2752
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
2628
2753
|
// 设置
|
|
2629
2754
|
element.forEach(($ele) => {
|
|
2630
2755
|
DOMUtilsContext.fadeIn($ele, duration, callback);
|
|
@@ -2675,7 +2800,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
2675
2800
|
if (typeof element === "string") {
|
|
2676
2801
|
element = DOMUtilsContext.selectorAll(element);
|
|
2677
2802
|
}
|
|
2678
|
-
if (isNodeList(element)) {
|
|
2803
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
2679
2804
|
// 设置
|
|
2680
2805
|
element.forEach(($ele) => {
|
|
2681
2806
|
DOMUtilsContext.fadeOut($ele, duration, callback);
|
|
@@ -2721,7 +2846,7 @@ System.register('DOMUtils', [], (function (exports) {
|
|
|
2721
2846
|
if (element == null) {
|
|
2722
2847
|
return;
|
|
2723
2848
|
}
|
|
2724
|
-
if (isNodeList(element)) {
|
|
2849
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
2725
2850
|
// 设置
|
|
2726
2851
|
element.forEach(($ele) => {
|
|
2727
2852
|
DOMUtilsContext.toggle($ele);
|