@sdata/web-vue 3.0.1 → 3.0.2

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,4 +1,4 @@
1
- import "../style/theme/z-index.js";
1
+ import { MESSAGE_STACK_BASE_Z_INDEX } from "../style/theme/z-index.js";
2
2
  import { onBeforeUnmount, onMounted, readonly, ref, watch } from "vue";
3
3
  //#region components/_hooks/use-popup-manager.ts
4
4
  var PopupManager = class {
@@ -9,17 +9,18 @@ var PopupManager = class {
9
9
  message: /* @__PURE__ */ new Set()
10
10
  };
11
11
  this.getNextZIndex = (type) => {
12
- return (type === "message" ? Array.from(this.popupStack.message).pop() || 1002 : Array.from(this.popupStack.popup).pop() || 1e3) + 1;
12
+ const popupZIndex = Array.from(this.popupStack.popup).pop() || 1e3;
13
+ return (type === "message" ? Math.max(popupZIndex, MESSAGE_STACK_BASE_Z_INDEX) : popupZIndex) + 1;
13
14
  };
14
15
  this.add = (type) => {
15
16
  const zIndex = this.getNextZIndex(type);
16
17
  this.popupStack[type].add(zIndex);
17
- if (type === "dialog") this.popupStack.popup.add(zIndex);
18
+ if (type !== "popup") this.popupStack.popup.add(zIndex);
18
19
  return zIndex;
19
20
  };
20
21
  this.delete = (zIndex, type) => {
21
22
  this.popupStack[type].delete(zIndex);
22
- if (type === "dialog") this.popupStack.popup.delete(zIndex);
23
+ if (type !== "popup") this.popupStack.popup.delete(zIndex);
23
24
  };
24
25
  this.isLastDialog = (zIndex) => {
25
26
  if (this.popupStack.dialog.size > 1) return zIndex === Array.from(this.popupStack.dialog).pop();
@@ -366,6 +366,14 @@ var trigger_default = /* @__PURE__ */ defineComponent({
366
366
  documentContainer: true
367
367
  });
368
368
  const { zIndex } = usePopupManager("popup", { visible: computedVisible });
369
+ const syncThemePopupContainerZIndex = () => {
370
+ if (computedVisible.value && zIndex.value > 0 && (themePopupContainer === null || themePopupContainer === void 0 ? void 0 : themePopupContainer.value) && mergedPopupContainer.value === themePopupContainer.value) themePopupContainer.value.style.zIndex = String(zIndex.value);
371
+ };
372
+ watch([
373
+ computedVisible,
374
+ zIndex,
375
+ mergedPopupContainer
376
+ ], syncThemePopupContainerZIndex, { immediate: true });
369
377
  let delayTimer = 0;
370
378
  let outsideListener = false;
371
379
  let windowListener = false;
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "framework": "vue",
4
4
  "name": "@sdata/web-vue",
5
- "version": "3.0.0",
5
+ "version": "3.0.1",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "types-syntax": "typescript",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdata/web-vue",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "SD Design Vue: A Vue.js 3 UI Library",
5
5
  "keywords": [
6
6
  "sd",