@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.
@@ -1,5 +1,5 @@
1
- import { defineComponent, ref, useAttrs, computed, openBlock, createBlock, unref, mergeProps, createSlots, renderList, withCtx, renderSlot, mergeModels, useModel, createElementVNode, normalizeProps, guardReactiveProps, inject, createElementBlock, watch, resolveComponent, createVNode, isVNode } from "vue";
2
- import { ElButton, ElTag, ElInput, ElForm, ElFormItem, ElSelect, ElOption, ElCheckbox, ElCheckboxGroup, ElRadio, ElRadioGroup, ElRadioButton, ElSwitch, ElCascader, ElDatePicker, ElTimePicker, ElUpload, ElTransfer, ElTable, ElTableColumn, ElTree, localeContextKey, ElPagination, ElImage, ElProgress, ElBadge, ElCard, ElDescriptions, ElAlert, ElDialog, ElDrawer, ElPopover, ElTooltip, ElNotification as ElNotification$1, vLoading as vLoading$1, ElMenu, ElDropdown, ElTabs, ElTabPane, ElMenuItem, ElSubMenu, ElDropdownMenu, ElDropdownItem, ElCollapse, ElCollapseItem, ElDescriptionsItem, ElMessageBox, ElMessage } from "element-plus";
1
+ import { defineComponent, ref, useAttrs, computed, openBlock, createBlock, unref, mergeProps, createSlots, renderList, withCtx, renderSlot, mergeModels, useModel, createElementVNode, normalizeProps, guardReactiveProps, inject, createElementBlock, watch, resolveComponent, createVNode, onUnmounted, isVNode } from "vue";
2
+ import { ElButton, ElTag, ElInput, ElForm, ElFormItem, ElSelect, ElOption, ElCheckbox, ElCheckboxGroup, ElRadio, ElRadioGroup, ElRadioButton, ElSwitch, ElCascader, ElDatePicker, ElTimePicker, ElUpload, ElTransfer, ElTable, ElTableColumn, ElTree, localeContextKey, ElPagination, ElImage, ElProgress, ElBadge, ElCard, ElDescriptions, ElAlert, ElDialog, ElDrawer, ElPopover, ElTooltip, ElNotification as ElNotification$1, vLoading as vLoading$1, ElMenu, ElDropdown, ElTabs, ElTabPane, ElMenuItem, ElSubMenu, ElDropdownMenu, ElDropdownItem, ElCollapse, ElCollapseItem, ElIcon, ElAvatar, ElRow, ElContainer, ElHeader, ElAside, ElMain, ElConfigProvider, ElScrollbar, ElDescriptionsItem, ElBreadcrumb, ElBreadcrumbItem, ElTour, ElTourStep, ElMessageBox, ElMessage } from "element-plus";
3
3
  import { ElMessage as ElMessage2 } from "element-plus";
4
4
  function useExpose(proxyElement) {
5
5
  const expose = new Proxy({}, {
@@ -914,13 +914,61 @@ const index_vue_vue_type_style_index_0_lang$9 = "";
914
914
  const _sfc_main$e = /* @__PURE__ */ defineComponent({
915
915
  __name: "index",
916
916
  setup(__props, { expose: __expose }) {
917
+ useAttrs();
917
918
  const proxyElement = ref();
918
919
  const expose = useExpose(proxyElement);
919
920
  __expose(expose);
921
+ const isInIframe = window.self !== window.top;
922
+ let hasCounted = false;
923
+ const dialogModal = ref(true);
924
+ function onOpen() {
925
+ if (isInIframe) {
926
+ const currentCount = window.__elDialogOverlayCount__ || 0;
927
+ dialogModal.value = currentCount === 0;
928
+ } else {
929
+ dialogModal.value = true;
930
+ }
931
+ triggerOverlay(true);
932
+ }
933
+ function onClose() {
934
+ triggerOverlay(false);
935
+ }
936
+ function triggerOverlay(visible) {
937
+ if (!isInIframe)
938
+ return;
939
+ try {
940
+ let count = window.__elDialogOverlayCount__ || 0;
941
+ if (visible) {
942
+ if (hasCounted)
943
+ return;
944
+ count++;
945
+ hasCounted = true;
946
+ } else {
947
+ if (!hasCounted)
948
+ return;
949
+ count = Math.max(0, count - 1);
950
+ hasCounted = false;
951
+ }
952
+ ;
953
+ window.__elDialogOverlayCount__ = count;
954
+ const shouldShow = count > 0;
955
+ window.parent.postMessage({ overlayMask: shouldShow }, "*");
956
+ } catch (e) {
957
+ console.log(e);
958
+ }
959
+ }
960
+ onUnmounted(() => {
961
+ if (hasCounted) {
962
+ triggerOverlay(false);
963
+ }
964
+ });
920
965
  return (_ctx, _cache) => {
921
966
  return openBlock(), createBlock(unref(ElDialog), mergeProps(_ctx.$attrs, {
967
+ modal: dialogModal.value,
922
968
  ref_key: "proxyElement",
923
- ref: proxyElement
969
+ ref: proxyElement,
970
+ onOpen,
971
+ onClose
924
972
  }), createSlots({ _: 2 }, [
925
973
  renderList(_ctx.$slots, (value, key) => {
926
974
  return {
@@ -930,7 +978,7 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
930
978
  ])
931
979
  };
932
980
  })
933
- ]), 1040);
981
+ ]), 1040, ["modal"]);
934
982
  };
935
983
  }
936
984
  });
@@ -1357,6 +1405,16 @@ const Adapter = {
1357
1405
  // 基础组件
1358
1406
  ElButton: _sfc_main$G,
1359
1407
  ElTag: _sfc_main$F,
1408
+ ElIcon,
1409
+ ElAvatar,
1410
+ ElRow,
1411
+ // 布局组件
1412
+ ElContainer,
1413
+ ElHeader,
1414
+ ElAside,
1415
+ ElMain,
1416
+ ElConfigProvider,
1417
+ ElScrollbar,
1360
1418
  // 表单组件
1361
1419
  ElInput: _sfc_main$E,
1362
1420
  ElForm: _sfc_main$D,
@@ -1398,12 +1456,16 @@ const Adapter = {
1398
1456
  ElDropdown: _sfc_main$9,
1399
1457
  ElDropdownMenu: _sfc_main$4,
1400
1458
  ElDropdownItem: _sfc_main$3,
1459
+ ElBreadcrumb,
1460
+ ElBreadcrumbItem,
1401
1461
  ElTabs: _sfc_main$8,
1402
1462
  ElTabPane: _sfc_main$7,
1403
1463
  // 其他
1404
1464
  ElCollapse: _sfc_main$2,
1405
1465
  ElCollapseItem: _sfc_main$1,
1406
- ElPoper: _sfc_main
1466
+ ElPoper: _sfc_main,
1467
+ ElTour,
1468
+ ElTourStep
1407
1469
  };
1408
1470
  function adapterInstall(app) {
1409
1471
  for (const [key, component] of Object.entries(Adapter)) {