@aplus-frontend/ui 0.4.20 → 0.4.21
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,51 +1,56 @@
|
|
|
1
|
-
import { ref as h, onMounted as
|
|
1
|
+
import { ref as h, onMounted as g, nextTick as x, onActivated as y, onDeactivated as D } from "vue";
|
|
2
2
|
import "../../index.mjs";
|
|
3
|
-
import { useGlobalConfig as
|
|
4
|
-
function
|
|
3
|
+
import { useGlobalConfig as E } from "../../config-provider/hooks/use-global-config.mjs";
|
|
4
|
+
function f(e) {
|
|
5
5
|
return document.querySelector(e);
|
|
6
6
|
}
|
|
7
|
-
function
|
|
8
|
-
const l =
|
|
7
|
+
function L(e = ".demo") {
|
|
8
|
+
const l = f(e);
|
|
9
9
|
return l == null ? void 0 : l.scrollTop;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
const s =
|
|
11
|
+
function q(e, l = ".demo") {
|
|
12
|
+
const s = f(l);
|
|
13
13
|
s && (s.scrollTop = e);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
const l =
|
|
15
|
+
function k(e) {
|
|
16
|
+
const l = E("scrollYDomName");
|
|
17
17
|
let s = !0;
|
|
18
|
-
const d = h(0),
|
|
19
|
-
let
|
|
20
|
-
const
|
|
18
|
+
const d = h(0), m = h(0), R = (["reset", "submit", void 0].includes(e == null ? void 0 : e.refreshType) ? e == null ? void 0 : e.refreshType : "submit") ?? "submit", T = (e == null ? void 0 : e.refreshBefore) ?? (() => !0);
|
|
19
|
+
let n = !0;
|
|
20
|
+
const b = (c) => {
|
|
21
21
|
if (s === !1) return;
|
|
22
22
|
const r = c.target;
|
|
23
|
-
|
|
23
|
+
m.value = r.scrollTop;
|
|
24
24
|
};
|
|
25
|
-
return
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
});
|
|
29
|
-
}), x(() => {
|
|
30
|
-
setTimeout(() => {
|
|
31
|
-
const r = v(l.value);
|
|
32
|
-
r && r.addEventListener("scroll", n);
|
|
25
|
+
return g(() => {
|
|
26
|
+
x(() => {
|
|
27
|
+
n = !1;
|
|
33
28
|
});
|
|
29
|
+
}), y(() => {
|
|
34
30
|
const c = T == null ? void 0 : T();
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
if (n) {
|
|
32
|
+
setTimeout(() => {
|
|
33
|
+
const r = f(l.value);
|
|
34
|
+
r && r.addEventListener("scroll", b);
|
|
35
|
+
});
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
c && setTimeout(() => {
|
|
39
|
+
var a, u, t, S, o, v, Y;
|
|
40
|
+
s = !0, (u = (a = e == null ? void 0 : e.apTableRef) == null ? void 0 : a.value) == null || u[R](), (Y = (v = (o = (S = (t = e == null ? void 0 : e.apTableRef) == null ? void 0 : t.value) == null ? void 0 : S.scrollBar) == null ? void 0 : o.x) == null ? void 0 : v.scroll) == null || Y.call(v, d.value), q(m.value, l.value);
|
|
41
|
+
const r = f(l.value);
|
|
42
|
+
r && r.addEventListener("scroll", b);
|
|
38
43
|
});
|
|
39
|
-
}),
|
|
44
|
+
}), D(() => {
|
|
40
45
|
var r, a, u, t;
|
|
41
|
-
s = !1, d.value = ((t = (u = (a = (r = e == null ? void 0 : e.apTableRef) == null ? void 0 : r.value) == null ? void 0 : a.scrollBar) == null ? void 0 : u.x) == null ? void 0 : t.currentScroll) ?? 0,
|
|
42
|
-
const c =
|
|
43
|
-
c && c.removeEventListener("scroll",
|
|
46
|
+
s = !1, d.value = ((t = (u = (a = (r = e == null ? void 0 : e.apTableRef) == null ? void 0 : r.value) == null ? void 0 : a.scrollBar) == null ? void 0 : u.x) == null ? void 0 : t.currentScroll) ?? 0, m.value = L(l.value) ?? 0;
|
|
47
|
+
const c = f(l.value);
|
|
48
|
+
c && c.removeEventListener("scroll", b);
|
|
44
49
|
}), {
|
|
45
50
|
tableScrollX: d,
|
|
46
|
-
tableScrollY:
|
|
51
|
+
tableScrollY: m
|
|
47
52
|
};
|
|
48
53
|
}
|
|
49
54
|
export {
|
|
50
|
-
|
|
55
|
+
k as useTableRefresh
|
|
51
56
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("vue");require("../../index.js");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("vue");require("../../index.js");const R=require("../../config-provider/hooks/use-global-config.js");function v(e){return document.querySelector(e)}function Y(e=".demo"){const l=v(e);return l==null?void 0:l.scrollTop}function q(e,l=".demo"){const s=v(l);s&&(s.scrollTop=e)}function D(e){const l=R.useGlobalConfig("scrollYDomName");let s=!0;const n=c.ref(0),d=c.ref(0),y=(["reset","submit",void 0].includes(e==null?void 0:e.refreshType)?e==null?void 0:e.refreshType:"submit")??"submit",b=(e==null?void 0:e.refreshBefore)??(()=>!0);let S=!0;const T=u=>{if(s===!1)return;const r=u.target;d.value=r.scrollTop};return c.onMounted(()=>{c.nextTick(()=>{S=!1})}),c.onActivated(()=>{const u=b==null?void 0:b();if(S){setTimeout(()=>{const r=v(l.value);r&&r.addEventListener("scroll",T)});return}u&&setTimeout(()=>{var a,t,f,o,g,m,h;s=!0,(t=(a=e==null?void 0:e.apTableRef)==null?void 0:a.value)==null||t[y](),(h=(m=(g=(o=(f=e==null?void 0:e.apTableRef)==null?void 0:f.value)==null?void 0:o.scrollBar)==null?void 0:g.x)==null?void 0:m.scroll)==null||h.call(m,n.value),q(d.value,l.value);const r=v(l.value);r&&r.addEventListener("scroll",T)})}),c.onDeactivated(()=>{var r,a,t,f;s=!1,n.value=((f=(t=(a=(r=e==null?void 0:e.apTableRef)==null?void 0:r.value)==null?void 0:a.scrollBar)==null?void 0:t.x)==null?void 0:f.currentScroll)??0,d.value=Y(l.value)??0;const u=v(l.value);u&&u.removeEventListener("scroll",T)}),{tableScrollX:n,tableScrollY:d}}exports.useTableRefresh=D;
|