@ganwei-web/gw-base-components-plus 1.0.35 → 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 +65 -3
- package/element-plus-adapter/dist/ElementPlusAdapter.cjs.map +1 -1
- package/element-plus-adapter/dist/ElementPlusAdapter.iife.js +65 -3
- package/element-plus-adapter/dist/ElementPlusAdapter.iife.js.map +1 -1
- package/element-plus-adapter/dist/ElementPlusAdapter.js +67 -5
- package/element-plus-adapter/dist/ElementPlusAdapter.js.map +1 -1
- package/package.json +1 -1
|
@@ -915,13 +915,61 @@ const index_vue_vue_type_style_index_0_lang$9 = "";
|
|
|
915
915
|
const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
916
916
|
__name: "index",
|
|
917
917
|
setup(__props, { expose: __expose }) {
|
|
918
|
+
vue.useAttrs();
|
|
918
919
|
const proxyElement = vue.ref();
|
|
919
920
|
const expose = useExpose(proxyElement);
|
|
920
921
|
__expose(expose);
|
|
922
|
+
const isInIframe = window.self !== window.top;
|
|
923
|
+
let hasCounted = false;
|
|
924
|
+
const dialogModal = vue.ref(true);
|
|
925
|
+
function onOpen() {
|
|
926
|
+
if (isInIframe) {
|
|
927
|
+
const currentCount = window.__elDialogOverlayCount__ || 0;
|
|
928
|
+
dialogModal.value = currentCount === 0;
|
|
929
|
+
} else {
|
|
930
|
+
dialogModal.value = true;
|
|
931
|
+
}
|
|
932
|
+
triggerOverlay(true);
|
|
933
|
+
}
|
|
934
|
+
function onClose() {
|
|
935
|
+
triggerOverlay(false);
|
|
936
|
+
}
|
|
937
|
+
function triggerOverlay(visible) {
|
|
938
|
+
if (!isInIframe)
|
|
939
|
+
return;
|
|
940
|
+
try {
|
|
941
|
+
let count = window.__elDialogOverlayCount__ || 0;
|
|
942
|
+
if (visible) {
|
|
943
|
+
if (hasCounted)
|
|
944
|
+
return;
|
|
945
|
+
count++;
|
|
946
|
+
hasCounted = true;
|
|
947
|
+
} else {
|
|
948
|
+
if (!hasCounted)
|
|
949
|
+
return;
|
|
950
|
+
count = Math.max(0, count - 1);
|
|
951
|
+
hasCounted = false;
|
|
952
|
+
}
|
|
953
|
+
;
|
|
954
|
+
window.__elDialogOverlayCount__ = count;
|
|
955
|
+
const shouldShow = count > 0;
|
|
956
|
+
window.parent.postMessage({ overlayMask: shouldShow }, "*");
|
|
957
|
+
} catch (e) {
|
|
958
|
+
console.log(e);
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
vue.onUnmounted(() => {
|
|
962
|
+
if (hasCounted) {
|
|
963
|
+
triggerOverlay(false);
|
|
964
|
+
}
|
|
965
|
+
});
|
|
921
966
|
return (_ctx, _cache) => {
|
|
922
967
|
return vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElDialog), vue.mergeProps(_ctx.$attrs, {
|
|
968
|
+
modal: dialogModal.value,
|
|
923
969
|
ref_key: "proxyElement",
|
|
924
|
-
ref: proxyElement
|
|
970
|
+
ref: proxyElement,
|
|
971
|
+
onOpen,
|
|
972
|
+
onClose
|
|
925
973
|
}), vue.createSlots({ _: 2 }, [
|
|
926
974
|
vue.renderList(_ctx.$slots, (value, key) => {
|
|
927
975
|
return {
|
|
@@ -931,7 +979,7 @@ const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
|
|
|
931
979
|
])
|
|
932
980
|
};
|
|
933
981
|
})
|
|
934
|
-
]), 1040);
|
|
982
|
+
]), 1040, ["modal"]);
|
|
935
983
|
};
|
|
936
984
|
}
|
|
937
985
|
});
|
|
@@ -1358,6 +1406,16 @@ const Adapter = {
|
|
|
1358
1406
|
// 基础组件
|
|
1359
1407
|
ElButton: _sfc_main$G,
|
|
1360
1408
|
ElTag: _sfc_main$F,
|
|
1409
|
+
ElIcon: elementPlus.ElIcon,
|
|
1410
|
+
ElAvatar: elementPlus.ElAvatar,
|
|
1411
|
+
ElRow: elementPlus.ElRow,
|
|
1412
|
+
// 布局组件
|
|
1413
|
+
ElContainer: elementPlus.ElContainer,
|
|
1414
|
+
ElHeader: elementPlus.ElHeader,
|
|
1415
|
+
ElAside: elementPlus.ElAside,
|
|
1416
|
+
ElMain: elementPlus.ElMain,
|
|
1417
|
+
ElConfigProvider: elementPlus.ElConfigProvider,
|
|
1418
|
+
ElScrollbar: elementPlus.ElScrollbar,
|
|
1361
1419
|
// 表单组件
|
|
1362
1420
|
ElInput: _sfc_main$E,
|
|
1363
1421
|
ElForm: _sfc_main$D,
|
|
@@ -1399,12 +1457,16 @@ const Adapter = {
|
|
|
1399
1457
|
ElDropdown: _sfc_main$9,
|
|
1400
1458
|
ElDropdownMenu: _sfc_main$4,
|
|
1401
1459
|
ElDropdownItem: _sfc_main$3,
|
|
1460
|
+
ElBreadcrumb: elementPlus.ElBreadcrumb,
|
|
1461
|
+
ElBreadcrumbItem: elementPlus.ElBreadcrumbItem,
|
|
1402
1462
|
ElTabs: _sfc_main$8,
|
|
1403
1463
|
ElTabPane: _sfc_main$7,
|
|
1404
1464
|
// 其他
|
|
1405
1465
|
ElCollapse: _sfc_main$2,
|
|
1406
1466
|
ElCollapseItem: _sfc_main$1,
|
|
1407
|
-
ElPoper: _sfc_main
|
|
1467
|
+
ElPoper: _sfc_main,
|
|
1468
|
+
ElTour: elementPlus.ElTour,
|
|
1469
|
+
ElTourStep: elementPlus.ElTourStep
|
|
1408
1470
|
};
|
|
1409
1471
|
function adapterInstall(app) {
|
|
1410
1472
|
for (const [key, component] of Object.entries(Adapter)) {
|