@ganwei-web/gw-base-components-plus 1.0.38 → 1.0.40

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.
@@ -2,6 +2,7 @@
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const vue = require("vue");
4
4
  const elementPlus = require("element-plus");
5
+ const overlayNoTransition = "";
5
6
  function useExpose(proxyElement) {
6
7
  const expose = new Proxy({}, {
7
8
  get(target, key) {
@@ -14,7 +15,7 @@ function useExpose(proxyElement) {
14
15
  });
15
16
  return expose;
16
17
  }
17
- const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
18
+ const _sfc_main$H = /* @__PURE__ */ vue.defineComponent({
18
19
  ...{
19
20
  inheritAttrs: false
20
21
  },
@@ -62,7 +63,7 @@ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
62
63
  }
63
64
  });
64
65
  const index_vue_vue_type_style_index_0_lang$u = "";
65
- const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
66
+ const _sfc_main$G = /* @__PURE__ */ vue.defineComponent({
66
67
  __name: "index",
67
68
  setup(__props, { expose: __expose }) {
68
69
  const attrs = vue.useAttrs();
@@ -94,7 +95,7 @@ function useDataTestId() {
94
95
  console.warn(`${UI_AUTOMATION_TOKEN} is required to UI Automation`);
95
96
  }
96
97
  }
97
- const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
98
+ const _sfc_main$F = /* @__PURE__ */ vue.defineComponent({
98
99
  __name: "ElInput",
99
100
  props: {
100
101
  "modelValue": {
@@ -144,7 +145,7 @@ const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
144
145
  }
145
146
  });
146
147
  const ElInput_vue_vue_type_style_index_0_lang = "";
147
- const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
148
+ const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
148
149
  __name: "index",
149
150
  setup(__props, { expose: __expose }) {
150
151
  const proxyElement = vue.ref();
@@ -169,7 +170,7 @@ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
169
170
  }
170
171
  });
171
172
  const index_vue_vue_type_style_index_0_lang$s = "";
172
- const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
173
+ const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
173
174
  __name: "index",
174
175
  setup(__props, { expose: __expose }) {
175
176
  const attrs = vue.useAttrs();
@@ -193,7 +194,7 @@ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
193
194
  };
194
195
  }
195
196
  });
196
- const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
197
+ const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
197
198
  __name: "index",
198
199
  setup(__props, { expose: __expose }) {
199
200
  const proxyElement = vue.ref();
@@ -219,7 +220,7 @@ const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
219
220
  }
220
221
  });
221
222
  const index_vue_vue_type_style_index_0_lang$r = "";
222
- const _sfc_main$A = /* @__PURE__ */ vue.defineComponent({
223
+ const _sfc_main$B = /* @__PURE__ */ vue.defineComponent({
223
224
  __name: "index",
224
225
  setup(__props, { expose: __expose }) {
225
226
  const attrs = vue.useAttrs();
@@ -243,7 +244,7 @@ const _sfc_main$A = /* @__PURE__ */ vue.defineComponent({
243
244
  };
244
245
  }
245
246
  });
246
- const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({
247
+ const _sfc_main$A = /* @__PURE__ */ vue.defineComponent({
247
248
  ...{
248
249
  inheritAttrs: false
249
250
  },
@@ -271,7 +272,7 @@ const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({
271
272
  }
272
273
  });
273
274
  const index_vue_vue_type_style_index_0_lang$q = "";
274
- const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
275
+ const _sfc_main$z = /* @__PURE__ */ vue.defineComponent({
275
276
  ...{
276
277
  inheritAttrs: false
277
278
  },
@@ -298,7 +299,7 @@ const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
298
299
  };
299
300
  }
300
301
  });
301
- const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
302
+ const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
302
303
  __name: "index",
303
304
  setup(__props, { expose: __expose }) {
304
305
  const proxyElement = vue.ref();
@@ -323,7 +324,7 @@ const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
323
324
  }
324
325
  });
325
326
  const index_vue_vue_type_style_index_0_lang$p = "";
326
- const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
327
+ const _sfc_main$x = /* @__PURE__ */ vue.defineComponent({
327
328
  __name: "index",
328
329
  props: {
329
330
  round: {
@@ -356,7 +357,7 @@ const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
356
357
  }
357
358
  });
358
359
  const index_vue_vue_type_style_index_0_lang$o = "";
359
- const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
360
+ const _sfc_main$w = /* @__PURE__ */ vue.defineComponent({
360
361
  __name: "index",
361
362
  setup(__props, { expose: __expose }) {
362
363
  const attrs = vue.useAttrs();
@@ -380,7 +381,7 @@ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
380
381
  };
381
382
  }
382
383
  });
383
- const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
384
+ const _sfc_main$v = /* @__PURE__ */ vue.defineComponent({
384
385
  __name: "index",
385
386
  setup(__props, { expose: __expose }) {
386
387
  const proxyElement = vue.ref();
@@ -406,7 +407,7 @@ const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
406
407
  }
407
408
  });
408
409
  const index_vue_vue_type_style_index_0_lang$n = "";
409
- const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
410
+ const _sfc_main$u = /* @__PURE__ */ vue.defineComponent({
410
411
  __name: "index",
411
412
  setup(__props, { expose: __expose }) {
412
413
  const proxyElement = vue.ref();
@@ -431,7 +432,7 @@ const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
431
432
  }
432
433
  });
433
434
  const index_vue_vue_type_style_index_0_lang$m = "";
434
- const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
435
+ const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
435
436
  __name: "index",
436
437
  props: {
437
438
  defaultTime: {},
@@ -481,7 +482,7 @@ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
481
482
  }
482
483
  });
483
484
  const index_vue_vue_type_style_index_0_lang$l = "";
484
- const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
485
+ const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
485
486
  __name: "index",
486
487
  setup(__props, { expose: __expose }) {
487
488
  const proxyElement = vue.ref();
@@ -506,7 +507,7 @@ const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
506
507
  }
507
508
  });
508
509
  const index_vue_vue_type_style_index_0_lang$k = "";
509
- const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
510
+ const _sfc_main$r = /* @__PURE__ */ vue.defineComponent({
510
511
  __name: "index",
511
512
  setup(__props, { expose: __expose }) {
512
513
  const proxyElement = vue.ref();
@@ -531,7 +532,7 @@ const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
531
532
  }
532
533
  });
533
534
  const index_vue_vue_type_style_index_0_lang$j = "";
534
- const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
535
+ const _sfc_main$q = /* @__PURE__ */ vue.defineComponent({
535
536
  __name: "index",
536
537
  setup(__props, { expose: __expose }) {
537
538
  const attrs = vue.useAttrs();
@@ -556,7 +557,7 @@ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
556
557
  }
557
558
  });
558
559
  const index_vue_vue_type_style_index_0_lang$i = "";
559
- const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
560
+ const _sfc_main$p = /* @__PURE__ */ vue.defineComponent({
560
561
  __name: "index",
561
562
  setup(__props, { expose: __expose }) {
562
563
  const proxyElement = vue.ref();
@@ -588,7 +589,7 @@ const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
588
589
  }
589
590
  });
590
591
  const index_vue_vue_type_style_index_0_lang$h = "";
591
- const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
592
+ const _sfc_main$o = /* @__PURE__ */ vue.defineComponent({
592
593
  __name: "index",
593
594
  props: {
594
595
  formatter: {
@@ -626,7 +627,7 @@ const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
626
627
  };
627
628
  }
628
629
  });
629
- const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
630
+ const _sfc_main$n = /* @__PURE__ */ vue.defineComponent({
630
631
  __name: "index",
631
632
  setup(__props, { expose: __expose }) {
632
633
  const attrs = vue.useAttrs();
@@ -651,7 +652,7 @@ const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
651
652
  }
652
653
  });
653
654
  const index_vue_vue_type_style_index_0_lang$g = "";
654
- const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
655
+ const _sfc_main$m = /* @__PURE__ */ vue.defineComponent({
655
656
  __name: "index",
656
657
  setup(__props, { expose: __expose }) {
657
658
  const attrs = vue.useAttrs();
@@ -704,7 +705,7 @@ var _sfc_main197 = /* @__PURE__ */ vue.defineComponent({
704
705
  }
705
706
  }), picture_default = _sfc_main197;
706
707
  const _hoisted_1 = { class: "error-slot" };
707
- const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
708
+ const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
708
709
  ...{ inheritAttrs: false },
709
710
  __name: "index",
710
711
  props: {
@@ -777,7 +778,7 @@ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
777
778
  }
778
779
  });
779
780
  const index_vue_vue_type_style_index_0_lang$e = "";
780
- const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
781
+ const _sfc_main$k = /* @__PURE__ */ vue.defineComponent({
781
782
  __name: "index",
782
783
  setup(__props, { expose: __expose }) {
783
784
  const attrs = vue.useAttrs();
@@ -802,7 +803,7 @@ const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
802
803
  }
803
804
  });
804
805
  const index_vue_vue_type_style_index_0_lang$d = "";
805
- const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
806
+ const _sfc_main$j = /* @__PURE__ */ vue.defineComponent({
806
807
  __name: "index",
807
808
  setup(__props, { expose: __expose }) {
808
809
  const attrs = vue.useAttrs();
@@ -827,7 +828,7 @@ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
827
828
  }
828
829
  });
829
830
  const index_vue_vue_type_style_index_0_lang$c = "";
830
- const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
831
+ const _sfc_main$i = /* @__PURE__ */ vue.defineComponent({
831
832
  __name: "index",
832
833
  setup(__props, { expose: __expose }) {
833
834
  const attrs = vue.useAttrs();
@@ -852,7 +853,7 @@ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
852
853
  }
853
854
  });
854
855
  const index_vue_vue_type_style_index_0_lang$b = "";
855
- const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
856
+ const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
856
857
  __name: "index",
857
858
  setup(__props, { expose: __expose }) {
858
859
  const proxyElement = vue.ref();
@@ -887,7 +888,7 @@ const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
887
888
  }
888
889
  });
889
890
  const index_vue_vue_type_style_index_0_lang$a = "";
890
- const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
891
+ const _sfc_main$g = /* @__PURE__ */ vue.defineComponent({
891
892
  __name: "index",
892
893
  setup(__props, { expose: __expose }) {
893
894
  const attrs = vue.useAttrs();
@@ -912,74 +913,259 @@ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
912
913
  }
913
914
  });
914
915
  const index_vue_vue_type_style_index_0_lang$9 = "";
916
+ const isInIframe = typeof window !== "undefined" && window.self !== window.top;
917
+ const COUNT_KEY = "__elDialogOverlayCount__";
918
+ let transitionDisabled = false;
919
+ let enableTimer = null;
920
+ const OVERLAY_TRANSITION_DURATION = 200;
921
+ function disableOverlayTransition() {
922
+ if (!isInIframe)
923
+ return;
924
+ if (enableTimer) {
925
+ clearTimeout(enableTimer);
926
+ enableTimer = null;
927
+ }
928
+ if (transitionDisabled)
929
+ return;
930
+ transitionDisabled = true;
931
+ document.documentElement.classList.add("gw-overlay-no-transition");
932
+ }
933
+ function enableOverlayTransition() {
934
+ if (!isInIframe || !transitionDisabled)
935
+ return;
936
+ if (enableTimer)
937
+ clearTimeout(enableTimer);
938
+ enableTimer = setTimeout(() => {
939
+ transitionDisabled = false;
940
+ document.documentElement.classList.remove("gw-overlay-no-transition");
941
+ enableTimer = null;
942
+ }, OVERLAY_TRANSITION_DURATION);
943
+ }
944
+ function getCount() {
945
+ return window[COUNT_KEY] || 0;
946
+ }
947
+ function setCount(count) {
948
+ window[COUNT_KEY] = count;
949
+ }
950
+ function postOverlayMessage(visible) {
951
+ if (!isInIframe)
952
+ return;
953
+ try {
954
+ window.parent.postMessage({ overlayMask: visible }, "*");
955
+ } catch (e) {
956
+ console.log(e);
957
+ }
958
+ }
959
+ const globalOverlayVisible = vue.ref(false);
960
+ const globalOverlayZIndex = vue.ref(2e3);
961
+ function useOverlayMask() {
962
+ let hasCounted = false;
963
+ let isMounted = false;
964
+ function triggerOverlay(visible) {
965
+ if (!isInIframe)
966
+ return;
967
+ try {
968
+ let count = getCount();
969
+ if (visible) {
970
+ if (hasCounted)
971
+ return;
972
+ count++;
973
+ hasCounted = true;
974
+ } else {
975
+ if (!hasCounted)
976
+ return;
977
+ count = Math.max(0, count - 1);
978
+ hasCounted = false;
979
+ }
980
+ setCount(count);
981
+ const shouldShow = count > 0;
982
+ if (shouldShow) {
983
+ disableOverlayTransition();
984
+ } else {
985
+ enableOverlayTransition();
986
+ }
987
+ globalOverlayVisible.value = shouldShow;
988
+ postOverlayMessage(shouldShow);
989
+ } catch (e) {
990
+ console.log(e);
991
+ }
992
+ }
993
+ function onOpen() {
994
+ if (hasCounted)
995
+ return;
996
+ triggerOverlay(true);
997
+ }
998
+ function onClose() {
999
+ triggerOverlay(false);
1000
+ }
1001
+ function onMount(modelValue) {
1002
+ isMounted = true;
1003
+ Promise.resolve().then(() => {
1004
+ if (isMounted && !hasCounted && modelValue === true) {
1005
+ onOpen();
1006
+ }
1007
+ });
1008
+ }
1009
+ function onUnmount() {
1010
+ isMounted = false;
1011
+ if (hasCounted) {
1012
+ triggerOverlay(false);
1013
+ }
1014
+ }
1015
+ return {
1016
+ overlayVisible: globalOverlayVisible,
1017
+ overlayZIndex: globalOverlayZIndex,
1018
+ onOpen,
1019
+ onClose,
1020
+ onUnmount,
1021
+ onMount
1022
+ };
1023
+ }
1024
+ const overlayMask = {
1025
+ show() {
1026
+ if (!isInIframe)
1027
+ return;
1028
+ try {
1029
+ let count = getCount();
1030
+ const wasZero = count === 0;
1031
+ count++;
1032
+ setCount(count);
1033
+ if (wasZero) {
1034
+ disableOverlayTransition();
1035
+ postOverlayMessage(true);
1036
+ }
1037
+ } catch (e) {
1038
+ console.log(e);
1039
+ }
1040
+ },
1041
+ hide() {
1042
+ if (!isInIframe)
1043
+ return;
1044
+ try {
1045
+ let count = getCount();
1046
+ count = Math.max(0, count - 1);
1047
+ setCount(count);
1048
+ if (count === 0) {
1049
+ postOverlayMessage(false);
1050
+ enableOverlayTransition();
1051
+ }
1052
+ } catch (e) {
1053
+ console.log(e);
1054
+ }
1055
+ }
1056
+ };
1057
+ const GwOverlayMaskKey = "__gwOverlayMaskActive__";
1058
+ const _sfc_main$f = /* @__PURE__ */ vue.defineComponent({
1059
+ __name: "index",
1060
+ props: {
1061
+ visible: { type: Boolean, default: false },
1062
+ backgroundColor: { default: "rgba(0, 0, 0, 0.5)" },
1063
+ width: { default: "100%" },
1064
+ height: { default: "100%" },
1065
+ transitionDuration: { default: "0.2s" }
1066
+ },
1067
+ emits: ["click"],
1068
+ setup(__props, { emit: __emit }) {
1069
+ const props = __props;
1070
+ const emit = __emit;
1071
+ const isInstance = !window[GwOverlayMaskKey];
1072
+ if (isInstance) {
1073
+ window[GwOverlayMaskKey] = true;
1074
+ }
1075
+ vue.onUnmounted(() => {
1076
+ if (isInstance) {
1077
+ window[GwOverlayMaskKey] = false;
1078
+ }
1079
+ });
1080
+ const overlayStyle = vue.computed(() => ({
1081
+ position: "fixed",
1082
+ left: "0",
1083
+ top: "0",
1084
+ width: props.width,
1085
+ height: props.height,
1086
+ zIndex: 2e3,
1087
+ backgroundColor: props.backgroundColor,
1088
+ transitionDuration: props.transitionDuration
1089
+ }));
1090
+ const handleClick = (event) => {
1091
+ emit("click", event);
1092
+ };
1093
+ const handleMouseDown = (event) => {
1094
+ event.stopPropagation();
1095
+ };
1096
+ return (_ctx, _cache) => {
1097
+ return vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
1098
+ isInstance ? (vue.openBlock(), vue.createElementBlock("div", {
1099
+ key: 0,
1100
+ class: vue.normalizeClass(["gw-overlay-mask", { "gw-overlay-mask--visible": __props.visible }]),
1101
+ style: vue.normalizeStyle(overlayStyle.value),
1102
+ onClick: handleClick,
1103
+ onMousedown: handleMouseDown
1104
+ }, null, 38)) : vue.createCommentVNode("", true)
1105
+ ]);
1106
+ };
1107
+ }
1108
+ });
1109
+ const index_vue_vue_type_style_index_0_scoped_cf048b89_lang = "";
1110
+ const _export_sfc = (sfc, props) => {
1111
+ const target = sfc.__vccOpts || sfc;
1112
+ for (const [key, val] of props) {
1113
+ target[key] = val;
1114
+ }
1115
+ return target;
1116
+ };
1117
+ const GwOverlayMask = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-cf048b89"]]);
915
1118
  const _sfc_main$e = /* @__PURE__ */ vue.defineComponent({
916
1119
  __name: "index",
917
1120
  setup(__props, { expose: __expose }) {
918
- vue.useAttrs();
1121
+ const attrs = vue.useAttrs();
919
1122
  const proxyElement = vue.ref();
920
1123
  const expose = useExpose(proxyElement);
921
1124
  __expose(expose);
922
- const isInIframe = window.self !== window.top;
923
- let hasCounted = false;
924
- const dialogModal = vue.ref(true);
925
- function onOpen() {
1125
+ const { overlayVisible, overlayZIndex, onOpen, onClose, onUnmount, onMount } = useOverlayMask();
1126
+ const { nextZIndex } = elementPlus.useZIndex();
1127
+ const dialogModal = vue.computed(() => !isInIframe);
1128
+ function handleOpen() {
926
1129
  if (isInIframe) {
927
1130
  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;
1131
+ if (currentCount === 0) {
1132
+ overlayZIndex.value = nextZIndex();
952
1133
  }
953
- ;
954
- window.__elDialogOverlayCount__ = count;
955
- const shouldShow = count > 0;
956
- window.parent.postMessage({ overlayMask: shouldShow }, "*");
957
- } catch (e) {
958
- console.log(e);
959
1134
  }
1135
+ onOpen();
1136
+ }
1137
+ function handleClose() {
1138
+ onClose();
960
1139
  }
1140
+ vue.onMounted(() => {
1141
+ onMount(attrs.modelValue);
1142
+ });
961
1143
  vue.onUnmounted(() => {
962
- if (hasCounted) {
963
- triggerOverlay(false);
964
- }
1144
+ onUnmount();
965
1145
  });
966
1146
  return (_ctx, _cache) => {
967
- return vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElDialog), vue.mergeProps(_ctx.$attrs, {
968
- modal: dialogModal.value,
969
- ref_key: "proxyElement",
970
- ref: proxyElement,
971
- onOpen,
972
- onClose
973
- }), vue.createSlots({ _: 2 }, [
974
- vue.renderList(_ctx.$slots, (value, key) => {
975
- return {
976
- name: key,
977
- fn: vue.withCtx((slotProps) => [
978
- vue.renderSlot(_ctx.$slots, key, vue.mergeProps(slotProps, { key }))
979
- ])
980
- };
981
- })
982
- ]), 1040, ["modal"]);
1147
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
1148
+ vue.unref(isInIframe) ? (vue.openBlock(), vue.createBlock(GwOverlayMask, {
1149
+ key: 0,
1150
+ visible: vue.unref(overlayVisible)
1151
+ }, null, 8, ["visible"])) : vue.createCommentVNode("", true),
1152
+ vue.createVNode(vue.unref(elementPlus.ElDialog), vue.mergeProps(_ctx.$attrs, {
1153
+ modal: dialogModal.value,
1154
+ ref_key: "proxyElement",
1155
+ ref: proxyElement,
1156
+ onOpen: handleOpen,
1157
+ onClose: handleClose
1158
+ }), vue.createSlots({ _: 2 }, [
1159
+ vue.renderList(_ctx.$slots, (value, key) => {
1160
+ return {
1161
+ name: key,
1162
+ fn: vue.withCtx((slotProps) => [
1163
+ vue.renderSlot(_ctx.$slots, key, vue.mergeProps(slotProps, { key }))
1164
+ ])
1165
+ };
1166
+ })
1167
+ ]), 1040, ["modal"])
1168
+ ], 64);
983
1169
  };
984
1170
  }
985
1171
  });
@@ -1061,6 +1247,64 @@ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
1061
1247
  });
1062
1248
  const index_vue_vue_type_style_index_0_lang$5 = "";
1063
1249
  const index$2 = "";
1250
+ function wrapMethod(fn) {
1251
+ return function(...args) {
1252
+ let hasHidden = false;
1253
+ const injectOptions = (options) => {
1254
+ const userBeforeClose = options == null ? void 0 : options.beforeClose;
1255
+ const wrappedBeforeClose = (action, instance, done) => {
1256
+ const wrappedDone = () => {
1257
+ if (!hasHidden) {
1258
+ hasHidden = true;
1259
+ overlayMask.hide();
1260
+ }
1261
+ done();
1262
+ };
1263
+ if (typeof userBeforeClose === "function") {
1264
+ userBeforeClose(action, instance, wrappedDone);
1265
+ } else {
1266
+ wrappedDone();
1267
+ }
1268
+ };
1269
+ return { ...options, beforeClose: wrappedBeforeClose };
1270
+ };
1271
+ if (args.length > 0 && typeof args[0] === "object" && !Array.isArray(args[0])) {
1272
+ args[0] = injectOptions(args[0]);
1273
+ } else {
1274
+ args[2] = injectOptions(args[2] || {});
1275
+ }
1276
+ overlayMask.show();
1277
+ const result = fn.apply(this, args);
1278
+ return result.finally(() => {
1279
+ if (!hasHidden) {
1280
+ hasHidden = true;
1281
+ overlayMask.hide();
1282
+ }
1283
+ });
1284
+ };
1285
+ }
1286
+ const wrappedMsgbox = wrapMethod(elementPlus.ElMessageBox);
1287
+ const wrappedAlert = wrapMethod(elementPlus.ElMessageBox.alert.bind(elementPlus.ElMessageBox));
1288
+ const wrappedConfirm = wrapMethod(elementPlus.ElMessageBox.confirm.bind(elementPlus.ElMessageBox));
1289
+ const wrappedPrompt = wrapMethod(elementPlus.ElMessageBox.prompt.bind(elementPlus.ElMessageBox));
1290
+ const WrappedElMessageBox = Object.assign(wrappedMsgbox, {
1291
+ alert: wrappedAlert,
1292
+ confirm: wrappedConfirm,
1293
+ prompt: wrappedPrompt,
1294
+ close: elementPlus.ElMessageBox.close.bind(elementPlus.ElMessageBox),
1295
+ _context: null
1296
+ });
1297
+ WrappedElMessageBox.install = function(app) {
1298
+ if (WrappedElMessageBox._installed)
1299
+ return;
1300
+ WrappedElMessageBox._installed = true;
1301
+ WrappedElMessageBox._context = app._context;
1302
+ app.config.globalProperties.$msgbox = WrappedElMessageBox;
1303
+ app.config.globalProperties.$messageBox = WrappedElMessageBox;
1304
+ app.config.globalProperties.$alert = wrappedAlert;
1305
+ app.config.globalProperties.$confirm = wrappedConfirm;
1306
+ app.config.globalProperties.$prompt = wrappedPrompt;
1307
+ };
1064
1308
  const index$1 = "";
1065
1309
  const install = elementPlus.ElNotification.install;
1066
1310
  const defaultOption = {
@@ -1404,8 +1648,8 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
1404
1648
  const index_vue_vue_type_style_index_0_lang = "";
1405
1649
  const Adapter = {
1406
1650
  // 基础组件
1407
- ElButton: _sfc_main$G,
1408
- ElTag: _sfc_main$F,
1651
+ ElButton: _sfc_main$H,
1652
+ ElTag: _sfc_main$G,
1409
1653
  ElIcon: elementPlus.ElIcon,
1410
1654
  ElAvatar: elementPlus.ElAvatar,
1411
1655
  ElRow: elementPlus.ElRow,
@@ -1417,35 +1661,35 @@ const Adapter = {
1417
1661
  ElConfigProvider: elementPlus.ElConfigProvider,
1418
1662
  ElScrollbar: elementPlus.ElScrollbar,
1419
1663
  // 表单组件
1420
- ElInput: _sfc_main$E,
1421
- ElForm: _sfc_main$D,
1422
- ElFormItem: _sfc_main$C,
1423
- ElSelect: _sfc_main$B,
1424
- ElOption: _sfc_main$A,
1425
- ElCheckbox: _sfc_main$z,
1426
- ElCheckboxGroup: _sfc_main$y,
1427
- ElRadio: _sfc_main$x,
1428
- ElRadioGroup: _sfc_main$w,
1429
- ElRadioButton: _sfc_main$v,
1430
- ElSwitch: _sfc_main$u,
1431
- ElCascader: _sfc_main$t,
1432
- ElDatePicker: _sfc_main$s,
1433
- ElTimePicker: _sfc_main$r,
1434
- ElUpload: _sfc_main$q,
1435
- ElTransfer: _sfc_main$p,
1664
+ ElInput: _sfc_main$F,
1665
+ ElForm: _sfc_main$E,
1666
+ ElFormItem: _sfc_main$D,
1667
+ ElSelect: _sfc_main$C,
1668
+ ElOption: _sfc_main$B,
1669
+ ElCheckbox: _sfc_main$A,
1670
+ ElCheckboxGroup: _sfc_main$z,
1671
+ ElRadio: _sfc_main$y,
1672
+ ElRadioGroup: _sfc_main$x,
1673
+ ElRadioButton: _sfc_main$w,
1674
+ ElSwitch: _sfc_main$v,
1675
+ ElCascader: _sfc_main$u,
1676
+ ElDatePicker: _sfc_main$t,
1677
+ ElTimePicker: _sfc_main$s,
1678
+ ElUpload: _sfc_main$r,
1679
+ ElTransfer: _sfc_main$q,
1436
1680
  // 数据展示
1437
- ElTable: _sfc_main$o,
1438
- ElTableColumn: _sfc_main$n,
1439
- ElTree: _sfc_main$m,
1440
- ElPagination: _sfc_main$l,
1441
- ElImage: _sfc_main$k,
1442
- ElProgress: _sfc_main$j,
1443
- ElBadge: _sfc_main$i,
1444
- ElCard: _sfc_main$h,
1445
- ElDescriptions: _sfc_main$g,
1681
+ ElTable: _sfc_main$p,
1682
+ ElTableColumn: _sfc_main$o,
1683
+ ElTree: _sfc_main$n,
1684
+ ElPagination: _sfc_main$m,
1685
+ ElImage: _sfc_main$l,
1686
+ ElProgress: _sfc_main$k,
1687
+ ElBadge: _sfc_main$j,
1688
+ ElCard: _sfc_main$i,
1689
+ ElDescriptions: _sfc_main$h,
1446
1690
  ElDescriptionsItem: elementPlus.ElDescriptionsItem,
1447
1691
  // 反馈组件
1448
- ElAlert: _sfc_main$f,
1692
+ ElAlert: _sfc_main$g,
1449
1693
  ElDialog: _sfc_main$e,
1450
1694
  ElDrawer: _sfc_main$d,
1451
1695
  ElPopover: _sfc_main$c,
@@ -1473,7 +1717,7 @@ function adapterInstall(app) {
1473
1717
  app.component(key, component);
1474
1718
  }
1475
1719
  adapterLoading(app);
1476
- app.use(elementPlus.ElMessageBox);
1720
+ app.use(WrappedElMessageBox);
1477
1721
  app.use(ElNotification);
1478
1722
  app.config.globalProperties.$message = elementPlus.ElMessage;
1479
1723
  }