lew-ui 2.7.76 → 2.7.77

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/dist/index.js CHANGED
@@ -6943,7 +6943,7 @@ const _sfc_main$17 = /* @__PURE__ */ defineComponent({
6943
6943
  };
6944
6944
  }
6945
6945
  });
6946
- const LewDescItem = /* @__PURE__ */ _export_sfc(_sfc_main$17, [["__scopeId", "data-v-4f89faa6"]]);
6946
+ const LewDescItem = /* @__PURE__ */ _export_sfc(_sfc_main$17, [["__scopeId", "data-v-f36ef12d"]]);
6947
6947
  const _sfc_main$16 = /* @__PURE__ */ defineComponent({
6948
6948
  __name: "LewDesc",
6949
6949
  props: descProps,
@@ -8410,7 +8410,7 @@ const _hoisted_2$A = { class: "lew-table-header" };
8410
8410
  const _hoisted_3$t = { class: "lew-table-tr" };
8411
8411
  const _hoisted_4$l = { class: "lew-table-main" };
8412
8412
  const _hoisted_5$g = { class: "lew-table-tr" };
8413
- const _hoisted_6$b = { class: "lew-table-tr" };
8413
+ const _hoisted_6$a = { class: "lew-table-tr" };
8414
8414
  const _hoisted_7$8 = {
8415
8415
  key: 0,
8416
8416
  class: "lew-table-empty"
@@ -8724,7 +8724,9 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
8724
8724
  }
8725
8725
  function updateAllCheckedState() {
8726
8726
  const checkedKeys = keys(pickBy(selectionState.selectedRowsMap, Boolean));
8727
- const allDataKeys = dataState.dataSource.map((row) => String(row[_rowKey]));
8727
+ const allDataKeys = dataState.dataSource.map(
8728
+ (row) => String(row[_rowKey])
8729
+ );
8728
8730
  const uncheckedKeys = difference(allDataKeys, checkedKeys);
8729
8731
  selectionState.isAllChecked = isEmpty(uncheckedKeys) && props.multiple && props.checkable && checkedKeys.length > 0;
8730
8732
  }
@@ -8758,7 +8760,10 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
8758
8760
  return;
8759
8761
  const rowKey = row[_rowKey];
8760
8762
  const isFocused = focusState.focusedRowsMap[rowKey];
8761
- focusState.focusedRowsMap = { ...focusState.focusedRowsMap, [rowKey]: !isFocused };
8763
+ focusState.focusedRowsMap = {
8764
+ ...focusState.focusedRowsMap,
8765
+ [rowKey]: !isFocused
8766
+ };
8762
8767
  }
8763
8768
  function handleRowClick(row) {
8764
8769
  if (props.checkable) {
@@ -8849,7 +8854,9 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
8849
8854
  column.children?.length > 0 ? h(
8850
8855
  "div",
8851
8856
  { class: "lew-table-td-group", style: { display: "flex" } },
8852
- column.children.map((child) => readerHeaderTd({ column: child }))
8857
+ column.children.map(
8858
+ (child) => readerHeaderTd({ column: child })
8859
+ )
8853
8860
  ) : null
8854
8861
  ]
8855
8862
  );
@@ -9032,7 +9039,10 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
9032
9039
  dragState.showTooltip = false;
9033
9040
  dragState.isDragging = false;
9034
9041
  }
9035
- const throttledTooltipUpdate = throttle(updateTooltipPosition, TOOLTIP_THROTTLE_DELAY);
9042
+ const throttledTooltipUpdate = throttle(
9043
+ updateTooltipPosition,
9044
+ TOOLTIP_THROTTLE_DELAY
9045
+ );
9036
9046
  function dragStart(event, row, index2) {
9037
9047
  if (!props.sortable)
9038
9048
  return;
@@ -9273,9 +9283,13 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
9273
9283
  computeTableRowHeight();
9274
9284
  }
9275
9285
  }, ROW_HEIGHT_THROTTLE_DELAY);
9276
- watch([trRefMap, fixedLeftTrRefMap, fixedRightTrRefMap], throttledRowHeightCompute, {
9277
- deep: true
9278
- });
9286
+ watch(
9287
+ [trRefMap, fixedLeftTrRefMap, fixedRightTrRefMap],
9288
+ throttledRowHeightCompute,
9289
+ {
9290
+ deep: true
9291
+ }
9292
+ );
9279
9293
  watch(
9280
9294
  () => props.size,
9281
9295
  () => {
@@ -9409,7 +9423,7 @@ const _sfc_main$12 = /* @__PURE__ */ defineComponent({
9409
9423
  ref: fixedRightRef,
9410
9424
  class: "lew-table-fixed-right"
9411
9425
  }, [
9412
- createElementVNode("div", _hoisted_6$b, [
9426
+ createElementVNode("div", _hoisted_6$a, [
9413
9427
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(headerColumns).right, (column) => {
9414
9428
  return openBlock(), createBlock(readerHeaderTd, {
9415
9429
  key: column.field,
@@ -9673,6 +9687,135 @@ function useEventListener(target, event, callback) {
9673
9687
  onMounted(() => target.addEventListener(event, callback, true));
9674
9688
  onUnmounted(() => target.removeEventListener(event, callback, true));
9675
9689
  }
9690
+ class PopupManager {
9691
+ /** 基础 z-index,从 2001 开始 */
9692
+ static BASE_Z_INDEX = 2001;
9693
+ /** 当前 z-index 计数器 */
9694
+ currentZIndex = PopupManager.BASE_Z_INDEX;
9695
+ /** 弹出层栈,按打开顺序排列,最后一个是最顶层 */
9696
+ stack = [];
9697
+ /** 是否已初始化 ESC 监听 */
9698
+ escInitialized = false;
9699
+ /**
9700
+ * 注册弹出层,返回分配的 z-index
9701
+ * @param id 唯一标识
9702
+ * @param type 类型
9703
+ * @param close 关闭回调
9704
+ * @returns 分配的 z-index
9705
+ */
9706
+ register(id, type, close) {
9707
+ const existingIndex = this.stack.findIndex((p) => p.id === id);
9708
+ if (existingIndex !== -1) {
9709
+ return this.stack[existingIndex].zIndex;
9710
+ }
9711
+ const zIndex = this.currentZIndex++;
9712
+ this.stack.push({ id, type, zIndex, close });
9713
+ return zIndex;
9714
+ }
9715
+ /**
9716
+ * 注销弹出层
9717
+ * @param id 唯一标识
9718
+ */
9719
+ unregister(id) {
9720
+ const index2 = this.stack.findIndex((p) => p.id === id);
9721
+ if (index2 !== -1) {
9722
+ this.stack.splice(index2, 1);
9723
+ }
9724
+ }
9725
+ /**
9726
+ * 关闭最顶层弹出层
9727
+ * @returns 是否成功关闭
9728
+ */
9729
+ closeTop() {
9730
+ if (this.stack.length === 0) {
9731
+ return false;
9732
+ }
9733
+ const topPopup = this.stack[this.stack.length - 1];
9734
+ topPopup.close();
9735
+ return true;
9736
+ }
9737
+ /**
9738
+ * 检查是否是最顶层弹出层
9739
+ * @param id 唯一标识
9740
+ * @returns 是否是最顶层
9741
+ */
9742
+ isTop(id) {
9743
+ if (this.stack.length === 0) {
9744
+ return false;
9745
+ }
9746
+ return this.stack[this.stack.length - 1].id === id;
9747
+ }
9748
+ /**
9749
+ * 获取当前栈的长度
9750
+ * @returns 栈长度
9751
+ */
9752
+ getStackLength() {
9753
+ return this.stack.length;
9754
+ }
9755
+ /**
9756
+ * 获取指定弹出层的信息
9757
+ * @param id 唯一标识
9758
+ * @returns 弹出层信息或 undefined
9759
+ */
9760
+ getPopup(id) {
9761
+ return this.stack.find((p) => p.id === id);
9762
+ }
9763
+ /**
9764
+ * 初始化全局 ESC 监听(内部使用)
9765
+ */
9766
+ initEscListener(escape2) {
9767
+ if (this.escInitialized) {
9768
+ return;
9769
+ }
9770
+ this.escInitialized = true;
9771
+ watch(escape2, (pressed) => {
9772
+ if (pressed && this.stack.length > 0) {
9773
+ this.closeTop();
9774
+ }
9775
+ });
9776
+ }
9777
+ }
9778
+ const popupManager = new PopupManager();
9779
+ function usePopupManager(options) {
9780
+ const { id, type, visible, closeByEsc = false, onClose } = options;
9781
+ const zIndex = ref(0);
9782
+ const close = () => {
9783
+ visible.value = false;
9784
+ onClose?.();
9785
+ };
9786
+ watch(
9787
+ visible,
9788
+ (newVal) => {
9789
+ if (newVal) {
9790
+ zIndex.value = popupManager.register(id, type, close);
9791
+ } else {
9792
+ popupManager.unregister(id);
9793
+ }
9794
+ },
9795
+ { immediate: true }
9796
+ );
9797
+ if (closeByEsc) {
9798
+ const { Escape } = useMagicKeys();
9799
+ watch(Escape, (pressed) => {
9800
+ if (pressed && visible.value && popupManager.isTop(id)) {
9801
+ close();
9802
+ }
9803
+ });
9804
+ }
9805
+ onUnmounted(() => {
9806
+ popupManager.unregister(id);
9807
+ });
9808
+ return {
9809
+ /** 响应式 z-index */
9810
+ zIndex,
9811
+ /** 检查是否是最顶层 */
9812
+ isTop: () => popupManager.isTop(id),
9813
+ /** 关闭方法 */
9814
+ close,
9815
+ /** 获取当前栈长度 */
9816
+ getStackLength: () => popupManager.getStackLength()
9817
+ };
9818
+ }
9676
9819
  function useTreeSelection() {
9677
9820
  const tree = ref([]);
9678
9821
  const parentMap = /* @__PURE__ */ new Map();
@@ -10794,7 +10937,7 @@ const _sfc_main$$ = /* @__PURE__ */ defineComponent({
10794
10937
  };
10795
10938
  }
10796
10939
  });
10797
- const LewAlert = /* @__PURE__ */ _export_sfc(_sfc_main$$, [["__scopeId", "data-v-8a27d2f9"]]);
10940
+ const LewAlert = /* @__PURE__ */ _export_sfc(_sfc_main$$, [["__scopeId", "data-v-239398fa"]]);
10798
10941
  const drawerEmits = {
10799
10942
  close: () => true
10800
10943
  };
@@ -10941,9 +11084,14 @@ const drawerProps = {
10941
11084
  propName: "hideCloseButton"
10942
11085
  })
10943
11086
  },
11087
+ /**
11088
+ * z-index 层级
11089
+ * 默认值 2001 表示使用全局弹出层管理器自动分配层级(从 2001 开始递增)
11090
+ * 如果手动设置其他值,则使用用户指定的值(不推荐,可能导致层级冲突)
11091
+ */
10944
11092
  zIndex: {
10945
11093
  type: Number,
10946
- default: 1001,
11094
+ default: 2001,
10947
11095
  validator: validators.nonNegativeInteger({
10948
11096
  componentName: "LewDrawer",
10949
11097
  propName: "zIndex"
@@ -10970,37 +11118,26 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
10970
11118
  setup(__props, { emit: __emit }) {
10971
11119
  const props = __props;
10972
11120
  const emit = __emit;
10973
- const { Escape } = useMagicKeys();
10974
11121
  useDOMCreate("lew-drawer");
10975
11122
  const visible = useModel(__props, "visible");
10976
11123
  const drawerBodyRef = ref(null);
10977
11124
  const drawerId = `lew-drawer-${getUniqueId()}`;
10978
11125
  const slots = useSlots();
10979
- function checkIsTopDrawer() {
10980
- if (!visible.value) {
10981
- return false;
10982
- }
10983
- const drawerEl = document.getElementById(drawerId);
10984
- if (!drawerEl) {
10985
- return false;
10986
- }
10987
- const dialogEl = document.getElementById("lew-dialog");
10988
- const hasDialog = dialogEl && dialogEl.children.length > 0;
10989
- if (hasDialog) {
10990
- return false;
10991
- }
10992
- const drawerContainer = drawerEl?.parentElement;
10993
- if (!drawerContainer) {
10994
- return false;
11126
+ const { zIndex: managedZIndex, isTop } = usePopupManager({
11127
+ id: drawerId,
11128
+ type: "drawer",
11129
+ visible,
11130
+ closeByEsc: props.closeByEsc,
11131
+ onClose: () => emit("close")
11132
+ });
11133
+ const actualZIndex = computed(() => {
11134
+ if (props.zIndex !== 2001) {
11135
+ return props.zIndex;
10995
11136
  }
10996
- const openDrawers = Array.from(drawerContainer.childNodes).filter((e) => e instanceof Element).filter((e) => e.children.length > 0).filter((e) => {
10997
- const drawerBody = e.querySelector(".lew-drawer-body");
10998
- return drawerBody && drawerBody.classList.contains("lew-drawer-body-show");
10999
- });
11000
- return openDrawers.length > 0 && openDrawers[openDrawers.length - 1]?.id === drawerId;
11001
- }
11137
+ return managedZIndex.value || props.zIndex;
11138
+ });
11002
11139
  const drawerStyle = computed(() => {
11003
- const { position, width, height, zIndex } = props;
11140
+ const { position, width, height } = props;
11004
11141
  const styleParts = [];
11005
11142
  switch (position) {
11006
11143
  case "left":
@@ -11017,16 +11154,13 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
11017
11154
  styleParts.push("width:30%");
11018
11155
  styleParts.push("height:100%");
11019
11156
  }
11020
- styleParts.push(`z-index:${zIndex}`);
11157
+ styleParts.push(`z-index:${actualZIndex.value}`);
11021
11158
  return styleParts.join(";");
11022
11159
  });
11023
11160
  const drawerBodyClass = computed(() => {
11024
- return [
11025
- object2class("lew-drawer-body", {
11026
- position: props.position
11027
- }),
11028
- visible.value ? "lew-drawer-body-show" : ""
11029
- ].filter(Boolean).join(" ");
11161
+ return object2class("lew-drawer-body", {
11162
+ position: props.position
11163
+ });
11030
11164
  });
11031
11165
  function handleClose() {
11032
11166
  visible.value = false;
@@ -11036,7 +11170,7 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
11036
11170
  await nextTick();
11037
11171
  });
11038
11172
  onClickOutside(drawerBodyRef, (e) => {
11039
- if (visible.value && props.closeOnClickOverlay) {
11173
+ if (visible.value && props.closeOnClickOverlay && isTop()) {
11040
11174
  const target = e?.target;
11041
11175
  const parentElement = target?.parentElement;
11042
11176
  if (parentElement?.id === drawerId) {
@@ -11044,14 +11178,6 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
11044
11178
  }
11045
11179
  }
11046
11180
  });
11047
- if (props.closeByEsc) {
11048
- watch(Escape, (v) => {
11049
- if (!visible.value || !v || !checkIsTopDrawer()) {
11050
- return;
11051
- }
11052
- visible.value = false;
11053
- });
11054
- }
11055
11181
  return (_ctx, _cache) => {
11056
11182
  return openBlock(), createBlock(Teleport, { to: "#lew-drawer" }, [
11057
11183
  createElementVNode("div", {
@@ -11062,73 +11188,82 @@ const _sfc_main$Z = /* @__PURE__ */ defineComponent({
11062
11188
  default: withCtx(() => [
11063
11189
  visible.value ? (openBlock(), createElementBlock("div", {
11064
11190
  key: 0,
11065
- style: normalizeStyle({ zIndex: props.zIndex }),
11191
+ style: normalizeStyle({ zIndex: unref(actualZIndex) }),
11066
11192
  class: "lew-drawer-mask"
11067
11193
  }, null, 4)) : createCommentVNode("", true)
11068
11194
  ]),
11069
11195
  _: 1
11070
11196
  }),
11071
- createElementVNode("div", {
11072
- ref_key: "drawerBodyRef",
11073
- ref: drawerBodyRef,
11074
- style: normalizeStyle(unref(drawerStyle)),
11075
- class: normalizeClass(["lew-drawer-body", unref(drawerBodyClass)])
11076
- }, [
11077
- unref(slots).header ? (openBlock(), createElementBlock("div", _hoisted_1$L, [
11078
- renderSlot(_ctx.$slots, "header")
11079
- ])) : props.title ? (openBlock(), createBlock(unref(LewFlex), {
11080
- key: 1,
11081
- mode: "between",
11082
- y: "center",
11083
- class: "lew-drawer-header"
11084
- }, {
11085
- default: withCtx(() => [
11086
- createElementVNode("div", _hoisted_2$y, toDisplayString$1(props.title), 1),
11087
- createVNode(CloseButton, {
11088
- size: "large",
11089
- color: "gray",
11090
- round: "",
11091
- class: "lew-drawer-icon-close",
11092
- onClick: handleClose
11093
- })
11094
- ]),
11095
- _: 1
11096
- })) : createCommentVNode("", true),
11097
- createElementVNode("div", _hoisted_3$r, [
11098
- renderSlot(_ctx.$slots, "default")
11197
+ createVNode(Transition, {
11198
+ name: `lew-drawer-${props.position}`
11199
+ }, {
11200
+ default: withCtx(() => [
11201
+ visible.value ? (openBlock(), createElementBlock("div", {
11202
+ key: 0,
11203
+ ref_key: "drawerBodyRef",
11204
+ ref: drawerBodyRef,
11205
+ style: normalizeStyle(unref(drawerStyle)),
11206
+ class: normalizeClass(["lew-drawer-body", unref(drawerBodyClass)])
11207
+ }, [
11208
+ unref(slots).header ? (openBlock(), createElementBlock("div", _hoisted_1$L, [
11209
+ renderSlot(_ctx.$slots, "header", {}, void 0, true)
11210
+ ])) : props.title ? (openBlock(), createBlock(unref(LewFlex), {
11211
+ key: 1,
11212
+ mode: "between",
11213
+ y: "center",
11214
+ class: "lew-drawer-header"
11215
+ }, {
11216
+ default: withCtx(() => [
11217
+ createElementVNode("div", _hoisted_2$y, toDisplayString$1(props.title), 1),
11218
+ createVNode(CloseButton, {
11219
+ size: "large",
11220
+ color: "gray",
11221
+ round: "",
11222
+ class: "lew-drawer-icon-close",
11223
+ onClick: handleClose
11224
+ })
11225
+ ]),
11226
+ _: 1
11227
+ })) : createCommentVNode("", true),
11228
+ createElementVNode("div", _hoisted_3$r, [
11229
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
11230
+ ]),
11231
+ unref(slots).footer ? (openBlock(), createElementBlock("div", _hoisted_4$j, [
11232
+ renderSlot(_ctx.$slots, "footer", {}, void 0, true)
11233
+ ])) : !props.hideFooter ? (openBlock(), createBlock(unref(LewFlex), {
11234
+ key: 3,
11235
+ x: "end",
11236
+ y: "center",
11237
+ class: "lew-drawer-footer"
11238
+ }, {
11239
+ default: withCtx(() => [
11240
+ !props.hideCloseButton ? (openBlock(), createBlock(unref(LewButton), normalizeProps(mergeProps({ key: 0 }, {
11241
+ size: "small",
11242
+ text: unref(locale).t("drawer.closeText"),
11243
+ type: "light",
11244
+ color: "normal",
11245
+ request: handleClose,
11246
+ ...props.closeButtonProps
11247
+ })), null, 16)) : createCommentVNode("", true),
11248
+ !props.hideOkButton ? (openBlock(), createBlock(unref(LewButton), normalizeProps(mergeProps({ key: 1 }, {
11249
+ size: "small",
11250
+ text: unref(locale).t("drawer.okText"),
11251
+ color: "primary",
11252
+ ...props.okButtonProps
11253
+ })), null, 16)) : createCommentVNode("", true)
11254
+ ]),
11255
+ _: 1
11256
+ })) : createCommentVNode("", true)
11257
+ ], 6)) : createCommentVNode("", true)
11099
11258
  ]),
11100
- unref(slots).footer ? (openBlock(), createElementBlock("div", _hoisted_4$j, [
11101
- renderSlot(_ctx.$slots, "footer")
11102
- ])) : !props.hideFooter ? (openBlock(), createBlock(unref(LewFlex), {
11103
- key: 3,
11104
- x: "end",
11105
- y: "center",
11106
- class: "lew-drawer-footer"
11107
- }, {
11108
- default: withCtx(() => [
11109
- !props.hideCloseButton ? (openBlock(), createBlock(unref(LewButton), normalizeProps(mergeProps({ key: 0 }, {
11110
- size: "small",
11111
- text: unref(locale).t("drawer.closeText"),
11112
- type: "light",
11113
- color: "normal",
11114
- request: handleClose,
11115
- ...props.closeButtonProps
11116
- })), null, 16)) : createCommentVNode("", true),
11117
- !props.hideOkButton ? (openBlock(), createBlock(unref(LewButton), normalizeProps(mergeProps({ key: 1 }, {
11118
- size: "small",
11119
- text: unref(locale).t("drawer.okText"),
11120
- color: "primary",
11121
- ...props.okButtonProps
11122
- })), null, 16)) : createCommentVNode("", true)
11123
- ]),
11124
- _: 1
11125
- })) : createCommentVNode("", true)
11126
- ], 6)
11259
+ _: 3
11260
+ }, 8, ["name"])
11127
11261
  ])
11128
11262
  ]);
11129
11263
  };
11130
11264
  }
11131
11265
  });
11266
+ const LewDrawer = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["__scopeId", "data-v-951b4654"]]);
11132
11267
  const drawerModel = {
11133
11268
  visible: {
11134
11269
  type: Boolean,
@@ -11335,9 +11470,14 @@ const modalProps = {
11335
11470
  propName: "hideCloseButton"
11336
11471
  })
11337
11472
  },
11473
+ /**
11474
+ * z-index 层级
11475
+ * 默认值 2001 表示使用全局弹出层管理器自动分配层级(从 2001 开始递增)
11476
+ * 如果手动设置其他值,则使用用户指定的值(不推荐,可能导致层级冲突)
11477
+ */
11338
11478
  zIndex: {
11339
11479
  type: Number,
11340
- default: 1001,
11480
+ default: 2001,
11341
11481
  validator: validators.nonNegativeInteger({
11342
11482
  componentName: "LewModal",
11343
11483
  propName: "zIndex"
@@ -11363,35 +11503,24 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
11363
11503
  setup(__props, { emit: __emit }) {
11364
11504
  const props = __props;
11365
11505
  const emit = __emit;
11366
- const { Escape } = useMagicKeys();
11367
11506
  useDOMCreate("lew-modal");
11368
11507
  const visible = useModel(__props, "visible");
11369
11508
  const modalBodyRef = ref(null);
11370
11509
  const modalId = `lew-modal-${getUniqueId()}`;
11371
11510
  const slots = useSlots();
11372
- function checkIsTopModal() {
11373
- if (!visible.value) {
11374
- return false;
11375
- }
11376
- const modalEl = document.getElementById(modalId);
11377
- if (!modalEl) {
11378
- return false;
11379
- }
11380
- const dialogEl = document.getElementById("lew-dialog");
11381
- const hasDialog = dialogEl && dialogEl.children.length > 0;
11382
- if (hasDialog) {
11383
- return false;
11384
- }
11385
- const modalContainer = modalEl?.parentElement;
11386
- if (!modalContainer) {
11387
- return false;
11511
+ const { zIndex: managedZIndex, isTop } = usePopupManager({
11512
+ id: modalId,
11513
+ type: "modal",
11514
+ visible,
11515
+ closeByEsc: props.closeByEsc,
11516
+ onClose: () => emit("close")
11517
+ });
11518
+ const actualZIndex = computed(() => {
11519
+ if (props.zIndex !== 2001) {
11520
+ return props.zIndex;
11388
11521
  }
11389
- const openModals = Array.from(modalContainer.childNodes).filter((e) => e instanceof Element).filter((e) => e.children.length > 0).filter((e) => {
11390
- const modalBody = e.querySelector(".lew-modal");
11391
- return modalBody && modalBody.style.display !== "none";
11392
- });
11393
- return openModals.length > 0 && openModals[openModals.length - 1]?.id === modalId;
11394
- }
11522
+ return managedZIndex.value || props.zIndex;
11523
+ });
11395
11524
  const modalStyle = computed(() => {
11396
11525
  const { width, top: top2 } = props;
11397
11526
  return {
@@ -11410,21 +11539,13 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
11410
11539
  await nextTick();
11411
11540
  });
11412
11541
  onClickOutside(modalBodyRef, (e) => {
11413
- if (visible.value && props.closeOnClickOverlay) {
11542
+ if (visible.value && props.closeOnClickOverlay && isTop()) {
11414
11543
  const { parentElement } = e?.target;
11415
11544
  if (parentElement?.id === modalId) {
11416
11545
  visible.value = false;
11417
11546
  }
11418
11547
  }
11419
11548
  });
11420
- if (props.closeByEsc) {
11421
- watch(Escape, (v) => {
11422
- if (!visible.value || !v || !checkIsTopModal()) {
11423
- return;
11424
- }
11425
- visible.value = false;
11426
- });
11427
- }
11428
11549
  return (_ctx, _cache) => {
11429
11550
  return openBlock(), createBlock(Teleport, { to: "#lew-modal" }, [
11430
11551
  createElementVNode("div", {
@@ -11435,7 +11556,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
11435
11556
  default: withCtx(() => [
11436
11557
  visible.value ? (openBlock(), createElementBlock("div", {
11437
11558
  key: 0,
11438
- style: normalizeStyle({ zIndex: props.zIndex }),
11559
+ style: normalizeStyle({ zIndex: unref(actualZIndex) }),
11439
11560
  class: "lew-modal-mask"
11440
11561
  }, null, 4)) : createCommentVNode("", true)
11441
11562
  ]),
@@ -11445,7 +11566,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
11445
11566
  default: withCtx(() => [
11446
11567
  visible.value ? (openBlock(), createElementBlock("div", {
11447
11568
  key: 0,
11448
- style: normalizeStyle({ zIndex: props.zIndex }),
11569
+ style: normalizeStyle({ zIndex: unref(actualZIndex) }),
11449
11570
  class: "lew-modal"
11450
11571
  }, [
11451
11572
  createElementVNode("div", {
@@ -11518,7 +11639,7 @@ const _sfc_main$X = /* @__PURE__ */ defineComponent({
11518
11639
  };
11519
11640
  }
11520
11641
  });
11521
- const LewModal = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["__scopeId", "data-v-11d5b596"]]);
11642
+ const LewModal = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["__scopeId", "data-v-dea5a6a4"]]);
11522
11643
  const modalModel = {
11523
11644
  visible: {
11524
11645
  type: Boolean,
@@ -17830,7 +17951,7 @@ const _hoisted_2$r = { class: "lew-date-control-left" };
17830
17951
  const _hoisted_3$m = { class: "cur-date" };
17831
17952
  const _hoisted_4$g = { class: "lew-date-control-right" };
17832
17953
  const _hoisted_5$d = { class: "lew-date-box" };
17833
- const _hoisted_6$a = { class: "lew-date-num" };
17954
+ const _hoisted_6$9 = { class: "lew-date-num" };
17834
17955
  const _hoisted_7$7 = ["onClick"];
17835
17956
  const _hoisted_8$6 = {
17836
17957
  key: 0,
@@ -18021,7 +18142,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
18021
18142
  key: `h${index2}`,
18022
18143
  class: "lew-date-item lew-date-item-unselect"
18023
18144
  }, [
18024
- createElementVNode("div", _hoisted_6$a, toDisplayString$1(item), 1)
18145
+ createElementVNode("div", _hoisted_6$9, toDisplayString$1(item), 1)
18025
18146
  ]);
18026
18147
  }), 128)),
18027
18148
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(dateData), (item, index2) => {
@@ -18047,7 +18168,7 @@ const _hoisted_2$q = { class: "cur-time" };
18047
18168
  const _hoisted_3$l = { class: "lew-time-container" };
18048
18169
  const _hoisted_4$f = { class: "lew-time-column" };
18049
18170
  const _hoisted_5$c = ["data-value", "onClick"];
18050
- const _hoisted_6$9 = ["data-text"];
18171
+ const _hoisted_6$8 = ["data-text"];
18051
18172
  const _hoisted_7$6 = { class: "lew-time-column" };
18052
18173
  const _hoisted_8$5 = ["data-value", "onClick"];
18053
18174
  const _hoisted_9$5 = ["data-text"];
@@ -18371,7 +18492,7 @@ const _sfc_main$N = /* @__PURE__ */ defineComponent({
18371
18492
  createElementVNode("div", {
18372
18493
  class: "lew-time-value",
18373
18494
  "data-text": hour.label
18374
- }, toDisplayString$1(hour.label), 9, _hoisted_6$9)
18495
+ }, toDisplayString$1(hour.label), 9, _hoisted_6$8)
18375
18496
  ], 8, _hoisted_5$c);
18376
18497
  }), 128)),
18377
18498
  _cache[11] || (_cache[11] = createElementVNode("div", { class: "lew-time-padding" }, null, -1))
@@ -18464,7 +18585,7 @@ const _hoisted_2$p = { class: "lew-datetime-content" };
18464
18585
  const _hoisted_3$k = { class: "lew-datetime-panel lew-datetime-date-panel" };
18465
18586
  const _hoisted_4$e = { class: "lew-datetime-panel lew-datetime-time-panel" };
18466
18587
  const _hoisted_5$b = { class: "lew-datetime-actions" };
18467
- const _hoisted_6$8 = { class: "lew-datetime-actions-left" };
18588
+ const _hoisted_6$7 = { class: "lew-datetime-actions-left" };
18468
18589
  const _hoisted_7$5 = { class: "lew-datetime-actions-right" };
18469
18590
  const _sfc_main$M = /* @__PURE__ */ defineComponent({
18470
18591
  __name: "LewDateTime",
@@ -18558,7 +18679,7 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
18558
18679
  ])
18559
18680
  ]),
18560
18681
  createElementVNode("div", _hoisted_5$b, [
18561
- createElementVNode("div", _hoisted_6$8, [
18682
+ createElementVNode("div", _hoisted_6$7, [
18562
18683
  createVNode(unref(LewButton), {
18563
18684
  type: "light",
18564
18685
  color: "gray",
@@ -18607,7 +18728,7 @@ const _hoisted_2$o = { class: "lew-month-control-left" };
18607
18728
  const _hoisted_3$j = { class: "cur-year" };
18608
18729
  const _hoisted_4$d = { class: "lew-month-control-right" };
18609
18730
  const _hoisted_5$a = { class: "lew-month-list" };
18610
- const _hoisted_6$7 = ["onClick"];
18731
+ const _hoisted_6$6 = ["onClick"];
18611
18732
  const _hoisted_7$4 = { class: "lew-month-label" };
18612
18733
  const _hoisted_8$4 = {
18613
18734
  key: 0,
@@ -18739,7 +18860,7 @@ const _sfc_main$L = /* @__PURE__ */ defineComponent({
18739
18860
  unref(checkCurrentMonth)(month.value) ? (openBlock(), createElementBlock("i", _hoisted_8$4)) : createCommentVNode("", true),
18740
18861
  createElementVNode("div", _hoisted_9$4, toDisplayString$1(month.label), 1)
18741
18862
  ])
18742
- ], 10, _hoisted_6$7);
18863
+ ], 10, _hoisted_6$6);
18743
18864
  }), 128))
18744
18865
  ])
18745
18866
  ]);
@@ -18752,7 +18873,7 @@ const _hoisted_2$n = { class: "lew-quarter-control-left" };
18752
18873
  const _hoisted_3$i = { class: "cur-year" };
18753
18874
  const _hoisted_4$c = { class: "lew-quarter-control-right" };
18754
18875
  const _hoisted_5$9 = { class: "lew-quarter-list" };
18755
- const _hoisted_6$6 = ["onClick"];
18876
+ const _hoisted_6$5 = ["onClick"];
18756
18877
  const _hoisted_7$3 = { class: "lew-quarter-label" };
18757
18878
  const _hoisted_8$3 = {
18758
18879
  key: 0,
@@ -18880,7 +19001,7 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
18880
19001
  createElementVNode("div", _hoisted_11$2, toDisplayString$1(item.months), 1)
18881
19002
  ])
18882
19003
  ])
18883
- ], 10, _hoisted_6$6);
19004
+ ], 10, _hoisted_6$5);
18884
19005
  }), 128))
18885
19006
  ])
18886
19007
  ]);
@@ -18893,7 +19014,7 @@ const _hoisted_2$m = { class: "lew-year-control-left" };
18893
19014
  const _hoisted_3$h = { class: "cur-decade" };
18894
19015
  const _hoisted_4$b = { class: "lew-year-control-right" };
18895
19016
  const _hoisted_5$8 = { class: "lew-year-list" };
18896
- const _hoisted_6$5 = ["onClick"];
19017
+ const _hoisted_6$4 = ["onClick"];
18897
19018
  const _hoisted_7$2 = { class: "lew-year-label" };
18898
19019
  const _hoisted_8$2 = {
18899
19020
  key: 0,
@@ -19020,7 +19141,7 @@ const _sfc_main$J = /* @__PURE__ */ defineComponent({
19020
19141
  unref(checkCurrentYear)(year) ? (openBlock(), createElementBlock("i", _hoisted_8$2)) : createCommentVNode("", true),
19021
19142
  createElementVNode("div", _hoisted_9$2, toDisplayString$1(year), 1)
19022
19143
  ])
19023
- ], 10, _hoisted_6$5);
19144
+ ], 10, _hoisted_6$4);
19024
19145
  }), 128))
19025
19146
  ])
19026
19147
  ]);
@@ -19553,7 +19674,7 @@ const _hoisted_2$k = { class: "lew-date" };
19553
19674
  const _hoisted_3$f = { class: "lew-date-control-left" };
19554
19675
  const _hoisted_4$a = { class: "cur-date" };
19555
19676
  const _hoisted_5$7 = { class: "lew-date-control-right" };
19556
- const _hoisted_6$4 = { class: "lew-date-box" };
19677
+ const _hoisted_6$3 = { class: "lew-date-box" };
19557
19678
  const _hoisted_7$1 = { class: "lew-date-num" };
19558
19679
  const _hoisted_8$1 = ["onClick", "onMouseenter"];
19559
19680
  const _hoisted_9$1 = {
@@ -19898,7 +20019,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
19898
20019
  ]),
19899
20020
  _: 1
19900
20021
  }),
19901
- createElementVNode("div", _hoisted_6$4, [
20022
+ createElementVNode("div", _hoisted_6$3, [
19902
20023
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(headDate), (item, index2) => {
19903
20024
  return openBlock(), createElementBlock("div", {
19904
20025
  key: `h${index2}`,
@@ -20036,7 +20157,7 @@ const _hoisted_5$6 = {
20036
20157
  key: 2,
20037
20158
  class: "lew-date-range-picker-placeholder"
20038
20159
  };
20039
- const _hoisted_6$3 = {
20160
+ const _hoisted_6$2 = {
20040
20161
  key: 3,
20041
20162
  class: "lew-date-range-picker-dateValue lew-date-range-picker-end"
20042
20163
  };
@@ -20178,7 +20299,7 @@ const _sfc_main$F = /* @__PURE__ */ defineComponent({
20178
20299
  type: "minus"
20179
20300
  })
20180
20301
  ]),
20181
- !modelValue.value?.end ? (openBlock(), createElementBlock("div", _hoisted_5$6, toDisplayString$1(_ctx.placeholderEnd ? _ctx.placeholderEnd : unref(locale).t("dateRangePicker.placeholderEnd")), 1)) : (openBlock(), createElementBlock("div", _hoisted_6$3, toDisplayString$1(modelValue.value.end), 1)),
20302
+ !modelValue.value?.end ? (openBlock(), createElementBlock("div", _hoisted_5$6, toDisplayString$1(_ctx.placeholderEnd ? _ctx.placeholderEnd : unref(locale).t("dateRangePicker.placeholderEnd")), 1)) : (openBlock(), createElementBlock("div", _hoisted_6$2, toDisplayString$1(modelValue.value.end), 1)),
20182
20303
  createVNode(CommonIcon, {
20183
20304
  class: normalizeClass(["lew-date-range-picker-icon-calendar", {
20184
20305
  "lew-date-range-picker-icon-calendar-hide": unref(checkClear)
@@ -21846,29 +21967,30 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
21846
21967
  const formSchema = inject("formSchema", ref(null));
21847
21968
  const formData = inject("formData", ref({}));
21848
21969
  const asMap = {
21849
- input: LewInput,
21850
- textarea: LewTextarea,
21970
+ "input": LewInput,
21971
+ "textarea": LewTextarea,
21851
21972
  "input-tag": LewInputTag,
21852
21973
  "checkbox-group": LewCheckboxGroup,
21853
21974
  "radio-group": LewRadioGroup,
21854
- checkbox: LewCheckbox,
21855
- select: LewSelect,
21975
+ "checkbox": LewCheckbox,
21976
+ "select": LewSelect,
21856
21977
  "date-picker": LewDatePicker,
21857
21978
  "date-range-picker": LewDateRangePicker,
21858
- tabs: LewTabs,
21859
- cascader: LewCascader,
21860
- switch: LewSwitch,
21861
- button: LewButton,
21862
- upload: LewUpload,
21979
+ "tabs": LewTabs,
21980
+ "cascader": LewCascader,
21981
+ "switch": LewSwitch,
21982
+ "button": LewButton,
21983
+ "upload": LewUpload,
21863
21984
  "input-number": LewInputNumber,
21864
- slider: LewSlider,
21985
+ "slider": LewSlider,
21865
21986
  "slider-range": LewSliderRange,
21866
21987
  "color-picker": LewColorPicker,
21867
- rate: LewRate,
21988
+ "rate": LewRate,
21868
21989
  "tree-select": LewTreeSelect
21869
21990
  };
21870
21991
  const app = getCurrentInstance()?.appContext.app;
21871
- if (app && !app.directive("tooltip")) app.use(LewTooltip);
21992
+ if (app && !app.directive("tooltip"))
21993
+ app.use(LewTooltip);
21872
21994
  const getFormItemClassNames = computed(
21873
21995
  () => object2class("lew-form-item", {
21874
21996
  direction: props.direction,
@@ -22059,7 +22181,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
22059
22181
  };
22060
22182
  }
22061
22183
  });
22062
- const LewFormItem = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["__scopeId", "data-v-51ac2032"]]);
22184
+ const LewFormItem = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["__scopeId", "data-v-6cbd2f5c"]]);
22063
22185
  const _sfc_main$D = /* @__PURE__ */ defineComponent({
22064
22186
  __name: "LewForm",
22065
22187
  props: formProps,
@@ -22504,7 +22626,7 @@ const _hoisted_4$8 = {
22504
22626
  class: "lew-input-prefixes-select"
22505
22627
  };
22506
22628
  const _hoisted_5$5 = ["disabled", "placeholder", "type", "readonly", "maxlength"];
22507
- const _hoisted_6$2 = {
22629
+ const _hoisted_6$1 = {
22508
22630
  key: 0,
22509
22631
  class: "lew-input-auto-width"
22510
22632
  };
@@ -22809,7 +22931,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
22809
22931
  }, null, 44, _hoisted_5$5), [
22810
22932
  [vModelDynamic, modelValue.value]
22811
22933
  ]),
22812
- _ctx.autoWidth ? (openBlock(), createElementBlock("label", _hoisted_6$2, toDisplayString$1(modelValue.value), 1)) : createCommentVNode("", true),
22934
+ _ctx.autoWidth ? (openBlock(), createElementBlock("label", _hoisted_6$1, toDisplayString$1(modelValue.value), 1)) : createCommentVNode("", true),
22813
22935
  _ctx.autoWidth && _ctx.clearable ? (openBlock(), createElementBlock("label", _hoisted_7)) : createCommentVNode("", true),
22814
22936
  unref(showCloseIcon) || unref(showPasswordIcon) || unref(showCopyIcon) || modelValue.value && _ctx.showCount ? (openBlock(), createElementBlock("div", _hoisted_8, [
22815
22937
  modelValue.value && _ctx.showCount ? (openBlock(), createElementBlock("div", {
@@ -23842,7 +23964,8 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
23842
23964
  originalKeydownHandler = document.onkeydown;
23843
23965
  document.onkeydown = function(event) {
23844
23966
  const keyCode = event.key || event.code;
23845
- if (!isInputActive.value && selectedTagIndex.value < 0) return;
23967
+ if (!isInputActive.value && selectedTagIndex.value < 0)
23968
+ return;
23846
23969
  const tagsLength = (modelValue.value || []).length;
23847
23970
  if (selectedTagIndex.value >= 0) {
23848
23971
  handleSelectedTagKeydown(event, keyCode, tagsLength);
@@ -23912,7 +24035,8 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
23912
24035
  }
23913
24036
  }
23914
24037
  function startEditingSelectedTag() {
23915
- if (selectedTagIndex.value < 0 || props.readonly || props.disabled) return;
24038
+ if (selectedTagIndex.value < 0 || props.readonly || props.disabled)
24039
+ return;
23916
24040
  const index2 = selectedTagIndex.value;
23917
24041
  editingIndex.value = index2;
23918
24042
  selectedTagIndex.value = -1;
@@ -23924,7 +24048,8 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
23924
24048
  });
23925
24049
  }
23926
24050
  function deleteSelectedTag() {
23927
- if (selectedTagIndex.value < 0) return;
24051
+ if (selectedTagIndex.value < 0)
24052
+ return;
23928
24053
  const index2 = selectedTagIndex.value;
23929
24054
  const tagsLength = (modelValue.value || []).length;
23930
24055
  delTag(index2);
@@ -23943,8 +24068,10 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
23943
24068
  }
23944
24069
  }
23945
24070
  function openInput() {
23946
- if (editingIndex.value >= 0) return;
23947
- if (isInputActive.value || props.disabled || props.readonly) return;
24071
+ if (editingIndex.value >= 0)
24072
+ return;
24073
+ if (isInputActive.value || props.disabled || props.readonly)
24074
+ return;
23948
24075
  if (props.maxLength > 0 && Array.isArray(modelValue.value) && modelValue.value.length >= props.maxLength) {
23949
24076
  LewMessage.warning(
23950
24077
  locale.t("inputTag.maxLength", { maxLength: props.maxLength })
@@ -23960,13 +24087,15 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
23960
24087
  attachKeydownListener();
23961
24088
  }
23962
24089
  function tryAddTag() {
23963
- if (!inputValue.value || inputValue.value.trim() === "") return false;
24090
+ if (!inputValue.value || inputValue.value.trim() === "")
24091
+ return false;
23964
24092
  addTag();
23965
24093
  return true;
23966
24094
  }
23967
24095
  function addTag() {
23968
24096
  const _value = Array.isArray(modelValue.value) ? [...modelValue.value] : [];
23969
- if (!inputValue.value || inputValue.value.trim() === "") return;
24097
+ if (!inputValue.value || inputValue.value.trim() === "")
24098
+ return;
23970
24099
  if (props.maxLength > 0 && _value.length >= props.maxLength) {
23971
24100
  inputValue.value = "";
23972
24101
  isInputActive.value = false;
@@ -24000,7 +24129,8 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
24000
24129
  emit("remove", removedTag, index2);
24001
24130
  }
24002
24131
  function handleTagChange(index2, newValue) {
24003
- if (!Array.isArray(modelValue.value)) return;
24132
+ if (!Array.isArray(modelValue.value))
24133
+ return;
24004
24134
  const trimmedValue = newValue.trim();
24005
24135
  if (!trimmedValue) {
24006
24136
  delTag(index2);
@@ -24037,7 +24167,8 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
24037
24167
  }, 150);
24038
24168
  }
24039
24169
  function onFocus() {
24040
- if (props.disabled || props.readonly) return;
24170
+ if (props.disabled || props.readonly)
24171
+ return;
24041
24172
  isInputActive.value = true;
24042
24173
  selectedTagIndex.value = -1;
24043
24174
  attachKeydownListener();
@@ -24140,7 +24271,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
24140
24271
  };
24141
24272
  }
24142
24273
  });
24143
- const LewInputTag = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-551b32c0"]]);
24274
+ const LewInputTag = /* @__PURE__ */ _export_sfc(_sfc_main$y, [["__scopeId", "data-v-6b3f0bcf"]]);
24144
24275
  const radioEmits = {
24145
24276
  change: () => true
24146
24277
  };
@@ -24792,7 +24923,7 @@ const _hoisted_2$f = {
24792
24923
  const _hoisted_3$c = ["onClick"];
24793
24924
  const _hoisted_4$7 = ["title"];
24794
24925
  const _hoisted_5$4 = ["onClick"];
24795
- const _hoisted_6$1 = ["title"];
24926
+ const _hoisted_6 = ["title"];
24796
24927
  const SELECT_WIDTH_TOLERANCE = 40;
24797
24928
  const VIRTUAL_LIST_THRESHOLD = 30;
24798
24929
  const _sfc_main$u = /* @__PURE__ */ defineComponent({
@@ -25356,7 +25487,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
25356
25487
  createElementVNode("div", {
25357
25488
  class: normalizeClass(["lew-select-label", { "is-group": item.isGroup }]),
25358
25489
  title: unref(getOptionText)(item)
25359
- }, toDisplayString$1(unref(getOptionText)(item)), 11, _hoisted_6$1),
25490
+ }, toDisplayString$1(unref(getOptionText)(item)), 11, _hoisted_6),
25360
25491
  unref(shouldShowCheckIcon)(item.value) ? (openBlock(), createBlock(CommonIcon, {
25361
25492
  key: 1,
25362
25493
  class: "lew-icon-check",
@@ -30244,8 +30375,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
30244
30375
  () => parseDimension(props.dropdownThreshold || 0)
30245
30376
  );
30246
30377
  const visibleOptions = computed(() => {
30247
- if (!props.options)
30248
- return [];
30378
+ if (!props.options) return [];
30249
30379
  if (threshold.value <= 0) {
30250
30380
  return props.options;
30251
30381
  }
@@ -30287,11 +30417,11 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
30287
30417
  unref(isValidComponent)(option.customRender) ? (openBlock(), createBlock(_sfc_main$18, {
30288
30418
  key: 0,
30289
30419
  "render-fn": option.customRender,
30290
- onClick: (event) => handleOptionClick(option, event)
30420
+ onClick: withModifiers((event) => handleOptionClick(option, event), ["stop"])
30291
30421
  }, null, 8, ["render-fn", "onClick"])) : (openBlock(), createElementBlock("div", {
30292
30422
  key: 1,
30293
30423
  class: "lew-action-box-item",
30294
- onClick: (event) => handleOptionClick(option, event)
30424
+ onClick: withModifiers((event) => handleOptionClick(option, event), ["stop"])
30295
30425
  }, [
30296
30426
  option.icon && !props.iconOnly ? (openBlock(), createBlock(_sfc_main$18, {
30297
30427
  key: 0,
@@ -30312,7 +30442,9 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
30312
30442
  }), 128)),
30313
30443
  unref(dropdownOptions).length > 0 ? (openBlock(), createBlock(unref(_sfc_main$7), {
30314
30444
  key: 0,
30315
- options: unref(dropdownOptions)
30445
+ options: unref(dropdownOptions),
30446
+ onClick: _cache[0] || (_cache[0] = withModifiers(() => {
30447
+ }, ["stop"]))
30316
30448
  }, {
30317
30449
  default: withCtx(() => [
30318
30450
  createElementVNode("div", _hoisted_3$6, [
@@ -30335,7 +30467,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
30335
30467
  };
30336
30468
  }
30337
30469
  });
30338
- const LewActionBox = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-81ae1218"]]);
30470
+ const LewActionBox = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-95e9bab2"]]);
30339
30471
  const backTopEmits = {};
30340
30472
  const backTopProps = {
30341
30473
  right: {
@@ -31735,7 +31867,7 @@ const components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
31735
31867
  LewDateRangePicker,
31736
31868
  LewDesc,
31737
31869
  LewDescItem,
31738
- LewDrawer: _sfc_main$Z,
31870
+ LewDrawer,
31739
31871
  LewDropdown: _sfc_main$7,
31740
31872
  LewEmpty,
31741
31873
  LewExpand,
@@ -32165,17 +32297,13 @@ const dialogProps = {
32165
32297
  }
32166
32298
  };
32167
32299
  const _hoisted_1$1 = {
32168
- key: 0,
32169
- class: "lew-dialog-mask"
32170
- };
32171
- const _hoisted_2$1 = {
32172
32300
  key: 0,
32173
32301
  class: "lew-dialog-box-left"
32174
32302
  };
32175
- const _hoisted_3$1 = { class: "lew-dialog-box-right" };
32176
- const _hoisted_4$1 = { class: "lew-dialog-box-right-header" };
32177
- const _hoisted_5$1 = { class: "lew-dialog-box-right-main" };
32178
- const _hoisted_6 = { class: "lew-dialog-box-footer" };
32303
+ const _hoisted_2$1 = { class: "lew-dialog-box-right" };
32304
+ const _hoisted_3$1 = { class: "lew-dialog-box-right-header" };
32305
+ const _hoisted_4$1 = { class: "lew-dialog-box-right-main" };
32306
+ const _hoisted_5$1 = { class: "lew-dialog-box-footer" };
32179
32307
  const _sfc_main$2 = /* @__PURE__ */ defineComponent({
32180
32308
  __name: "LewDialog",
32181
32309
  props: dialogProps,
@@ -32185,12 +32313,21 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
32185
32313
  const emit = __emit;
32186
32314
  const { Escape } = useMagicKeys();
32187
32315
  useDOMCreate("lew-dialog");
32316
+ const dialogId = `lew-dialog-${getUniqueId()}`;
32188
32317
  const visible = ref(false);
32189
32318
  const okLoading = ref(false);
32190
32319
  const cancelLoading = ref(false);
32191
32320
  const okRef = ref();
32321
+ const { zIndex: managedZIndex, isTop } = usePopupManager({
32322
+ id: dialogId,
32323
+ type: "modal",
32324
+ // Dialog 本质上是一种 Modal
32325
+ visible,
32326
+ closeByEsc: props.closeByEsc,
32327
+ onClose: () => emit("close")
32328
+ });
32192
32329
  function maskClick() {
32193
- if (props.closeOnClickOverlay) {
32330
+ if (props.closeOnClickOverlay && isTop()) {
32194
32331
  visible.value = false;
32195
32332
  }
32196
32333
  }
@@ -32222,7 +32359,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
32222
32359
  const cancel = () => handleAction("cancel");
32223
32360
  if (props.closeByEsc) {
32224
32361
  watch(Escape, (v) => {
32225
- if (v && visible.value) {
32362
+ if (v && visible.value && isTop()) {
32226
32363
  visible.value = false;
32227
32364
  }
32228
32365
  });
@@ -32230,6 +32367,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
32230
32367
  return (_ctx, _cache) => {
32231
32368
  return openBlock(), createBlock(Teleport, { to: "#lew-dialog" }, [
32232
32369
  createElementVNode("div", {
32370
+ id: dialogId,
32233
32371
  class: "lew-dialog-container",
32234
32372
  style: normalizeStyle({
32235
32373
  "--lew-dialog-transform-origin": _ctx.transformOrigin
@@ -32237,7 +32375,11 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
32237
32375
  }, [
32238
32376
  createVNode(Transition, { name: "lew-dialog-mask" }, {
32239
32377
  default: withCtx(() => [
32240
- unref(visible) ? (openBlock(), createElementBlock("div", _hoisted_1$1)) : createCommentVNode("", true)
32378
+ unref(visible) ? (openBlock(), createElementBlock("div", {
32379
+ key: 0,
32380
+ class: "lew-dialog-mask",
32381
+ style: normalizeStyle({ zIndex: unref(managedZIndex) })
32382
+ }, null, 4)) : createCommentVNode("", true)
32241
32383
  ]),
32242
32384
  _: 1
32243
32385
  }),
@@ -32246,6 +32388,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
32246
32388
  unref(visible) ? (openBlock(), createElementBlock("div", {
32247
32389
  key: 0,
32248
32390
  class: "lew-dialog",
32391
+ style: normalizeStyle({ zIndex: unref(managedZIndex) }),
32249
32392
  onClick: maskClick
32250
32393
  }, [
32251
32394
  createVNode(unref(LewFlex), {
@@ -32258,7 +32401,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
32258
32401
  default: withCtx(() => [
32259
32402
  createVNode(unref(LewFlex), { y: "start" }, {
32260
32403
  default: withCtx(() => [
32261
- !_ctx.hideIcon ? (openBlock(), createElementBlock("div", _hoisted_2$1, [
32404
+ !_ctx.hideIcon ? (openBlock(), createElementBlock("div", _hoisted_1$1, [
32262
32405
  !_ctx.icon ? (openBlock(), createBlock(CommonIcon, {
32263
32406
  key: 0,
32264
32407
  type: _ctx.type,
@@ -32268,18 +32411,18 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
32268
32411
  "render-fn": _ctx.icon
32269
32412
  }, null, 8, ["render-fn"]))
32270
32413
  ])) : createCommentVNode("", true),
32271
- createElementVNode("div", _hoisted_3$1, [
32272
- createElementVNode("div", _hoisted_4$1, [
32414
+ createElementVNode("div", _hoisted_2$1, [
32415
+ createElementVNode("div", _hoisted_3$1, [
32273
32416
  createVNode(_sfc_main$18, { "render-fn": _ctx.title }, null, 8, ["render-fn"])
32274
32417
  ]),
32275
- createElementVNode("div", _hoisted_5$1, [
32418
+ createElementVNode("div", _hoisted_4$1, [
32276
32419
  createVNode(_sfc_main$18, { "render-fn": _ctx.content }, null, 8, ["render-fn"])
32277
32420
  ])
32278
32421
  ])
32279
32422
  ]),
32280
32423
  _: 1
32281
32424
  }),
32282
- createElementVNode("div", _hoisted_6, [
32425
+ createElementVNode("div", _hoisted_5$1, [
32283
32426
  createVNode(unref(LewButton), {
32284
32427
  text: _ctx.cancelText || unref(locale).t("dialog.cancelText"),
32285
32428
  color: "gray",
@@ -32302,7 +32445,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
32302
32445
  ]),
32303
32446
  _: 1
32304
32447
  })
32305
- ])) : createCommentVNode("", true)
32448
+ ], 4)) : createCommentVNode("", true)
32306
32449
  ]),
32307
32450
  _: 1
32308
32451
  })
@@ -32311,7 +32454,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
32311
32454
  };
32312
32455
  }
32313
32456
  });
32314
- const _LewDialog = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-796fe870"]]);
32457
+ const _LewDialog = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-6b2f4835"]]);
32315
32458
  const { x, y } = useMouse();
32316
32459
  function createDialog(type) {
32317
32460
  return (options) => dialog(type, options);
@@ -32642,7 +32785,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
32642
32785
  timers.delete(id);
32643
32786
  }
32644
32787
  const index2 = notifications.value.findIndex((item) => item.id === id);
32645
- if (index2 === -1) return;
32788
+ if (index2 === -1)
32789
+ return;
32646
32790
  notifications.value.splice(index2, 1);
32647
32791
  updateContainerWidth();
32648
32792
  if (notifications.value.length === 0) {
@@ -39413,7 +39557,7 @@ export {
39413
39557
  LewDesc,
39414
39558
  LewDescItem,
39415
39559
  LewDialog,
39416
- _sfc_main$Z as LewDrawer,
39560
+ LewDrawer,
39417
39561
  _sfc_main$7 as LewDropdown,
39418
39562
  LewEmpty,
39419
39563
  LewExpand,