@whitesev/pops 2.5.2 → 2.5.4
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 +76 -112
- 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 +76 -112
- 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 +76 -112
- 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 +76 -112
- 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 +76 -112
- 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 +76 -112
- 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 +4 -4
- package/dist/types/src/components/panel/handlerComponents.d.ts +2 -2
- package/dist/types/src/components/panel/types/components-common.d.ts +3 -5
- package/dist/types/src/components/panel/types/index.d.ts +5 -11
- package/dist/types/src/components/rightClickMenu/index.d.ts +1 -1
- package/dist/types/src/components/rightClickMenu/types/index.d.ts +3 -2
- package/dist/types/src/components/searchSuggestion/types/index.d.ts +3 -2
- package/dist/types/src/components/tooltip/index.d.ts +1 -1
- package/dist/types/src/components/tooltip/types/index.d.ts +2 -1
- package/dist/types/src/utils/PopsDOMUtils.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/panel/config.ts +37 -79
- package/src/components/panel/handlerComponents.ts +7 -22
- package/src/components/panel/index.ts +12 -2
- package/src/components/panel/types/components-common.ts +5 -9
- package/src/components/panel/types/index.ts +5 -13
- package/src/components/rightClickMenu/types/index.ts +3 -2
- package/src/components/searchSuggestion/types/index.ts +3 -2
- package/src/components/tooltip/index.ts +1 -3
- package/src/components/tooltip/types/index.ts +2 -1
- package/src/utils/PopsDOMUtils.ts +23 -10
package/dist/index.system.js
CHANGED
|
@@ -1837,17 +1837,28 @@ System.register('pops', [], (function (exports) {
|
|
|
1837
1837
|
* @param className className属性
|
|
1838
1838
|
*/
|
|
1839
1839
|
addClassName($el, className) {
|
|
1840
|
-
if ($el == null)
|
|
1840
|
+
if ($el == null)
|
|
1841
1841
|
return;
|
|
1842
|
-
|
|
1843
|
-
if (typeof className !== "string") {
|
|
1842
|
+
if (className == null)
|
|
1844
1843
|
return;
|
|
1844
|
+
if (typeof className === "function") {
|
|
1845
|
+
className = className();
|
|
1845
1846
|
}
|
|
1846
|
-
if (
|
|
1847
|
-
|
|
1847
|
+
if (!Array.isArray(className)) {
|
|
1848
|
+
className = [className];
|
|
1848
1849
|
}
|
|
1849
|
-
|
|
1850
|
-
|
|
1850
|
+
className.forEach((classNameStrItem) => {
|
|
1851
|
+
if (typeof classNameStrItem !== "string") {
|
|
1852
|
+
// 不是字符串
|
|
1853
|
+
return;
|
|
1854
|
+
}
|
|
1855
|
+
if (classNameStrItem.trim() === "") {
|
|
1856
|
+
// 空字符串
|
|
1857
|
+
return;
|
|
1858
|
+
}
|
|
1859
|
+
const classNameList = classNameStrItem.split(" ").filter((item) => item.trim() !== "");
|
|
1860
|
+
$el?.classList?.add?.(...classNameList);
|
|
1861
|
+
});
|
|
1851
1862
|
}
|
|
1852
1863
|
/**
|
|
1853
1864
|
* 删除className
|
|
@@ -6055,18 +6066,16 @@ System.register('pops', [], (function (exports) {
|
|
|
6055
6066
|
title: "菜单配置1",
|
|
6056
6067
|
headerTitle: "菜单配置1",
|
|
6057
6068
|
isDefault: false,
|
|
6058
|
-
attributes:
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
},
|
|
6063
|
-
],
|
|
6069
|
+
attributes: {
|
|
6070
|
+
"data-test": "test",
|
|
6071
|
+
"data-test-2": "test2",
|
|
6072
|
+
},
|
|
6064
6073
|
forms: [
|
|
6065
6074
|
{
|
|
6066
6075
|
className: "forms-1",
|
|
6067
6076
|
text: "区域设置",
|
|
6068
6077
|
type: "forms",
|
|
6069
|
-
attributes:
|
|
6078
|
+
attributes: {},
|
|
6070
6079
|
forms: [
|
|
6071
6080
|
{
|
|
6072
6081
|
className: "panel-switch",
|
|
@@ -6078,7 +6087,7 @@ System.register('pops', [], (function (exports) {
|
|
|
6078
6087
|
// TODO
|
|
6079
6088
|
},
|
|
6080
6089
|
props: {},
|
|
6081
|
-
attributes:
|
|
6090
|
+
attributes: {},
|
|
6082
6091
|
getValue() {
|
|
6083
6092
|
return true;
|
|
6084
6093
|
},
|
|
@@ -6101,7 +6110,7 @@ System.register('pops', [], (function (exports) {
|
|
|
6101
6110
|
isShowHoverTip: true,
|
|
6102
6111
|
step: 1,
|
|
6103
6112
|
props: {},
|
|
6104
|
-
attributes:
|
|
6113
|
+
attributes: {},
|
|
6105
6114
|
getValue() {
|
|
6106
6115
|
return 50;
|
|
6107
6116
|
},
|
|
@@ -6122,7 +6131,7 @@ System.register('pops', [], (function (exports) {
|
|
|
6122
6131
|
afterAddToUListCallBack() {
|
|
6123
6132
|
// TODO
|
|
6124
6133
|
},
|
|
6125
|
-
attributes:
|
|
6134
|
+
attributes: {},
|
|
6126
6135
|
buttonIcon: "view",
|
|
6127
6136
|
buttonIconIsLoading: true,
|
|
6128
6137
|
buttonType: "default",
|
|
@@ -6136,7 +6145,7 @@ System.register('pops', [], (function (exports) {
|
|
|
6136
6145
|
text: "button",
|
|
6137
6146
|
type: "button",
|
|
6138
6147
|
props: {},
|
|
6139
|
-
attributes:
|
|
6148
|
+
attributes: {},
|
|
6140
6149
|
buttonIcon: "eleme",
|
|
6141
6150
|
buttonIconIsLoading: true,
|
|
6142
6151
|
buttonType: "warning",
|
|
@@ -6151,7 +6160,7 @@ System.register('pops', [], (function (exports) {
|
|
|
6151
6160
|
// @ts-ignore
|
|
6152
6161
|
props: {},
|
|
6153
6162
|
type: "button",
|
|
6154
|
-
attributes:
|
|
6163
|
+
attributes: {},
|
|
6155
6164
|
buttonIcon: "chromeFilled",
|
|
6156
6165
|
buttonIconIsLoading: true,
|
|
6157
6166
|
buttonType: "danger",
|
|
@@ -6164,7 +6173,7 @@ System.register('pops', [], (function (exports) {
|
|
|
6164
6173
|
className: "panel-button",
|
|
6165
6174
|
text: "button",
|
|
6166
6175
|
type: "button",
|
|
6167
|
-
attributes:
|
|
6176
|
+
attributes: {},
|
|
6168
6177
|
// @ts-ignore
|
|
6169
6178
|
props: {},
|
|
6170
6179
|
buttonIcon: "upload",
|
|
@@ -6184,12 +6193,10 @@ System.register('pops', [], (function (exports) {
|
|
|
6184
6193
|
title: "菜单配置2",
|
|
6185
6194
|
headerTitle: "菜单配置2",
|
|
6186
6195
|
isDefault: true,
|
|
6187
|
-
attributes:
|
|
6188
|
-
|
|
6189
|
-
|
|
6190
|
-
|
|
6191
|
-
},
|
|
6192
|
-
],
|
|
6196
|
+
attributes: {
|
|
6197
|
+
"data-value": "value",
|
|
6198
|
+
"data-value-2": "value2",
|
|
6199
|
+
},
|
|
6193
6200
|
forms: [
|
|
6194
6201
|
{
|
|
6195
6202
|
className: "panel-input",
|
|
@@ -6197,7 +6204,7 @@ System.register('pops', [], (function (exports) {
|
|
|
6197
6204
|
type: "input",
|
|
6198
6205
|
isNumber: false,
|
|
6199
6206
|
props: {},
|
|
6200
|
-
attributes:
|
|
6207
|
+
attributes: {},
|
|
6201
6208
|
getValue() {
|
|
6202
6209
|
return "50";
|
|
6203
6210
|
},
|
|
@@ -6213,7 +6220,7 @@ System.register('pops', [], (function (exports) {
|
|
|
6213
6220
|
type: "input",
|
|
6214
6221
|
// @ts-ignore
|
|
6215
6222
|
props: {},
|
|
6216
|
-
attributes:
|
|
6223
|
+
attributes: {},
|
|
6217
6224
|
getValue() {
|
|
6218
6225
|
return "123456";
|
|
6219
6226
|
},
|
|
@@ -6230,7 +6237,7 @@ System.register('pops', [], (function (exports) {
|
|
|
6230
6237
|
type: "textarea",
|
|
6231
6238
|
// @ts-ignore
|
|
6232
6239
|
props: {},
|
|
6233
|
-
attributes:
|
|
6240
|
+
attributes: {},
|
|
6234
6241
|
getValue() {
|
|
6235
6242
|
return "50";
|
|
6236
6243
|
},
|
|
@@ -6247,7 +6254,7 @@ System.register('pops', [], (function (exports) {
|
|
|
6247
6254
|
disabled: true,
|
|
6248
6255
|
// @ts-ignore
|
|
6249
6256
|
props: {},
|
|
6250
|
-
attributes:
|
|
6257
|
+
attributes: {},
|
|
6251
6258
|
getValue() {
|
|
6252
6259
|
return 50;
|
|
6253
6260
|
},
|
|
@@ -6288,7 +6295,7 @@ System.register('pops', [], (function (exports) {
|
|
|
6288
6295
|
disabled: true,
|
|
6289
6296
|
// @ts-ignore
|
|
6290
6297
|
props: {},
|
|
6291
|
-
attributes:
|
|
6298
|
+
attributes: {},
|
|
6292
6299
|
placeholder: "请至少选择一个选项",
|
|
6293
6300
|
getValue() {
|
|
6294
6301
|
return ["select-1", "select-2"];
|
|
@@ -6371,7 +6378,8 @@ System.register('pops', [], (function (exports) {
|
|
|
6371
6378
|
className: "forms-1",
|
|
6372
6379
|
text: "区域设置",
|
|
6373
6380
|
type: "forms",
|
|
6374
|
-
attributes:
|
|
6381
|
+
attributes: {},
|
|
6382
|
+
props: {},
|
|
6375
6383
|
forms: [
|
|
6376
6384
|
{
|
|
6377
6385
|
className: "panel-switch",
|
|
@@ -6379,7 +6387,7 @@ System.register('pops', [], (function (exports) {
|
|
|
6379
6387
|
type: "switch",
|
|
6380
6388
|
// @ts-ignore
|
|
6381
6389
|
props: {},
|
|
6382
|
-
attributes:
|
|
6390
|
+
attributes: {},
|
|
6383
6391
|
getValue() {
|
|
6384
6392
|
return true;
|
|
6385
6393
|
},
|
|
@@ -6393,7 +6401,7 @@ System.register('pops', [], (function (exports) {
|
|
|
6393
6401
|
// @ts-ignore
|
|
6394
6402
|
props: {},
|
|
6395
6403
|
type: "slider",
|
|
6396
|
-
attributes:
|
|
6404
|
+
attributes: {},
|
|
6397
6405
|
getValue() {
|
|
6398
6406
|
return 50;
|
|
6399
6407
|
},
|
|
@@ -6409,7 +6417,7 @@ System.register('pops', [], (function (exports) {
|
|
|
6409
6417
|
// @ts-ignore
|
|
6410
6418
|
props: {},
|
|
6411
6419
|
type: "button",
|
|
6412
|
-
attributes:
|
|
6420
|
+
attributes: {},
|
|
6413
6421
|
buttonIcon: "eleme",
|
|
6414
6422
|
buttonIconIsLoading: true,
|
|
6415
6423
|
buttonType: "warning",
|
|
@@ -6424,7 +6432,7 @@ System.register('pops', [], (function (exports) {
|
|
|
6424
6432
|
type: "button",
|
|
6425
6433
|
// @ts-ignore
|
|
6426
6434
|
props: {},
|
|
6427
|
-
attributes:
|
|
6435
|
+
attributes: {},
|
|
6428
6436
|
buttonIcon: "chromeFilled",
|
|
6429
6437
|
buttonIconIsLoading: true,
|
|
6430
6438
|
buttonType: "danger",
|
|
@@ -6439,7 +6447,7 @@ System.register('pops', [], (function (exports) {
|
|
|
6439
6447
|
// @ts-ignore
|
|
6440
6448
|
props: {},
|
|
6441
6449
|
type: "button",
|
|
6442
|
-
attributes:
|
|
6450
|
+
attributes: {},
|
|
6443
6451
|
buttonIcon: "upload",
|
|
6444
6452
|
buttonIconIsLoading: false,
|
|
6445
6453
|
buttonType: "info",
|
|
@@ -6486,7 +6494,7 @@ System.register('pops', [], (function (exports) {
|
|
|
6486
6494
|
// @ts-ignore
|
|
6487
6495
|
props: {},
|
|
6488
6496
|
type: "switch",
|
|
6489
|
-
attributes:
|
|
6497
|
+
attributes: {},
|
|
6490
6498
|
getValue() {
|
|
6491
6499
|
return true;
|
|
6492
6500
|
},
|
|
@@ -6505,12 +6513,10 @@ System.register('pops', [], (function (exports) {
|
|
|
6505
6513
|
`,
|
|
6506
6514
|
isBottom: true,
|
|
6507
6515
|
disableAsideItemHoverCSS: true,
|
|
6508
|
-
attributes:
|
|
6509
|
-
|
|
6510
|
-
|
|
6511
|
-
|
|
6512
|
-
},
|
|
6513
|
-
],
|
|
6516
|
+
attributes: {
|
|
6517
|
+
"data-value": "value",
|
|
6518
|
+
"data-value-2": "value2",
|
|
6519
|
+
},
|
|
6514
6520
|
// @ts-ignore
|
|
6515
6521
|
props: {},
|
|
6516
6522
|
forms: [],
|
|
@@ -6522,12 +6528,10 @@ System.register('pops', [], (function (exports) {
|
|
|
6522
6528
|
id: "whitesev-panel-bottom-config-2",
|
|
6523
6529
|
title: "版本:xxx.xx.xx",
|
|
6524
6530
|
isBottom: true,
|
|
6525
|
-
attributes:
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
},
|
|
6530
|
-
],
|
|
6531
|
+
attributes: {
|
|
6532
|
+
"data-value": "value",
|
|
6533
|
+
"data-value-2": "value2",
|
|
6534
|
+
},
|
|
6531
6535
|
// @ts-ignore
|
|
6532
6536
|
props: {},
|
|
6533
6537
|
forms: [],
|
|
@@ -6536,42 +6540,7 @@ System.register('pops', [], (function (exports) {
|
|
|
6536
6540
|
},
|
|
6537
6541
|
},
|
|
6538
6542
|
],
|
|
6539
|
-
bottomContentConfig: [
|
|
6540
|
-
{
|
|
6541
|
-
text: "Github",
|
|
6542
|
-
position: "left",
|
|
6543
|
-
className: "user-home",
|
|
6544
|
-
attributes: {
|
|
6545
|
-
"data-url": "https://github.com/whitesevs",
|
|
6546
|
-
},
|
|
6547
|
-
props: {
|
|
6548
|
-
"data-test": 1,
|
|
6549
|
-
},
|
|
6550
|
-
disableHoverCSS: false,
|
|
6551
|
-
clickCallback() {
|
|
6552
|
-
const userHomeUrl = this.attributes["data-url"];
|
|
6553
|
-
console.log("打开个人主页:" + userHomeUrl);
|
|
6554
|
-
window.open(userHomeUrl, "_blank");
|
|
6555
|
-
},
|
|
6556
|
-
afterRender(config) {
|
|
6557
|
-
console.log(config);
|
|
6558
|
-
},
|
|
6559
|
-
},
|
|
6560
|
-
{
|
|
6561
|
-
text: "0.0.1",
|
|
6562
|
-
position: "right",
|
|
6563
|
-
className: "script-version",
|
|
6564
|
-
attributes: {},
|
|
6565
|
-
props: {},
|
|
6566
|
-
disableHoverCSS: true,
|
|
6567
|
-
clickCallback() {
|
|
6568
|
-
console.log("当前版本:" + this.text);
|
|
6569
|
-
},
|
|
6570
|
-
afterRender(config) {
|
|
6571
|
-
console.log(config);
|
|
6572
|
-
},
|
|
6573
|
-
},
|
|
6574
|
-
],
|
|
6543
|
+
bottomContentConfig: [],
|
|
6575
6544
|
btn: {
|
|
6576
6545
|
close: {
|
|
6577
6546
|
enable: true,
|
|
@@ -6779,9 +6748,7 @@ System.register('pops', [], (function (exports) {
|
|
|
6779
6748
|
/** 箭头 */
|
|
6780
6749
|
const $toolTipArrow = $toolTipContainer.querySelector(".pops-tip-arrow");
|
|
6781
6750
|
// 处理className
|
|
6782
|
-
|
|
6783
|
-
popsDOMUtils.addClassName($toolTipContainer, this.$data.config.className);
|
|
6784
|
-
}
|
|
6751
|
+
popsDOMUtils.addClassName($toolTipContainer, this.$data.config.className);
|
|
6785
6752
|
// 添加z-index
|
|
6786
6753
|
$toolTipContainer.style.zIndex = PopsHandler.handleZIndex(this.$data.config.zIndex).toString();
|
|
6787
6754
|
if (this.$data.config.style != null) {
|
|
@@ -7429,10 +7396,12 @@ System.register('pops', [], (function (exports) {
|
|
|
7429
7396
|
* @param props 属性
|
|
7430
7397
|
*/
|
|
7431
7398
|
setElementProps($el, props) {
|
|
7432
|
-
if (props == null)
|
|
7399
|
+
if (props == null)
|
|
7433
7400
|
return;
|
|
7434
|
-
|
|
7435
|
-
|
|
7401
|
+
if (typeof props !== "object")
|
|
7402
|
+
return;
|
|
7403
|
+
const propsKeys = Object.keys(props);
|
|
7404
|
+
propsKeys.forEach((propName) => {
|
|
7436
7405
|
const value = props[propName];
|
|
7437
7406
|
if (propName === "innerHTML") {
|
|
7438
7407
|
PopsSafeUtils.setSafeHTML($el, value);
|
|
@@ -7447,23 +7416,7 @@ System.register('pops', [], (function (exports) {
|
|
|
7447
7416
|
* @param className
|
|
7448
7417
|
*/
|
|
7449
7418
|
setElementClassName($el, className) {
|
|
7450
|
-
|
|
7451
|
-
return;
|
|
7452
|
-
}
|
|
7453
|
-
if (typeof className === "function") {
|
|
7454
|
-
className = className();
|
|
7455
|
-
}
|
|
7456
|
-
if (typeof className === "string") {
|
|
7457
|
-
const splitClassName = className.split(" ");
|
|
7458
|
-
splitClassName.forEach((classNameStr) => {
|
|
7459
|
-
$el.classList.add(classNameStr);
|
|
7460
|
-
});
|
|
7461
|
-
}
|
|
7462
|
-
else if (Array.isArray(className)) {
|
|
7463
|
-
className.forEach((classNameStr) => {
|
|
7464
|
-
this.setElementClassName($el, classNameStr);
|
|
7465
|
-
});
|
|
7466
|
-
}
|
|
7419
|
+
popsDOMUtils.addClassName($el, className);
|
|
7467
7420
|
},
|
|
7468
7421
|
/**
|
|
7469
7422
|
* 创建底部项元素<li>
|
|
@@ -10104,8 +10057,19 @@ System.register('pops', [], (function (exports) {
|
|
|
10104
10057
|
let config = PopsPanelConfig();
|
|
10105
10058
|
config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
|
|
10106
10059
|
config = popsUtils.assign(config, details);
|
|
10107
|
-
if (details
|
|
10108
|
-
|
|
10060
|
+
if (details) {
|
|
10061
|
+
if (Array.isArray(details.content)) {
|
|
10062
|
+
// 存在内容配置
|
|
10063
|
+
config.content = details.content;
|
|
10064
|
+
}
|
|
10065
|
+
if (Array.isArray(details.bottomContentConfig)) {
|
|
10066
|
+
// 存在底部配置
|
|
10067
|
+
config.bottomContentConfig = details.bottomContentConfig;
|
|
10068
|
+
}
|
|
10069
|
+
else {
|
|
10070
|
+
// 不存在底部配置 清空默认的
|
|
10071
|
+
config.bottomContentConfig = [];
|
|
10072
|
+
}
|
|
10109
10073
|
}
|
|
10110
10074
|
config = PopsHandler.handleOnly(popsType, config);
|
|
10111
10075
|
const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
|
|
@@ -11959,7 +11923,7 @@ System.register('pops', [], (function (exports) {
|
|
|
11959
11923
|
},
|
|
11960
11924
|
};
|
|
11961
11925
|
|
|
11962
|
-
const version = "2.5.
|
|
11926
|
+
const version = "2.5.4";
|
|
11963
11927
|
|
|
11964
11928
|
class Pops {
|
|
11965
11929
|
/** 配置 */
|