@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.esm.js
CHANGED
|
@@ -1832,17 +1832,28 @@ class PopsDOMUtils extends PopsDOMUtilsEvent {
|
|
|
1832
1832
|
* @param className className属性
|
|
1833
1833
|
*/
|
|
1834
1834
|
addClassName($el, className) {
|
|
1835
|
-
if ($el == null)
|
|
1835
|
+
if ($el == null)
|
|
1836
1836
|
return;
|
|
1837
|
-
|
|
1838
|
-
if (typeof className !== "string") {
|
|
1837
|
+
if (className == null)
|
|
1839
1838
|
return;
|
|
1839
|
+
if (typeof className === "function") {
|
|
1840
|
+
className = className();
|
|
1840
1841
|
}
|
|
1841
|
-
if (
|
|
1842
|
-
|
|
1842
|
+
if (!Array.isArray(className)) {
|
|
1843
|
+
className = [className];
|
|
1843
1844
|
}
|
|
1844
|
-
|
|
1845
|
-
|
|
1845
|
+
className.forEach((classNameStrItem) => {
|
|
1846
|
+
if (typeof classNameStrItem !== "string") {
|
|
1847
|
+
// 不是字符串
|
|
1848
|
+
return;
|
|
1849
|
+
}
|
|
1850
|
+
if (classNameStrItem.trim() === "") {
|
|
1851
|
+
// 空字符串
|
|
1852
|
+
return;
|
|
1853
|
+
}
|
|
1854
|
+
const classNameList = classNameStrItem.split(" ").filter((item) => item.trim() !== "");
|
|
1855
|
+
$el?.classList?.add?.(...classNameList);
|
|
1856
|
+
});
|
|
1846
1857
|
}
|
|
1847
1858
|
/**
|
|
1848
1859
|
* 删除className
|
|
@@ -6050,18 +6061,16 @@ const PopsPanelConfig = () => {
|
|
|
6050
6061
|
title: "菜单配置1",
|
|
6051
6062
|
headerTitle: "菜单配置1",
|
|
6052
6063
|
isDefault: false,
|
|
6053
|
-
attributes:
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
},
|
|
6058
|
-
],
|
|
6064
|
+
attributes: {
|
|
6065
|
+
"data-test": "test",
|
|
6066
|
+
"data-test-2": "test2",
|
|
6067
|
+
},
|
|
6059
6068
|
forms: [
|
|
6060
6069
|
{
|
|
6061
6070
|
className: "forms-1",
|
|
6062
6071
|
text: "区域设置",
|
|
6063
6072
|
type: "forms",
|
|
6064
|
-
attributes:
|
|
6073
|
+
attributes: {},
|
|
6065
6074
|
forms: [
|
|
6066
6075
|
{
|
|
6067
6076
|
className: "panel-switch",
|
|
@@ -6073,7 +6082,7 @@ const PopsPanelConfig = () => {
|
|
|
6073
6082
|
// TODO
|
|
6074
6083
|
},
|
|
6075
6084
|
props: {},
|
|
6076
|
-
attributes:
|
|
6085
|
+
attributes: {},
|
|
6077
6086
|
getValue() {
|
|
6078
6087
|
return true;
|
|
6079
6088
|
},
|
|
@@ -6096,7 +6105,7 @@ const PopsPanelConfig = () => {
|
|
|
6096
6105
|
isShowHoverTip: true,
|
|
6097
6106
|
step: 1,
|
|
6098
6107
|
props: {},
|
|
6099
|
-
attributes:
|
|
6108
|
+
attributes: {},
|
|
6100
6109
|
getValue() {
|
|
6101
6110
|
return 50;
|
|
6102
6111
|
},
|
|
@@ -6117,7 +6126,7 @@ const PopsPanelConfig = () => {
|
|
|
6117
6126
|
afterAddToUListCallBack() {
|
|
6118
6127
|
// TODO
|
|
6119
6128
|
},
|
|
6120
|
-
attributes:
|
|
6129
|
+
attributes: {},
|
|
6121
6130
|
buttonIcon: "view",
|
|
6122
6131
|
buttonIconIsLoading: true,
|
|
6123
6132
|
buttonType: "default",
|
|
@@ -6131,7 +6140,7 @@ const PopsPanelConfig = () => {
|
|
|
6131
6140
|
text: "button",
|
|
6132
6141
|
type: "button",
|
|
6133
6142
|
props: {},
|
|
6134
|
-
attributes:
|
|
6143
|
+
attributes: {},
|
|
6135
6144
|
buttonIcon: "eleme",
|
|
6136
6145
|
buttonIconIsLoading: true,
|
|
6137
6146
|
buttonType: "warning",
|
|
@@ -6146,7 +6155,7 @@ const PopsPanelConfig = () => {
|
|
|
6146
6155
|
// @ts-ignore
|
|
6147
6156
|
props: {},
|
|
6148
6157
|
type: "button",
|
|
6149
|
-
attributes:
|
|
6158
|
+
attributes: {},
|
|
6150
6159
|
buttonIcon: "chromeFilled",
|
|
6151
6160
|
buttonIconIsLoading: true,
|
|
6152
6161
|
buttonType: "danger",
|
|
@@ -6159,7 +6168,7 @@ const PopsPanelConfig = () => {
|
|
|
6159
6168
|
className: "panel-button",
|
|
6160
6169
|
text: "button",
|
|
6161
6170
|
type: "button",
|
|
6162
|
-
attributes:
|
|
6171
|
+
attributes: {},
|
|
6163
6172
|
// @ts-ignore
|
|
6164
6173
|
props: {},
|
|
6165
6174
|
buttonIcon: "upload",
|
|
@@ -6179,12 +6188,10 @@ const PopsPanelConfig = () => {
|
|
|
6179
6188
|
title: "菜单配置2",
|
|
6180
6189
|
headerTitle: "菜单配置2",
|
|
6181
6190
|
isDefault: true,
|
|
6182
|
-
attributes:
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
},
|
|
6187
|
-
],
|
|
6191
|
+
attributes: {
|
|
6192
|
+
"data-value": "value",
|
|
6193
|
+
"data-value-2": "value2",
|
|
6194
|
+
},
|
|
6188
6195
|
forms: [
|
|
6189
6196
|
{
|
|
6190
6197
|
className: "panel-input",
|
|
@@ -6192,7 +6199,7 @@ const PopsPanelConfig = () => {
|
|
|
6192
6199
|
type: "input",
|
|
6193
6200
|
isNumber: false,
|
|
6194
6201
|
props: {},
|
|
6195
|
-
attributes:
|
|
6202
|
+
attributes: {},
|
|
6196
6203
|
getValue() {
|
|
6197
6204
|
return "50";
|
|
6198
6205
|
},
|
|
@@ -6208,7 +6215,7 @@ const PopsPanelConfig = () => {
|
|
|
6208
6215
|
type: "input",
|
|
6209
6216
|
// @ts-ignore
|
|
6210
6217
|
props: {},
|
|
6211
|
-
attributes:
|
|
6218
|
+
attributes: {},
|
|
6212
6219
|
getValue() {
|
|
6213
6220
|
return "123456";
|
|
6214
6221
|
},
|
|
@@ -6225,7 +6232,7 @@ const PopsPanelConfig = () => {
|
|
|
6225
6232
|
type: "textarea",
|
|
6226
6233
|
// @ts-ignore
|
|
6227
6234
|
props: {},
|
|
6228
|
-
attributes:
|
|
6235
|
+
attributes: {},
|
|
6229
6236
|
getValue() {
|
|
6230
6237
|
return "50";
|
|
6231
6238
|
},
|
|
@@ -6242,7 +6249,7 @@ const PopsPanelConfig = () => {
|
|
|
6242
6249
|
disabled: true,
|
|
6243
6250
|
// @ts-ignore
|
|
6244
6251
|
props: {},
|
|
6245
|
-
attributes:
|
|
6252
|
+
attributes: {},
|
|
6246
6253
|
getValue() {
|
|
6247
6254
|
return 50;
|
|
6248
6255
|
},
|
|
@@ -6283,7 +6290,7 @@ const PopsPanelConfig = () => {
|
|
|
6283
6290
|
disabled: true,
|
|
6284
6291
|
// @ts-ignore
|
|
6285
6292
|
props: {},
|
|
6286
|
-
attributes:
|
|
6293
|
+
attributes: {},
|
|
6287
6294
|
placeholder: "请至少选择一个选项",
|
|
6288
6295
|
getValue() {
|
|
6289
6296
|
return ["select-1", "select-2"];
|
|
@@ -6366,7 +6373,8 @@ const PopsPanelConfig = () => {
|
|
|
6366
6373
|
className: "forms-1",
|
|
6367
6374
|
text: "区域设置",
|
|
6368
6375
|
type: "forms",
|
|
6369
|
-
attributes:
|
|
6376
|
+
attributes: {},
|
|
6377
|
+
props: {},
|
|
6370
6378
|
forms: [
|
|
6371
6379
|
{
|
|
6372
6380
|
className: "panel-switch",
|
|
@@ -6374,7 +6382,7 @@ const PopsPanelConfig = () => {
|
|
|
6374
6382
|
type: "switch",
|
|
6375
6383
|
// @ts-ignore
|
|
6376
6384
|
props: {},
|
|
6377
|
-
attributes:
|
|
6385
|
+
attributes: {},
|
|
6378
6386
|
getValue() {
|
|
6379
6387
|
return true;
|
|
6380
6388
|
},
|
|
@@ -6388,7 +6396,7 @@ const PopsPanelConfig = () => {
|
|
|
6388
6396
|
// @ts-ignore
|
|
6389
6397
|
props: {},
|
|
6390
6398
|
type: "slider",
|
|
6391
|
-
attributes:
|
|
6399
|
+
attributes: {},
|
|
6392
6400
|
getValue() {
|
|
6393
6401
|
return 50;
|
|
6394
6402
|
},
|
|
@@ -6404,7 +6412,7 @@ const PopsPanelConfig = () => {
|
|
|
6404
6412
|
// @ts-ignore
|
|
6405
6413
|
props: {},
|
|
6406
6414
|
type: "button",
|
|
6407
|
-
attributes:
|
|
6415
|
+
attributes: {},
|
|
6408
6416
|
buttonIcon: "eleme",
|
|
6409
6417
|
buttonIconIsLoading: true,
|
|
6410
6418
|
buttonType: "warning",
|
|
@@ -6419,7 +6427,7 @@ const PopsPanelConfig = () => {
|
|
|
6419
6427
|
type: "button",
|
|
6420
6428
|
// @ts-ignore
|
|
6421
6429
|
props: {},
|
|
6422
|
-
attributes:
|
|
6430
|
+
attributes: {},
|
|
6423
6431
|
buttonIcon: "chromeFilled",
|
|
6424
6432
|
buttonIconIsLoading: true,
|
|
6425
6433
|
buttonType: "danger",
|
|
@@ -6434,7 +6442,7 @@ const PopsPanelConfig = () => {
|
|
|
6434
6442
|
// @ts-ignore
|
|
6435
6443
|
props: {},
|
|
6436
6444
|
type: "button",
|
|
6437
|
-
attributes:
|
|
6445
|
+
attributes: {},
|
|
6438
6446
|
buttonIcon: "upload",
|
|
6439
6447
|
buttonIconIsLoading: false,
|
|
6440
6448
|
buttonType: "info",
|
|
@@ -6481,7 +6489,7 @@ const PopsPanelConfig = () => {
|
|
|
6481
6489
|
// @ts-ignore
|
|
6482
6490
|
props: {},
|
|
6483
6491
|
type: "switch",
|
|
6484
|
-
attributes:
|
|
6492
|
+
attributes: {},
|
|
6485
6493
|
getValue() {
|
|
6486
6494
|
return true;
|
|
6487
6495
|
},
|
|
@@ -6500,12 +6508,10 @@ const PopsPanelConfig = () => {
|
|
|
6500
6508
|
`,
|
|
6501
6509
|
isBottom: true,
|
|
6502
6510
|
disableAsideItemHoverCSS: true,
|
|
6503
|
-
attributes:
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
},
|
|
6508
|
-
],
|
|
6511
|
+
attributes: {
|
|
6512
|
+
"data-value": "value",
|
|
6513
|
+
"data-value-2": "value2",
|
|
6514
|
+
},
|
|
6509
6515
|
// @ts-ignore
|
|
6510
6516
|
props: {},
|
|
6511
6517
|
forms: [],
|
|
@@ -6517,12 +6523,10 @@ const PopsPanelConfig = () => {
|
|
|
6517
6523
|
id: "whitesev-panel-bottom-config-2",
|
|
6518
6524
|
title: "版本:xxx.xx.xx",
|
|
6519
6525
|
isBottom: true,
|
|
6520
|
-
attributes:
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
|
|
6524
|
-
},
|
|
6525
|
-
],
|
|
6526
|
+
attributes: {
|
|
6527
|
+
"data-value": "value",
|
|
6528
|
+
"data-value-2": "value2",
|
|
6529
|
+
},
|
|
6526
6530
|
// @ts-ignore
|
|
6527
6531
|
props: {},
|
|
6528
6532
|
forms: [],
|
|
@@ -6774,9 +6778,7 @@ class ToolTip {
|
|
|
6774
6778
|
/** 箭头 */
|
|
6775
6779
|
const $toolTipArrow = $toolTipContainer.querySelector(".pops-tip-arrow");
|
|
6776
6780
|
// 处理className
|
|
6777
|
-
|
|
6778
|
-
popsDOMUtils.addClassName($toolTipContainer, this.$data.config.className);
|
|
6779
|
-
}
|
|
6781
|
+
popsDOMUtils.addClassName($toolTipContainer, this.$data.config.className);
|
|
6780
6782
|
// 添加z-index
|
|
6781
6783
|
$toolTipContainer.style.zIndex = PopsHandler.handleZIndex(this.$data.config.zIndex).toString();
|
|
6782
6784
|
if (this.$data.config.style != null) {
|
|
@@ -7424,10 +7426,12 @@ const PanelHandlerComponents = () => {
|
|
|
7424
7426
|
* @param props 属性
|
|
7425
7427
|
*/
|
|
7426
7428
|
setElementProps($el, props) {
|
|
7427
|
-
if (props == null)
|
|
7429
|
+
if (props == null)
|
|
7428
7430
|
return;
|
|
7429
|
-
|
|
7430
|
-
|
|
7431
|
+
if (typeof props !== "object")
|
|
7432
|
+
return;
|
|
7433
|
+
const propsKeys = Object.keys(props);
|
|
7434
|
+
propsKeys.forEach((propName) => {
|
|
7431
7435
|
const value = props[propName];
|
|
7432
7436
|
if (propName === "innerHTML") {
|
|
7433
7437
|
PopsSafeUtils.setSafeHTML($el, value);
|
|
@@ -7442,23 +7446,7 @@ const PanelHandlerComponents = () => {
|
|
|
7442
7446
|
* @param className
|
|
7443
7447
|
*/
|
|
7444
7448
|
setElementClassName($el, className) {
|
|
7445
|
-
|
|
7446
|
-
return;
|
|
7447
|
-
}
|
|
7448
|
-
if (typeof className === "function") {
|
|
7449
|
-
className = className();
|
|
7450
|
-
}
|
|
7451
|
-
if (typeof className === "string") {
|
|
7452
|
-
const splitClassName = className.split(" ");
|
|
7453
|
-
splitClassName.forEach((classNameStr) => {
|
|
7454
|
-
$el.classList.add(classNameStr);
|
|
7455
|
-
});
|
|
7456
|
-
}
|
|
7457
|
-
else if (Array.isArray(className)) {
|
|
7458
|
-
className.forEach((classNameStr) => {
|
|
7459
|
-
this.setElementClassName($el, classNameStr);
|
|
7460
|
-
});
|
|
7461
|
-
}
|
|
7449
|
+
popsDOMUtils.addClassName($el, className);
|
|
7462
7450
|
},
|
|
7463
7451
|
/**
|
|
7464
7452
|
* 创建底部项元素<li>
|
|
@@ -11954,7 +11942,7 @@ const PopsSearchSuggestion = {
|
|
|
11954
11942
|
},
|
|
11955
11943
|
};
|
|
11956
11944
|
|
|
11957
|
-
const version = "2.5.
|
|
11945
|
+
const version = "2.5.3";
|
|
11958
11946
|
|
|
11959
11947
|
class Pops {
|
|
11960
11948
|
/** 配置 */
|