@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.
Files changed (44) hide show
  1. package/dist/index.amd.js +62 -74
  2. package/dist/index.amd.js.map +1 -1
  3. package/dist/index.amd.min.js +1 -1
  4. package/dist/index.amd.min.js.map +1 -1
  5. package/dist/index.cjs.js +62 -74
  6. package/dist/index.cjs.js.map +1 -1
  7. package/dist/index.cjs.min.js +1 -1
  8. package/dist/index.cjs.min.js.map +1 -1
  9. package/dist/index.esm.js +62 -74
  10. package/dist/index.esm.js.map +1 -1
  11. package/dist/index.esm.min.js +1 -1
  12. package/dist/index.esm.min.js.map +1 -1
  13. package/dist/index.iife.js +62 -74
  14. package/dist/index.iife.js.map +1 -1
  15. package/dist/index.iife.min.js +1 -1
  16. package/dist/index.iife.min.js.map +1 -1
  17. package/dist/index.system.js +62 -74
  18. package/dist/index.system.js.map +1 -1
  19. package/dist/index.system.min.js +1 -1
  20. package/dist/index.system.min.js.map +1 -1
  21. package/dist/index.umd.js +62 -74
  22. package/dist/index.umd.js.map +1 -1
  23. package/dist/index.umd.min.js +1 -1
  24. package/dist/index.umd.min.js.map +1 -1
  25. package/dist/types/src/Pops.d.ts +4 -4
  26. package/dist/types/src/components/panel/handlerComponents.d.ts +2 -2
  27. package/dist/types/src/components/panel/types/components-common.d.ts +3 -5
  28. package/dist/types/src/components/panel/types/index.d.ts +5 -11
  29. package/dist/types/src/components/rightClickMenu/index.d.ts +1 -1
  30. package/dist/types/src/components/rightClickMenu/types/index.d.ts +3 -2
  31. package/dist/types/src/components/searchSuggestion/types/index.d.ts +3 -2
  32. package/dist/types/src/components/tooltip/index.d.ts +1 -1
  33. package/dist/types/src/components/tooltip/types/index.d.ts +2 -1
  34. package/dist/types/src/utils/PopsDOMUtils.d.ts +1 -1
  35. package/package.json +1 -1
  36. package/src/components/panel/config.ts +36 -43
  37. package/src/components/panel/handlerComponents.ts +7 -22
  38. package/src/components/panel/types/components-common.ts +5 -9
  39. package/src/components/panel/types/index.ts +5 -13
  40. package/src/components/rightClickMenu/types/index.ts +3 -2
  41. package/src/components/searchSuggestion/types/index.ts +3 -2
  42. package/src/components/tooltip/index.ts +1 -3
  43. package/src/components/tooltip/types/index.ts +2 -1
  44. package/src/utils/PopsDOMUtils.ts +23 -10
@@ -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 (className.trim() === "") {
1847
- return;
1847
+ if (!Array.isArray(className)) {
1848
+ className = [className];
1848
1849
  }
1849
- const classNameList = className.split(" ").filter((item) => item.trim() !== "");
1850
- $el.classList.add(...classNameList);
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
- "data-test": "test",
6061
- "data-test-2": "test2",
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
- "data-value": "value",
6190
- "data-value-2": "value2",
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
- "data-value": "value",
6511
- "data-value-2": "value2",
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
- "data-value": "value",
6528
- "data-value-2": "value2",
6529
- },
6530
- ],
6531
+ attributes: {
6532
+ "data-value": "value",
6533
+ "data-value-2": "value2",
6534
+ },
6531
6535
  // @ts-ignore
6532
6536
  props: {},
6533
6537
  forms: [],
@@ -6779,9 +6783,7 @@ System.register('pops', [], (function (exports) {
6779
6783
  /** 箭头 */
6780
6784
  const $toolTipArrow = $toolTipContainer.querySelector(".pops-tip-arrow");
6781
6785
  // 处理className
6782
- if (typeof this.$data.config.className === "string" && this.$data.config.className.trim() !== "") {
6783
- popsDOMUtils.addClassName($toolTipContainer, this.$data.config.className);
6784
- }
6786
+ popsDOMUtils.addClassName($toolTipContainer, this.$data.config.className);
6785
6787
  // 添加z-index
6786
6788
  $toolTipContainer.style.zIndex = PopsHandler.handleZIndex(this.$data.config.zIndex).toString();
6787
6789
  if (this.$data.config.style != null) {
@@ -7429,10 +7431,12 @@ System.register('pops', [], (function (exports) {
7429
7431
  * @param props 属性
7430
7432
  */
7431
7433
  setElementProps($el, props) {
7432
- if (props == null) {
7434
+ if (props == null)
7433
7435
  return;
7434
- }
7435
- Object.keys(props).forEach((propName) => {
7436
+ if (typeof props !== "object")
7437
+ return;
7438
+ const propsKeys = Object.keys(props);
7439
+ propsKeys.forEach((propName) => {
7436
7440
  const value = props[propName];
7437
7441
  if (propName === "innerHTML") {
7438
7442
  PopsSafeUtils.setSafeHTML($el, value);
@@ -7447,23 +7451,7 @@ System.register('pops', [], (function (exports) {
7447
7451
  * @param className
7448
7452
  */
7449
7453
  setElementClassName($el, className) {
7450
- if (className == null) {
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
- }
7454
+ popsDOMUtils.addClassName($el, className);
7467
7455
  },
7468
7456
  /**
7469
7457
  * 创建底部项元素<li>
@@ -11959,7 +11947,7 @@ System.register('pops', [], (function (exports) {
11959
11947
  },
11960
11948
  };
11961
11949
 
11962
- const version = "2.5.2";
11950
+ const version = "2.5.3";
11963
11951
 
11964
11952
  class Pops {
11965
11953
  /** 配置 */