@ganwei-web/gw-base-components-plus 1.0.36 → 1.0.37
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/element-plus-adapter/dist/ElementPlusAdapter.cjs +35 -11
- package/element-plus-adapter/dist/ElementPlusAdapter.cjs.map +1 -1
- package/element-plus-adapter/dist/ElementPlusAdapter.iife.js +35 -11
- package/element-plus-adapter/dist/ElementPlusAdapter.iife.js.map +1 -1
- package/element-plus-adapter/dist/ElementPlusAdapter.js +35 -11
- package/element-plus-adapter/dist/ElementPlusAdapter.js.map +1 -1
- package/package.json +1 -1
|
@@ -913,37 +913,61 @@ var ElementPlusAdapter = function(exports, elementPlus, vue) {
|
|
|
913
913
|
const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
914
914
|
__name: "index",
|
|
915
915
|
setup(__props, { expose: __expose }) {
|
|
916
|
-
|
|
916
|
+
vue.useAttrs();
|
|
917
917
|
const proxyElement = vue.ref();
|
|
918
918
|
const expose = useExpose(proxyElement);
|
|
919
919
|
__expose(expose);
|
|
920
|
-
|
|
920
|
+
const isInIframe = window.self !== window.top;
|
|
921
|
+
let hasCounted = false;
|
|
922
|
+
const dialogModal = vue.ref(true);
|
|
923
|
+
function onOpen() {
|
|
924
|
+
if (isInIframe) {
|
|
925
|
+
const currentCount = window.__elDialogOverlayCount__ || 0;
|
|
926
|
+
dialogModal.value = currentCount === 0;
|
|
927
|
+
} else {
|
|
928
|
+
dialogModal.value = true;
|
|
929
|
+
}
|
|
930
|
+
triggerOverlay(true);
|
|
931
|
+
}
|
|
932
|
+
function onClose() {
|
|
933
|
+
triggerOverlay(false);
|
|
934
|
+
}
|
|
921
935
|
function triggerOverlay(visible) {
|
|
936
|
+
if (!isInIframe)
|
|
937
|
+
return;
|
|
922
938
|
try {
|
|
939
|
+
let count = window.__elDialogOverlayCount__ || 0;
|
|
923
940
|
if (visible) {
|
|
924
|
-
|
|
925
|
-
|
|
941
|
+
if (hasCounted)
|
|
942
|
+
return;
|
|
943
|
+
count++;
|
|
944
|
+
hasCounted = true;
|
|
926
945
|
} else {
|
|
927
|
-
|
|
928
|
-
|
|
946
|
+
if (!hasCounted)
|
|
947
|
+
return;
|
|
948
|
+
count = Math.max(0, count - 1);
|
|
949
|
+
hasCounted = false;
|
|
929
950
|
}
|
|
930
|
-
|
|
951
|
+
;
|
|
952
|
+
window.__elDialogOverlayCount__ = count;
|
|
953
|
+
const shouldShow = count > 0;
|
|
931
954
|
window.parent.postMessage({ overlayMask: shouldShow }, "*");
|
|
932
955
|
} catch (e) {
|
|
933
956
|
console.log(e);
|
|
934
957
|
}
|
|
935
958
|
}
|
|
936
959
|
vue.onUnmounted(() => {
|
|
937
|
-
if (
|
|
960
|
+
if (hasCounted) {
|
|
938
961
|
triggerOverlay(false);
|
|
939
962
|
}
|
|
940
963
|
});
|
|
941
964
|
return (_ctx, _cache) => {
|
|
942
965
|
return vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElDialog), vue.mergeProps(_ctx.$attrs, {
|
|
966
|
+
modal: dialogModal.value,
|
|
943
967
|
ref_key: "proxyElement",
|
|
944
968
|
ref: proxyElement,
|
|
945
|
-
onOpen
|
|
946
|
-
onClose
|
|
969
|
+
onOpen,
|
|
970
|
+
onClose
|
|
947
971
|
}), vue.createSlots({ _: 2 }, [
|
|
948
972
|
vue.renderList(_ctx.$slots, (value, key) => {
|
|
949
973
|
return {
|
|
@@ -953,7 +977,7 @@ var ElementPlusAdapter = function(exports, elementPlus, vue) {
|
|
|
953
977
|
])
|
|
954
978
|
};
|
|
955
979
|
})
|
|
956
|
-
]), 1040);
|
|
980
|
+
]), 1040, ["modal"]);
|
|
957
981
|
};
|
|
958
982
|
}
|
|
959
983
|
});
|