@whitesev/pops 1.1.0 → 1.2.1

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.
@@ -1492,6 +1492,12 @@ var pops = (function () {
1492
1492
  }
1493
1493
  assign(target = {}, source = {}, isAdd = false) {
1494
1494
  let UtilsContext = this;
1495
+ if (source == null) {
1496
+ return target;
1497
+ }
1498
+ if (target == null) {
1499
+ target = {};
1500
+ }
1495
1501
  if (Array.isArray(source)) {
1496
1502
  let canTraverse = source.filter((item) => {
1497
1503
  return typeof item === "object";
@@ -1505,8 +1511,9 @@ var pops = (function () {
1505
1511
  const targetKeyName = sourceKeyName;
1506
1512
  let targetValue = target[targetKeyName];
1507
1513
  let sourceValue = source[sourceKeyName];
1508
- if (sourceKeyName in target &&
1509
- typeof sourceValue === "object" &&
1514
+ if (typeof sourceValue === "object" &&
1515
+ sourceValue != null &&
1516
+ sourceKeyName in target &&
1510
1517
  !UtilsContext.isDOM(sourceValue)) {
1511
1518
  /* 源端的值是object类型,且不是元素节点 */
1512
1519
  target[sourceKeyName] = UtilsContext.assign(targetValue, sourceValue, isAdd);
@@ -1521,6 +1528,7 @@ var pops = (function () {
1521
1528
  let targetValue = target[targetKeyName];
1522
1529
  let sourceValue = source[targetKeyName];
1523
1530
  if (typeof sourceValue === "object" &&
1531
+ sourceValue != null &&
1524
1532
  !UtilsContext.isDOM(sourceValue) &&
1525
1533
  Object.keys(sourceValue).length) {
1526
1534
  /* 源端的值是object类型,且不是元素节点 */
@@ -8957,11 +8965,13 @@ var pops = (function () {
8957
8965
  popsDOMUtils.on(globalThis, "click touchstart", void 0, PopsContextMenu.windowCheckClickEvent, {
8958
8966
  capture: true,
8959
8967
  });
8960
- const $shadowRoot = config.target.getRootNode();
8961
- if ($shadowRoot instanceof ShadowRoot) {
8962
- popsDOMUtils.on($shadowRoot, "click touchstart", void 0, PopsContextMenu.shadowRootCheckClickEvent, {
8963
- capture: true,
8964
- });
8968
+ if (config.target instanceof Node) {
8969
+ const $shadowRoot = config.target.getRootNode();
8970
+ if ($shadowRoot instanceof ShadowRoot) {
8971
+ popsDOMUtils.on($shadowRoot, "click touchstart", void 0, PopsContextMenu.shadowRootCheckClickEvent, {
8972
+ capture: true,
8973
+ });
8974
+ }
8965
8975
  }
8966
8976
  },
8967
8977
  /**
@@ -8971,11 +8981,13 @@ var pops = (function () {
8971
8981
  popsDOMUtils.off(globalThis, "click touchstart", void 0, PopsContextMenu.windowCheckClickEvent, {
8972
8982
  capture: true,
8973
8983
  });
8974
- const $shadowRoot = config.target.getRootNode();
8975
- if ($shadowRoot instanceof ShadowRoot) {
8976
- popsDOMUtils.off($shadowRoot, "click touchstart", void 0, PopsContextMenu.windowCheckClickEvent, {
8977
- capture: true,
8978
- });
8984
+ if (config.target instanceof Node) {
8985
+ const $shadowRoot = config.target.getRootNode();
8986
+ if ($shadowRoot instanceof ShadowRoot) {
8987
+ popsDOMUtils.off($shadowRoot, "click touchstart", void 0, PopsContextMenu.windowCheckClickEvent, {
8988
+ capture: true,
8989
+ });
8990
+ }
8979
8991
  }
8980
8992
  },
8981
8993
  /**
@@ -9918,7 +9930,7 @@ var pops = (function () {
9918
9930
  /** 配置 */
9919
9931
  config = {
9920
9932
  /** 版本号 */
9921
- version: "2024.7.8",
9933
+ version: "2024.7.14",
9922
9934
  cssText: {
9923
9935
  /** 主CSS */
9924
9936
  index: indexCSS,