@whitesev/pops 2.5.2 → 2.5.3
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 +62 -74
- 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 +62 -74
- 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 +62 -74
- 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 +62 -74
- 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 +62 -74
- 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 +62 -74
- 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 +36 -43
- package/src/components/panel/handlerComponents.ts +7 -22
- 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.umd.js
CHANGED
|
@@ -1838,17 +1838,28 @@
|
|
|
1838
1838
|
* @param className className属性
|
|
1839
1839
|
*/
|
|
1840
1840
|
addClassName($el, className) {
|
|
1841
|
-
if ($el == null)
|
|
1841
|
+
if ($el == null)
|
|
1842
1842
|
return;
|
|
1843
|
-
|
|
1844
|
-
if (typeof className !== "string") {
|
|
1843
|
+
if (className == null)
|
|
1845
1844
|
return;
|
|
1845
|
+
if (typeof className === "function") {
|
|
1846
|
+
className = className();
|
|
1846
1847
|
}
|
|
1847
|
-
if (
|
|
1848
|
-
|
|
1848
|
+
if (!Array.isArray(className)) {
|
|
1849
|
+
className = [className];
|
|
1849
1850
|
}
|
|
1850
|
-
|
|
1851
|
-
|
|
1851
|
+
className.forEach((classNameStrItem) => {
|
|
1852
|
+
if (typeof classNameStrItem !== "string") {
|
|
1853
|
+
// 不是字符串
|
|
1854
|
+
return;
|
|
1855
|
+
}
|
|
1856
|
+
if (classNameStrItem.trim() === "") {
|
|
1857
|
+
// 空字符串
|
|
1858
|
+
return;
|
|
1859
|
+
}
|
|
1860
|
+
const classNameList = classNameStrItem.split(" ").filter((item) => item.trim() !== "");
|
|
1861
|
+
$el?.classList?.add?.(...classNameList);
|
|
1862
|
+
});
|
|
1852
1863
|
}
|
|
1853
1864
|
/**
|
|
1854
1865
|
* 删除className
|
|
@@ -6056,18 +6067,16 @@
|
|
|
6056
6067
|
title: "菜单配置1",
|
|
6057
6068
|
headerTitle: "菜单配置1",
|
|
6058
6069
|
isDefault: false,
|
|
6059
|
-
attributes:
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
},
|
|
6064
|
-
],
|
|
6070
|
+
attributes: {
|
|
6071
|
+
"data-test": "test",
|
|
6072
|
+
"data-test-2": "test2",
|
|
6073
|
+
},
|
|
6065
6074
|
forms: [
|
|
6066
6075
|
{
|
|
6067
6076
|
className: "forms-1",
|
|
6068
6077
|
text: "区域设置",
|
|
6069
6078
|
type: "forms",
|
|
6070
|
-
attributes:
|
|
6079
|
+
attributes: {},
|
|
6071
6080
|
forms: [
|
|
6072
6081
|
{
|
|
6073
6082
|
className: "panel-switch",
|
|
@@ -6079,7 +6088,7 @@
|
|
|
6079
6088
|
// TODO
|
|
6080
6089
|
},
|
|
6081
6090
|
props: {},
|
|
6082
|
-
attributes:
|
|
6091
|
+
attributes: {},
|
|
6083
6092
|
getValue() {
|
|
6084
6093
|
return true;
|
|
6085
6094
|
},
|
|
@@ -6102,7 +6111,7 @@
|
|
|
6102
6111
|
isShowHoverTip: true,
|
|
6103
6112
|
step: 1,
|
|
6104
6113
|
props: {},
|
|
6105
|
-
attributes:
|
|
6114
|
+
attributes: {},
|
|
6106
6115
|
getValue() {
|
|
6107
6116
|
return 50;
|
|
6108
6117
|
},
|
|
@@ -6123,7 +6132,7 @@
|
|
|
6123
6132
|
afterAddToUListCallBack() {
|
|
6124
6133
|
// TODO
|
|
6125
6134
|
},
|
|
6126
|
-
attributes:
|
|
6135
|
+
attributes: {},
|
|
6127
6136
|
buttonIcon: "view",
|
|
6128
6137
|
buttonIconIsLoading: true,
|
|
6129
6138
|
buttonType: "default",
|
|
@@ -6137,7 +6146,7 @@
|
|
|
6137
6146
|
text: "button",
|
|
6138
6147
|
type: "button",
|
|
6139
6148
|
props: {},
|
|
6140
|
-
attributes:
|
|
6149
|
+
attributes: {},
|
|
6141
6150
|
buttonIcon: "eleme",
|
|
6142
6151
|
buttonIconIsLoading: true,
|
|
6143
6152
|
buttonType: "warning",
|
|
@@ -6152,7 +6161,7 @@
|
|
|
6152
6161
|
// @ts-ignore
|
|
6153
6162
|
props: {},
|
|
6154
6163
|
type: "button",
|
|
6155
|
-
attributes:
|
|
6164
|
+
attributes: {},
|
|
6156
6165
|
buttonIcon: "chromeFilled",
|
|
6157
6166
|
buttonIconIsLoading: true,
|
|
6158
6167
|
buttonType: "danger",
|
|
@@ -6165,7 +6174,7 @@
|
|
|
6165
6174
|
className: "panel-button",
|
|
6166
6175
|
text: "button",
|
|
6167
6176
|
type: "button",
|
|
6168
|
-
attributes:
|
|
6177
|
+
attributes: {},
|
|
6169
6178
|
// @ts-ignore
|
|
6170
6179
|
props: {},
|
|
6171
6180
|
buttonIcon: "upload",
|
|
@@ -6185,12 +6194,10 @@
|
|
|
6185
6194
|
title: "菜单配置2",
|
|
6186
6195
|
headerTitle: "菜单配置2",
|
|
6187
6196
|
isDefault: true,
|
|
6188
|
-
attributes:
|
|
6189
|
-
|
|
6190
|
-
|
|
6191
|
-
|
|
6192
|
-
},
|
|
6193
|
-
],
|
|
6197
|
+
attributes: {
|
|
6198
|
+
"data-value": "value",
|
|
6199
|
+
"data-value-2": "value2",
|
|
6200
|
+
},
|
|
6194
6201
|
forms: [
|
|
6195
6202
|
{
|
|
6196
6203
|
className: "panel-input",
|
|
@@ -6198,7 +6205,7 @@
|
|
|
6198
6205
|
type: "input",
|
|
6199
6206
|
isNumber: false,
|
|
6200
6207
|
props: {},
|
|
6201
|
-
attributes:
|
|
6208
|
+
attributes: {},
|
|
6202
6209
|
getValue() {
|
|
6203
6210
|
return "50";
|
|
6204
6211
|
},
|
|
@@ -6214,7 +6221,7 @@
|
|
|
6214
6221
|
type: "input",
|
|
6215
6222
|
// @ts-ignore
|
|
6216
6223
|
props: {},
|
|
6217
|
-
attributes:
|
|
6224
|
+
attributes: {},
|
|
6218
6225
|
getValue() {
|
|
6219
6226
|
return "123456";
|
|
6220
6227
|
},
|
|
@@ -6231,7 +6238,7 @@
|
|
|
6231
6238
|
type: "textarea",
|
|
6232
6239
|
// @ts-ignore
|
|
6233
6240
|
props: {},
|
|
6234
|
-
attributes:
|
|
6241
|
+
attributes: {},
|
|
6235
6242
|
getValue() {
|
|
6236
6243
|
return "50";
|
|
6237
6244
|
},
|
|
@@ -6248,7 +6255,7 @@
|
|
|
6248
6255
|
disabled: true,
|
|
6249
6256
|
// @ts-ignore
|
|
6250
6257
|
props: {},
|
|
6251
|
-
attributes:
|
|
6258
|
+
attributes: {},
|
|
6252
6259
|
getValue() {
|
|
6253
6260
|
return 50;
|
|
6254
6261
|
},
|
|
@@ -6289,7 +6296,7 @@
|
|
|
6289
6296
|
disabled: true,
|
|
6290
6297
|
// @ts-ignore
|
|
6291
6298
|
props: {},
|
|
6292
|
-
attributes:
|
|
6299
|
+
attributes: {},
|
|
6293
6300
|
placeholder: "请至少选择一个选项",
|
|
6294
6301
|
getValue() {
|
|
6295
6302
|
return ["select-1", "select-2"];
|
|
@@ -6372,7 +6379,8 @@
|
|
|
6372
6379
|
className: "forms-1",
|
|
6373
6380
|
text: "区域设置",
|
|
6374
6381
|
type: "forms",
|
|
6375
|
-
attributes:
|
|
6382
|
+
attributes: {},
|
|
6383
|
+
props: {},
|
|
6376
6384
|
forms: [
|
|
6377
6385
|
{
|
|
6378
6386
|
className: "panel-switch",
|
|
@@ -6380,7 +6388,7 @@
|
|
|
6380
6388
|
type: "switch",
|
|
6381
6389
|
// @ts-ignore
|
|
6382
6390
|
props: {},
|
|
6383
|
-
attributes:
|
|
6391
|
+
attributes: {},
|
|
6384
6392
|
getValue() {
|
|
6385
6393
|
return true;
|
|
6386
6394
|
},
|
|
@@ -6394,7 +6402,7 @@
|
|
|
6394
6402
|
// @ts-ignore
|
|
6395
6403
|
props: {},
|
|
6396
6404
|
type: "slider",
|
|
6397
|
-
attributes:
|
|
6405
|
+
attributes: {},
|
|
6398
6406
|
getValue() {
|
|
6399
6407
|
return 50;
|
|
6400
6408
|
},
|
|
@@ -6410,7 +6418,7 @@
|
|
|
6410
6418
|
// @ts-ignore
|
|
6411
6419
|
props: {},
|
|
6412
6420
|
type: "button",
|
|
6413
|
-
attributes:
|
|
6421
|
+
attributes: {},
|
|
6414
6422
|
buttonIcon: "eleme",
|
|
6415
6423
|
buttonIconIsLoading: true,
|
|
6416
6424
|
buttonType: "warning",
|
|
@@ -6425,7 +6433,7 @@
|
|
|
6425
6433
|
type: "button",
|
|
6426
6434
|
// @ts-ignore
|
|
6427
6435
|
props: {},
|
|
6428
|
-
attributes:
|
|
6436
|
+
attributes: {},
|
|
6429
6437
|
buttonIcon: "chromeFilled",
|
|
6430
6438
|
buttonIconIsLoading: true,
|
|
6431
6439
|
buttonType: "danger",
|
|
@@ -6440,7 +6448,7 @@
|
|
|
6440
6448
|
// @ts-ignore
|
|
6441
6449
|
props: {},
|
|
6442
6450
|
type: "button",
|
|
6443
|
-
attributes:
|
|
6451
|
+
attributes: {},
|
|
6444
6452
|
buttonIcon: "upload",
|
|
6445
6453
|
buttonIconIsLoading: false,
|
|
6446
6454
|
buttonType: "info",
|
|
@@ -6487,7 +6495,7 @@
|
|
|
6487
6495
|
// @ts-ignore
|
|
6488
6496
|
props: {},
|
|
6489
6497
|
type: "switch",
|
|
6490
|
-
attributes:
|
|
6498
|
+
attributes: {},
|
|
6491
6499
|
getValue() {
|
|
6492
6500
|
return true;
|
|
6493
6501
|
},
|
|
@@ -6506,12 +6514,10 @@
|
|
|
6506
6514
|
`,
|
|
6507
6515
|
isBottom: true,
|
|
6508
6516
|
disableAsideItemHoverCSS: true,
|
|
6509
|
-
attributes:
|
|
6510
|
-
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
},
|
|
6514
|
-
],
|
|
6517
|
+
attributes: {
|
|
6518
|
+
"data-value": "value",
|
|
6519
|
+
"data-value-2": "value2",
|
|
6520
|
+
},
|
|
6515
6521
|
// @ts-ignore
|
|
6516
6522
|
props: {},
|
|
6517
6523
|
forms: [],
|
|
@@ -6523,12 +6529,10 @@
|
|
|
6523
6529
|
id: "whitesev-panel-bottom-config-2",
|
|
6524
6530
|
title: "版本:xxx.xx.xx",
|
|
6525
6531
|
isBottom: true,
|
|
6526
|
-
attributes:
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
},
|
|
6531
|
-
],
|
|
6532
|
+
attributes: {
|
|
6533
|
+
"data-value": "value",
|
|
6534
|
+
"data-value-2": "value2",
|
|
6535
|
+
},
|
|
6532
6536
|
// @ts-ignore
|
|
6533
6537
|
props: {},
|
|
6534
6538
|
forms: [],
|
|
@@ -6780,9 +6784,7 @@
|
|
|
6780
6784
|
/** 箭头 */
|
|
6781
6785
|
const $toolTipArrow = $toolTipContainer.querySelector(".pops-tip-arrow");
|
|
6782
6786
|
// 处理className
|
|
6783
|
-
|
|
6784
|
-
popsDOMUtils.addClassName($toolTipContainer, this.$data.config.className);
|
|
6785
|
-
}
|
|
6787
|
+
popsDOMUtils.addClassName($toolTipContainer, this.$data.config.className);
|
|
6786
6788
|
// 添加z-index
|
|
6787
6789
|
$toolTipContainer.style.zIndex = PopsHandler.handleZIndex(this.$data.config.zIndex).toString();
|
|
6788
6790
|
if (this.$data.config.style != null) {
|
|
@@ -7430,10 +7432,12 @@
|
|
|
7430
7432
|
* @param props 属性
|
|
7431
7433
|
*/
|
|
7432
7434
|
setElementProps($el, props) {
|
|
7433
|
-
if (props == null)
|
|
7435
|
+
if (props == null)
|
|
7434
7436
|
return;
|
|
7435
|
-
|
|
7436
|
-
|
|
7437
|
+
if (typeof props !== "object")
|
|
7438
|
+
return;
|
|
7439
|
+
const propsKeys = Object.keys(props);
|
|
7440
|
+
propsKeys.forEach((propName) => {
|
|
7437
7441
|
const value = props[propName];
|
|
7438
7442
|
if (propName === "innerHTML") {
|
|
7439
7443
|
PopsSafeUtils.setSafeHTML($el, value);
|
|
@@ -7448,23 +7452,7 @@
|
|
|
7448
7452
|
* @param className
|
|
7449
7453
|
*/
|
|
7450
7454
|
setElementClassName($el, className) {
|
|
7451
|
-
|
|
7452
|
-
return;
|
|
7453
|
-
}
|
|
7454
|
-
if (typeof className === "function") {
|
|
7455
|
-
className = className();
|
|
7456
|
-
}
|
|
7457
|
-
if (typeof className === "string") {
|
|
7458
|
-
const splitClassName = className.split(" ");
|
|
7459
|
-
splitClassName.forEach((classNameStr) => {
|
|
7460
|
-
$el.classList.add(classNameStr);
|
|
7461
|
-
});
|
|
7462
|
-
}
|
|
7463
|
-
else if (Array.isArray(className)) {
|
|
7464
|
-
className.forEach((classNameStr) => {
|
|
7465
|
-
this.setElementClassName($el, classNameStr);
|
|
7466
|
-
});
|
|
7467
|
-
}
|
|
7455
|
+
popsDOMUtils.addClassName($el, className);
|
|
7468
7456
|
},
|
|
7469
7457
|
/**
|
|
7470
7458
|
* 创建底部项元素<li>
|
|
@@ -11960,7 +11948,7 @@
|
|
|
11960
11948
|
},
|
|
11961
11949
|
};
|
|
11962
11950
|
|
|
11963
|
-
const version = "2.5.
|
|
11951
|
+
const version = "2.5.3";
|
|
11964
11952
|
|
|
11965
11953
|
class Pops {
|
|
11966
11954
|
/** 配置 */
|