@whitesev/pops 3.0.2 → 3.1.0
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 +87 -66
- package/dist/index.amd.js.map +1 -1
- package/dist/index.amd.min.js +1 -1
- package/dist/index.amd.min.js.map +1 -1
- package/dist/index.cjs.js +87 -66
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs.min.js +1 -1
- package/dist/index.cjs.min.js.map +1 -1
- package/dist/index.esm.js +87 -66
- package/dist/index.esm.js.map +1 -1
- package/dist/index.esm.min.js +1 -1
- package/dist/index.esm.min.js.map +1 -1
- package/dist/index.iife.js +87 -66
- package/dist/index.iife.js.map +1 -1
- package/dist/index.iife.min.js +1 -1
- package/dist/index.iife.min.js.map +1 -1
- package/dist/index.system.js +87 -66
- package/dist/index.system.js.map +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/dist/index.umd.js +87 -66
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/dist/types/src/Pops.d.ts +20 -20
- package/dist/types/src/components/panel/handlerComponents.d.ts +4 -6
- package/dist/types/src/components/tooltip/index.d.ts +2 -2
- package/dist/types/src/components/tooltip/types/index.d.ts +3 -3
- package/dist/types/src/types/PopsDOMUtilsEventType.d.ts +22 -0
- package/dist/types/src/utils/PopsDOMUtils.d.ts +29 -29
- package/dist/types/src/utils/PopsInstanceUtils.d.ts +1 -1
- package/package.json +3 -3
- package/src/components/folder/index.ts +3 -3
- package/src/components/panel/handlerComponents.ts +8 -10
- package/src/components/rightClickMenu/index.ts +3 -3
- package/src/components/tooltip/defaultConfig.ts +2 -2
- package/src/components/tooltip/index.ts +4 -4
- package/src/components/tooltip/types/index.ts +3 -3
- package/src/types/PopsDOMUtilsEventType.d.ts +22 -0
- package/src/utils/PopsDOMUtils.ts +90 -59
- package/src/utils/PopsInstanceUtils.ts +5 -5
package/dist/index.system.js
CHANGED
|
@@ -875,22 +875,25 @@ System.register('pops', [], (function (exports) {
|
|
|
875
875
|
}
|
|
876
876
|
return option;
|
|
877
877
|
}
|
|
878
|
-
const
|
|
878
|
+
const that = this;
|
|
879
879
|
// eslint-disable-next-line prefer-rest-params
|
|
880
880
|
const args = arguments;
|
|
881
881
|
if (typeof element === "string") {
|
|
882
|
-
element =
|
|
882
|
+
element = that.selectorAll(element);
|
|
883
883
|
}
|
|
884
884
|
if (element == null) {
|
|
885
|
-
return
|
|
885
|
+
return {
|
|
886
|
+
off() { },
|
|
887
|
+
emit() { },
|
|
888
|
+
};
|
|
886
889
|
}
|
|
887
|
-
let
|
|
890
|
+
let $elList = [];
|
|
888
891
|
if (element instanceof NodeList || Array.isArray(element)) {
|
|
889
892
|
element = element;
|
|
890
|
-
|
|
893
|
+
$elList = [...element];
|
|
891
894
|
}
|
|
892
895
|
else {
|
|
893
|
-
|
|
896
|
+
$elList.push(element);
|
|
894
897
|
}
|
|
895
898
|
// 事件名
|
|
896
899
|
let eventTypeList = [];
|
|
@@ -932,10 +935,10 @@ System.register('pops', [], (function (exports) {
|
|
|
932
935
|
*/
|
|
933
936
|
function checkOptionOnceToRemoveEventListener() {
|
|
934
937
|
if (listenerOption.once) {
|
|
935
|
-
|
|
938
|
+
that.off(element, eventType, selector, callback, option);
|
|
936
939
|
}
|
|
937
940
|
}
|
|
938
|
-
|
|
941
|
+
$elList.forEach((elementItem) => {
|
|
939
942
|
/**
|
|
940
943
|
* 事件回调
|
|
941
944
|
* @param event
|
|
@@ -955,12 +958,12 @@ System.register('pops', [], (function (exports) {
|
|
|
955
958
|
}
|
|
956
959
|
const findValue = selectorList.find((selectorItem) => {
|
|
957
960
|
// 判断目标元素是否匹配选择器
|
|
958
|
-
if (
|
|
961
|
+
if (that.matches(eventTarget, selectorItem)) {
|
|
959
962
|
// 当前目标可以被selector所匹配到
|
|
960
963
|
return true;
|
|
961
964
|
}
|
|
962
965
|
// 在上层与主元素之间寻找可以被selector所匹配到的
|
|
963
|
-
const $closestMatches =
|
|
966
|
+
const $closestMatches = that.closest(eventTarget, selectorItem);
|
|
964
967
|
if ($closestMatches && totalParent?.contains($closestMatches)) {
|
|
965
968
|
eventTarget = $closestMatches;
|
|
966
969
|
return true;
|
|
@@ -1006,6 +1009,23 @@ System.register('pops', [], (function (exports) {
|
|
|
1006
1009
|
Reflect.set(elementItem, SymbolEvents, elementEvents);
|
|
1007
1010
|
});
|
|
1008
1011
|
});
|
|
1012
|
+
return {
|
|
1013
|
+
/**
|
|
1014
|
+
* 取消绑定的监听事件
|
|
1015
|
+
* @param filter (可选)过滤函数,对元素属性上的事件进行过滤出想要删除的事件
|
|
1016
|
+
*/
|
|
1017
|
+
off: (filter) => {
|
|
1018
|
+
that.off($elList, eventTypeList, selectorList, listenerCallBack, listenerOption, filter);
|
|
1019
|
+
},
|
|
1020
|
+
/**
|
|
1021
|
+
* 主动触发事件
|
|
1022
|
+
* @param details 赋予触发的Event的额外属性,如果是Event类型,那么将自动代替默认new的Event对象
|
|
1023
|
+
* @param useDispatchToEmit 是否使用dispatchEvent来触发事件,默认true,如果为false,则直接调用callback,但是这种会让使用了selectorTarget的没有值
|
|
1024
|
+
*/
|
|
1025
|
+
emit: (details, useDispatchToEmit) => {
|
|
1026
|
+
that.emit($elList, eventTypeList, details, useDispatchToEmit);
|
|
1027
|
+
},
|
|
1028
|
+
};
|
|
1009
1029
|
}
|
|
1010
1030
|
off(element, eventType, selector, callback, option, filter) {
|
|
1011
1031
|
/**
|
|
@@ -1183,11 +1203,11 @@ System.register('pops', [], (function (exports) {
|
|
|
1183
1203
|
* 等待文档加载完成后执行指定的函数
|
|
1184
1204
|
* @param callback 需要执行的函数
|
|
1185
1205
|
* @example
|
|
1186
|
-
* DOMUtils.
|
|
1206
|
+
* DOMUtils.onReady(function(){
|
|
1187
1207
|
* console.log("文档加载完毕")
|
|
1188
1208
|
* })
|
|
1189
1209
|
*/
|
|
1190
|
-
|
|
1210
|
+
onReady(callback) {
|
|
1191
1211
|
const that = this;
|
|
1192
1212
|
if (typeof callback !== "function") {
|
|
1193
1213
|
return;
|
|
@@ -1260,16 +1280,16 @@ System.register('pops', [], (function (exports) {
|
|
|
1260
1280
|
* @param element 需要触发的元素|元素数组|window
|
|
1261
1281
|
* @param eventType 需要触发的事件
|
|
1262
1282
|
* @param details 赋予触发的Event的额外属性,如果是Event类型,那么将自动代替默认new的Event对象
|
|
1263
|
-
* @param
|
|
1283
|
+
* @param useDispatchToEmitEvent 是否使用dispatchEvent来触发事件,默认true
|
|
1264
1284
|
* @example
|
|
1265
1285
|
* // 触发元素a.xx的click事件
|
|
1266
|
-
* DOMUtils.
|
|
1267
|
-
* DOMUtils.
|
|
1286
|
+
* DOMUtils.emit(document.querySelector("a.xx"),"click")
|
|
1287
|
+
* DOMUtils.emit("a.xx","click")
|
|
1268
1288
|
* // 触发元素a.xx的click、tap、hover事件
|
|
1269
|
-
* DOMUtils.
|
|
1270
|
-
* DOMUtils.
|
|
1289
|
+
* DOMUtils.emit(document.querySelector("a.xx"),"click tap hover")
|
|
1290
|
+
* DOMUtils.emit("a.xx",["click","tap","hover"])
|
|
1271
1291
|
*/
|
|
1272
|
-
|
|
1292
|
+
emit(element, eventType, details, useDispatchToEmitEvent = true) {
|
|
1273
1293
|
if (typeof element === "string") {
|
|
1274
1294
|
element = PopsCore.document.querySelector(element);
|
|
1275
1295
|
}
|
|
@@ -1307,7 +1327,7 @@ System.register('pops', [], (function (exports) {
|
|
|
1307
1327
|
});
|
|
1308
1328
|
}
|
|
1309
1329
|
}
|
|
1310
|
-
if (
|
|
1330
|
+
if (useDispatchToEmitEvent == false && _eventType_ in events) {
|
|
1311
1331
|
events[_eventType_].forEach((eventsItem) => {
|
|
1312
1332
|
eventsItem.callback(event);
|
|
1313
1333
|
});
|
|
@@ -1323,7 +1343,7 @@ System.register('pops', [], (function (exports) {
|
|
|
1323
1343
|
* @param element 目标元素
|
|
1324
1344
|
* @param handler (可选)事件处理函数
|
|
1325
1345
|
* @param details (可选)赋予触发的Event的额外属性
|
|
1326
|
-
* @param
|
|
1346
|
+
* @param useDispatchToEmitEvent (可选)是否使用dispatchEvent来触发事件,默认true
|
|
1327
1347
|
* @example
|
|
1328
1348
|
* // 触发元素a.xx的click事件
|
|
1329
1349
|
* DOMUtils.click(document.querySelector("a.xx"))
|
|
@@ -1332,7 +1352,7 @@ System.register('pops', [], (function (exports) {
|
|
|
1332
1352
|
* console.log("触发click事件成功")
|
|
1333
1353
|
* })
|
|
1334
1354
|
* */
|
|
1335
|
-
click(element, handler, details,
|
|
1355
|
+
click(element, handler, details, useDispatchToEmitEvent) {
|
|
1336
1356
|
const DOMUtilsContext = this;
|
|
1337
1357
|
if (typeof element === "string") {
|
|
1338
1358
|
element = PopsCore.document.querySelector(element);
|
|
@@ -1341,7 +1361,7 @@ System.register('pops', [], (function (exports) {
|
|
|
1341
1361
|
return;
|
|
1342
1362
|
}
|
|
1343
1363
|
if (handler == null) {
|
|
1344
|
-
DOMUtilsContext.
|
|
1364
|
+
DOMUtilsContext.emit(element, "click", details, useDispatchToEmitEvent);
|
|
1345
1365
|
}
|
|
1346
1366
|
else {
|
|
1347
1367
|
DOMUtilsContext.on(element, "click", null, handler);
|
|
@@ -1352,7 +1372,7 @@ System.register('pops', [], (function (exports) {
|
|
|
1352
1372
|
* @param element 目标元素
|
|
1353
1373
|
* @param handler (可选)事件处理函数
|
|
1354
1374
|
* @param details (可选)赋予触发的Event的额外属性
|
|
1355
|
-
* @param
|
|
1375
|
+
* @param useDispatchToEmitEvent (可选)是否使用dispatchEvent来触发事件,默认true
|
|
1356
1376
|
* @example
|
|
1357
1377
|
* // 触发元素a.xx的blur事件
|
|
1358
1378
|
* DOMUtils.blur(document.querySelector("a.xx"))
|
|
@@ -1361,7 +1381,7 @@ System.register('pops', [], (function (exports) {
|
|
|
1361
1381
|
* console.log("触发blur事件成功")
|
|
1362
1382
|
* })
|
|
1363
1383
|
* */
|
|
1364
|
-
blur(element, handler, details,
|
|
1384
|
+
blur(element, handler, details, useDispatchToEmitEvent) {
|
|
1365
1385
|
const DOMUtilsContext = this;
|
|
1366
1386
|
if (typeof element === "string") {
|
|
1367
1387
|
element = PopsCore.document.querySelector(element);
|
|
@@ -1370,7 +1390,7 @@ System.register('pops', [], (function (exports) {
|
|
|
1370
1390
|
return;
|
|
1371
1391
|
}
|
|
1372
1392
|
if (handler === null) {
|
|
1373
|
-
DOMUtilsContext.
|
|
1393
|
+
DOMUtilsContext.emit(element, "blur", details, useDispatchToEmitEvent);
|
|
1374
1394
|
}
|
|
1375
1395
|
else {
|
|
1376
1396
|
DOMUtilsContext.on(element, "blur", null, handler);
|
|
@@ -1381,7 +1401,7 @@ System.register('pops', [], (function (exports) {
|
|
|
1381
1401
|
* @param element 目标元素
|
|
1382
1402
|
* @param handler (可选)事件处理函数
|
|
1383
1403
|
* @param details (可选)赋予触发的Event的额外属性
|
|
1384
|
-
* @param
|
|
1404
|
+
* @param useDispatchToEmitEvent (可选)是否使用dispatchEvent来触发事件,默认true
|
|
1385
1405
|
* @example
|
|
1386
1406
|
* // 触发元素a.xx的focus事件
|
|
1387
1407
|
* DOMUtils.focus(document.querySelector("a.xx"))
|
|
@@ -1390,7 +1410,7 @@ System.register('pops', [], (function (exports) {
|
|
|
1390
1410
|
* console.log("触发focus事件成功")
|
|
1391
1411
|
* })
|
|
1392
1412
|
* */
|
|
1393
|
-
focus(element, handler, details,
|
|
1413
|
+
focus(element, handler, details, useDispatchToEmitEvent) {
|
|
1394
1414
|
const DOMUtilsContext = this;
|
|
1395
1415
|
if (typeof element === "string") {
|
|
1396
1416
|
element = PopsCore.document.querySelector(element);
|
|
@@ -1399,7 +1419,7 @@ System.register('pops', [], (function (exports) {
|
|
|
1399
1419
|
return;
|
|
1400
1420
|
}
|
|
1401
1421
|
if (handler == null) {
|
|
1402
|
-
DOMUtilsContext.
|
|
1422
|
+
DOMUtilsContext.emit(element, "focus", details, useDispatchToEmitEvent);
|
|
1403
1423
|
}
|
|
1404
1424
|
else {
|
|
1405
1425
|
DOMUtilsContext.on(element, "focus", null, handler);
|
|
@@ -1419,7 +1439,7 @@ System.register('pops', [], (function (exports) {
|
|
|
1419
1439
|
* console.log("移入/移除");
|
|
1420
1440
|
* })
|
|
1421
1441
|
*/
|
|
1422
|
-
|
|
1442
|
+
onHover(element, handler, option) {
|
|
1423
1443
|
const DOMUtilsContext = this;
|
|
1424
1444
|
if (typeof element === "string") {
|
|
1425
1445
|
element = PopsCore.document.querySelector(element);
|
|
@@ -1445,7 +1465,7 @@ System.register('pops', [], (function (exports) {
|
|
|
1445
1465
|
* console.log("按键松开");
|
|
1446
1466
|
* })
|
|
1447
1467
|
*/
|
|
1448
|
-
|
|
1468
|
+
onKeyup(target, handler, option) {
|
|
1449
1469
|
const DOMUtilsContext = this;
|
|
1450
1470
|
if (target == null) {
|
|
1451
1471
|
return;
|
|
@@ -1470,7 +1490,7 @@ System.register('pops', [], (function (exports) {
|
|
|
1470
1490
|
* console.log("按键按下");
|
|
1471
1491
|
* })
|
|
1472
1492
|
*/
|
|
1473
|
-
|
|
1493
|
+
onKeydown(target, handler, option) {
|
|
1474
1494
|
const DOMUtilsContext = this;
|
|
1475
1495
|
if (target == null) {
|
|
1476
1496
|
return;
|
|
@@ -1495,7 +1515,7 @@ System.register('pops', [], (function (exports) {
|
|
|
1495
1515
|
* console.log("按键按下");
|
|
1496
1516
|
* })
|
|
1497
1517
|
*/
|
|
1498
|
-
|
|
1518
|
+
onKeypress(target, handler, option) {
|
|
1499
1519
|
const DOMUtilsContext = this;
|
|
1500
1520
|
if (target == null) {
|
|
1501
1521
|
return;
|
|
@@ -2554,6 +2574,9 @@ System.register('pops', [], (function (exports) {
|
|
|
2554
2574
|
* 监input、textarea的输入框值改变的事件
|
|
2555
2575
|
*/
|
|
2556
2576
|
onInput($el, callback, option) {
|
|
2577
|
+
/**
|
|
2578
|
+
* 是否正在输入中
|
|
2579
|
+
*/
|
|
2557
2580
|
let isComposite = false;
|
|
2558
2581
|
const __callback = async (event) => {
|
|
2559
2582
|
if (isComposite)
|
|
@@ -2565,18 +2588,18 @@ System.register('pops', [], (function (exports) {
|
|
|
2565
2588
|
};
|
|
2566
2589
|
const __composition_end_callback = () => {
|
|
2567
2590
|
isComposite = false;
|
|
2568
|
-
this.
|
|
2591
|
+
this.emit($el, "input", {
|
|
2569
2592
|
isComposite,
|
|
2570
2593
|
});
|
|
2571
2594
|
};
|
|
2572
|
-
this.on($el, "input", __callback, option);
|
|
2573
|
-
this.on($el, "compositionstart", __composition_start_callback, option);
|
|
2574
|
-
this.on($el, "compositionend", __composition_end_callback, option);
|
|
2595
|
+
const inputListener = this.on($el, "input", __callback, option);
|
|
2596
|
+
const compositionStartListener = this.on($el, "compositionstart", __composition_start_callback, option);
|
|
2597
|
+
const compositionEndListener = this.on($el, "compositionend", __composition_end_callback, option);
|
|
2575
2598
|
return {
|
|
2576
2599
|
off: () => {
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2600
|
+
inputListener.off();
|
|
2601
|
+
compositionStartListener.off();
|
|
2602
|
+
compositionEndListener.off();
|
|
2580
2603
|
},
|
|
2581
2604
|
};
|
|
2582
2605
|
}
|
|
@@ -3313,7 +3336,7 @@ System.register('pops', [], (function (exports) {
|
|
|
3313
3336
|
popsDOMUtils.on($pops, popsDOMUtils.getTransitionEndNameList(), closeCallBack);
|
|
3314
3337
|
const popsTransForm = getComputedStyle($pops).transform;
|
|
3315
3338
|
if (popsTransForm !== "none") {
|
|
3316
|
-
popsDOMUtils.
|
|
3339
|
+
popsDOMUtils.emit($pops, popsDOMUtils.getTransitionEndNameList(), void 0, true);
|
|
3317
3340
|
return;
|
|
3318
3341
|
}
|
|
3319
3342
|
if (["top"].includes(drawerConfig.direction)) {
|
|
@@ -3356,7 +3379,7 @@ System.register('pops', [], (function (exports) {
|
|
|
3356
3379
|
limit: true,
|
|
3357
3380
|
extraDistance: 3,
|
|
3358
3381
|
container: PopsCore.globalThis,
|
|
3359
|
-
|
|
3382
|
+
emitClick: true,
|
|
3360
3383
|
}, options);
|
|
3361
3384
|
let isMove = false;
|
|
3362
3385
|
// 点击元素,left偏移
|
|
@@ -3507,11 +3530,11 @@ System.register('pops', [], (function (exports) {
|
|
|
3507
3530
|
}
|
|
3508
3531
|
}
|
|
3509
3532
|
});
|
|
3510
|
-
if (options.
|
|
3533
|
+
if (options.emitClick) {
|
|
3511
3534
|
// 因为会覆盖上面的点击事件,主动触发一下
|
|
3512
3535
|
anyTouchElement.on(["tap"], function (event) {
|
|
3513
3536
|
event.changedPoints.forEach((item) => {
|
|
3514
|
-
popsDOMUtils.
|
|
3537
|
+
popsDOMUtils.emit(item.target, "click", void 0, true);
|
|
3515
3538
|
});
|
|
3516
3539
|
});
|
|
3517
3540
|
}
|
|
@@ -5247,17 +5270,17 @@ System.register('pops', [], (function (exports) {
|
|
|
5247
5270
|
});
|
|
5248
5271
|
// 设置默认触发的arrow
|
|
5249
5272
|
if (config.sort.name === "fileName") {
|
|
5250
|
-
popsDOMUtils.
|
|
5273
|
+
popsDOMUtils.emit(folderListSortFileNameElement, "click", {
|
|
5251
5274
|
notChangeSortRule: true,
|
|
5252
5275
|
});
|
|
5253
5276
|
}
|
|
5254
5277
|
else if (config.sort.name === "latestTime") {
|
|
5255
|
-
popsDOMUtils.
|
|
5278
|
+
popsDOMUtils.emit(folderListSortLatestTimeElement, "click", {
|
|
5256
5279
|
notChangeSortRule: true,
|
|
5257
5280
|
});
|
|
5258
5281
|
}
|
|
5259
5282
|
else if (config.sort.name === "fileSize") {
|
|
5260
|
-
popsDOMUtils.
|
|
5283
|
+
popsDOMUtils.emit(folderListSortFileSizeElement, "click", {
|
|
5261
5284
|
notChangeSortRule: true,
|
|
5262
5285
|
});
|
|
5263
5286
|
}
|
|
@@ -7053,8 +7076,8 @@ System.register('pops', [], (function (exports) {
|
|
|
7053
7076
|
className: "",
|
|
7054
7077
|
isFixed: false,
|
|
7055
7078
|
alwaysShow: false,
|
|
7056
|
-
|
|
7057
|
-
|
|
7079
|
+
onShowEventName: "mouseenter touchstart",
|
|
7080
|
+
onCloseEventName: "mouseleave touchend",
|
|
7058
7081
|
zIndex: 10000,
|
|
7059
7082
|
only: false,
|
|
7060
7083
|
eventOption: {
|
|
@@ -7385,13 +7408,13 @@ System.register('pops', [], (function (exports) {
|
|
|
7385
7408
|
* 绑定 显示事件
|
|
7386
7409
|
*/
|
|
7387
7410
|
onShowEvent() {
|
|
7388
|
-
popsDOMUtils.on(this.$data.config.$target, this.$data.config.
|
|
7411
|
+
popsDOMUtils.on(this.$data.config.$target, this.$data.config.onShowEventName, this.show, this.$data.config.eventOption);
|
|
7389
7412
|
}
|
|
7390
7413
|
/**
|
|
7391
7414
|
* 取消绑定 显示事件
|
|
7392
7415
|
*/
|
|
7393
7416
|
offShowEvent() {
|
|
7394
|
-
popsDOMUtils.off(this.$data.config.$target, this.$data.config.
|
|
7417
|
+
popsDOMUtils.off(this.$data.config.$target, this.$data.config.onShowEventName, this.show, {
|
|
7395
7418
|
capture: true,
|
|
7396
7419
|
});
|
|
7397
7420
|
}
|
|
@@ -7446,13 +7469,13 @@ System.register('pops', [], (function (exports) {
|
|
|
7446
7469
|
* 绑定 关闭事件
|
|
7447
7470
|
*/
|
|
7448
7471
|
onCloseEvent() {
|
|
7449
|
-
popsDOMUtils.on(this.$data.config.$target, this.$data.config.
|
|
7472
|
+
popsDOMUtils.on(this.$data.config.$target, this.$data.config.onCloseEventName, this.close, this.$data.config.eventOption);
|
|
7450
7473
|
}
|
|
7451
7474
|
/**
|
|
7452
7475
|
* 取消绑定 关闭事件
|
|
7453
7476
|
*/
|
|
7454
7477
|
offCloseEvent() {
|
|
7455
|
-
popsDOMUtils.off(this.$data.config.$target, this.$data.config.
|
|
7478
|
+
popsDOMUtils.off(this.$data.config.$target, this.$data.config.onCloseEventName, this.close, {
|
|
7456
7479
|
capture: true,
|
|
7457
7480
|
});
|
|
7458
7481
|
}
|
|
@@ -8861,7 +8884,7 @@ System.register('pops', [], (function (exports) {
|
|
|
8861
8884
|
/**
|
|
8862
8885
|
* 主动触发输入框改变事件
|
|
8863
8886
|
*/
|
|
8864
|
-
|
|
8887
|
+
emitValueChange() {
|
|
8865
8888
|
this.$el.input.dispatchEvent(new Event("input"));
|
|
8866
8889
|
},
|
|
8867
8890
|
/**
|
|
@@ -9631,7 +9654,6 @@ System.register('pops', [], (function (exports) {
|
|
|
9631
9654
|
/**
|
|
9632
9655
|
* 添加选中信息
|
|
9633
9656
|
* @param data 选择项的数据
|
|
9634
|
-
* @param [triggerValueChangeCallBack=true] 主动触发值改变回调
|
|
9635
9657
|
*/
|
|
9636
9658
|
addSelectedItemInfo(data) {
|
|
9637
9659
|
this.resetCurrentSelectedInfo();
|
|
@@ -10041,7 +10063,6 @@ System.register('pops', [], (function (exports) {
|
|
|
10041
10063
|
/**
|
|
10042
10064
|
* 添加选中信息
|
|
10043
10065
|
* @param data 选择项的数据
|
|
10044
|
-
* @param [triggerValueChangeCallBack=true] 主动触发值改变回调
|
|
10045
10066
|
*/
|
|
10046
10067
|
addSelectedItemInfo(data) {
|
|
10047
10068
|
this.resetCurrentSelectedInfo();
|
|
@@ -10752,11 +10773,11 @@ System.register('pops', [], (function (exports) {
|
|
|
10752
10773
|
/**
|
|
10753
10774
|
* 从保存的已选中的信息列表中移除目标信息
|
|
10754
10775
|
* @param data 需要移除的信息
|
|
10755
|
-
* @param [
|
|
10776
|
+
* @param [emitValueChangeCallBack=true] 是否触发值改变的回调
|
|
10756
10777
|
* + true (默认)触发值改变的回调
|
|
10757
10778
|
* + false 不触发值改变的回调
|
|
10758
10779
|
*/
|
|
10759
|
-
removeSelectedInfo(data,
|
|
10780
|
+
removeSelectedInfo(data, emitValueChangeCallBack = true) {
|
|
10760
10781
|
for (let index = 0; index < this.$data.selectedDataList.length; index++) {
|
|
10761
10782
|
const selectInfo = this.$data.selectedDataList[index];
|
|
10762
10783
|
if (selectInfo.value === data.value) {
|
|
@@ -10764,7 +10785,7 @@ System.register('pops', [], (function (exports) {
|
|
|
10764
10785
|
break;
|
|
10765
10786
|
}
|
|
10766
10787
|
}
|
|
10767
|
-
|
|
10788
|
+
emitValueChangeCallBack && this.onValueChange();
|
|
10768
10789
|
},
|
|
10769
10790
|
/** 显示输入框 */
|
|
10770
10791
|
showInputWrapper() {
|
|
@@ -11181,7 +11202,7 @@ System.register('pops', [], (function (exports) {
|
|
|
11181
11202
|
else {
|
|
11182
11203
|
leaveViewTransition();
|
|
11183
11204
|
}
|
|
11184
|
-
that.
|
|
11205
|
+
that.emitRenderRightContainer($currentSection);
|
|
11185
11206
|
}, {
|
|
11186
11207
|
once: true,
|
|
11187
11208
|
});
|
|
@@ -11223,7 +11244,7 @@ System.register('pops', [], (function (exports) {
|
|
|
11223
11244
|
$sectionBodyContainer: $deepMenuMain,
|
|
11224
11245
|
});
|
|
11225
11246
|
}
|
|
11226
|
-
that.
|
|
11247
|
+
that.emitRenderRightContainer($deepMenuSection);
|
|
11227
11248
|
},
|
|
11228
11249
|
/** 设置项的点击事件 */
|
|
11229
11250
|
onLiClick() {
|
|
@@ -11384,7 +11405,7 @@ System.register('pops', [], (function (exports) {
|
|
|
11384
11405
|
* 主动触发触发渲染右侧容器的事件
|
|
11385
11406
|
* @param $container 容器
|
|
11386
11407
|
*/
|
|
11387
|
-
|
|
11408
|
+
emitRenderRightContainer($container) {
|
|
11388
11409
|
const dataViewConfig = Reflect.get($container, this.$data.nodeStoreConfigKey);
|
|
11389
11410
|
this.$el.$pops.dispatchEvent(new CustomEvent("pops:renderRightContainer", {
|
|
11390
11411
|
detail: {
|
|
@@ -11449,7 +11470,7 @@ System.register('pops', [], (function (exports) {
|
|
|
11449
11470
|
return;
|
|
11450
11471
|
}
|
|
11451
11472
|
}
|
|
11452
|
-
this.
|
|
11473
|
+
this.emitRenderRightContainer(this.$el.$panelContentSectionContainer);
|
|
11453
11474
|
});
|
|
11454
11475
|
},
|
|
11455
11476
|
};
|
|
@@ -12383,15 +12404,15 @@ System.register('pops', [], (function (exports) {
|
|
|
12383
12404
|
}
|
|
12384
12405
|
// 鼠标|触摸 移入事件
|
|
12385
12406
|
// 在移动端会先触发touchstart再然后mouseenter
|
|
12386
|
-
let
|
|
12407
|
+
let isEmitTouchEvent = false;
|
|
12387
12408
|
/**
|
|
12388
12409
|
* 鼠标|触摸 移入事件
|
|
12389
12410
|
*/
|
|
12390
12411
|
function liElementHoverEvent(event) {
|
|
12391
12412
|
if (event.type === "touchstart") {
|
|
12392
|
-
|
|
12413
|
+
isEmitTouchEvent = true;
|
|
12393
12414
|
}
|
|
12394
|
-
if (
|
|
12415
|
+
if (isEmitTouchEvent && event.type === "mouseenter") {
|
|
12395
12416
|
return;
|
|
12396
12417
|
}
|
|
12397
12418
|
Array.from(menuULElement.children).forEach((liElement) => {
|
|
@@ -13343,7 +13364,7 @@ System.register('pops', [], (function (exports) {
|
|
|
13343
13364
|
},
|
|
13344
13365
|
};
|
|
13345
13366
|
|
|
13346
|
-
const version = "3.0
|
|
13367
|
+
const version = "3.1.0";
|
|
13347
13368
|
|
|
13348
13369
|
class Pops {
|
|
13349
13370
|
/** 配置 */
|