@whitesev/pops 2.0.12 → 2.0.14
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 +9 -6
- package/dist/index.amd.js.map +1 -1
- package/dist/index.cjs.js +9 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +9 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +9 -6
- package/dist/index.iife.js.map +1 -1
- package/dist/index.system.js +9 -6
- package/dist/index.system.js.map +1 -1
- package/dist/index.umd.js +9 -6
- package/dist/index.umd.js.map +1 -1
- package/dist/types/src/components/rightClickMenu/indexType.d.ts +5 -3
- package/package.json +2 -1
- package/src/components/rightClickMenu/index.ts +10 -6
- package/src/components/rightClickMenu/indexType.ts +5 -3
|
@@ -5,13 +5,15 @@ import type { PopsIconType } from "../../types/icon";
|
|
|
5
5
|
*/
|
|
6
6
|
export interface PopsRightClickMenuDataDetails {
|
|
7
7
|
/**
|
|
8
|
-
* svg
|
|
8
|
+
* svg图标,留空则是没图标
|
|
9
|
+
* @default ""
|
|
9
10
|
*/
|
|
10
|
-
icon
|
|
11
|
+
icon?: PopsIconType | string;
|
|
11
12
|
/**
|
|
12
13
|
* 图标是否旋转
|
|
14
|
+
* @default false
|
|
13
15
|
*/
|
|
14
|
-
iconIsLoading
|
|
16
|
+
iconIsLoading?: boolean;
|
|
15
17
|
/**
|
|
16
18
|
* 文字
|
|
17
19
|
*/
|
package/package.json
CHANGED
|
@@ -457,7 +457,9 @@ export const PopsRightClickMenu = {
|
|
|
457
457
|
if (typeof item.icon === "string" && item.icon.trim() !== "") {
|
|
458
458
|
let iconSVGHTML = PopsIcon.getIcon(item.icon) ?? item.icon;
|
|
459
459
|
let iconElement = popsDOMUtils.parseTextToDOM(
|
|
460
|
-
/*html*/ `<i class="pops-${PopsType}-icon" is-loading="${
|
|
460
|
+
/*html*/ `<i class="pops-${PopsType}-icon" is-loading="${
|
|
461
|
+
item.iconIsLoading ?? false
|
|
462
|
+
}">${iconSVGHTML}</i>`
|
|
461
463
|
);
|
|
462
464
|
menuLiElement.appendChild(iconElement);
|
|
463
465
|
}
|
|
@@ -539,11 +541,13 @@ export const PopsRightClickMenu = {
|
|
|
539
541
|
clickEvent: MouseEvent | PointerEvent
|
|
540
542
|
) {
|
|
541
543
|
if (typeof item.callback === "function") {
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
544
|
+
try {
|
|
545
|
+
OriginPrototype.Object.defineProperty(menuEvent, "target", {
|
|
546
|
+
get() {
|
|
547
|
+
return menuEventTarget;
|
|
548
|
+
},
|
|
549
|
+
});
|
|
550
|
+
} catch (error) {}
|
|
547
551
|
let callbackResult = await item.callback(
|
|
548
552
|
clickEvent as PointerEvent,
|
|
549
553
|
menuEvent,
|
|
@@ -6,13 +6,15 @@ import type { PopsIconType } from "../../types/icon";
|
|
|
6
6
|
*/
|
|
7
7
|
export interface PopsRightClickMenuDataDetails {
|
|
8
8
|
/**
|
|
9
|
-
* svg
|
|
9
|
+
* svg图标,留空则是没图标
|
|
10
|
+
* @default ""
|
|
10
11
|
*/
|
|
11
|
-
icon
|
|
12
|
+
icon?: PopsIconType | string;
|
|
12
13
|
/**
|
|
13
14
|
* 图标是否旋转
|
|
15
|
+
* @default false
|
|
14
16
|
*/
|
|
15
|
-
iconIsLoading
|
|
17
|
+
iconIsLoading?: boolean;
|
|
16
18
|
/**
|
|
17
19
|
* 文字
|
|
18
20
|
*/
|