@whitesev/pops 1.9.0 → 1.9.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 +288 -170
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +288 -170
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +288 -170
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +288 -170
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +288 -170
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +288 -170
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/GlobalConfig.d.ts +1 -0
- package/dist/types/src/Pops.d.ts +2 -0
- package/dist/types/src/components/alert/config.d.ts +1 -1
- package/dist/types/src/components/confirm/config.d.ts +1 -1
- package/dist/types/src/components/drawer/config.d.ts +1 -1
- package/dist/types/src/components/folder/config.d.ts +1 -1
- package/dist/types/src/components/iframe/config.d.ts +1 -1
- package/dist/types/src/components/loading/config.d.ts +1 -1
- package/dist/types/src/components/panel/config.d.ts +1 -1
- package/dist/types/src/components/prompt/config.d.ts +1 -1
- package/dist/types/src/components/rightClickMenu/config.d.ts +1 -1
- package/dist/types/src/components/rightClickMenu/indexType.d.ts +4 -21
- package/dist/types/src/components/searchSuggestion/config.d.ts +1 -1
- package/dist/types/src/components/searchSuggestion/indexType.d.ts +2 -10
- package/dist/types/src/components/tooltip/config.d.ts +1 -1
- package/dist/types/src/components/tooltip/index.d.ts +5 -5
- package/dist/types/src/components/tooltip/indexType.d.ts +28 -28
- package/dist/types/src/handler/PopsElementHandler.d.ts +1 -1
- package/dist/types/src/handler/PopsHandler.d.ts +7 -3
- package/dist/types/src/types/button.d.ts +13 -19
- package/dist/types/src/types/components.d.ts +26 -11
- package/dist/types/src/types/event.d.ts +1 -1
- package/dist/types/src/types/global.d.ts +9 -0
- package/dist/types/src/types/layer.d.ts +1 -1
- package/dist/types/src/types/mask.d.ts +14 -11
- package/dist/types/src/utils/PopsInstanceUtils.d.ts +2 -1
- package/package.json +1 -1
- package/src/Pops.ts +1 -1
- package/src/components/alert/config.ts +10 -9
- package/src/components/alert/index.ts +9 -9
- package/src/components/confirm/config.ts +18 -24
- package/src/components/confirm/index.ts +9 -9
- package/src/components/drawer/config.ts +22 -21
- package/src/components/drawer/index.ts +9 -9
- package/src/components/folder/config.ts +17 -16
- package/src/components/folder/index.ts +32 -24
- package/src/components/iframe/config.ts +3 -3
- package/src/components/iframe/index.ts +15 -11
- package/src/components/loading/config.ts +3 -3
- package/src/components/loading/index.ts +1 -1
- package/src/components/panel/config.ts +65 -2
- package/src/components/panel/index.ts +13 -11
- package/src/components/prompt/config.ts +17 -27
- package/src/components/prompt/index.ts +10 -8
- package/src/components/rightClickMenu/config.ts +117 -109
- package/src/components/rightClickMenu/index.ts +13 -12
- package/src/components/rightClickMenu/indexType.ts +13 -24
- package/src/components/searchSuggestion/config.ts +2 -1
- package/src/components/searchSuggestion/index.ts +11 -10
- package/src/components/searchSuggestion/indexType.ts +4 -10
- package/src/components/tooltip/config.ts +7 -5
- package/src/components/tooltip/index.ts +34 -21
- package/src/components/tooltip/indexType.ts +38 -35
- package/src/css/index.css +1 -1
- package/src/handler/PopsElementHandler.ts +2 -2
- package/src/handler/PopsHandler.ts +24 -20
- package/src/types/button.d.ts +13 -19
- package/src/types/components.d.ts +26 -11
- package/src/types/event.d.ts +1 -1
- package/src/types/global.d.ts +9 -0
- package/src/types/layer.d.ts +1 -1
- package/src/types/mask.d.ts +14 -11
- package/src/utils/PopsInstanceUtils.ts +8 -8
|
@@ -154,36 +154,50 @@ export interface PopsDragConfig {
|
|
|
154
154
|
*/
|
|
155
155
|
export interface PopsCommonConfig {
|
|
156
156
|
/**
|
|
157
|
-
*
|
|
157
|
+
* 是否使用shadowRoot
|
|
158
|
+
*
|
|
159
|
+
* @default true
|
|
160
|
+
*/
|
|
161
|
+
useShadowRoot?: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* 自定义的className
|
|
164
|
+
*
|
|
165
|
+
* @default ""
|
|
158
166
|
*/
|
|
159
167
|
class?: string;
|
|
160
168
|
/**
|
|
161
|
-
*
|
|
169
|
+
* 是否是唯一的
|
|
170
|
+
*
|
|
162
171
|
* @default false
|
|
163
172
|
*/
|
|
164
173
|
only?: boolean;
|
|
165
174
|
/**
|
|
166
|
-
*
|
|
167
|
-
*
|
|
175
|
+
* 宽度
|
|
176
|
+
*
|
|
177
|
+
* @default "350px"
|
|
168
178
|
*/
|
|
169
179
|
width: string;
|
|
170
180
|
/**
|
|
171
|
-
*
|
|
172
|
-
*
|
|
181
|
+
* 高度
|
|
182
|
+
*
|
|
183
|
+
* @default "200px"
|
|
173
184
|
*/
|
|
174
185
|
height: string;
|
|
175
186
|
/**
|
|
176
|
-
*
|
|
187
|
+
* 位置
|
|
188
|
+
*
|
|
177
189
|
* @default "center"
|
|
178
190
|
*/
|
|
179
191
|
position?: PopsPosition;
|
|
180
192
|
/**
|
|
181
|
-
*
|
|
193
|
+
* 动画
|
|
194
|
+
*
|
|
182
195
|
* @default "pops-anim-fadein-zoom"
|
|
183
196
|
*/
|
|
184
197
|
animation?: PopsAnimation;
|
|
185
198
|
/**
|
|
186
|
-
* z-index
|
|
199
|
+
* z-index显示层级
|
|
200
|
+
*
|
|
187
201
|
* @default 10000
|
|
188
202
|
*/
|
|
189
203
|
zIndex?: number | (() => number);
|
|
@@ -192,9 +206,10 @@ export interface PopsCommonConfig {
|
|
|
192
206
|
*/
|
|
193
207
|
mask?: PopsMaskDetails;
|
|
194
208
|
/**
|
|
195
|
-
*
|
|
209
|
+
* 是否禁用页面滚动
|
|
196
210
|
*
|
|
197
211
|
* 暂时不会生效
|
|
212
|
+
*
|
|
198
213
|
* @default false
|
|
199
214
|
*/
|
|
200
215
|
forbiddenScroll?: boolean;
|
|
@@ -208,7 +223,7 @@ export interface PopsCommonConfig {
|
|
|
208
223
|
* @param $shadowContainer 容器
|
|
209
224
|
*/
|
|
210
225
|
beforeAppendToPageCallBack?: (
|
|
211
|
-
$shadowRoot: ShadowRoot,
|
|
226
|
+
$shadowRoot: ShadowRoot | HTMLElement,
|
|
212
227
|
$shadowContainer: HTMLDivElement
|
|
213
228
|
) => void;
|
|
214
229
|
}
|
package/src/types/event.d.ts
CHANGED
package/src/types/global.d.ts
CHANGED
package/src/types/layer.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export interface PopsLayerCommonConfig extends PopsLayerConfig {
|
|
|
16
16
|
/** shadow容器 */
|
|
17
17
|
$shadowContainer: HTMLDivElement;
|
|
18
18
|
/** shadow容器的shandowRoot */
|
|
19
|
-
$shadowRoot: ShadowRoot;
|
|
19
|
+
$shadowRoot: ShadowRoot | HTMLElement;
|
|
20
20
|
/** 移除实例前的回调函数 */
|
|
21
21
|
beforeRemoveCallBack?: (layerCommonConfig: PopsLayerCommonConfig) => void;
|
|
22
22
|
}
|
package/src/types/mask.d.ts
CHANGED
|
@@ -24,15 +24,18 @@ export interface PopsMaskDetails {
|
|
|
24
24
|
* @param originalRun 当toClose为true,它是关闭弹窗,当toHide为true,它是隐藏弹窗
|
|
25
25
|
* @param config 配置信息
|
|
26
26
|
*/
|
|
27
|
-
clickCallBack?:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
clickCallBack?:
|
|
28
|
+
| ((
|
|
29
|
+
originalRun: () => void,
|
|
30
|
+
config:
|
|
31
|
+
| PopsAlertDetails
|
|
32
|
+
| PopsDrawerDetails
|
|
33
|
+
| PopsIframeDetails
|
|
34
|
+
| PopsPromptDetails
|
|
35
|
+
| PopsFolderDetails
|
|
36
|
+
| PopsLoadingDetails
|
|
37
|
+
| PopsPanelDetails
|
|
38
|
+
) => void)
|
|
39
|
+
| undefined
|
|
40
|
+
| null;
|
|
38
41
|
}
|
|
@@ -105,10 +105,9 @@ export const PopsInstanceUtils = {
|
|
|
105
105
|
getPopsMaxZIndex(deviation: number = 1) {
|
|
106
106
|
deviation = Number.isNaN(deviation) ? 1 : deviation;
|
|
107
107
|
// 最大值 2147483647
|
|
108
|
-
//
|
|
109
|
-
// const maxZIndex = Math.pow(2, 31) - 1;
|
|
108
|
+
// const browserMaxZIndex = Math.pow(2, 31) - 1;
|
|
110
109
|
// 比较值 2000000000
|
|
111
|
-
const
|
|
110
|
+
const maxZIndex = 2 * Math.pow(10, 9);
|
|
112
111
|
// 当前页面最大的z-index
|
|
113
112
|
let zIndex = 0;
|
|
114
113
|
// 当前的最大z-index的元素,调试使用
|
|
@@ -139,17 +138,18 @@ export const PopsInstanceUtils = {
|
|
|
139
138
|
}
|
|
140
139
|
});
|
|
141
140
|
zIndex += deviation;
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
141
|
+
let isOverMaxZIndex = zIndex >= maxZIndex;
|
|
142
|
+
if (isOverMaxZIndex) {
|
|
143
|
+
// 超出z-index最大值
|
|
144
|
+
zIndex = maxZIndex;
|
|
145
145
|
}
|
|
146
|
-
return { zIndex: zIndex, animElement: maxZIndexNode };
|
|
146
|
+
return { zIndex: zIndex, animElement: maxZIndexNode, isOverMaxZIndex };
|
|
147
147
|
},
|
|
148
148
|
/**
|
|
149
149
|
* 获取页面中最大的z-index
|
|
150
150
|
* @param deviation 获取最大的z-index值的偏移,默认是+1
|
|
151
151
|
* @example
|
|
152
|
-
*
|
|
152
|
+
* getMaxZIndex();
|
|
153
153
|
* > 1001
|
|
154
154
|
**/
|
|
155
155
|
getMaxZIndex(deviation = 1): number {
|