@ganwei-web/gw-base-components-plus 1.0.60 → 1.0.62

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.
@@ -1053,7 +1053,7 @@ const overlayMask = {
1053
1053
  }
1054
1054
  }
1055
1055
  };
1056
- const GwOverlayMaskKey = "__gwOverlayMaskActive__";
1056
+ const GwOverlayMaskKey = "__gwOverlayMaskRegistry__";
1057
1057
  const _sfc_main$f = /* @__PURE__ */ defineComponent({
1058
1058
  __name: "index",
1059
1059
  props: {
@@ -1067,13 +1067,25 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
1067
1067
  setup(__props, { emit: __emit }) {
1068
1068
  const props = __props;
1069
1069
  const emit = __emit;
1070
- const isInstance = !window[GwOverlayMaskKey];
1071
- if (isInstance) {
1072
- window[GwOverlayMaskKey] = true;
1070
+ const existingRegistry = window[GwOverlayMaskKey];
1071
+ const registry = (existingRegistry == null ? void 0 : existingRegistry.owner) && Array.isArray(existingRegistry.instances) ? existingRegistry : {
1072
+ owner: ref(null),
1073
+ instances: []
1074
+ };
1075
+ window[GwOverlayMaskKey] = registry;
1076
+ const instanceId = Symbol("GwOverlayMask");
1077
+ registry.instances.push(instanceId);
1078
+ if (!registry.owner.value) {
1079
+ registry.owner.value = instanceId;
1073
1080
  }
1081
+ const isInstance = computed(() => registry.owner.value === instanceId);
1074
1082
  onUnmounted(() => {
1075
- if (isInstance) {
1076
- window[GwOverlayMaskKey] = false;
1083
+ const index2 = registry.instances.indexOf(instanceId);
1084
+ if (index2 !== -1) {
1085
+ registry.instances.splice(index2, 1);
1086
+ }
1087
+ if (registry.owner.value === instanceId) {
1088
+ registry.owner.value = registry.instances[0] || null;
1077
1089
  }
1078
1090
  });
1079
1091
  const overlayStyle = computed(() => ({
@@ -1094,7 +1106,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
1094
1106
  };
1095
1107
  return (_ctx, _cache) => {
1096
1108
  return openBlock(), createBlock(Teleport, { to: "body" }, [
1097
- isInstance ? (openBlock(), createElementBlock("div", {
1109
+ isInstance.value ? (openBlock(), createElementBlock("div", {
1098
1110
  key: 0,
1099
1111
  class: normalizeClass(["gw-overlay-mask", { "gw-overlay-mask--visible": __props.visible }]),
1100
1112
  style: normalizeStyle(overlayStyle.value),
@@ -1105,7 +1117,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
1105
1117
  };
1106
1118
  }
1107
1119
  });
1108
- const index_vue_vue_type_style_index_0_scoped_cf048b89_lang = "";
1120
+ const index_vue_vue_type_style_index_0_scoped_b335d597_lang = "";
1109
1121
  const _export_sfc = (sfc, props) => {
1110
1122
  const target = sfc.__vccOpts || sfc;
1111
1123
  for (const [key, val] of props) {
@@ -1113,7 +1125,7 @@ const _export_sfc = (sfc, props) => {
1113
1125
  }
1114
1126
  return target;
1115
1127
  };
1116
- const GwOverlayMask = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-cf048b89"]]);
1128
+ const GwOverlayMask = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-b335d597"]]);
1117
1129
  const _sfc_main$e = /* @__PURE__ */ defineComponent({
1118
1130
  __name: "index",
1119
1131
  setup(__props, { expose: __expose }) {
@@ -1125,6 +1137,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
1125
1137
  const { nextZIndex } = useZIndex();
1126
1138
  const dialogModal = computed(() => !isInIframe);
1127
1139
  function handleOpen() {
1140
+ console.log("[ElDialog adapter] handleOpen", isInIframe);
1128
1141
  if (isInIframe) {
1129
1142
  const currentCount = window.__elDialogOverlayCount__ || 0;
1130
1143
  if (currentCount === 0) {