@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.esm.js CHANGED
@@ -10254,7 +10254,7 @@ const PopsRightClickMenu = {
10254
10254
  if (typeof item.icon === "string" && item.icon.trim() !== "") {
10255
10255
  let iconSVGHTML = PopsIcon.getIcon(item.icon) ?? item.icon;
10256
10256
  let iconElement = popsDOMUtils.parseTextToDOM(
10257
- /*html*/ `<i class="pops-${PopsType}-icon" is-loading="${item.iconIsLoading}">${iconSVGHTML}</i>`);
10257
+ /*html*/ `<i class="pops-${PopsType}-icon" is-loading="${item.iconIsLoading ?? false}">${iconSVGHTML}</i>`);
10258
10258
  menuLiElement.appendChild(iconElement);
10259
10259
  }
10260
10260
  /* 插入文字 */
@@ -10311,11 +10311,14 @@ const PopsRightClickMenu = {
10311
10311
  */
10312
10312
  async function liElementClickEvent(clickEvent) {
10313
10313
  if (typeof item.callback === "function") {
10314
- OriginPrototype.Object.defineProperty(menuEvent, "target", {
10315
- get() {
10316
- return menuEventTarget;
10317
- },
10318
- });
10314
+ try {
10315
+ OriginPrototype.Object.defineProperty(menuEvent, "target", {
10316
+ get() {
10317
+ return menuEventTarget;
10318
+ },
10319
+ });
10320
+ }
10321
+ catch (error) { }
10319
10322
  let callbackResult = await item.callback(clickEvent, menuEvent, menuLiElement, menuListenerRootNode);
10320
10323
  if (typeof callbackResult === "boolean" &&
10321
10324
  callbackResult == false) {