@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.amd.js
CHANGED
|
@@ -460,6 +460,13 @@ define((function () { 'use strict';
|
|
|
460
460
|
globalThis.clearInterval(timeId);
|
|
461
461
|
}
|
|
462
462
|
},
|
|
463
|
+
/**
|
|
464
|
+
* 判断是否是元素列表
|
|
465
|
+
* @param $ele
|
|
466
|
+
*/
|
|
467
|
+
isNodeList($ele) {
|
|
468
|
+
return Array.isArray($ele) || $ele instanceof NodeList;
|
|
469
|
+
},
|
|
463
470
|
};
|
|
464
471
|
|
|
465
472
|
/* 数据 */
|
|
@@ -586,12 +593,12 @@ define((function () { 'use strict';
|
|
|
586
593
|
: elementItem;
|
|
587
594
|
let findValue = selectorList.find((selectorItem) => {
|
|
588
595
|
// 判断目标元素是否匹配选择器
|
|
589
|
-
if (
|
|
596
|
+
if (DOMUtilsContext.matches(eventTarget, selectorItem)) {
|
|
590
597
|
/* 当前目标可以被selector所匹配到 */
|
|
591
598
|
return true;
|
|
592
599
|
}
|
|
593
600
|
/* 在上层与主元素之间寻找可以被selector所匹配到的 */
|
|
594
|
-
let $closestMatches =
|
|
601
|
+
let $closestMatches = DOMUtilsContext.closest(eventTarget, selectorItem);
|
|
595
602
|
if ($closestMatches && totalParent?.contains($closestMatches)) {
|
|
596
603
|
eventTarget = $closestMatches;
|
|
597
604
|
return true;
|
|
@@ -973,7 +980,7 @@ define((function () { 'use strict';
|
|
|
973
980
|
if (element == null) {
|
|
974
981
|
return;
|
|
975
982
|
}
|
|
976
|
-
if (isNodeList(element)) {
|
|
983
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
977
984
|
// 设置
|
|
978
985
|
element.forEach(($ele) => {
|
|
979
986
|
DOMUtilsContext.click($ele, handler, details, useDispatchToTriggerEvent);
|
|
@@ -1009,7 +1016,7 @@ define((function () { 'use strict';
|
|
|
1009
1016
|
if (element == null) {
|
|
1010
1017
|
return;
|
|
1011
1018
|
}
|
|
1012
|
-
if (isNodeList(element)) {
|
|
1019
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1013
1020
|
// 设置
|
|
1014
1021
|
element.forEach(($ele) => {
|
|
1015
1022
|
DOMUtilsContext.focus($ele, handler, details, useDispatchToTriggerEvent);
|
|
@@ -1045,7 +1052,7 @@ define((function () { 'use strict';
|
|
|
1045
1052
|
if (element == null) {
|
|
1046
1053
|
return;
|
|
1047
1054
|
}
|
|
1048
|
-
if (isNodeList(element)) {
|
|
1055
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1049
1056
|
// 设置
|
|
1050
1057
|
element.forEach(($ele) => {
|
|
1051
1058
|
DOMUtilsContext.focus($ele, handler, details, useDispatchToTriggerEvent);
|
|
@@ -1081,7 +1088,7 @@ define((function () { 'use strict';
|
|
|
1081
1088
|
if (element == null) {
|
|
1082
1089
|
return;
|
|
1083
1090
|
}
|
|
1084
|
-
if (isNodeList(element)) {
|
|
1091
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1085
1092
|
// 设置
|
|
1086
1093
|
element.forEach(($ele) => {
|
|
1087
1094
|
DOMUtilsContext.hover($ele, handler, option);
|
|
@@ -1114,7 +1121,7 @@ define((function () { 'use strict';
|
|
|
1114
1121
|
if (typeof element === "string") {
|
|
1115
1122
|
element = DOMUtilsContext.selectorAll(element);
|
|
1116
1123
|
}
|
|
1117
|
-
if (isNodeList(element)) {
|
|
1124
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1118
1125
|
// 设置
|
|
1119
1126
|
element.forEach(($ele) => {
|
|
1120
1127
|
DOMUtilsContext.keyup($ele, handler, option);
|
|
@@ -1146,7 +1153,7 @@ define((function () { 'use strict';
|
|
|
1146
1153
|
if (typeof element === "string") {
|
|
1147
1154
|
element = DOMUtilsContext.selectorAll(element);
|
|
1148
1155
|
}
|
|
1149
|
-
if (isNodeList(element)) {
|
|
1156
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1150
1157
|
// 设置
|
|
1151
1158
|
element.forEach(($ele) => {
|
|
1152
1159
|
DOMUtilsContext.keydown($ele, handler, option);
|
|
@@ -1178,7 +1185,7 @@ define((function () { 'use strict';
|
|
|
1178
1185
|
if (typeof element === "string") {
|
|
1179
1186
|
element = DOMUtilsContext.selectorAll(element);
|
|
1180
1187
|
}
|
|
1181
|
-
if (isNodeList(element)) {
|
|
1188
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1182
1189
|
// 设置
|
|
1183
1190
|
element.forEach(($ele) => {
|
|
1184
1191
|
DOMUtilsContext.keypress($ele, handler, option);
|
|
@@ -1332,21 +1339,139 @@ define((function () { 'use strict';
|
|
|
1332
1339
|
return Array.from(context.windowApi.document.querySelectorAll(selector));
|
|
1333
1340
|
}
|
|
1334
1341
|
}
|
|
1342
|
+
/**
|
|
1343
|
+
* 匹配元素,可使用以下的额外语法
|
|
1344
|
+
*
|
|
1345
|
+
* + :contains([text]) 作用: 找到包含指定文本内容的指定元素
|
|
1346
|
+
* + :empty 作用:找到既没有文本内容也没有子元素的指定元素
|
|
1347
|
+
* + :regexp([text]) 作用: 找到符合正则表达式的内容的指定元素
|
|
1348
|
+
* @param $el 元素
|
|
1349
|
+
* @param selector 选择器
|
|
1350
|
+
* @example
|
|
1351
|
+
* DOMUtils.matches("div:contains('测试')")
|
|
1352
|
+
* > true
|
|
1353
|
+
* @example
|
|
1354
|
+
* DOMUtils.matches("div:empty")
|
|
1355
|
+
* > true
|
|
1356
|
+
* @example
|
|
1357
|
+
* DOMUtils.matches("div:regexp('^xxxx$')")
|
|
1358
|
+
* > true
|
|
1359
|
+
* @example
|
|
1360
|
+
* DOMUtils.matches("div:regexp(/^xxx/ig)")
|
|
1361
|
+
* > false
|
|
1362
|
+
*/
|
|
1363
|
+
matches($el, selector) {
|
|
1364
|
+
selector = selector.trim();
|
|
1365
|
+
if ($el == null) {
|
|
1366
|
+
return false;
|
|
1367
|
+
}
|
|
1368
|
+
if (selector.match(/[^\s]{1}:empty$/gi)) {
|
|
1369
|
+
// empty 语法
|
|
1370
|
+
selector = selector.replace(/:empty$/gi, "");
|
|
1371
|
+
return $el.matches(selector) && $el?.innerHTML?.trim() === "";
|
|
1372
|
+
}
|
|
1373
|
+
else if (selector.match(/[^\s]{1}:contains\("(.*)"\)$/i) ||
|
|
1374
|
+
selector.match(/[^\s]{1}:contains\('(.*)'\)$/i)) {
|
|
1375
|
+
// contains 语法
|
|
1376
|
+
let textMatch = selector.match(/:contains\(("|')(.*)("|')\)$/i);
|
|
1377
|
+
let text = textMatch[2];
|
|
1378
|
+
selector = selector.replace(/:contains\(("|')(.*)("|')\)$/gi, "");
|
|
1379
|
+
// @ts-ignore
|
|
1380
|
+
let content = $el?.textContent || $el?.innerText;
|
|
1381
|
+
if (typeof content !== "string") {
|
|
1382
|
+
content = "";
|
|
1383
|
+
}
|
|
1384
|
+
return $el.matches(selector) && content?.includes(text);
|
|
1385
|
+
}
|
|
1386
|
+
else if (selector.match(/[^\s]{1}:regexp\("(.*)"\)$/i) ||
|
|
1387
|
+
selector.match(/[^\s]{1}:regexp\('(.*)'\)$/i)) {
|
|
1388
|
+
// regexp 语法
|
|
1389
|
+
let textMatch = selector.match(/:regexp\(("|')(.*)("|')\)$/i);
|
|
1390
|
+
let pattern = textMatch[2];
|
|
1391
|
+
let flagMatch = pattern.match(/("|'),[\s]*("|')([igm]{0,3})$/i);
|
|
1392
|
+
let flags = "";
|
|
1393
|
+
if (flagMatch) {
|
|
1394
|
+
pattern = pattern.replace(/("|'),[\s]*("|')([igm]{0,3})$/gi, "");
|
|
1395
|
+
flags = flagMatch[3];
|
|
1396
|
+
}
|
|
1397
|
+
let regexp = new RegExp(pattern, flags);
|
|
1398
|
+
selector = selector.replace(/:regexp\(("|')(.*)("|')\)$/gi, "");
|
|
1399
|
+
// @ts-ignore
|
|
1400
|
+
let content = $el?.textContent || $el?.innerText;
|
|
1401
|
+
if (typeof content !== "string") {
|
|
1402
|
+
content = "";
|
|
1403
|
+
}
|
|
1404
|
+
return $el.matches(selector) && Boolean(content?.match(regexp));
|
|
1405
|
+
}
|
|
1406
|
+
else {
|
|
1407
|
+
// 普通语法
|
|
1408
|
+
return $el.matches(selector);
|
|
1409
|
+
}
|
|
1410
|
+
}
|
|
1411
|
+
closest($el, selector) {
|
|
1412
|
+
selector = selector.trim();
|
|
1413
|
+
if (selector.match(/[^\s]{1}:empty$/gi)) {
|
|
1414
|
+
// empty 语法
|
|
1415
|
+
selector = selector.replace(/:empty$/gi, "");
|
|
1416
|
+
let $closest = $el?.closest(selector);
|
|
1417
|
+
if ($closest && $closest?.innerHTML?.trim() === "") {
|
|
1418
|
+
return $closest;
|
|
1419
|
+
}
|
|
1420
|
+
return null;
|
|
1421
|
+
}
|
|
1422
|
+
else if (selector.match(/[^\s]{1}:contains\("(.*)"\)$/i) ||
|
|
1423
|
+
selector.match(/[^\s]{1}:contains\('(.*)'\)$/i)) {
|
|
1424
|
+
// contains 语法
|
|
1425
|
+
let textMatch = selector.match(/:contains\(("|')(.*)("|')\)$/i);
|
|
1426
|
+
let text = textMatch[2];
|
|
1427
|
+
selector = selector.replace(/:contains\(("|')(.*)("|')\)$/gi, "");
|
|
1428
|
+
let $closest = $el?.closest(selector);
|
|
1429
|
+
if ($closest) {
|
|
1430
|
+
// @ts-ignore
|
|
1431
|
+
let content = $el?.textContent || $el?.innerText;
|
|
1432
|
+
if (typeof content === "string" && content.includes(text)) {
|
|
1433
|
+
return $closest;
|
|
1434
|
+
}
|
|
1435
|
+
}
|
|
1436
|
+
return null;
|
|
1437
|
+
}
|
|
1438
|
+
else if (selector.match(/[^\s]{1}:regexp\("(.*)"\)$/i) ||
|
|
1439
|
+
selector.match(/[^\s]{1}:regexp\('(.*)'\)$/i)) {
|
|
1440
|
+
// regexp 语法
|
|
1441
|
+
let textMatch = selector.match(/:regexp\(("|')(.*)("|')\)$/i);
|
|
1442
|
+
let pattern = textMatch[2];
|
|
1443
|
+
let flagMatch = pattern.match(/("|'),[\s]*("|')([igm]{0,3})$/i);
|
|
1444
|
+
let flags = "";
|
|
1445
|
+
if (flagMatch) {
|
|
1446
|
+
pattern = pattern.replace(/("|'),[\s]*("|')([igm]{0,3})$/gi, "");
|
|
1447
|
+
flags = flagMatch[3];
|
|
1448
|
+
}
|
|
1449
|
+
let regexp = new RegExp(pattern, flags);
|
|
1450
|
+
selector = selector.replace(/:regexp\(("|')(.*)("|')\)$/gi, "");
|
|
1451
|
+
let $closest = $el?.closest(selector);
|
|
1452
|
+
if ($closest) {
|
|
1453
|
+
// @ts-ignore
|
|
1454
|
+
let content = $el?.textContent || $el?.innerText;
|
|
1455
|
+
if (typeof content === "string" && content.match(regexp)) {
|
|
1456
|
+
return $closest;
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
return null;
|
|
1460
|
+
}
|
|
1461
|
+
else {
|
|
1462
|
+
// 普通语法
|
|
1463
|
+
let $closest = $el?.closest(selector);
|
|
1464
|
+
return $closest;
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1335
1467
|
}
|
|
1336
1468
|
|
|
1337
|
-
/**
|
|
1338
|
-
* 判断是否是元素列表
|
|
1339
|
-
* @param $ele
|
|
1340
|
-
*/
|
|
1341
|
-
const isNodeList = ($ele) => {
|
|
1342
|
-
return Array.isArray($ele) || $ele instanceof NodeList;
|
|
1343
|
-
};
|
|
1344
1469
|
class DOMUtils extends DOMUtilsEvent {
|
|
1345
1470
|
constructor(option) {
|
|
1346
1471
|
super(option);
|
|
1347
1472
|
}
|
|
1348
1473
|
/** 版本号 */
|
|
1349
|
-
version = "2025.5.
|
|
1474
|
+
version = "2025.5.30";
|
|
1350
1475
|
attr(element, attrName, attrValue) {
|
|
1351
1476
|
let DOMUtilsContext = this;
|
|
1352
1477
|
if (typeof element === "string") {
|
|
@@ -1355,7 +1480,7 @@ define((function () { 'use strict';
|
|
|
1355
1480
|
if (element == null) {
|
|
1356
1481
|
return;
|
|
1357
1482
|
}
|
|
1358
|
-
if (isNodeList(element)) {
|
|
1483
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1359
1484
|
if (attrValue == null) {
|
|
1360
1485
|
// 获取属性
|
|
1361
1486
|
return DOMUtilsContext.attr(element[0], attrName, attrValue);
|
|
@@ -1465,7 +1590,7 @@ define((function () { 'use strict';
|
|
|
1465
1590
|
if (element == null) {
|
|
1466
1591
|
return;
|
|
1467
1592
|
}
|
|
1468
|
-
if (isNodeList(element)) {
|
|
1593
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1469
1594
|
if (typeof property === "string") {
|
|
1470
1595
|
if (value == null) {
|
|
1471
1596
|
// 获取属性
|
|
@@ -1532,7 +1657,7 @@ define((function () { 'use strict';
|
|
|
1532
1657
|
if (element == null) {
|
|
1533
1658
|
return;
|
|
1534
1659
|
}
|
|
1535
|
-
if (isNodeList(element)) {
|
|
1660
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1536
1661
|
if (text == null) {
|
|
1537
1662
|
// 获取
|
|
1538
1663
|
return DOMUtilsContext.text(element[0]);
|
|
@@ -1568,7 +1693,7 @@ define((function () { 'use strict';
|
|
|
1568
1693
|
if (element == null) {
|
|
1569
1694
|
return;
|
|
1570
1695
|
}
|
|
1571
|
-
if (isNodeList(element)) {
|
|
1696
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1572
1697
|
if (html == null) {
|
|
1573
1698
|
// 获取
|
|
1574
1699
|
return DOMUtilsContext.html(element[0]);
|
|
@@ -1638,7 +1763,7 @@ define((function () { 'use strict';
|
|
|
1638
1763
|
if (element == null) {
|
|
1639
1764
|
return;
|
|
1640
1765
|
}
|
|
1641
|
-
if (isNodeList(element)) {
|
|
1766
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1642
1767
|
if (value == null) {
|
|
1643
1768
|
// 获取
|
|
1644
1769
|
return DOMUtilsContext.val(element[0]);
|
|
@@ -1680,7 +1805,7 @@ define((function () { 'use strict';
|
|
|
1680
1805
|
if (element == null) {
|
|
1681
1806
|
return;
|
|
1682
1807
|
}
|
|
1683
|
-
if (isNodeList(element)) {
|
|
1808
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1684
1809
|
if (propValue == null) {
|
|
1685
1810
|
// 获取
|
|
1686
1811
|
return DOMUtilsContext.prop(element[0], propName);
|
|
@@ -1722,7 +1847,7 @@ define((function () { 'use strict';
|
|
|
1722
1847
|
if (element == null) {
|
|
1723
1848
|
return;
|
|
1724
1849
|
}
|
|
1725
|
-
if (isNodeList(element)) {
|
|
1850
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1726
1851
|
// 设置
|
|
1727
1852
|
element.forEach(($ele) => {
|
|
1728
1853
|
DOMUtilsContext.removeAttr($ele, attrName);
|
|
@@ -1748,7 +1873,7 @@ define((function () { 'use strict';
|
|
|
1748
1873
|
if (element == null) {
|
|
1749
1874
|
return;
|
|
1750
1875
|
}
|
|
1751
|
-
if (isNodeList(element)) {
|
|
1876
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1752
1877
|
// 设置
|
|
1753
1878
|
element.forEach(($ele) => {
|
|
1754
1879
|
DOMUtilsContext.removeClass($ele, className);
|
|
@@ -1785,7 +1910,7 @@ define((function () { 'use strict';
|
|
|
1785
1910
|
if (element == null) {
|
|
1786
1911
|
return;
|
|
1787
1912
|
}
|
|
1788
|
-
if (isNodeList(element)) {
|
|
1913
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1789
1914
|
// 设置
|
|
1790
1915
|
element.forEach(($ele) => {
|
|
1791
1916
|
DOMUtilsContext.removeProp($ele, propName);
|
|
@@ -1811,7 +1936,7 @@ define((function () { 'use strict';
|
|
|
1811
1936
|
if (element == null) {
|
|
1812
1937
|
return;
|
|
1813
1938
|
}
|
|
1814
|
-
if (isNodeList(element)) {
|
|
1939
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1815
1940
|
// 设置
|
|
1816
1941
|
element.forEach(($ele) => {
|
|
1817
1942
|
DOMUtilsContext.replaceWith($ele, newElement);
|
|
@@ -1840,7 +1965,7 @@ define((function () { 'use strict';
|
|
|
1840
1965
|
if (element == null) {
|
|
1841
1966
|
return;
|
|
1842
1967
|
}
|
|
1843
|
-
if (isNodeList(element)) {
|
|
1968
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1844
1969
|
// 设置
|
|
1845
1970
|
element.forEach(($ele) => {
|
|
1846
1971
|
DOMUtilsContext.addClass($ele, className);
|
|
@@ -1870,7 +1995,7 @@ define((function () { 'use strict';
|
|
|
1870
1995
|
if (element == null) {
|
|
1871
1996
|
return false;
|
|
1872
1997
|
}
|
|
1873
|
-
if (isNodeList(element)) {
|
|
1998
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1874
1999
|
let flag = true;
|
|
1875
2000
|
for (let index = 0; index < element.length; index++) {
|
|
1876
2001
|
const $ele = element[index];
|
|
@@ -1909,7 +2034,7 @@ define((function () { 'use strict';
|
|
|
1909
2034
|
if (element == null) {
|
|
1910
2035
|
return;
|
|
1911
2036
|
}
|
|
1912
|
-
if (isNodeList(element)) {
|
|
2037
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1913
2038
|
// 设置
|
|
1914
2039
|
element.forEach(($ele) => {
|
|
1915
2040
|
DOMUtilsContext.append($ele, content);
|
|
@@ -1956,7 +2081,7 @@ define((function () { 'use strict';
|
|
|
1956
2081
|
if (element == null) {
|
|
1957
2082
|
return;
|
|
1958
2083
|
}
|
|
1959
|
-
if (isNodeList(element)) {
|
|
2084
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1960
2085
|
// 设置
|
|
1961
2086
|
element.forEach(($ele) => {
|
|
1962
2087
|
DOMUtilsContext.prepend($ele, content);
|
|
@@ -1993,7 +2118,7 @@ define((function () { 'use strict';
|
|
|
1993
2118
|
if (element == null) {
|
|
1994
2119
|
return;
|
|
1995
2120
|
}
|
|
1996
|
-
if (isNodeList(element)) {
|
|
2121
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
1997
2122
|
// 设置
|
|
1998
2123
|
element.forEach(($ele) => {
|
|
1999
2124
|
DOMUtilsContext.after($ele, content);
|
|
@@ -2032,7 +2157,7 @@ define((function () { 'use strict';
|
|
|
2032
2157
|
if (element == null) {
|
|
2033
2158
|
return;
|
|
2034
2159
|
}
|
|
2035
|
-
if (isNodeList(element)) {
|
|
2160
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
2036
2161
|
// 设置
|
|
2037
2162
|
element.forEach(($ele) => {
|
|
2038
2163
|
DOMUtilsContext.before($ele, content);
|
|
@@ -2069,7 +2194,7 @@ define((function () { 'use strict';
|
|
|
2069
2194
|
if (element == null) {
|
|
2070
2195
|
return;
|
|
2071
2196
|
}
|
|
2072
|
-
if (isNodeList(element)) {
|
|
2197
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
2073
2198
|
element.forEach(($ele) => {
|
|
2074
2199
|
DOMUtilsContext.remove($ele);
|
|
2075
2200
|
});
|
|
@@ -2093,7 +2218,7 @@ define((function () { 'use strict';
|
|
|
2093
2218
|
if (element == null) {
|
|
2094
2219
|
return;
|
|
2095
2220
|
}
|
|
2096
|
-
if (isNodeList(element)) {
|
|
2221
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
2097
2222
|
// 设置
|
|
2098
2223
|
element.forEach(($ele) => {
|
|
2099
2224
|
DOMUtilsContext.empty($ele);
|
|
@@ -2300,7 +2425,7 @@ define((function () { 'use strict';
|
|
|
2300
2425
|
if (element == null) {
|
|
2301
2426
|
return;
|
|
2302
2427
|
}
|
|
2303
|
-
if (isNodeList(element)) {
|
|
2428
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
2304
2429
|
// 设置
|
|
2305
2430
|
element.forEach(($ele) => {
|
|
2306
2431
|
DOMUtilsContext.animate($ele, styles, duration, callback);
|
|
@@ -2362,7 +2487,7 @@ define((function () { 'use strict';
|
|
|
2362
2487
|
if (element == null) {
|
|
2363
2488
|
return;
|
|
2364
2489
|
}
|
|
2365
|
-
if (isNodeList(element)) {
|
|
2490
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
2366
2491
|
// 设置
|
|
2367
2492
|
element.forEach(($ele) => {
|
|
2368
2493
|
DOMUtilsContext.wrap($ele, wrapperHTML);
|
|
@@ -2442,7 +2567,7 @@ define((function () { 'use strict';
|
|
|
2442
2567
|
if (element == null) {
|
|
2443
2568
|
return;
|
|
2444
2569
|
}
|
|
2445
|
-
if (isNodeList(element)) {
|
|
2570
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
2446
2571
|
let resultArray = [];
|
|
2447
2572
|
element.forEach(($ele) => {
|
|
2448
2573
|
resultArray.push(DOMUtilsContext.parent($ele));
|
|
@@ -2621,7 +2746,7 @@ define((function () { 'use strict';
|
|
|
2621
2746
|
if (typeof element === "string") {
|
|
2622
2747
|
element = DOMUtilsContext.selectorAll(element);
|
|
2623
2748
|
}
|
|
2624
|
-
if (isNodeList(element)) {
|
|
2749
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
2625
2750
|
// 设置
|
|
2626
2751
|
element.forEach(($ele) => {
|
|
2627
2752
|
DOMUtilsContext.fadeIn($ele, duration, callback);
|
|
@@ -2672,7 +2797,7 @@ define((function () { 'use strict';
|
|
|
2672
2797
|
if (typeof element === "string") {
|
|
2673
2798
|
element = DOMUtilsContext.selectorAll(element);
|
|
2674
2799
|
}
|
|
2675
|
-
if (isNodeList(element)) {
|
|
2800
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
2676
2801
|
// 设置
|
|
2677
2802
|
element.forEach(($ele) => {
|
|
2678
2803
|
DOMUtilsContext.fadeOut($ele, duration, callback);
|
|
@@ -2718,7 +2843,7 @@ define((function () { 'use strict';
|
|
|
2718
2843
|
if (element == null) {
|
|
2719
2844
|
return;
|
|
2720
2845
|
}
|
|
2721
|
-
if (isNodeList(element)) {
|
|
2846
|
+
if (DOMUtilsCommonUtils.isNodeList(element)) {
|
|
2722
2847
|
// 设置
|
|
2723
2848
|
element.forEach(($ele) => {
|
|
2724
2849
|
DOMUtilsContext.toggle($ele);
|