@whitesev/pops 2.2.0 → 2.2.2

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 (48) hide show
  1. package/dist/index.amd.js +364 -357
  2. package/dist/index.amd.js.map +1 -1
  3. package/dist/index.cjs.js +364 -357
  4. package/dist/index.cjs.js.map +1 -1
  5. package/dist/index.esm.js +364 -357
  6. package/dist/index.esm.js.map +1 -1
  7. package/dist/index.iife.js +364 -357
  8. package/dist/index.iife.js.map +1 -1
  9. package/dist/index.system.js +364 -357
  10. package/dist/index.system.js.map +1 -1
  11. package/dist/index.umd.js +364 -357
  12. package/dist/index.umd.js.map +1 -1
  13. package/dist/types/src/Pops.d.ts +17 -17
  14. package/dist/types/src/PopsInst.d.ts +8 -0
  15. package/dist/types/src/components/panel/index.d.ts +2 -1
  16. package/dist/types/src/components/searchSuggestion/index.d.ts +1 -1
  17. package/dist/types/src/handler/PopsElementHandler.d.ts +6 -6
  18. package/dist/types/src/handler/PopsHandler.d.ts +6 -6
  19. package/dist/types/src/types/button.d.ts +2 -2
  20. package/dist/types/src/types/components.d.ts +5 -5
  21. package/dist/types/src/types/event.d.ts +3 -3
  22. package/dist/types/src/types/{layer.d.ts → inst.d.ts} +7 -5
  23. package/dist/types/src/types/main.d.ts +36 -58
  24. package/dist/types/src/utils/PopsInstanceUtils.d.ts +10 -10
  25. package/package.json +1 -1
  26. package/src/Pops.ts +2 -2
  27. package/src/PopsInst.ts +21 -0
  28. package/src/components/alert/index.ts +16 -16
  29. package/src/components/confirm/index.ts +16 -15
  30. package/src/components/drawer/index.ts +16 -15
  31. package/src/components/folder/index.ts +141 -152
  32. package/src/components/iframe/index.ts +16 -15
  33. package/src/components/panel/index.ts +19 -18
  34. package/src/components/prompt/index.ts +15 -14
  35. package/src/components/rightClickMenu/index.ts +19 -18
  36. package/src/components/searchSuggestion/index.ts +21 -20
  37. package/src/components/tooltip/index.ts +3 -2
  38. package/src/css/scrollbar.css +9 -5
  39. package/src/handler/PopsElementHandler.ts +18 -18
  40. package/src/handler/PopsHandler.ts +38 -32
  41. package/src/types/button.d.ts +2 -2
  42. package/src/types/components.d.ts +5 -5
  43. package/src/types/event.d.ts +3 -3
  44. package/src/types/{layer.d.ts → inst.d.ts} +7 -5
  45. package/src/types/main.d.ts +36 -58
  46. package/src/utils/PopsInstanceUtils.ts +84 -81
  47. package/dist/types/src/PopsLayer.d.ts +0 -5
  48. package/src/PopsLayer.ts +0 -18
@@ -8,12 +8,13 @@ import { PopsPanelConfig } from "./config";
8
8
  import { PanelHandlerComponents } from "./handlerComponents";
9
9
  import { GlobalConfig } from "../../GlobalConfig";
10
10
  import { PopsCSS } from "../../PopsCSS";
11
+ import type { PopsType } from "../../types/main";
11
12
 
12
13
  export const PopsPanel = {
13
14
  init(details: PopsPanelDetails) {
14
15
  const guid = popsUtils.getRandomGUID();
15
16
  // 设置当前类型
16
- const PopsType = "panel";
17
+ const popsType: PopsType = "panel";
17
18
 
18
19
  let config: Required<PopsPanelDetails> = PopsPanelConfig();
19
20
  config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
@@ -21,7 +22,7 @@ export const PopsPanel = {
21
22
  if (details && Array.isArray(details.content)) {
22
23
  config.content = details.content;
23
24
  }
24
- config = PopsHandler.handleOnly(PopsType, config);
25
+ config = PopsHandler.handleOnly(popsType, config);
25
26
 
26
27
  const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
27
28
  PopsHandler.handleInit($shadowRoot, [
@@ -59,32 +60,32 @@ export const PopsPanel = {
59
60
  let zIndex = PopsHandler.handleZIndex(config.zIndex);
60
61
  let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
61
62
 
62
- let headerBtnHTML = PopsElementHandler.getHeaderBtnHTML(PopsType, config);
63
+ let headerBtnHTML = PopsElementHandler.getHeaderBtnHTML(popsType, config);
63
64
  let { headerStyle, headerPStyle } = PopsElementHandler.getHeaderStyle(
64
- PopsType,
65
+ popsType,
65
66
  config
66
67
  );
67
68
 
68
69
  let animHTML = PopsElementHandler.getAnimHTML(
69
70
  guid,
70
- PopsType,
71
+ popsType,
71
72
  config,
72
73
  /*html*/ `
73
- <div class="pops-title pops-${PopsType}-title" style="text-align: ${
74
+ <div class="pops-title pops-${popsType}-title" style="text-align: ${
74
75
  config.title.position
75
76
  };${headerStyle}">${
76
77
  config.title.html
77
78
  ? config.title.text
78
- : `<p pops class="pops-${PopsType}-title-text" class="pops-${PopsType}-title-text" style="${headerPStyle}">${config.title.text}</p>`
79
+ : `<p pops class="pops-${popsType}-title-text" class="pops-${popsType}-title-text" style="${headerPStyle}">${config.title.text}</p>`
79
80
  }${headerBtnHTML}</div>
80
- <div class="pops-content pops-${PopsType}-content">
81
- <aside class="pops-${PopsType}-aside">
82
- <ul class="pops-${PopsType}-aside-top-container"></ul>
83
- <ul class="pops-${PopsType}-aside-bottom-container"></ul>
81
+ <div class="pops-content pops-${popsType}-content">
82
+ <aside class="pops-${popsType}-aside">
83
+ <ul class="pops-${popsType}-aside-top-container"></ul>
84
+ <ul class="pops-${popsType}-aside-bottom-container"></ul>
84
85
  </aside>
85
- <section class="pops-${PopsType}-container">
86
- <ul class="pops-${PopsType}-container-header-ul"></ul>
87
- <ul class="pops-${PopsType}-container-main-ul"></ul>
86
+ <section class="pops-${popsType}-container">
87
+ <ul class="pops-${popsType}-container-header-ul"></ul>
88
+ <ul class="pops-${popsType}-container-main-ul"></ul>
88
89
  </section>
89
90
  </div>`,
90
91
  "",
@@ -102,7 +103,7 @@ export const PopsPanel = {
102
103
  contentElement: $content,
103
104
  contentAsideElement: $contentAside,
104
105
  contentSectionContainerElement: $contentSectionContainer,
105
- } = PopsHandler.handleQueryElement($anim, PopsType);
106
+ } = PopsHandler.handleQueryElement($anim, popsType);
106
107
  if (config.isMobile || popsUtils.isPhone()) {
107
108
  popsDOMUtils.addClassName($pops, config.mobileClassName);
108
109
  }
@@ -118,7 +119,7 @@ export const PopsPanel = {
118
119
  /* 遮罩层元素 */
119
120
  if (config.mask.enable) {
120
121
  let { maskElement } = PopsHandler.handleMask({
121
- type: PopsType,
122
+ type: popsType,
122
123
  guid: guid,
123
124
  config: config,
124
125
  animElement: $anim,
@@ -133,7 +134,7 @@ export const PopsPanel = {
133
134
  guid,
134
135
  $shadowContainer,
135
136
  $shadowRoot,
136
- PopsType,
137
+ popsType,
137
138
  $anim,
138
139
  $pops,
139
140
  $mask!,
@@ -171,7 +172,7 @@ export const PopsPanel = {
171
172
  },
172
173
  });
173
174
 
174
- PopsHandler.handlePush(PopsType, {
175
+ PopsHandler.handlePush(popsType, {
175
176
  guid: guid,
176
177
  animElement: $anim,
177
178
  popsElement: $pops,
@@ -2,6 +2,7 @@ import { GlobalConfig } from "../../GlobalConfig";
2
2
  import { PopsElementHandler } from "../../handler/PopsElementHandler";
3
3
  import { PopsHandler } from "../../handler/PopsHandler";
4
4
  import { PopsCSS } from "../../PopsCSS";
5
+ import type { PopsType } from "../../types/main";
5
6
  import { popsDOMUtils } from "../../utils/PopsDOMUtils";
6
7
  import { PopsInstanceUtils } from "../../utils/PopsInstanceUtils";
7
8
  import { popsUtils } from "../../utils/PopsUtils";
@@ -12,12 +13,12 @@ export const PopsPrompt = {
12
13
  init(details: PopsPromptDetails) {
13
14
  const guid = popsUtils.getRandomGUID();
14
15
  // 设置当前类型
15
- const PopsType = "prompt";
16
+ const popsType: PopsType = "prompt";
16
17
 
17
18
  let config = PopsPromptConfig();
18
19
  config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
19
20
  config = popsUtils.assign(config, details);
20
- config = PopsHandler.handleOnly(PopsType, config);
21
+ config = PopsHandler.handleOnly(popsType, config);
21
22
 
22
23
  const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
23
24
  PopsHandler.handleInit($shadowRoot, [
@@ -55,29 +56,29 @@ export const PopsPrompt = {
55
56
  let zIndex = PopsHandler.handleZIndex(config.zIndex);
56
57
  let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
57
58
 
58
- let headerBtnHTML = PopsElementHandler.getHeaderBtnHTML(PopsType, config);
59
- let bottomBtnHTML = PopsElementHandler.getBottomBtnHTML(PopsType, config);
59
+ let headerBtnHTML = PopsElementHandler.getHeaderBtnHTML(popsType, config);
60
+ let bottomBtnHTML = PopsElementHandler.getBottomBtnHTML(popsType, config);
60
61
  let { headerStyle, headerPStyle } = PopsElementHandler.getHeaderStyle(
61
- PopsType,
62
+ popsType,
62
63
  config
63
64
  );
64
65
  let { contentPStyle } = PopsElementHandler.getContentStyle(
65
- PopsType,
66
+ popsType,
66
67
  config
67
68
  );
68
69
  let animHTML = PopsElementHandler.getAnimHTML(
69
70
  guid,
70
- PopsType,
71
+ popsType,
71
72
  config,
72
73
  /*html*/ `
73
- <div class="pops-title pops-${PopsType}-title" style="text-align: ${
74
+ <div class="pops-title pops-${popsType}-title" style="text-align: ${
74
75
  config.title.position
75
76
  };${headerStyle}">${
76
77
  config.title.html
77
78
  ? config.title.text
78
- : `<p pops class="pops-${PopsType}-title-text" style="${headerPStyle}">${config.title.text}</p>`
79
+ : `<p pops class="pops-${popsType}-title-text" style="${headerPStyle}">${config.title.text}</p>`
79
80
  }${headerBtnHTML}</div>
80
- <div class="pops-content pops-${PopsType}-content" style="${contentPStyle}">${
81
+ <div class="pops-content pops-${popsType}-content" style="${contentPStyle}">${
81
82
  config.content.row
82
83
  ? '<textarea name="pops-input-text" pops="" placeholder="' +
83
84
  config.content.placeholder +
@@ -105,7 +106,7 @@ export const PopsPrompt = {
105
106
  btnCancelElement: $btnCancel,
106
107
  btnOtherElement: $btnOther,
107
108
  titleElement: $title,
108
- } = PopsHandler.handleQueryElement($anim, PopsType);
109
+ } = PopsHandler.handleQueryElement($anim, popsType);
109
110
  /**
110
111
  * 遮罩层元素
111
112
  */
@@ -119,7 +120,7 @@ export const PopsPrompt = {
119
120
  if (config.mask.enable) {
120
121
  // 启用遮罩层
121
122
  let _handleMask_ = PopsHandler.handleMask({
122
- type: PopsType,
123
+ type: popsType,
123
124
  guid: guid,
124
125
  config: config,
125
126
  animElement: $anim,
@@ -132,7 +133,7 @@ export const PopsPrompt = {
132
133
  guid,
133
134
  $shadowContainer,
134
135
  $shadowRoot,
135
- PopsType,
136
+ popsType,
136
137
  $anim,
137
138
 
138
139
  $pops!,
@@ -187,7 +188,7 @@ export const PopsPrompt = {
187
188
  if ($mask != null) {
188
189
  $anim.after($mask);
189
190
  }
190
- PopsHandler.handlePush(PopsType, {
191
+ PopsHandler.handlePush(popsType, {
191
192
  guid: guid,
192
193
  animElement: $anim,
193
194
 
@@ -11,17 +11,18 @@ import type {
11
11
  } from "./types";
12
12
  import { PopsCSS } from "../../PopsCSS";
13
13
  import { PopsIcon } from "../../PopsIcon";
14
+ import type { PopsType } from "../../types/main";
14
15
 
15
16
  export const PopsRightClickMenu = {
16
17
  init(details: PopsRightClickMenuDetails) {
17
18
  const guid = popsUtils.getRandomGUID();
18
19
  // 设置当前类型
19
- const PopsType = "rightClickMenu";
20
+ const popsType: PopsType = "rightClickMenu";
20
21
 
21
22
  let config = PopsRightClickMenuConfig();
22
23
  config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
23
24
  config = popsUtils.assign(config, details);
24
- config = PopsHandler.handleOnly(PopsType, config);
25
+ config = PopsHandler.handleOnly(popsType, config);
25
26
  if (config.target == null) {
26
27
  throw new Error("config.target 不能为空");
27
28
  }
@@ -76,7 +77,7 @@ export const PopsRightClickMenu = {
76
77
  return;
77
78
  }
78
79
  let $click = event.target as HTMLElement;
79
- if ($click.closest(`.pops-${PopsType}`)) {
80
+ if ($click.closest(`.pops-${popsType}`)) {
80
81
  return;
81
82
  }
82
83
  if (
@@ -97,7 +98,7 @@ export const PopsRightClickMenu = {
97
98
  return;
98
99
  }
99
100
  let $click = event.target as HTMLElement;
100
- if ($click.closest(`.pops-${PopsType}`)) {
101
+ if ($click.closest(`.pops-${popsType}`)) {
101
102
  return;
102
103
  }
103
104
  PopsContextMenu.closeAllMenu(PopsContextMenu.rootElement);
@@ -167,7 +168,7 @@ export const PopsRightClickMenu = {
167
168
  if (config.preventDefault) {
168
169
  popsDOMUtils.preventEvent(event);
169
170
  }
170
- PopsHandler.handleOnly(PopsType, config);
171
+ PopsHandler.handleOnly(popsType, config);
171
172
  if (PopsContextMenu.rootElement) {
172
173
  PopsContextMenu.closeAllMenu(PopsContextMenu.rootElement);
173
174
  }
@@ -178,14 +179,14 @@ export const PopsRightClickMenu = {
178
179
  );
179
180
  PopsContextMenu.rootElement = rootElement;
180
181
  if (config.only) {
181
- PopsHandler.handlePush(PopsType, {
182
+ PopsHandler.handlePush(popsType, {
182
183
  $shadowRoot: $shadowRoot,
183
184
  $shadowContainer: $shadowContainer,
184
185
  guid: guid,
185
186
  animElement: rootElement,
186
187
  popsElement: rootElement,
187
- beforeRemoveCallBack(layerCommonConfig) {
188
- PopsContextMenu.closeAllMenu(layerCommonConfig.popsElement);
188
+ beforeRemoveCallBack(instCommonConfig) {
189
+ PopsContextMenu.closeAllMenu(instCommonConfig.popsElement);
189
190
  },
190
191
  });
191
192
  }
@@ -241,7 +242,7 @@ export const PopsRightClickMenu = {
241
242
  );
242
243
  element.remove();
243
244
  }
244
- if (element.classList.contains(`pops-${PopsType}-anim-show`)) {
245
+ if (element.classList.contains(`pops-${popsType}-anim-show`)) {
245
246
  /* 有动画 */
246
247
  popsDOMUtils.on(
247
248
  element,
@@ -251,7 +252,7 @@ export const PopsRightClickMenu = {
251
252
  capture: true,
252
253
  }
253
254
  );
254
- element.classList.remove(`pops-${PopsType}-anim-show`);
255
+ element.classList.remove(`pops-${popsType}-anim-show`);
255
256
  } else {
256
257
  /* 无动画 */
257
258
  element.remove();
@@ -283,7 +284,7 @@ export const PopsRightClickMenu = {
283
284
  */
284
285
  getMenuContainerElement(isChildren: boolean) {
285
286
  let $menu = popsDOMUtils.createElement("div", {
286
- className: `pops-${PopsType}`,
287
+ className: `pops-${popsType}`,
287
288
  innerHTML: /*html*/ `
288
289
  <ul></ul>
289
290
  `,
@@ -297,7 +298,7 @@ export const PopsRightClickMenu = {
297
298
  }
298
299
  /* 添加动画 */
299
300
  if (config.isAnimation) {
300
- popsDOMUtils.addClassName($menu, `pops-${PopsType}-anim-grid`);
301
+ popsDOMUtils.addClassName($menu, `pops-${popsType}-anim-grid`);
301
302
  }
302
303
  return $menu;
303
304
  },
@@ -456,7 +457,7 @@ export const PopsRightClickMenu = {
456
457
  });
457
458
  /* 过渡动画 */
458
459
  if (config.isAnimation) {
459
- popsDOMUtils.addClassName(menuElement, `pops-${PopsType}-anim-show`);
460
+ popsDOMUtils.addClassName(menuElement, `pops-${popsType}-anim-show`);
460
461
  }
461
462
  return menuElement;
462
463
  },
@@ -518,7 +519,7 @@ export const PopsRightClickMenu = {
518
519
  popsDOMUtils.css(menuElement, { ...offset, display: "" });
519
520
  /* 过渡动画 */
520
521
  if (config.isAnimation) {
521
- popsDOMUtils.addClassName(menuElement, `pops-${PopsType}-anim-show`);
522
+ popsDOMUtils.addClassName(menuElement, `pops-${popsType}-anim-show`);
522
523
  }
523
524
  return menuElement;
524
525
  },
@@ -546,7 +547,7 @@ export const PopsRightClickMenu = {
546
547
  if (typeof item.icon === "string" && item.icon.trim() !== "") {
547
548
  let iconSVGHTML = PopsIcon.getIcon(item.icon) ?? item.icon;
548
549
  let iconElement = popsDOMUtils.parseTextToDOM(
549
- /*html*/ `<i class="pops-${PopsType}-icon" is-loading="${
550
+ /*html*/ `<i class="pops-${popsType}-icon" is-loading="${
550
551
  item.iconIsLoading ?? false
551
552
  }">${iconSVGHTML}</i>`
552
553
  );
@@ -559,7 +560,7 @@ export const PopsRightClickMenu = {
559
560
  );
560
561
  /* 如果存在子数据,显示 */
561
562
  if (item.item && Array.isArray(item.item)) {
562
- popsDOMUtils.addClassName(menuLiElement, `pops-${PopsType}-item`);
563
+ popsDOMUtils.addClassName(menuLiElement, `pops-${popsType}-item`);
563
564
  }
564
565
  /* 鼠标|触摸 移入事件 */
565
566
  function liElementHoverEvent() {
@@ -568,7 +569,7 @@ export const PopsRightClickMenu = {
568
569
  ).forEach((liElement) => {
569
570
  popsDOMUtils.removeClassName(
570
571
  liElement,
571
- `pops-${PopsType}-is-visited`
572
+ `pops-${popsType}-is-visited`
572
573
  );
573
574
  if (!(liElement as any).__menuData__) {
574
575
  return;
@@ -600,7 +601,7 @@ export const PopsRightClickMenu = {
600
601
  }
601
602
  popsDOMUtils.addClassName(
602
603
  menuLiElement,
603
- `pops-${PopsType}-is-visited`
604
+ `pops-${popsType}-is-visited`
604
605
  );
605
606
  if (!item.item) {
606
607
  return;
@@ -6,12 +6,13 @@ import { GlobalConfig } from "../../GlobalConfig";
6
6
  import { PopsSafeUtils } from "../../utils/PopsSafeUtils";
7
7
  import type { PopsSearchSuggestionDetails } from "./types/index";
8
8
  import { PopsCSS } from "../../PopsCSS";
9
+ import type { PopsType } from "../../types/main";
9
10
 
10
11
  export const PopsSearchSuggestion = {
11
12
  init(details: PopsSearchSuggestionDetails) {
12
13
  const guid = popsUtils.getRandomGUID();
13
14
  // 设置当前类型
14
- const PopsType = "searchSuggestion";
15
+ const popsType: PopsType = "searchSuggestion";
15
16
 
16
17
  let config = PopsSearchSuggestionConfig();
17
18
  config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
@@ -88,7 +89,7 @@ export const PopsSearchSuggestion = {
88
89
 
89
90
  SearchSuggestion.hide();
90
91
  if (config.isAnimation) {
91
- SearchSuggestion.$el.root.classList.add(`pops-${PopsType}-animation`);
92
+ SearchSuggestion.$el.root.classList.add(`pops-${popsType}-animation`);
92
93
  }
93
94
  $shadowRoot.appendChild(SearchSuggestion.$el.root);
94
95
  parentElement.appendChild($shadowContainer);
@@ -109,19 +110,19 @@ export const PopsSearchSuggestion = {
109
110
  let element = popsDOMUtils.createElement(
110
111
  "div",
111
112
  {
112
- className: `pops pops-${PopsType}-search-suggestion`,
113
+ className: `pops pops-${popsType}-search-suggestion`,
113
114
  innerHTML: /*html*/ `
114
115
  <style data-dynamic="true">
115
116
  ${this.getDynamicCSS()}
116
117
  </style>
117
- <ul class="pops-${PopsType}-search-suggestion-hint">${
118
+ <ul class="pops-${popsType}-search-suggestion-hint">${
118
119
  config.toSearhNotResultHTML
119
120
  }</ul>
120
121
  `,
121
122
  },
122
123
  {
123
124
  "data-guid": guid,
124
- "type-value": PopsType,
125
+ "type-value": popsType,
125
126
  }
126
127
  );
127
128
  if (config.className !== "" && config.className != null) {
@@ -132,24 +133,24 @@ export const PopsSearchSuggestion = {
132
133
  /** 动态获取CSS */
133
134
  getDynamicCSS() {
134
135
  return /*css*/ `
135
- .pops-${PopsType}-animation{
136
+ .pops-${popsType}-animation{
136
137
  -moz-animation: searchSelectFalIn 0.5s 1 linear;
137
138
  -webkit-animation: searchSelectFalIn 0.5s 1 linear;
138
139
  -o-animation: searchSelectFalIn 0.5s 1 linear;
139
140
  -ms-animation: searchSelectFalIn 0.5s 1 linear;
140
141
  }
141
- .pops-${PopsType}-search-suggestion{
142
+ .pops-${popsType}-search-suggestion{
142
143
  --search-suggestion-bg-color: #ffffff;
143
144
  --search-suggestion-box-shadow-color: rgb(0 0 0 / 20%);
144
145
  --search-suggestion-item-color: #515a6e;
145
146
  --search-suggestion-item-none-color: #8e8e8e;
146
147
  --search-suggestion-item-hover-bg-color: rgba(0, 0, 0, .1);
147
148
  }
148
- .pops-${PopsType}-search-suggestion{
149
+ .pops-${popsType}-search-suggestion{
149
150
  border: initial;
150
151
  overflow: initial;
151
152
  }
152
- ul.pops-${PopsType}-search-suggestion-hint{
153
+ ul.pops-${popsType}-search-suggestion-hint{
153
154
  position: ${config.isAbsolute ? "absolute" : "fixed"};
154
155
  z-index: ${PopsHandler.handleZIndex(config.zIndex)};
155
156
  width: 0;
@@ -164,14 +165,14 @@ export const PopsSearchSuggestion = {
164
165
  box-shadow: 0 1px 6px var(--search-suggestion-box-shadow-color);
165
166
  }
166
167
  /* 建议框在上面时 */
167
- ul.pops-${PopsType}-search-suggestion-hint[data-top-reverse]{
168
+ ul.pops-${popsType}-search-suggestion-hint[data-top-reverse]{
168
169
  display: flex;
169
170
  flex-direction: column-reverse;
170
171
  }
171
- ul.pops-${PopsType}-search-suggestion-hint[data-top-reverse] li{
172
+ ul.pops-${popsType}-search-suggestion-hint[data-top-reverse] li{
172
173
  flex-shrink: 0;
173
174
  }
174
- ul.pops-${PopsType}-search-suggestion-hint li{
175
+ ul.pops-${popsType}-search-suggestion-hint li{
175
176
  padding: 7px;
176
177
  margin: 0;
177
178
  clear: both;
@@ -184,17 +185,17 @@ export const PopsSearchSuggestion = {
184
185
  text-overflow: ellipsis;
185
186
  width: 100%;
186
187
  }
187
- ul.pops-${PopsType}-search-suggestion-hint li[data-none]{
188
+ ul.pops-${popsType}-search-suggestion-hint li[data-none]{
188
189
  text-align: center;
189
190
  font-size: 12px;
190
191
  color: var(--search-suggestion-item-none-color);
191
192
  }
192
- ul.pops-${PopsType}-search-suggestion-hint li:hover{
193
+ ul.pops-${popsType}-search-suggestion-hint li:hover{
193
194
  background-color: var(--search-suggestion-item-hover-bg-color);
194
195
  }
195
196
 
196
197
  @media (prefers-color-scheme: dark){
197
- .pops-${PopsType}-search-suggestion{
198
+ .pops-${popsType}-search-suggestion{
198
199
  --search-suggestion-bg-color: #1d1e1f;
199
200
  --search-suggestion-item-color: #cfd3d4;
200
201
  --search-suggestion-item-hover-bg-color: rgba(175, 175, 175, .1);
@@ -209,7 +210,7 @@ export const PopsSearchSuggestion = {
209
210
  */
210
211
  getSearchItemLiElement(data: any, index: number) {
211
212
  return popsDOMUtils.createElement("li", {
212
- className: `pops-${PopsType}-search-suggestion-hint-item pops-flex-items-center pops-flex-y-center`,
213
+ className: `pops-${popsType}-search-suggestion-hint-item pops-flex-items-center pops-flex-y-center`,
213
214
  "data-index": index,
214
215
  "data-value": SearchSuggestion.getItemDataValue(data),
215
216
  innerHTML: `${config.getItemHTML(data)}${
@@ -236,7 +237,7 @@ export const PopsSearchSuggestion = {
236
237
  (event) => {
237
238
  popsDOMUtils.preventEvent(event);
238
239
  let $click = event.target as HTMLLIElement;
239
- if ($click.closest(`.pops-${PopsType}-delete-icon`)) {
240
+ if ($click.closest(`.pops-${popsType}-delete-icon`)) {
240
241
  /* 点击的是删除按钮 */
241
242
  if (typeof config.deleteIcon.callback === "function") {
242
243
  config.deleteIcon.callback(
@@ -512,7 +513,7 @@ export const PopsSearchSuggestion = {
512
513
  */
513
514
  getDeleteIconHTML(size = 16, fill = "#bababa") {
514
515
  return /*html*/ `
515
- <svg class="pops-${PopsType}-delete-icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" fill="${fill}">
516
+ <svg class="pops-${popsType}-delete-icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="${size}" height="${size}" fill="${fill}">
516
517
  <path d="M512 883.2A371.2 371.2 0 1 0 140.8 512 371.2 371.2 0 0 0 512 883.2z m0 64a435.2 435.2 0 1 1 435.2-435.2 435.2 435.2 0 0 1-435.2 435.2z"></path>
517
518
  <path d="M557.056 512l122.368 122.368a31.744 31.744 0 1 1-45.056 45.056L512 557.056l-122.368 122.368a31.744 31.744 0 1 1-45.056-45.056L466.944 512 344.576 389.632a31.744 31.744 0 1 1 45.056-45.056L512 466.944l122.368-122.368a31.744 31.744 0 1 1 45.056 45.056z"></path>
518
519
  </svg>
@@ -523,7 +524,7 @@ export const PopsSearchSuggestion = {
523
524
  */
524
525
  setPromptsInSearch() {
525
526
  let isSearchingElement = popsDOMUtils.createElement("li", {
526
- className: `pops-${PopsType}-search-suggestion-hint-searching-item`,
527
+ className: `pops-${popsType}-search-suggestion-hint-searching-item`,
527
528
  innerHTML: config.searchingTip,
528
529
  });
529
530
  SearchSuggestion.$el.$hintULContainer.appendChild(isSearchingElement);
@@ -534,7 +535,7 @@ export const PopsSearchSuggestion = {
534
535
  removePromptsInSearch() {
535
536
  SearchSuggestion.$el.$hintULContainer
536
537
  .querySelector<HTMLLIElement>(
537
- `li.pops-${PopsType}-search-suggestion-hint-searching-item`
538
+ `li.pops-${popsType}-search-suggestion-hint-searching-item`
538
539
  )
539
540
  ?.remove();
540
541
  },
@@ -1,6 +1,7 @@
1
1
  import { GlobalConfig } from "../../GlobalConfig";
2
2
  import { PopsHandler } from "../../handler/PopsHandler";
3
3
  import { PopsCSS } from "../../PopsCSS";
4
+ import type { PopsType } from "../../types/main";
4
5
  import { popsDOMUtils } from "../../utils/PopsDOMUtils";
5
6
  import { PopsSafeUtils } from "../../utils/PopsSafeUtils";
6
7
  import { popsUtils } from "../../utils/PopsUtils";
@@ -601,7 +602,7 @@ export const PopsTooltip = {
601
602
  init(details: PopsToolTipDetails) {
602
603
  const guid = popsUtils.getRandomGUID();
603
604
  // 设置当前类型
604
- const PopsType = "tooltip";
605
+ const popsType: PopsType = "tooltip";
605
606
 
606
607
  let config = PopsTooltipConfig();
607
608
  config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
@@ -609,7 +610,7 @@ export const PopsTooltip = {
609
610
  if (!(config.target instanceof HTMLElement)) {
610
611
  throw new TypeError("config.target 必须是HTMLElement类型");
611
612
  }
612
- config = PopsHandler.handleOnly(PopsType, config);
613
+ config = PopsHandler.handleOnly(popsType, config);
613
614
 
614
615
  const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
615
616
  PopsHandler.handleInit($shadowRoot, [
@@ -1,18 +1,22 @@
1
- /* firefox上暂不支持::-webkit-scrollbar */
1
+ /* ::-webkit-scrollbar 是非标准的css */
2
+ /* https://caniuse.com/?search=%20%3A%3A-webkit-scrollbar */
2
3
  .pops ::-webkit-scrollbar {
3
4
  width: 6px;
4
5
  height: 0;
5
6
  }
6
7
 
8
+ /* 滚动条轨道 */
7
9
  .pops ::-webkit-scrollbar-track {
8
10
  width: 0;
9
11
  }
10
- .pops ::-webkit-scrollbar-thumb:hover {
11
- background: rgb(178, 178, 178, var(--pops-bg-opacity));
12
- }
12
+ /* 滚动条滑块 */
13
13
  .pops ::-webkit-scrollbar-thumb {
14
14
  min-height: 28px;
15
15
  border-radius: 2em;
16
- background: rgb(204, 204, 204, var(--pops-bg-opacity));
16
+ background: rgb(204, 204, 204, var(--pops-bg-opacity, 1));
17
17
  background-clip: padding-box;
18
18
  }
19
+ /* 滚动条滑块 */
20
+ .pops ::-webkit-scrollbar-thumb:hover {
21
+ background: rgb(178, 178, 178, var(--pops-bg-opacity, 1));
22
+ }
@@ -3,14 +3,14 @@ import type { PopsConfirmDetails } from "../components/confirm/types";
3
3
  import type { PopsIframeDetails } from "../components/iframe/types";
4
4
  import type { PopsIconType } from "../types/icon";
5
5
  import type {
6
- PopsSupportAnim,
7
- PopsSupportBottomBtn,
8
- PopsSupportContent,
9
- PopsSupportHeaderTitle,
10
- PopsTypeSupportAnim,
11
- PopsTypeSupportBottomBtn,
12
- PopsTypeSupportContent,
13
- PopsTypeSupportHeaderTitle,
6
+ PopsSupportAnimDetails,
7
+ PopsSupportBottomBtnDetails,
8
+ PopsSupportContentDetails,
9
+ PopsSupportHeaderTitleDetails,
10
+ PopsSupportAnimDetailsType,
11
+ PopsSupportBottomBtnDetailsType,
12
+ PopsSupportContentDetailsType,
13
+ PopsSupportHeaderTitleDetailsType,
14
14
  } from "../types/main";
15
15
  import { PopsIcon } from "../PopsIcon";
16
16
  import { popsDOMUtils } from "../utils/PopsDOMUtils";
@@ -40,8 +40,8 @@ export const PopsElementHandler = {
40
40
  */
41
41
  getAnimHTML(
42
42
  guid: string,
43
- type: PopsTypeSupportAnim,
44
- config: PopsSupportAnim[keyof PopsSupportAnim],
43
+ type: PopsSupportAnimDetailsType,
44
+ config: PopsSupportAnimDetails[keyof PopsSupportAnimDetails],
45
45
  html = "",
46
46
  bottomBtnHTML = "",
47
47
  zIndex: number
@@ -80,8 +80,8 @@ export const PopsElementHandler = {
80
80
  * @param config
81
81
  */
82
82
  getHeaderBtnHTML(
83
- type: PopsTypeSupportHeaderTitle,
84
- config: PopsSupportHeaderTitle[keyof PopsSupportHeaderTitle]
83
+ type: PopsSupportHeaderTitleDetailsType,
84
+ config: PopsSupportHeaderTitleDetails[keyof PopsSupportHeaderTitleDetails]
85
85
  ): string {
86
86
  if (!config.btn) {
87
87
  return "";
@@ -126,8 +126,8 @@ export const PopsElementHandler = {
126
126
  * @param config
127
127
  */
128
128
  getBottomBtnHTML(
129
- type: PopsTypeSupportBottomBtn,
130
- config: Omit<PopsSupportBottomBtn[keyof PopsSupportBottomBtn], "content">
129
+ type: PopsSupportBottomBtnDetailsType,
130
+ config: Omit<PopsSupportBottomBtnDetails[keyof PopsSupportBottomBtnDetails], "content">
131
131
  ): string {
132
132
  if (!config.btn) {
133
133
  // 未设置btn参数
@@ -282,8 +282,8 @@ export const PopsElementHandler = {
282
282
  * @param config 弹窗配置
283
283
  */
284
284
  getHeaderStyle(
285
- type: PopsTypeSupportHeaderTitle,
286
- config: PopsSupportHeaderTitle[keyof PopsSupportHeaderTitle]
285
+ type: PopsSupportHeaderTitleDetailsType,
286
+ config: PopsSupportHeaderTitleDetails[keyof PopsSupportHeaderTitleDetails]
287
287
  ) {
288
288
  return {
289
289
  headerStyle: config?.title?.html ? config?.title?.style || "" : "",
@@ -297,8 +297,8 @@ export const PopsElementHandler = {
297
297
  * @param config 弹窗配置
298
298
  */
299
299
  getContentStyle(
300
- type: PopsTypeSupportContent,
301
- config: PopsSupportContent[keyof PopsSupportContent]
300
+ type: PopsSupportContentDetailsType,
301
+ config: PopsSupportContentDetails[keyof PopsSupportContentDetails]
302
302
  ) {
303
303
  return {
304
304
  contentStyle: (config?.content as any)?.html