prlg-ui 1.8.46 → 1.8.48

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,14 +1,14 @@
1
1
  import { inject as i, ref as s, defineComponent as u, computed as c, createBlock as f, createCommentVNode as y, openBlock as p, Teleport as g, createElementVNode as h, normalizeStyle as m, renderSlot as E } from "vue";
2
2
  function O() {
3
- let n = null, t = null;
3
+ let n = null, e = null;
4
4
  return { lockScroll: () => {
5
5
  if (typeof window > "u") return;
6
- const e = document.body, d = window.innerWidth - e.clientWidth;
7
- n === null && (n = e.style.overflow, t = e.style.paddingRight), e.style.overflow = "hidden", e.style.paddingRight = `${d}px`;
6
+ const t = document.body, d = window.innerWidth - t.clientWidth;
7
+ n === null && (n = t.style.overflow, e = t.style.paddingRight), t.style.overflow = "hidden", t.style.paddingRight = `${d}px`;
8
8
  }, unlockScroll: () => {
9
- if (!(typeof window > "u") && n !== null && t !== null) {
10
- const e = document.body;
11
- e.style.overflow = "auto", e.style.paddingRight = "0", n = null, t = null;
9
+ if (!(typeof window > "u") && n !== null && e !== null) {
10
+ const t = document.body;
11
+ t.style.overflow = n, t.style.paddingRight = e, n = null, e = null;
12
12
  }
13
13
  } };
14
14
  }
@@ -41,20 +41,20 @@ const S = ["data-layer"], b = /* @__PURE__ */ u({
41
41
  show: { type: Boolean, default: !0 }
42
42
  },
43
43
  setup(n) {
44
- const t = n, { getNextLayer: l } = I(), o = c(() => t.zIndex ? t.zIndex : t.layer && t.layer !== "BASE" ? a[t.layer] : l());
45
- return (e, d) => e.show ? (p(), f(g, {
44
+ const e = n, { getNextLayer: l } = I(), o = c(() => e.zIndex ? e.zIndex : e.layer && e.layer !== "BASE" ? a[e.layer] : l());
45
+ return (t, d) => t.show ? (p(), f(g, {
46
46
  key: 0,
47
- to: e.target,
48
- disabled: !e.teleport
47
+ to: t.target,
48
+ disabled: !t.teleport
49
49
  }, [
50
50
  h("div", {
51
51
  style: m({
52
52
  zIndex: o.value,
53
53
  position: "relative"
54
54
  }),
55
- "data-layer": e.layer
55
+ "data-layer": t.layer
56
56
  }, [
57
- E(e.$slots, "default")
57
+ E(t.$slots, "default")
58
58
  ], 12, S)
59
59
  ], 8, ["to", "disabled"])) : y("", !0);
60
60
  }
@@ -62,20 +62,20 @@ const S = ["data-layer"], b = /* @__PURE__ */ u({
62
62
  function N() {
63
63
  const n = /* @__PURE__ */ new Map();
64
64
  return {
65
- on(t, l) {
66
- const o = n.get(t) || [];
67
- o.push(l), n.set(t, o);
65
+ on(e, l) {
66
+ const o = n.get(e) || [];
67
+ o.push(l), n.set(e, o);
68
68
  },
69
- off(t, l) {
70
- const o = n.get(t);
69
+ off(e, l) {
70
+ const o = n.get(e);
71
71
  o && n.set(
72
- t,
73
- o.filter((e) => e !== l)
72
+ e,
73
+ o.filter((t) => t !== l)
74
74
  );
75
75
  },
76
- emit(t, l) {
77
- const o = n.get(t);
78
- o && o.forEach((e) => e(l));
76
+ emit(e, l) {
77
+ const o = n.get(e);
78
+ o && o.forEach((t) => t(l));
79
79
  },
80
80
  clear() {
81
81
  n.clear();
@@ -0,0 +1 @@
1
+ "use strict";const l=require("vue");function i(){let n=null,e=null;return{lockScroll:()=>{if(typeof window>"u")return;const t=document.body,a=window.innerWidth-t.clientWidth;n===null&&(n=t.style.overflow,e=t.style.paddingRight),t.style.overflow="hidden",t.style.paddingRight=`${a}px`},unlockScroll:()=>{if(!(typeof window>"u")&&n!==null&&e!==null){const t=document.body;t.style.overflow=n,t.style.paddingRight=e,n=null,e=null}}}}const s={BASE:1e3,DROPDOWN:1010,STICKY:1020,DRAWER:1030,TOOLTIP:1040,POPOVER:1050,MODAL:1060,NOTIFICATION:1070,DEBUG:9999},u=Symbol("z-index-context");let d=s.BASE;function c(){const n=l.inject(u,null);return n||{currentLayer:l.ref(d),getNextLayer:()=>(d+=10,d)}}const f=["data-layer"],y=l.defineComponent({__name:"Portal",props:{layer:{default:"BASE"},teleport:{type:Boolean,default:!0},target:{default:"body"},zIndex:{},show:{type:Boolean,default:!0}},setup(n){const e=n,{getNextLayer:r}=c(),o=l.computed(()=>e.zIndex?e.zIndex:e.layer&&e.layer!=="BASE"?s[e.layer]:r());return(t,a)=>t.show?(l.openBlock(),l.createBlock(l.Teleport,{key:0,to:t.target,disabled:!t.teleport},[l.createElementVNode("div",{style:l.normalizeStyle({zIndex:o.value,position:"relative"}),"data-layer":t.layer},[l.renderSlot(t.$slots,"default")],12,f)],8,["to","disabled"])):l.createCommentVNode("",!0)}});function p(){const n=new Map;return{on(e,r){const o=n.get(e)||[];o.push(r),n.set(e,o)},off(e,r){const o=n.get(e);o&&n.set(e,o.filter(t=>t!==r))},emit(e,r){const o=n.get(e);o&&o.forEach(t=>t(r))},clear(){n.clear()}}}exports.EventBus=p;exports._sfc_main=y;exports.useBodyScroll=i;