@whitesev/pops 2.5.2 → 2.5.4
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 +76 -112
- 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 +76 -112
- 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 +76 -112
- 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 +76 -112
- 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 +76 -112
- 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 +76 -112
- 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 +37 -79
- package/src/components/panel/handlerComponents.ts +7 -22
- package/src/components/panel/index.ts +12 -2
- 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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PopsCommonConfig } from "../../../types/components";
|
|
2
|
+
import type { PopsPanelCommonDetails } from "../../panel/types/components-common";
|
|
2
3
|
|
|
3
4
|
export type PopsSearchSuggestionData<T = any> = {
|
|
4
5
|
/**
|
|
@@ -126,10 +127,10 @@ export interface PopsSearchSuggestionDetails<T = any>
|
|
|
126
127
|
*/
|
|
127
128
|
data: PopsSearchSuggestionData<T>[] | (() => PopsSearchSuggestionData<T>[]);
|
|
128
129
|
/**
|
|
129
|
-
*
|
|
130
|
+
* (可选)元素的className,值为空的话就不设置
|
|
130
131
|
* @default ""
|
|
131
132
|
*/
|
|
132
|
-
className?:
|
|
133
|
+
className?: PopsPanelCommonDetails<any>["className"];
|
|
133
134
|
/**
|
|
134
135
|
* 建议框的position位置
|
|
135
136
|
*
|
|
@@ -82,9 +82,7 @@ export class ToolTip {
|
|
|
82
82
|
const $toolTipArrow = $toolTipContainer.querySelector<HTMLElement>(".pops-tip-arrow")!;
|
|
83
83
|
|
|
84
84
|
// 处理className
|
|
85
|
-
|
|
86
|
-
popsDOMUtils.addClassName($toolTipContainer, this.$data.config.className);
|
|
87
|
-
}
|
|
85
|
+
popsDOMUtils.addClassName($toolTipContainer, this.$data.config.className);
|
|
88
86
|
// 添加z-index
|
|
89
87
|
$toolTipContainer.style.zIndex = PopsHandler.handleZIndex(this.$data.config.zIndex).toString();
|
|
90
88
|
if (this.$data.config.style != null) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PopsCommonConfig } from "../../../types/components";
|
|
2
|
+
import type { PopsPanelCommonDetails } from "../../panel/types/components-common";
|
|
2
3
|
|
|
3
4
|
/** tooltip的出现位置 */
|
|
4
5
|
export type PopsTooltipPosition = "top" | "right" | "bottom" | "left" | "follow";
|
|
@@ -35,7 +36,7 @@ export interface PopsToolTipDetails
|
|
|
35
36
|
* + `github-tooltip` github的样式
|
|
36
37
|
* @default ""
|
|
37
38
|
*/
|
|
38
|
-
className?:
|
|
39
|
+
className?: PopsPanelCommonDetails<any>["className"];
|
|
39
40
|
/**
|
|
40
41
|
* 是否使用fixed定位,false则是absolute定位
|
|
41
42
|
*
|
|
@@ -1575,18 +1575,31 @@ class PopsDOMUtils extends PopsDOMUtilsEvent {
|
|
|
1575
1575
|
* @param $el 目标元素
|
|
1576
1576
|
* @param className className属性
|
|
1577
1577
|
*/
|
|
1578
|
-
addClassName(
|
|
1579
|
-
|
|
1580
|
-
|
|
1578
|
+
addClassName(
|
|
1579
|
+
$el: Element | undefined | null | undefined,
|
|
1580
|
+
className: string | string[] | (() => string | string[]) | undefined | null
|
|
1581
|
+
) {
|
|
1582
|
+
if ($el == null) return;
|
|
1583
|
+
if (className == null) return;
|
|
1584
|
+
|
|
1585
|
+
if (typeof className === "function") {
|
|
1586
|
+
className = className();
|
|
1581
1587
|
}
|
|
1582
|
-
if (
|
|
1583
|
-
|
|
1588
|
+
if (!Array.isArray(className)) {
|
|
1589
|
+
className = [className];
|
|
1584
1590
|
}
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1591
|
+
className.forEach((classNameStrItem) => {
|
|
1592
|
+
if (typeof classNameStrItem !== "string") {
|
|
1593
|
+
// 不是字符串
|
|
1594
|
+
return;
|
|
1595
|
+
}
|
|
1596
|
+
if (classNameStrItem.trim() === "") {
|
|
1597
|
+
// 空字符串
|
|
1598
|
+
return;
|
|
1599
|
+
}
|
|
1600
|
+
const classNameList = classNameStrItem.split(" ").filter((item) => item.trim() !== "");
|
|
1601
|
+
$el?.classList?.add?.(...classNameList);
|
|
1602
|
+
});
|
|
1590
1603
|
}
|
|
1591
1604
|
/**
|
|
1592
1605
|
* 删除className
|