@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.iife.js
CHANGED
|
@@ -873,22 +873,25 @@ var pops = (function () {
|
|
|
873
873
|
}
|
|
874
874
|
return option;
|
|
875
875
|
}
|
|
876
|
-
const
|
|
876
|
+
const that = this;
|
|
877
877
|
// eslint-disable-next-line prefer-rest-params
|
|
878
878
|
const args = arguments;
|
|
879
879
|
if (typeof element === "string") {
|
|
880
|
-
element =
|
|
880
|
+
element = that.selectorAll(element);
|
|
881
881
|
}
|
|
882
882
|
if (element == null) {
|
|
883
|
-
return
|
|
883
|
+
return {
|
|
884
|
+
off() { },
|
|
885
|
+
emit() { },
|
|
886
|
+
};
|
|
884
887
|
}
|
|
885
|
-
let
|
|
888
|
+
let $elList = [];
|
|
886
889
|
if (element instanceof NodeList || Array.isArray(element)) {
|
|
887
890
|
element = element;
|
|
888
|
-
|
|
891
|
+
$elList = [...element];
|
|
889
892
|
}
|
|
890
893
|
else {
|
|
891
|
-
|
|
894
|
+
$elList.push(element);
|
|
892
895
|
}
|
|
893
896
|
// 事件名
|
|
894
897
|
let eventTypeList = [];
|
|
@@ -930,10 +933,10 @@ var pops = (function () {
|
|
|
930
933
|
*/
|
|
931
934
|
function checkOptionOnceToRemoveEventListener() {
|
|
932
935
|
if (listenerOption.once) {
|
|
933
|
-
|
|
936
|
+
that.off(element, eventType, selector, callback, option);
|
|
934
937
|
}
|
|
935
938
|
}
|
|
936
|
-
|
|
939
|
+
$elList.forEach((elementItem) => {
|
|
937
940
|
/**
|
|
938
941
|
* 事件回调
|
|
939
942
|
* @param event
|
|
@@ -953,12 +956,12 @@ var pops = (function () {
|
|
|
953
956
|
}
|
|
954
957
|
const findValue = selectorList.find((selectorItem) => {
|
|
955
958
|
// 判断目标元素是否匹配选择器
|
|
956
|
-
if (
|
|
959
|
+
if (that.matches(eventTarget, selectorItem)) {
|
|
957
960
|
// 当前目标可以被selector所匹配到
|
|
958
961
|
return true;
|
|
959
962
|
}
|
|
960
963
|
// 在上层与主元素之间寻找可以被selector所匹配到的
|
|
961
|
-
const $closestMatches =
|
|
964
|
+
const $closestMatches = that.closest(eventTarget, selectorItem);
|
|
962
965
|
if ($closestMatches && totalParent?.contains($closestMatches)) {
|
|
963
966
|
eventTarget = $closestMatches;
|
|
964
967
|
return true;
|
|
@@ -1004,6 +1007,23 @@ var pops = (function () {
|
|
|
1004
1007
|
Reflect.set(elementItem, SymbolEvents, elementEvents);
|
|
1005
1008
|
});
|
|
1006
1009
|
});
|
|
1010
|
+
return {
|
|
1011
|
+
/**
|
|
1012
|
+
* 取消绑定的监听事件
|
|
1013
|
+
* @param filter (可选)过滤函数,对元素属性上的事件进行过滤出想要删除的事件
|
|
1014
|
+
*/
|
|
1015
|
+
off: (filter) => {
|
|
1016
|
+
that.off($elList, eventTypeList, selectorList, listenerCallBack, listenerOption, filter);
|
|
1017
|
+
},
|
|
1018
|
+
/**
|
|
1019
|
+
* 主动触发事件
|
|
1020
|
+
* @param details 赋予触发的Event的额外属性,如果是Event类型,那么将自动代替默认new的Event对象
|
|
1021
|
+
* @param useDispatchToEmit 是否使用dispatchEvent来触发事件,默认true,如果为false,则直接调用callback,但是这种会让使用了selectorTarget的没有值
|
|
1022
|
+
*/
|
|
1023
|
+
emit: (details, useDispatchToEmit) => {
|
|
1024
|
+
that.emit($elList, eventTypeList, details, useDispatchToEmit);
|
|
1025
|
+
},
|
|
1026
|
+
};
|
|
1007
1027
|
}
|
|
1008
1028
|
off(element, eventType, selector, callback, option, filter) {
|
|
1009
1029
|
/**
|
|
@@ -1181,11 +1201,11 @@ var pops = (function () {
|
|
|
1181
1201
|
* 等待文档加载完成后执行指定的函数
|
|
1182
1202
|
* @param callback 需要执行的函数
|
|
1183
1203
|
* @example
|
|
1184
|
-
* DOMUtils.
|
|
1204
|
+
* DOMUtils.onReady(function(){
|
|
1185
1205
|
* console.log("文档加载完毕")
|
|
1186
1206
|
* })
|
|
1187
1207
|
*/
|
|
1188
|
-
|
|
1208
|
+
onReady(callback) {
|
|
1189
1209
|
const that = this;
|
|
1190
1210
|
if (typeof callback !== "function") {
|
|
1191
1211
|
return;
|
|
@@ -1258,16 +1278,16 @@ var pops = (function () {
|
|
|
1258
1278
|
* @param element 需要触发的元素|元素数组|window
|
|
1259
1279
|
* @param eventType 需要触发的事件
|
|
1260
1280
|
* @param details 赋予触发的Event的额外属性,如果是Event类型,那么将自动代替默认new的Event对象
|
|
1261
|
-
* @param
|
|
1281
|
+
* @param useDispatchToEmitEvent 是否使用dispatchEvent来触发事件,默认true
|
|
1262
1282
|
* @example
|
|
1263
1283
|
* // 触发元素a.xx的click事件
|
|
1264
|
-
* DOMUtils.
|
|
1265
|
-
* DOMUtils.
|
|
1284
|
+
* DOMUtils.emit(document.querySelector("a.xx"),"click")
|
|
1285
|
+
* DOMUtils.emit("a.xx","click")
|
|
1266
1286
|
* // 触发元素a.xx的click、tap、hover事件
|
|
1267
|
-
* DOMUtils.
|
|
1268
|
-
* DOMUtils.
|
|
1287
|
+
* DOMUtils.emit(document.querySelector("a.xx"),"click tap hover")
|
|
1288
|
+
* DOMUtils.emit("a.xx",["click","tap","hover"])
|
|
1269
1289
|
*/
|
|
1270
|
-
|
|
1290
|
+
emit(element, eventType, details, useDispatchToEmitEvent = true) {
|
|
1271
1291
|
if (typeof element === "string") {
|
|
1272
1292
|
element = PopsCore.document.querySelector(element);
|
|
1273
1293
|
}
|
|
@@ -1305,7 +1325,7 @@ var pops = (function () {
|
|
|
1305
1325
|
});
|
|
1306
1326
|
}
|
|
1307
1327
|
}
|
|
1308
|
-
if (
|
|
1328
|
+
if (useDispatchToEmitEvent == false && _eventType_ in events) {
|
|
1309
1329
|
events[_eventType_].forEach((eventsItem) => {
|
|
1310
1330
|
eventsItem.callback(event);
|
|
1311
1331
|
});
|
|
@@ -1321,7 +1341,7 @@ var pops = (function () {
|
|
|
1321
1341
|
* @param element 目标元素
|
|
1322
1342
|
* @param handler (可选)事件处理函数
|
|
1323
1343
|
* @param details (可选)赋予触发的Event的额外属性
|
|
1324
|
-
* @param
|
|
1344
|
+
* @param useDispatchToEmitEvent (可选)是否使用dispatchEvent来触发事件,默认true
|
|
1325
1345
|
* @example
|
|
1326
1346
|
* // 触发元素a.xx的click事件
|
|
1327
1347
|
* DOMUtils.click(document.querySelector("a.xx"))
|
|
@@ -1330,7 +1350,7 @@ var pops = (function () {
|
|
|
1330
1350
|
* console.log("触发click事件成功")
|
|
1331
1351
|
* })
|
|
1332
1352
|
* */
|
|
1333
|
-
click(element, handler, details,
|
|
1353
|
+
click(element, handler, details, useDispatchToEmitEvent) {
|
|
1334
1354
|
const DOMUtilsContext = this;
|
|
1335
1355
|
if (typeof element === "string") {
|
|
1336
1356
|
element = PopsCore.document.querySelector(element);
|
|
@@ -1339,7 +1359,7 @@ var pops = (function () {
|
|
|
1339
1359
|
return;
|
|
1340
1360
|
}
|
|
1341
1361
|
if (handler == null) {
|
|
1342
|
-
DOMUtilsContext.
|
|
1362
|
+
DOMUtilsContext.emit(element, "click", details, useDispatchToEmitEvent);
|
|
1343
1363
|
}
|
|
1344
1364
|
else {
|
|
1345
1365
|
DOMUtilsContext.on(element, "click", null, handler);
|
|
@@ -1350,7 +1370,7 @@ var pops = (function () {
|
|
|
1350
1370
|
* @param element 目标元素
|
|
1351
1371
|
* @param handler (可选)事件处理函数
|
|
1352
1372
|
* @param details (可选)赋予触发的Event的额外属性
|
|
1353
|
-
* @param
|
|
1373
|
+
* @param useDispatchToEmitEvent (可选)是否使用dispatchEvent来触发事件,默认true
|
|
1354
1374
|
* @example
|
|
1355
1375
|
* // 触发元素a.xx的blur事件
|
|
1356
1376
|
* DOMUtils.blur(document.querySelector("a.xx"))
|
|
@@ -1359,7 +1379,7 @@ var pops = (function () {
|
|
|
1359
1379
|
* console.log("触发blur事件成功")
|
|
1360
1380
|
* })
|
|
1361
1381
|
* */
|
|
1362
|
-
blur(element, handler, details,
|
|
1382
|
+
blur(element, handler, details, useDispatchToEmitEvent) {
|
|
1363
1383
|
const DOMUtilsContext = this;
|
|
1364
1384
|
if (typeof element === "string") {
|
|
1365
1385
|
element = PopsCore.document.querySelector(element);
|
|
@@ -1368,7 +1388,7 @@ var pops = (function () {
|
|
|
1368
1388
|
return;
|
|
1369
1389
|
}
|
|
1370
1390
|
if (handler === null) {
|
|
1371
|
-
DOMUtilsContext.
|
|
1391
|
+
DOMUtilsContext.emit(element, "blur", details, useDispatchToEmitEvent);
|
|
1372
1392
|
}
|
|
1373
1393
|
else {
|
|
1374
1394
|
DOMUtilsContext.on(element, "blur", null, handler);
|
|
@@ -1379,7 +1399,7 @@ var pops = (function () {
|
|
|
1379
1399
|
* @param element 目标元素
|
|
1380
1400
|
* @param handler (可选)事件处理函数
|
|
1381
1401
|
* @param details (可选)赋予触发的Event的额外属性
|
|
1382
|
-
* @param
|
|
1402
|
+
* @param useDispatchToEmitEvent (可选)是否使用dispatchEvent来触发事件,默认true
|
|
1383
1403
|
* @example
|
|
1384
1404
|
* // 触发元素a.xx的focus事件
|
|
1385
1405
|
* DOMUtils.focus(document.querySelector("a.xx"))
|
|
@@ -1388,7 +1408,7 @@ var pops = (function () {
|
|
|
1388
1408
|
* console.log("触发focus事件成功")
|
|
1389
1409
|
* })
|
|
1390
1410
|
* */
|
|
1391
|
-
focus(element, handler, details,
|
|
1411
|
+
focus(element, handler, details, useDispatchToEmitEvent) {
|
|
1392
1412
|
const DOMUtilsContext = this;
|
|
1393
1413
|
if (typeof element === "string") {
|
|
1394
1414
|
element = PopsCore.document.querySelector(element);
|
|
@@ -1397,7 +1417,7 @@ var pops = (function () {
|
|
|
1397
1417
|
return;
|
|
1398
1418
|
}
|
|
1399
1419
|
if (handler == null) {
|
|
1400
|
-
DOMUtilsContext.
|
|
1420
|
+
DOMUtilsContext.emit(element, "focus", details, useDispatchToEmitEvent);
|
|
1401
1421
|
}
|
|
1402
1422
|
else {
|
|
1403
1423
|
DOMUtilsContext.on(element, "focus", null, handler);
|
|
@@ -1417,7 +1437,7 @@ var pops = (function () {
|
|
|
1417
1437
|
* console.log("移入/移除");
|
|
1418
1438
|
* })
|
|
1419
1439
|
*/
|
|
1420
|
-
|
|
1440
|
+
onHover(element, handler, option) {
|
|
1421
1441
|
const DOMUtilsContext = this;
|
|
1422
1442
|
if (typeof element === "string") {
|
|
1423
1443
|
element = PopsCore.document.querySelector(element);
|
|
@@ -1443,7 +1463,7 @@ var pops = (function () {
|
|
|
1443
1463
|
* console.log("按键松开");
|
|
1444
1464
|
* })
|
|
1445
1465
|
*/
|
|
1446
|
-
|
|
1466
|
+
onKeyup(target, handler, option) {
|
|
1447
1467
|
const DOMUtilsContext = this;
|
|
1448
1468
|
if (target == null) {
|
|
1449
1469
|
return;
|
|
@@ -1468,7 +1488,7 @@ var pops = (function () {
|
|
|
1468
1488
|
* console.log("按键按下");
|
|
1469
1489
|
* })
|
|
1470
1490
|
*/
|
|
1471
|
-
|
|
1491
|
+
onKeydown(target, handler, option) {
|
|
1472
1492
|
const DOMUtilsContext = this;
|
|
1473
1493
|
if (target == null) {
|
|
1474
1494
|
return;
|
|
@@ -1493,7 +1513,7 @@ var pops = (function () {
|
|
|
1493
1513
|
* console.log("按键按下");
|
|
1494
1514
|
* })
|
|
1495
1515
|
*/
|
|
1496
|
-
|
|
1516
|
+
onKeypress(target, handler, option) {
|
|
1497
1517
|
const DOMUtilsContext = this;
|
|
1498
1518
|
if (target == null) {
|
|
1499
1519
|
return;
|
|
@@ -2552,6 +2572,9 @@ var pops = (function () {
|
|
|
2552
2572
|
* 监input、textarea的输入框值改变的事件
|
|
2553
2573
|
*/
|
|
2554
2574
|
onInput($el, callback, option) {
|
|
2575
|
+
/**
|
|
2576
|
+
* 是否正在输入中
|
|
2577
|
+
*/
|
|
2555
2578
|
let isComposite = false;
|
|
2556
2579
|
const __callback = async (event) => {
|
|
2557
2580
|
if (isComposite)
|
|
@@ -2563,18 +2586,18 @@ var pops = (function () {
|
|
|
2563
2586
|
};
|
|
2564
2587
|
const __composition_end_callback = () => {
|
|
2565
2588
|
isComposite = false;
|
|
2566
|
-
this.
|
|
2589
|
+
this.emit($el, "input", {
|
|
2567
2590
|
isComposite,
|
|
2568
2591
|
});
|
|
2569
2592
|
};
|
|
2570
|
-
this.on($el, "input", __callback, option);
|
|
2571
|
-
this.on($el, "compositionstart", __composition_start_callback, option);
|
|
2572
|
-
this.on($el, "compositionend", __composition_end_callback, option);
|
|
2593
|
+
const inputListener = this.on($el, "input", __callback, option);
|
|
2594
|
+
const compositionStartListener = this.on($el, "compositionstart", __composition_start_callback, option);
|
|
2595
|
+
const compositionEndListener = this.on($el, "compositionend", __composition_end_callback, option);
|
|
2573
2596
|
return {
|
|
2574
2597
|
off: () => {
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2598
|
+
inputListener.off();
|
|
2599
|
+
compositionStartListener.off();
|
|
2600
|
+
compositionEndListener.off();
|
|
2578
2601
|
},
|
|
2579
2602
|
};
|
|
2580
2603
|
}
|
|
@@ -3311,7 +3334,7 @@ var pops = (function () {
|
|
|
3311
3334
|
popsDOMUtils.on($pops, popsDOMUtils.getTransitionEndNameList(), closeCallBack);
|
|
3312
3335
|
const popsTransForm = getComputedStyle($pops).transform;
|
|
3313
3336
|
if (popsTransForm !== "none") {
|
|
3314
|
-
popsDOMUtils.
|
|
3337
|
+
popsDOMUtils.emit($pops, popsDOMUtils.getTransitionEndNameList(), void 0, true);
|
|
3315
3338
|
return;
|
|
3316
3339
|
}
|
|
3317
3340
|
if (["top"].includes(drawerConfig.direction)) {
|
|
@@ -3354,7 +3377,7 @@ var pops = (function () {
|
|
|
3354
3377
|
limit: true,
|
|
3355
3378
|
extraDistance: 3,
|
|
3356
3379
|
container: PopsCore.globalThis,
|
|
3357
|
-
|
|
3380
|
+
emitClick: true,
|
|
3358
3381
|
}, options);
|
|
3359
3382
|
let isMove = false;
|
|
3360
3383
|
// 点击元素,left偏移
|
|
@@ -3505,11 +3528,11 @@ var pops = (function () {
|
|
|
3505
3528
|
}
|
|
3506
3529
|
}
|
|
3507
3530
|
});
|
|
3508
|
-
if (options.
|
|
3531
|
+
if (options.emitClick) {
|
|
3509
3532
|
// 因为会覆盖上面的点击事件,主动触发一下
|
|
3510
3533
|
anyTouchElement.on(["tap"], function (event) {
|
|
3511
3534
|
event.changedPoints.forEach((item) => {
|
|
3512
|
-
popsDOMUtils.
|
|
3535
|
+
popsDOMUtils.emit(item.target, "click", void 0, true);
|
|
3513
3536
|
});
|
|
3514
3537
|
});
|
|
3515
3538
|
}
|
|
@@ -5245,17 +5268,17 @@ var pops = (function () {
|
|
|
5245
5268
|
});
|
|
5246
5269
|
// 设置默认触发的arrow
|
|
5247
5270
|
if (config.sort.name === "fileName") {
|
|
5248
|
-
popsDOMUtils.
|
|
5271
|
+
popsDOMUtils.emit(folderListSortFileNameElement, "click", {
|
|
5249
5272
|
notChangeSortRule: true,
|
|
5250
5273
|
});
|
|
5251
5274
|
}
|
|
5252
5275
|
else if (config.sort.name === "latestTime") {
|
|
5253
|
-
popsDOMUtils.
|
|
5276
|
+
popsDOMUtils.emit(folderListSortLatestTimeElement, "click", {
|
|
5254
5277
|
notChangeSortRule: true,
|
|
5255
5278
|
});
|
|
5256
5279
|
}
|
|
5257
5280
|
else if (config.sort.name === "fileSize") {
|
|
5258
|
-
popsDOMUtils.
|
|
5281
|
+
popsDOMUtils.emit(folderListSortFileSizeElement, "click", {
|
|
5259
5282
|
notChangeSortRule: true,
|
|
5260
5283
|
});
|
|
5261
5284
|
}
|
|
@@ -7051,8 +7074,8 @@ var pops = (function () {
|
|
|
7051
7074
|
className: "",
|
|
7052
7075
|
isFixed: false,
|
|
7053
7076
|
alwaysShow: false,
|
|
7054
|
-
|
|
7055
|
-
|
|
7077
|
+
onShowEventName: "mouseenter touchstart",
|
|
7078
|
+
onCloseEventName: "mouseleave touchend",
|
|
7056
7079
|
zIndex: 10000,
|
|
7057
7080
|
only: false,
|
|
7058
7081
|
eventOption: {
|
|
@@ -7383,13 +7406,13 @@ var pops = (function () {
|
|
|
7383
7406
|
* 绑定 显示事件
|
|
7384
7407
|
*/
|
|
7385
7408
|
onShowEvent() {
|
|
7386
|
-
popsDOMUtils.on(this.$data.config.$target, this.$data.config.
|
|
7409
|
+
popsDOMUtils.on(this.$data.config.$target, this.$data.config.onShowEventName, this.show, this.$data.config.eventOption);
|
|
7387
7410
|
}
|
|
7388
7411
|
/**
|
|
7389
7412
|
* 取消绑定 显示事件
|
|
7390
7413
|
*/
|
|
7391
7414
|
offShowEvent() {
|
|
7392
|
-
popsDOMUtils.off(this.$data.config.$target, this.$data.config.
|
|
7415
|
+
popsDOMUtils.off(this.$data.config.$target, this.$data.config.onShowEventName, this.show, {
|
|
7393
7416
|
capture: true,
|
|
7394
7417
|
});
|
|
7395
7418
|
}
|
|
@@ -7444,13 +7467,13 @@ var pops = (function () {
|
|
|
7444
7467
|
* 绑定 关闭事件
|
|
7445
7468
|
*/
|
|
7446
7469
|
onCloseEvent() {
|
|
7447
|
-
popsDOMUtils.on(this.$data.config.$target, this.$data.config.
|
|
7470
|
+
popsDOMUtils.on(this.$data.config.$target, this.$data.config.onCloseEventName, this.close, this.$data.config.eventOption);
|
|
7448
7471
|
}
|
|
7449
7472
|
/**
|
|
7450
7473
|
* 取消绑定 关闭事件
|
|
7451
7474
|
*/
|
|
7452
7475
|
offCloseEvent() {
|
|
7453
|
-
popsDOMUtils.off(this.$data.config.$target, this.$data.config.
|
|
7476
|
+
popsDOMUtils.off(this.$data.config.$target, this.$data.config.onCloseEventName, this.close, {
|
|
7454
7477
|
capture: true,
|
|
7455
7478
|
});
|
|
7456
7479
|
}
|
|
@@ -8859,7 +8882,7 @@ var pops = (function () {
|
|
|
8859
8882
|
/**
|
|
8860
8883
|
* 主动触发输入框改变事件
|
|
8861
8884
|
*/
|
|
8862
|
-
|
|
8885
|
+
emitValueChange() {
|
|
8863
8886
|
this.$el.input.dispatchEvent(new Event("input"));
|
|
8864
8887
|
},
|
|
8865
8888
|
/**
|
|
@@ -9629,7 +9652,6 @@ var pops = (function () {
|
|
|
9629
9652
|
/**
|
|
9630
9653
|
* 添加选中信息
|
|
9631
9654
|
* @param data 选择项的数据
|
|
9632
|
-
* @param [triggerValueChangeCallBack=true] 主动触发值改变回调
|
|
9633
9655
|
*/
|
|
9634
9656
|
addSelectedItemInfo(data) {
|
|
9635
9657
|
this.resetCurrentSelectedInfo();
|
|
@@ -10039,7 +10061,6 @@ var pops = (function () {
|
|
|
10039
10061
|
/**
|
|
10040
10062
|
* 添加选中信息
|
|
10041
10063
|
* @param data 选择项的数据
|
|
10042
|
-
* @param [triggerValueChangeCallBack=true] 主动触发值改变回调
|
|
10043
10064
|
*/
|
|
10044
10065
|
addSelectedItemInfo(data) {
|
|
10045
10066
|
this.resetCurrentSelectedInfo();
|
|
@@ -10750,11 +10771,11 @@ var pops = (function () {
|
|
|
10750
10771
|
/**
|
|
10751
10772
|
* 从保存的已选中的信息列表中移除目标信息
|
|
10752
10773
|
* @param data 需要移除的信息
|
|
10753
|
-
* @param [
|
|
10774
|
+
* @param [emitValueChangeCallBack=true] 是否触发值改变的回调
|
|
10754
10775
|
* + true (默认)触发值改变的回调
|
|
10755
10776
|
* + false 不触发值改变的回调
|
|
10756
10777
|
*/
|
|
10757
|
-
removeSelectedInfo(data,
|
|
10778
|
+
removeSelectedInfo(data, emitValueChangeCallBack = true) {
|
|
10758
10779
|
for (let index = 0; index < this.$data.selectedDataList.length; index++) {
|
|
10759
10780
|
const selectInfo = this.$data.selectedDataList[index];
|
|
10760
10781
|
if (selectInfo.value === data.value) {
|
|
@@ -10762,7 +10783,7 @@ var pops = (function () {
|
|
|
10762
10783
|
break;
|
|
10763
10784
|
}
|
|
10764
10785
|
}
|
|
10765
|
-
|
|
10786
|
+
emitValueChangeCallBack && this.onValueChange();
|
|
10766
10787
|
},
|
|
10767
10788
|
/** 显示输入框 */
|
|
10768
10789
|
showInputWrapper() {
|
|
@@ -11179,7 +11200,7 @@ var pops = (function () {
|
|
|
11179
11200
|
else {
|
|
11180
11201
|
leaveViewTransition();
|
|
11181
11202
|
}
|
|
11182
|
-
that.
|
|
11203
|
+
that.emitRenderRightContainer($currentSection);
|
|
11183
11204
|
}, {
|
|
11184
11205
|
once: true,
|
|
11185
11206
|
});
|
|
@@ -11221,7 +11242,7 @@ var pops = (function () {
|
|
|
11221
11242
|
$sectionBodyContainer: $deepMenuMain,
|
|
11222
11243
|
});
|
|
11223
11244
|
}
|
|
11224
|
-
that.
|
|
11245
|
+
that.emitRenderRightContainer($deepMenuSection);
|
|
11225
11246
|
},
|
|
11226
11247
|
/** 设置项的点击事件 */
|
|
11227
11248
|
onLiClick() {
|
|
@@ -11382,7 +11403,7 @@ var pops = (function () {
|
|
|
11382
11403
|
* 主动触发触发渲染右侧容器的事件
|
|
11383
11404
|
* @param $container 容器
|
|
11384
11405
|
*/
|
|
11385
|
-
|
|
11406
|
+
emitRenderRightContainer($container) {
|
|
11386
11407
|
const dataViewConfig = Reflect.get($container, this.$data.nodeStoreConfigKey);
|
|
11387
11408
|
this.$el.$pops.dispatchEvent(new CustomEvent("pops:renderRightContainer", {
|
|
11388
11409
|
detail: {
|
|
@@ -11447,7 +11468,7 @@ var pops = (function () {
|
|
|
11447
11468
|
return;
|
|
11448
11469
|
}
|
|
11449
11470
|
}
|
|
11450
|
-
this.
|
|
11471
|
+
this.emitRenderRightContainer(this.$el.$panelContentSectionContainer);
|
|
11451
11472
|
});
|
|
11452
11473
|
},
|
|
11453
11474
|
};
|
|
@@ -12381,15 +12402,15 @@ var pops = (function () {
|
|
|
12381
12402
|
}
|
|
12382
12403
|
// 鼠标|触摸 移入事件
|
|
12383
12404
|
// 在移动端会先触发touchstart再然后mouseenter
|
|
12384
|
-
let
|
|
12405
|
+
let isEmitTouchEvent = false;
|
|
12385
12406
|
/**
|
|
12386
12407
|
* 鼠标|触摸 移入事件
|
|
12387
12408
|
*/
|
|
12388
12409
|
function liElementHoverEvent(event) {
|
|
12389
12410
|
if (event.type === "touchstart") {
|
|
12390
|
-
|
|
12411
|
+
isEmitTouchEvent = true;
|
|
12391
12412
|
}
|
|
12392
|
-
if (
|
|
12413
|
+
if (isEmitTouchEvent && event.type === "mouseenter") {
|
|
12393
12414
|
return;
|
|
12394
12415
|
}
|
|
12395
12416
|
Array.from(menuULElement.children).forEach((liElement) => {
|
|
@@ -13341,7 +13362,7 @@ var pops = (function () {
|
|
|
13341
13362
|
},
|
|
13342
13363
|
};
|
|
13343
13364
|
|
|
13344
|
-
const version = "3.0
|
|
13365
|
+
const version = "3.1.0";
|
|
13345
13366
|
|
|
13346
13367
|
class Pops {
|
|
13347
13368
|
/** 配置 */
|