@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.
- package/dist/index.amd.js +364 -357
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +364 -357
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +364 -357
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +364 -357
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +364 -357
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +364 -357
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/Pops.d.ts +17 -17
- package/dist/types/src/PopsInst.d.ts +8 -0
- package/dist/types/src/components/panel/index.d.ts +2 -1
- package/dist/types/src/components/searchSuggestion/index.d.ts +1 -1
- package/dist/types/src/handler/PopsElementHandler.d.ts +6 -6
- package/dist/types/src/handler/PopsHandler.d.ts +6 -6
- package/dist/types/src/types/button.d.ts +2 -2
- package/dist/types/src/types/components.d.ts +5 -5
- package/dist/types/src/types/event.d.ts +3 -3
- package/dist/types/src/types/{layer.d.ts → inst.d.ts} +7 -5
- package/dist/types/src/types/main.d.ts +36 -58
- package/dist/types/src/utils/PopsInstanceUtils.d.ts +10 -10
- package/package.json +1 -1
- package/src/Pops.ts +2 -2
- package/src/PopsInst.ts +21 -0
- package/src/components/alert/index.ts +16 -16
- package/src/components/confirm/index.ts +16 -15
- package/src/components/drawer/index.ts +16 -15
- package/src/components/folder/index.ts +141 -152
- package/src/components/iframe/index.ts +16 -15
- package/src/components/panel/index.ts +19 -18
- package/src/components/prompt/index.ts +15 -14
- package/src/components/rightClickMenu/index.ts +19 -18
- package/src/components/searchSuggestion/index.ts +21 -20
- package/src/components/tooltip/index.ts +3 -2
- package/src/css/scrollbar.css +9 -5
- package/src/handler/PopsElementHandler.ts +18 -18
- package/src/handler/PopsHandler.ts +38 -32
- package/src/types/button.d.ts +2 -2
- package/src/types/components.d.ts +5 -5
- package/src/types/event.d.ts +3 -3
- package/src/types/{layer.d.ts → inst.d.ts} +7 -5
- package/src/types/main.d.ts +36 -58
- package/src/utils/PopsInstanceUtils.ts +84 -81
- package/dist/types/src/PopsLayer.d.ts +0 -5
- package/src/PopsLayer.ts +0 -18
|
@@ -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,11 +13,11 @@ export const PopsConfirm = {
|
|
|
12
13
|
init(details: PopsConfirmDetails) {
|
|
13
14
|
const guid = popsUtils.getRandomGUID();
|
|
14
15
|
// 设置当前类型
|
|
15
|
-
const PopsType = "confirm";
|
|
16
|
+
const popsType: PopsType = "confirm";
|
|
16
17
|
let config = PopsConfirmConfig();
|
|
17
18
|
config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
|
|
18
19
|
config = popsUtils.assign(config, details);
|
|
19
|
-
config = PopsHandler.handleOnly(
|
|
20
|
+
config = PopsHandler.handleOnly(popsType, config);
|
|
20
21
|
|
|
21
22
|
const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
|
|
22
23
|
PopsHandler.handleInit($shadowRoot, [
|
|
@@ -54,32 +55,32 @@ export const PopsConfirm = {
|
|
|
54
55
|
let zIndex = PopsHandler.handleZIndex(config.zIndex);
|
|
55
56
|
let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
|
|
56
57
|
|
|
57
|
-
let headerBtnHTML = PopsElementHandler.getHeaderBtnHTML(
|
|
58
|
-
let bottomBtnHTML = PopsElementHandler.getBottomBtnHTML(
|
|
58
|
+
let headerBtnHTML = PopsElementHandler.getHeaderBtnHTML(popsType, config);
|
|
59
|
+
let bottomBtnHTML = PopsElementHandler.getBottomBtnHTML(popsType, config);
|
|
59
60
|
let { headerStyle, headerPStyle } = PopsElementHandler.getHeaderStyle(
|
|
60
|
-
|
|
61
|
+
popsType,
|
|
61
62
|
config
|
|
62
63
|
);
|
|
63
64
|
let { contentStyle, contentPStyle } = PopsElementHandler.getContentStyle(
|
|
64
|
-
|
|
65
|
+
popsType,
|
|
65
66
|
config
|
|
66
67
|
);
|
|
67
68
|
let animHTML = PopsElementHandler.getAnimHTML(
|
|
68
69
|
guid,
|
|
69
|
-
|
|
70
|
+
popsType,
|
|
70
71
|
config,
|
|
71
72
|
/*html*/ `
|
|
72
|
-
<div class="pops-title pops-${
|
|
73
|
+
<div class="pops-title pops-${popsType}-title" style="text-align: ${
|
|
73
74
|
config.title.position
|
|
74
75
|
};${headerStyle}">${
|
|
75
76
|
config.title.html
|
|
76
77
|
? config.title.text
|
|
77
|
-
: `<p pops class="pops-${
|
|
78
|
+
: `<p pops class="pops-${popsType}-title-text" style="${headerPStyle}">${config.title.text}</p>`
|
|
78
79
|
}${headerBtnHTML}</div>
|
|
79
|
-
<div class="pops-content pops-${
|
|
80
|
+
<div class="pops-content pops-${popsType}-content" style="${contentStyle}">${
|
|
80
81
|
config.content.html
|
|
81
82
|
? config.content.text
|
|
82
|
-
: `<p pops class="pops-${
|
|
83
|
+
: `<p pops class="pops-${popsType}-content-text" style="${contentPStyle}">${config.content.text}</p>`
|
|
83
84
|
}</div>${bottomBtnHTML}`,
|
|
84
85
|
bottomBtnHTML,
|
|
85
86
|
zIndex
|
|
@@ -95,7 +96,7 @@ export const PopsConfirm = {
|
|
|
95
96
|
btnOkElement: $btnOk,
|
|
96
97
|
btnCancelElement: $btnCancel,
|
|
97
98
|
btnOtherElement: $btnOther,
|
|
98
|
-
} = PopsHandler.handleQueryElement($anim,
|
|
99
|
+
} = PopsHandler.handleQueryElement($anim, popsType);
|
|
99
100
|
/**
|
|
100
101
|
* 遮罩层元素
|
|
101
102
|
*/
|
|
@@ -108,7 +109,7 @@ export const PopsConfirm = {
|
|
|
108
109
|
if (config.mask.enable) {
|
|
109
110
|
// 启用遮罩层
|
|
110
111
|
let _handleMask_ = PopsHandler.handleMask({
|
|
111
|
-
type:
|
|
112
|
+
type: popsType,
|
|
112
113
|
guid: guid,
|
|
113
114
|
config: config,
|
|
114
115
|
animElement: $anim,
|
|
@@ -121,7 +122,7 @@ export const PopsConfirm = {
|
|
|
121
122
|
guid,
|
|
122
123
|
$shadowContainer,
|
|
123
124
|
$shadowRoot,
|
|
124
|
-
|
|
125
|
+
popsType,
|
|
125
126
|
|
|
126
127
|
$anim,
|
|
127
128
|
$pops!,
|
|
@@ -164,7 +165,7 @@ export const PopsConfirm = {
|
|
|
164
165
|
if ($mask != null) {
|
|
165
166
|
$anim.after($mask);
|
|
166
167
|
}
|
|
167
|
-
PopsHandler.handlePush(
|
|
168
|
+
PopsHandler.handlePush(popsType, {
|
|
168
169
|
guid: guid,
|
|
169
170
|
|
|
170
171
|
animElement: $anim,
|
|
@@ -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 { popsUtils } from "../../utils/PopsUtils";
|
|
7
8
|
import { PopsDrawerConfig } from "./config";
|
|
@@ -11,11 +12,11 @@ export const PopsDrawer = {
|
|
|
11
12
|
init(details: PopsDrawerDetails) {
|
|
12
13
|
const guid = popsUtils.getRandomGUID();
|
|
13
14
|
// 设置当前类型
|
|
14
|
-
const PopsType = "drawer";
|
|
15
|
+
const popsType: PopsType = "drawer";
|
|
15
16
|
let config = PopsDrawerConfig();
|
|
16
17
|
config = popsUtils.assign(config, GlobalConfig.getGlobalConfig());
|
|
17
18
|
config = popsUtils.assign(config, details);
|
|
18
|
-
config = PopsHandler.handleOnly(
|
|
19
|
+
config = PopsHandler.handleOnly(popsType, config);
|
|
19
20
|
|
|
20
21
|
const { $shadowContainer, $shadowRoot } = PopsHandler.handlerShadow(config);
|
|
21
22
|
PopsHandler.handleInit($shadowRoot, [
|
|
@@ -53,34 +54,34 @@ export const PopsDrawer = {
|
|
|
53
54
|
let zIndex = PopsHandler.handleZIndex(config.zIndex);
|
|
54
55
|
let maskHTML = PopsElementHandler.getMaskHTML(guid, zIndex);
|
|
55
56
|
|
|
56
|
-
let headerBtnHTML = PopsElementHandler.getHeaderBtnHTML(
|
|
57
|
-
let bottomBtnHTML = PopsElementHandler.getBottomBtnHTML(
|
|
57
|
+
let headerBtnHTML = PopsElementHandler.getHeaderBtnHTML(popsType, config);
|
|
58
|
+
let bottomBtnHTML = PopsElementHandler.getBottomBtnHTML(popsType, config);
|
|
58
59
|
let { headerStyle, headerPStyle } = PopsElementHandler.getHeaderStyle(
|
|
59
|
-
|
|
60
|
+
popsType,
|
|
60
61
|
config
|
|
61
62
|
);
|
|
62
63
|
let { contentStyle, contentPStyle } = PopsElementHandler.getContentStyle(
|
|
63
|
-
|
|
64
|
+
popsType,
|
|
64
65
|
config
|
|
65
66
|
);
|
|
66
67
|
let animHTML = PopsElementHandler.getAnimHTML(
|
|
67
68
|
guid,
|
|
68
|
-
|
|
69
|
+
popsType,
|
|
69
70
|
config,
|
|
70
71
|
/*html*/ `
|
|
71
72
|
${
|
|
72
73
|
config.title.enable
|
|
73
|
-
? /*html*/ `<div class="pops-title pops-${
|
|
74
|
+
? /*html*/ `<div class="pops-title pops-${popsType}-title" style="${headerStyle}">${
|
|
74
75
|
config.title.html
|
|
75
76
|
? config.title.text
|
|
76
|
-
: /*html*/ `<p pops class="pops-${
|
|
77
|
+
: /*html*/ `<p pops class="pops-${popsType}-title-text" style="width: 100%;text-align: ${config.title.position};${headerPStyle}">${config.title.text}</p>`
|
|
77
78
|
}${headerBtnHTML}</div>`
|
|
78
79
|
: ""
|
|
79
80
|
}
|
|
80
|
-
<div class="pops-content pops-${
|
|
81
|
+
<div class="pops-content pops-${popsType}-content" style="${contentStyle}">${
|
|
81
82
|
config.content.html
|
|
82
83
|
? config.content.text
|
|
83
|
-
: `<p pops class="pops-${
|
|
84
|
+
: `<p pops class="pops-${popsType}-content-text" style="${contentPStyle}">${config.content.text}</p>`
|
|
84
85
|
}</div>${bottomBtnHTML}`,
|
|
85
86
|
bottomBtnHTML,
|
|
86
87
|
zIndex
|
|
@@ -95,7 +96,7 @@ export const PopsDrawer = {
|
|
|
95
96
|
btnCancelElement,
|
|
96
97
|
btnOkElement,
|
|
97
98
|
btnOtherElement,
|
|
98
|
-
} = PopsHandler.handleQueryElement($anim,
|
|
99
|
+
} = PopsHandler.handleQueryElement($anim, popsType);
|
|
99
100
|
let $pops = popsElement!;
|
|
100
101
|
let $headerCloseBtn = headerCloseBtnElement!;
|
|
101
102
|
let $btnCancel = btnCancelElement!;
|
|
@@ -112,7 +113,7 @@ export const PopsDrawer = {
|
|
|
112
113
|
|
|
113
114
|
if (config.mask.enable) {
|
|
114
115
|
let _handleMask_ = PopsHandler.handleMask({
|
|
115
|
-
type:
|
|
116
|
+
type: popsType,
|
|
116
117
|
guid: guid,
|
|
117
118
|
config: config,
|
|
118
119
|
animElement: $anim,
|
|
@@ -125,7 +126,7 @@ export const PopsDrawer = {
|
|
|
125
126
|
guid,
|
|
126
127
|
$shadowContainer,
|
|
127
128
|
$shadowRoot,
|
|
128
|
-
|
|
129
|
+
popsType,
|
|
129
130
|
$anim,
|
|
130
131
|
$pops,
|
|
131
132
|
$mask!,
|
|
@@ -245,7 +246,7 @@ export const PopsDrawer = {
|
|
|
245
246
|
$anim.after($mask);
|
|
246
247
|
}
|
|
247
248
|
|
|
248
|
-
PopsHandler.handlePush(
|
|
249
|
+
PopsHandler.handlePush(popsType, {
|
|
249
250
|
guid: guid,
|
|
250
251
|
animElement: $anim,
|
|
251
252
|
popsElement: $pops,
|