@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.esm.js
CHANGED
|
@@ -870,22 +870,25 @@ class PopsDOMUtilsEvent {
|
|
|
870
870
|
}
|
|
871
871
|
return option;
|
|
872
872
|
}
|
|
873
|
-
const
|
|
873
|
+
const that = this;
|
|
874
874
|
// eslint-disable-next-line prefer-rest-params
|
|
875
875
|
const args = arguments;
|
|
876
876
|
if (typeof element === "string") {
|
|
877
|
-
element =
|
|
877
|
+
element = that.selectorAll(element);
|
|
878
878
|
}
|
|
879
879
|
if (element == null) {
|
|
880
|
-
return
|
|
880
|
+
return {
|
|
881
|
+
off() { },
|
|
882
|
+
emit() { },
|
|
883
|
+
};
|
|
881
884
|
}
|
|
882
|
-
let
|
|
885
|
+
let $elList = [];
|
|
883
886
|
if (element instanceof NodeList || Array.isArray(element)) {
|
|
884
887
|
element = element;
|
|
885
|
-
|
|
888
|
+
$elList = [...element];
|
|
886
889
|
}
|
|
887
890
|
else {
|
|
888
|
-
|
|
891
|
+
$elList.push(element);
|
|
889
892
|
}
|
|
890
893
|
// 事件名
|
|
891
894
|
let eventTypeList = [];
|
|
@@ -927,10 +930,10 @@ class PopsDOMUtilsEvent {
|
|
|
927
930
|
*/
|
|
928
931
|
function checkOptionOnceToRemoveEventListener() {
|
|
929
932
|
if (listenerOption.once) {
|
|
930
|
-
|
|
933
|
+
that.off(element, eventType, selector, callback, option);
|
|
931
934
|
}
|
|
932
935
|
}
|
|
933
|
-
|
|
936
|
+
$elList.forEach((elementItem) => {
|
|
934
937
|
/**
|
|
935
938
|
* 事件回调
|
|
936
939
|
* @param event
|
|
@@ -950,12 +953,12 @@ class PopsDOMUtilsEvent {
|
|
|
950
953
|
}
|
|
951
954
|
const findValue = selectorList.find((selectorItem) => {
|
|
952
955
|
// 判断目标元素是否匹配选择器
|
|
953
|
-
if (
|
|
956
|
+
if (that.matches(eventTarget, selectorItem)) {
|
|
954
957
|
// 当前目标可以被selector所匹配到
|
|
955
958
|
return true;
|
|
956
959
|
}
|
|
957
960
|
// 在上层与主元素之间寻找可以被selector所匹配到的
|
|
958
|
-
const $closestMatches =
|
|
961
|
+
const $closestMatches = that.closest(eventTarget, selectorItem);
|
|
959
962
|
if ($closestMatches && totalParent?.contains($closestMatches)) {
|
|
960
963
|
eventTarget = $closestMatches;
|
|
961
964
|
return true;
|
|
@@ -1001,6 +1004,23 @@ class PopsDOMUtilsEvent {
|
|
|
1001
1004
|
Reflect.set(elementItem, SymbolEvents, elementEvents);
|
|
1002
1005
|
});
|
|
1003
1006
|
});
|
|
1007
|
+
return {
|
|
1008
|
+
/**
|
|
1009
|
+
* 取消绑定的监听事件
|
|
1010
|
+
* @param filter (可选)过滤函数,对元素属性上的事件进行过滤出想要删除的事件
|
|
1011
|
+
*/
|
|
1012
|
+
off: (filter) => {
|
|
1013
|
+
that.off($elList, eventTypeList, selectorList, listenerCallBack, listenerOption, filter);
|
|
1014
|
+
},
|
|
1015
|
+
/**
|
|
1016
|
+
* 主动触发事件
|
|
1017
|
+
* @param details 赋予触发的Event的额外属性,如果是Event类型,那么将自动代替默认new的Event对象
|
|
1018
|
+
* @param useDispatchToEmit 是否使用dispatchEvent来触发事件,默认true,如果为false,则直接调用callback,但是这种会让使用了selectorTarget的没有值
|
|
1019
|
+
*/
|
|
1020
|
+
emit: (details, useDispatchToEmit) => {
|
|
1021
|
+
that.emit($elList, eventTypeList, details, useDispatchToEmit);
|
|
1022
|
+
},
|
|
1023
|
+
};
|
|
1004
1024
|
}
|
|
1005
1025
|
off(element, eventType, selector, callback, option, filter) {
|
|
1006
1026
|
/**
|
|
@@ -1178,11 +1198,11 @@ class PopsDOMUtilsEvent {
|
|
|
1178
1198
|
* 等待文档加载完成后执行指定的函数
|
|
1179
1199
|
* @param callback 需要执行的函数
|
|
1180
1200
|
* @example
|
|
1181
|
-
* DOMUtils.
|
|
1201
|
+
* DOMUtils.onReady(function(){
|
|
1182
1202
|
* console.log("文档加载完毕")
|
|
1183
1203
|
* })
|
|
1184
1204
|
*/
|
|
1185
|
-
|
|
1205
|
+
onReady(callback) {
|
|
1186
1206
|
const that = this;
|
|
1187
1207
|
if (typeof callback !== "function") {
|
|
1188
1208
|
return;
|
|
@@ -1255,16 +1275,16 @@ class PopsDOMUtilsEvent {
|
|
|
1255
1275
|
* @param element 需要触发的元素|元素数组|window
|
|
1256
1276
|
* @param eventType 需要触发的事件
|
|
1257
1277
|
* @param details 赋予触发的Event的额外属性,如果是Event类型,那么将自动代替默认new的Event对象
|
|
1258
|
-
* @param
|
|
1278
|
+
* @param useDispatchToEmitEvent 是否使用dispatchEvent来触发事件,默认true
|
|
1259
1279
|
* @example
|
|
1260
1280
|
* // 触发元素a.xx的click事件
|
|
1261
|
-
* DOMUtils.
|
|
1262
|
-
* DOMUtils.
|
|
1281
|
+
* DOMUtils.emit(document.querySelector("a.xx"),"click")
|
|
1282
|
+
* DOMUtils.emit("a.xx","click")
|
|
1263
1283
|
* // 触发元素a.xx的click、tap、hover事件
|
|
1264
|
-
* DOMUtils.
|
|
1265
|
-
* DOMUtils.
|
|
1284
|
+
* DOMUtils.emit(document.querySelector("a.xx"),"click tap hover")
|
|
1285
|
+
* DOMUtils.emit("a.xx",["click","tap","hover"])
|
|
1266
1286
|
*/
|
|
1267
|
-
|
|
1287
|
+
emit(element, eventType, details, useDispatchToEmitEvent = true) {
|
|
1268
1288
|
if (typeof element === "string") {
|
|
1269
1289
|
element = PopsCore.document.querySelector(element);
|
|
1270
1290
|
}
|
|
@@ -1302,7 +1322,7 @@ class PopsDOMUtilsEvent {
|
|
|
1302
1322
|
});
|
|
1303
1323
|
}
|
|
1304
1324
|
}
|
|
1305
|
-
if (
|
|
1325
|
+
if (useDispatchToEmitEvent == false && _eventType_ in events) {
|
|
1306
1326
|
events[_eventType_].forEach((eventsItem) => {
|
|
1307
1327
|
eventsItem.callback(event);
|
|
1308
1328
|
});
|
|
@@ -1318,7 +1338,7 @@ class PopsDOMUtilsEvent {
|
|
|
1318
1338
|
* @param element 目标元素
|
|
1319
1339
|
* @param handler (可选)事件处理函数
|
|
1320
1340
|
* @param details (可选)赋予触发的Event的额外属性
|
|
1321
|
-
* @param
|
|
1341
|
+
* @param useDispatchToEmitEvent (可选)是否使用dispatchEvent来触发事件,默认true
|
|
1322
1342
|
* @example
|
|
1323
1343
|
* // 触发元素a.xx的click事件
|
|
1324
1344
|
* DOMUtils.click(document.querySelector("a.xx"))
|
|
@@ -1327,7 +1347,7 @@ class PopsDOMUtilsEvent {
|
|
|
1327
1347
|
* console.log("触发click事件成功")
|
|
1328
1348
|
* })
|
|
1329
1349
|
* */
|
|
1330
|
-
click(element, handler, details,
|
|
1350
|
+
click(element, handler, details, useDispatchToEmitEvent) {
|
|
1331
1351
|
const DOMUtilsContext = this;
|
|
1332
1352
|
if (typeof element === "string") {
|
|
1333
1353
|
element = PopsCore.document.querySelector(element);
|
|
@@ -1336,7 +1356,7 @@ class PopsDOMUtilsEvent {
|
|
|
1336
1356
|
return;
|
|
1337
1357
|
}
|
|
1338
1358
|
if (handler == null) {
|
|
1339
|
-
DOMUtilsContext.
|
|
1359
|
+
DOMUtilsContext.emit(element, "click", details, useDispatchToEmitEvent);
|
|
1340
1360
|
}
|
|
1341
1361
|
else {
|
|
1342
1362
|
DOMUtilsContext.on(element, "click", null, handler);
|
|
@@ -1347,7 +1367,7 @@ class PopsDOMUtilsEvent {
|
|
|
1347
1367
|
* @param element 目标元素
|
|
1348
1368
|
* @param handler (可选)事件处理函数
|
|
1349
1369
|
* @param details (可选)赋予触发的Event的额外属性
|
|
1350
|
-
* @param
|
|
1370
|
+
* @param useDispatchToEmitEvent (可选)是否使用dispatchEvent来触发事件,默认true
|
|
1351
1371
|
* @example
|
|
1352
1372
|
* // 触发元素a.xx的blur事件
|
|
1353
1373
|
* DOMUtils.blur(document.querySelector("a.xx"))
|
|
@@ -1356,7 +1376,7 @@ class PopsDOMUtilsEvent {
|
|
|
1356
1376
|
* console.log("触发blur事件成功")
|
|
1357
1377
|
* })
|
|
1358
1378
|
* */
|
|
1359
|
-
blur(element, handler, details,
|
|
1379
|
+
blur(element, handler, details, useDispatchToEmitEvent) {
|
|
1360
1380
|
const DOMUtilsContext = this;
|
|
1361
1381
|
if (typeof element === "string") {
|
|
1362
1382
|
element = PopsCore.document.querySelector(element);
|
|
@@ -1365,7 +1385,7 @@ class PopsDOMUtilsEvent {
|
|
|
1365
1385
|
return;
|
|
1366
1386
|
}
|
|
1367
1387
|
if (handler === null) {
|
|
1368
|
-
DOMUtilsContext.
|
|
1388
|
+
DOMUtilsContext.emit(element, "blur", details, useDispatchToEmitEvent);
|
|
1369
1389
|
}
|
|
1370
1390
|
else {
|
|
1371
1391
|
DOMUtilsContext.on(element, "blur", null, handler);
|
|
@@ -1376,7 +1396,7 @@ class PopsDOMUtilsEvent {
|
|
|
1376
1396
|
* @param element 目标元素
|
|
1377
1397
|
* @param handler (可选)事件处理函数
|
|
1378
1398
|
* @param details (可选)赋予触发的Event的额外属性
|
|
1379
|
-
* @param
|
|
1399
|
+
* @param useDispatchToEmitEvent (可选)是否使用dispatchEvent来触发事件,默认true
|
|
1380
1400
|
* @example
|
|
1381
1401
|
* // 触发元素a.xx的focus事件
|
|
1382
1402
|
* DOMUtils.focus(document.querySelector("a.xx"))
|
|
@@ -1385,7 +1405,7 @@ class PopsDOMUtilsEvent {
|
|
|
1385
1405
|
* console.log("触发focus事件成功")
|
|
1386
1406
|
* })
|
|
1387
1407
|
* */
|
|
1388
|
-
focus(element, handler, details,
|
|
1408
|
+
focus(element, handler, details, useDispatchToEmitEvent) {
|
|
1389
1409
|
const DOMUtilsContext = this;
|
|
1390
1410
|
if (typeof element === "string") {
|
|
1391
1411
|
element = PopsCore.document.querySelector(element);
|
|
@@ -1394,7 +1414,7 @@ class PopsDOMUtilsEvent {
|
|
|
1394
1414
|
return;
|
|
1395
1415
|
}
|
|
1396
1416
|
if (handler == null) {
|
|
1397
|
-
DOMUtilsContext.
|
|
1417
|
+
DOMUtilsContext.emit(element, "focus", details, useDispatchToEmitEvent);
|
|
1398
1418
|
}
|
|
1399
1419
|
else {
|
|
1400
1420
|
DOMUtilsContext.on(element, "focus", null, handler);
|
|
@@ -1414,7 +1434,7 @@ class PopsDOMUtilsEvent {
|
|
|
1414
1434
|
* console.log("移入/移除");
|
|
1415
1435
|
* })
|
|
1416
1436
|
*/
|
|
1417
|
-
|
|
1437
|
+
onHover(element, handler, option) {
|
|
1418
1438
|
const DOMUtilsContext = this;
|
|
1419
1439
|
if (typeof element === "string") {
|
|
1420
1440
|
element = PopsCore.document.querySelector(element);
|
|
@@ -1440,7 +1460,7 @@ class PopsDOMUtilsEvent {
|
|
|
1440
1460
|
* console.log("按键松开");
|
|
1441
1461
|
* })
|
|
1442
1462
|
*/
|
|
1443
|
-
|
|
1463
|
+
onKeyup(target, handler, option) {
|
|
1444
1464
|
const DOMUtilsContext = this;
|
|
1445
1465
|
if (target == null) {
|
|
1446
1466
|
return;
|
|
@@ -1465,7 +1485,7 @@ class PopsDOMUtilsEvent {
|
|
|
1465
1485
|
* console.log("按键按下");
|
|
1466
1486
|
* })
|
|
1467
1487
|
*/
|
|
1468
|
-
|
|
1488
|
+
onKeydown(target, handler, option) {
|
|
1469
1489
|
const DOMUtilsContext = this;
|
|
1470
1490
|
if (target == null) {
|
|
1471
1491
|
return;
|
|
@@ -1490,7 +1510,7 @@ class PopsDOMUtilsEvent {
|
|
|
1490
1510
|
* console.log("按键按下");
|
|
1491
1511
|
* })
|
|
1492
1512
|
*/
|
|
1493
|
-
|
|
1513
|
+
onKeypress(target, handler, option) {
|
|
1494
1514
|
const DOMUtilsContext = this;
|
|
1495
1515
|
if (target == null) {
|
|
1496
1516
|
return;
|
|
@@ -2549,6 +2569,9 @@ class PopsDOMUtils extends PopsDOMUtilsEvent {
|
|
|
2549
2569
|
* 监input、textarea的输入框值改变的事件
|
|
2550
2570
|
*/
|
|
2551
2571
|
onInput($el, callback, option) {
|
|
2572
|
+
/**
|
|
2573
|
+
* 是否正在输入中
|
|
2574
|
+
*/
|
|
2552
2575
|
let isComposite = false;
|
|
2553
2576
|
const __callback = async (event) => {
|
|
2554
2577
|
if (isComposite)
|
|
@@ -2560,18 +2583,18 @@ class PopsDOMUtils extends PopsDOMUtilsEvent {
|
|
|
2560
2583
|
};
|
|
2561
2584
|
const __composition_end_callback = () => {
|
|
2562
2585
|
isComposite = false;
|
|
2563
|
-
this.
|
|
2586
|
+
this.emit($el, "input", {
|
|
2564
2587
|
isComposite,
|
|
2565
2588
|
});
|
|
2566
2589
|
};
|
|
2567
|
-
this.on($el, "input", __callback, option);
|
|
2568
|
-
this.on($el, "compositionstart", __composition_start_callback, option);
|
|
2569
|
-
this.on($el, "compositionend", __composition_end_callback, option);
|
|
2590
|
+
const inputListener = this.on($el, "input", __callback, option);
|
|
2591
|
+
const compositionStartListener = this.on($el, "compositionstart", __composition_start_callback, option);
|
|
2592
|
+
const compositionEndListener = this.on($el, "compositionend", __composition_end_callback, option);
|
|
2570
2593
|
return {
|
|
2571
2594
|
off: () => {
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2595
|
+
inputListener.off();
|
|
2596
|
+
compositionStartListener.off();
|
|
2597
|
+
compositionEndListener.off();
|
|
2575
2598
|
},
|
|
2576
2599
|
};
|
|
2577
2600
|
}
|
|
@@ -3308,7 +3331,7 @@ const PopsInstanceUtils = {
|
|
|
3308
3331
|
popsDOMUtils.on($pops, popsDOMUtils.getTransitionEndNameList(), closeCallBack);
|
|
3309
3332
|
const popsTransForm = getComputedStyle($pops).transform;
|
|
3310
3333
|
if (popsTransForm !== "none") {
|
|
3311
|
-
popsDOMUtils.
|
|
3334
|
+
popsDOMUtils.emit($pops, popsDOMUtils.getTransitionEndNameList(), void 0, true);
|
|
3312
3335
|
return;
|
|
3313
3336
|
}
|
|
3314
3337
|
if (["top"].includes(drawerConfig.direction)) {
|
|
@@ -3351,7 +3374,7 @@ const PopsInstanceUtils = {
|
|
|
3351
3374
|
limit: true,
|
|
3352
3375
|
extraDistance: 3,
|
|
3353
3376
|
container: PopsCore.globalThis,
|
|
3354
|
-
|
|
3377
|
+
emitClick: true,
|
|
3355
3378
|
}, options);
|
|
3356
3379
|
let isMove = false;
|
|
3357
3380
|
// 点击元素,left偏移
|
|
@@ -3502,11 +3525,11 @@ const PopsInstanceUtils = {
|
|
|
3502
3525
|
}
|
|
3503
3526
|
}
|
|
3504
3527
|
});
|
|
3505
|
-
if (options.
|
|
3528
|
+
if (options.emitClick) {
|
|
3506
3529
|
// 因为会覆盖上面的点击事件,主动触发一下
|
|
3507
3530
|
anyTouchElement.on(["tap"], function (event) {
|
|
3508
3531
|
event.changedPoints.forEach((item) => {
|
|
3509
|
-
popsDOMUtils.
|
|
3532
|
+
popsDOMUtils.emit(item.target, "click", void 0, true);
|
|
3510
3533
|
});
|
|
3511
3534
|
});
|
|
3512
3535
|
}
|
|
@@ -5242,17 +5265,17 @@ const PopsFolder = {
|
|
|
5242
5265
|
});
|
|
5243
5266
|
// 设置默认触发的arrow
|
|
5244
5267
|
if (config.sort.name === "fileName") {
|
|
5245
|
-
popsDOMUtils.
|
|
5268
|
+
popsDOMUtils.emit(folderListSortFileNameElement, "click", {
|
|
5246
5269
|
notChangeSortRule: true,
|
|
5247
5270
|
});
|
|
5248
5271
|
}
|
|
5249
5272
|
else if (config.sort.name === "latestTime") {
|
|
5250
|
-
popsDOMUtils.
|
|
5273
|
+
popsDOMUtils.emit(folderListSortLatestTimeElement, "click", {
|
|
5251
5274
|
notChangeSortRule: true,
|
|
5252
5275
|
});
|
|
5253
5276
|
}
|
|
5254
5277
|
else if (config.sort.name === "fileSize") {
|
|
5255
|
-
popsDOMUtils.
|
|
5278
|
+
popsDOMUtils.emit(folderListSortFileSizeElement, "click", {
|
|
5256
5279
|
notChangeSortRule: true,
|
|
5257
5280
|
});
|
|
5258
5281
|
}
|
|
@@ -7048,8 +7071,8 @@ const PopsTooltipDefaultConfig = () => {
|
|
|
7048
7071
|
className: "",
|
|
7049
7072
|
isFixed: false,
|
|
7050
7073
|
alwaysShow: false,
|
|
7051
|
-
|
|
7052
|
-
|
|
7074
|
+
onShowEventName: "mouseenter touchstart",
|
|
7075
|
+
onCloseEventName: "mouseleave touchend",
|
|
7053
7076
|
zIndex: 10000,
|
|
7054
7077
|
only: false,
|
|
7055
7078
|
eventOption: {
|
|
@@ -7380,13 +7403,13 @@ class ToolTip {
|
|
|
7380
7403
|
* 绑定 显示事件
|
|
7381
7404
|
*/
|
|
7382
7405
|
onShowEvent() {
|
|
7383
|
-
popsDOMUtils.on(this.$data.config.$target, this.$data.config.
|
|
7406
|
+
popsDOMUtils.on(this.$data.config.$target, this.$data.config.onShowEventName, this.show, this.$data.config.eventOption);
|
|
7384
7407
|
}
|
|
7385
7408
|
/**
|
|
7386
7409
|
* 取消绑定 显示事件
|
|
7387
7410
|
*/
|
|
7388
7411
|
offShowEvent() {
|
|
7389
|
-
popsDOMUtils.off(this.$data.config.$target, this.$data.config.
|
|
7412
|
+
popsDOMUtils.off(this.$data.config.$target, this.$data.config.onShowEventName, this.show, {
|
|
7390
7413
|
capture: true,
|
|
7391
7414
|
});
|
|
7392
7415
|
}
|
|
@@ -7441,13 +7464,13 @@ class ToolTip {
|
|
|
7441
7464
|
* 绑定 关闭事件
|
|
7442
7465
|
*/
|
|
7443
7466
|
onCloseEvent() {
|
|
7444
|
-
popsDOMUtils.on(this.$data.config.$target, this.$data.config.
|
|
7467
|
+
popsDOMUtils.on(this.$data.config.$target, this.$data.config.onCloseEventName, this.close, this.$data.config.eventOption);
|
|
7445
7468
|
}
|
|
7446
7469
|
/**
|
|
7447
7470
|
* 取消绑定 关闭事件
|
|
7448
7471
|
*/
|
|
7449
7472
|
offCloseEvent() {
|
|
7450
|
-
popsDOMUtils.off(this.$data.config.$target, this.$data.config.
|
|
7473
|
+
popsDOMUtils.off(this.$data.config.$target, this.$data.config.onCloseEventName, this.close, {
|
|
7451
7474
|
capture: true,
|
|
7452
7475
|
});
|
|
7453
7476
|
}
|
|
@@ -8856,7 +8879,7 @@ const PanelHandlerComponents = () => {
|
|
|
8856
8879
|
/**
|
|
8857
8880
|
* 主动触发输入框改变事件
|
|
8858
8881
|
*/
|
|
8859
|
-
|
|
8882
|
+
emitValueChange() {
|
|
8860
8883
|
this.$el.input.dispatchEvent(new Event("input"));
|
|
8861
8884
|
},
|
|
8862
8885
|
/**
|
|
@@ -9626,7 +9649,6 @@ const PanelHandlerComponents = () => {
|
|
|
9626
9649
|
/**
|
|
9627
9650
|
* 添加选中信息
|
|
9628
9651
|
* @param data 选择项的数据
|
|
9629
|
-
* @param [triggerValueChangeCallBack=true] 主动触发值改变回调
|
|
9630
9652
|
*/
|
|
9631
9653
|
addSelectedItemInfo(data) {
|
|
9632
9654
|
this.resetCurrentSelectedInfo();
|
|
@@ -10036,7 +10058,6 @@ const PanelHandlerComponents = () => {
|
|
|
10036
10058
|
/**
|
|
10037
10059
|
* 添加选中信息
|
|
10038
10060
|
* @param data 选择项的数据
|
|
10039
|
-
* @param [triggerValueChangeCallBack=true] 主动触发值改变回调
|
|
10040
10061
|
*/
|
|
10041
10062
|
addSelectedItemInfo(data) {
|
|
10042
10063
|
this.resetCurrentSelectedInfo();
|
|
@@ -10747,11 +10768,11 @@ const PanelHandlerComponents = () => {
|
|
|
10747
10768
|
/**
|
|
10748
10769
|
* 从保存的已选中的信息列表中移除目标信息
|
|
10749
10770
|
* @param data 需要移除的信息
|
|
10750
|
-
* @param [
|
|
10771
|
+
* @param [emitValueChangeCallBack=true] 是否触发值改变的回调
|
|
10751
10772
|
* + true (默认)触发值改变的回调
|
|
10752
10773
|
* + false 不触发值改变的回调
|
|
10753
10774
|
*/
|
|
10754
|
-
removeSelectedInfo(data,
|
|
10775
|
+
removeSelectedInfo(data, emitValueChangeCallBack = true) {
|
|
10755
10776
|
for (let index = 0; index < this.$data.selectedDataList.length; index++) {
|
|
10756
10777
|
const selectInfo = this.$data.selectedDataList[index];
|
|
10757
10778
|
if (selectInfo.value === data.value) {
|
|
@@ -10759,7 +10780,7 @@ const PanelHandlerComponents = () => {
|
|
|
10759
10780
|
break;
|
|
10760
10781
|
}
|
|
10761
10782
|
}
|
|
10762
|
-
|
|
10783
|
+
emitValueChangeCallBack && this.onValueChange();
|
|
10763
10784
|
},
|
|
10764
10785
|
/** 显示输入框 */
|
|
10765
10786
|
showInputWrapper() {
|
|
@@ -11176,7 +11197,7 @@ const PanelHandlerComponents = () => {
|
|
|
11176
11197
|
else {
|
|
11177
11198
|
leaveViewTransition();
|
|
11178
11199
|
}
|
|
11179
|
-
that.
|
|
11200
|
+
that.emitRenderRightContainer($currentSection);
|
|
11180
11201
|
}, {
|
|
11181
11202
|
once: true,
|
|
11182
11203
|
});
|
|
@@ -11218,7 +11239,7 @@ const PanelHandlerComponents = () => {
|
|
|
11218
11239
|
$sectionBodyContainer: $deepMenuMain,
|
|
11219
11240
|
});
|
|
11220
11241
|
}
|
|
11221
|
-
that.
|
|
11242
|
+
that.emitRenderRightContainer($deepMenuSection);
|
|
11222
11243
|
},
|
|
11223
11244
|
/** 设置项的点击事件 */
|
|
11224
11245
|
onLiClick() {
|
|
@@ -11379,7 +11400,7 @@ const PanelHandlerComponents = () => {
|
|
|
11379
11400
|
* 主动触发触发渲染右侧容器的事件
|
|
11380
11401
|
* @param $container 容器
|
|
11381
11402
|
*/
|
|
11382
|
-
|
|
11403
|
+
emitRenderRightContainer($container) {
|
|
11383
11404
|
const dataViewConfig = Reflect.get($container, this.$data.nodeStoreConfigKey);
|
|
11384
11405
|
this.$el.$pops.dispatchEvent(new CustomEvent("pops:renderRightContainer", {
|
|
11385
11406
|
detail: {
|
|
@@ -11444,7 +11465,7 @@ const PanelHandlerComponents = () => {
|
|
|
11444
11465
|
return;
|
|
11445
11466
|
}
|
|
11446
11467
|
}
|
|
11447
|
-
this.
|
|
11468
|
+
this.emitRenderRightContainer(this.$el.$panelContentSectionContainer);
|
|
11448
11469
|
});
|
|
11449
11470
|
},
|
|
11450
11471
|
};
|
|
@@ -12378,15 +12399,15 @@ const PopsRightClickMenu = {
|
|
|
12378
12399
|
}
|
|
12379
12400
|
// 鼠标|触摸 移入事件
|
|
12380
12401
|
// 在移动端会先触发touchstart再然后mouseenter
|
|
12381
|
-
let
|
|
12402
|
+
let isEmitTouchEvent = false;
|
|
12382
12403
|
/**
|
|
12383
12404
|
* 鼠标|触摸 移入事件
|
|
12384
12405
|
*/
|
|
12385
12406
|
function liElementHoverEvent(event) {
|
|
12386
12407
|
if (event.type === "touchstart") {
|
|
12387
|
-
|
|
12408
|
+
isEmitTouchEvent = true;
|
|
12388
12409
|
}
|
|
12389
|
-
if (
|
|
12410
|
+
if (isEmitTouchEvent && event.type === "mouseenter") {
|
|
12390
12411
|
return;
|
|
12391
12412
|
}
|
|
12392
12413
|
Array.from(menuULElement.children).forEach((liElement) => {
|
|
@@ -13338,7 +13359,7 @@ const PopsSearchSuggestion = {
|
|
|
13338
13359
|
},
|
|
13339
13360
|
};
|
|
13340
13361
|
|
|
13341
|
-
const version = "3.0
|
|
13362
|
+
const version = "3.1.0";
|
|
13342
13363
|
|
|
13343
13364
|
class Pops {
|
|
13344
13365
|
/** 配置 */
|