@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 R, nextTick as g, onActivated as x, onDeactivated as y } from "vue";
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 D } from "../../config-provider/hooks/use-global-config.mjs";
4
- function v(e) {
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 q(e = ".demo") {
8
- const l = v(e);
7
+ function L(e = ".demo") {
8
+ const l = f(e);
9
9
  return l == null ? void 0 : l.scrollTop;
10
10
  }
11
- function A(e, l = ".demo") {
12
- const s = v(l);
11
+ function q(e, l = ".demo") {
12
+ const s = f(l);
13
13
  s && (s.scrollTop = e);
14
14
  }
15
- function N(e) {
16
- const l = D("scrollYDomName");
15
+ function k(e) {
16
+ const l = E("scrollYDomName");
17
17
  let s = !0;
18
- const d = h(0), f = h(0), o = (["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 b = !0;
20
- const n = (c) => {
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
- f.value = r.scrollTop;
23
+ m.value = r.scrollTop;
24
24
  };
25
- return R(() => {
26
- g(() => {
27
- b = !1;
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
- b || c && setTimeout(() => {
36
- var r, a, u, t, S, m, Y;
37
- s = !0, (a = (r = e == null ? void 0 : e.apTableRef) == null ? void 0 : r.value) == null || a[o](), (Y = (m = (S = (t = (u = e == null ? void 0 : e.apTableRef) == null ? void 0 : u.value) == null ? void 0 : t.scrollBar) == null ? void 0 : S.x) == null ? void 0 : m.scroll) == null || Y.call(m, d.value), A(f.value, l.value);
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
- }), y(() => {
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, f.value = q(l.value) ?? 0;
42
- const c = v(l.value);
43
- c && c.removeEventListener("scroll", n);
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: f
51
+ tableScrollY: m
47
52
  };
48
53
  }
49
54
  export {
50
- N as useTableRefresh
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 y=require("../../config-provider/hooks/use-global-config.js");function b(e){return document.querySelector(e)}function R(e=".demo"){const l=b(e);return l==null?void 0:l.scrollTop}function Y(e,l=".demo"){const s=b(l);s&&(s.scrollTop=e)}function q(e){const l=y.useGlobalConfig("scrollYDomName");let s=!0;const d=c.ref(0),v=c.ref(0),h=(["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);let n=!0;const S=u=>{if(s===!1)return;const r=u.target;v.value=r.scrollTop};return c.onMounted(()=>{c.nextTick(()=>{n=!1})}),c.onActivated(()=>{setTimeout(()=>{const r=b(l.value);r&&r.addEventListener("scroll",S)});const u=T==null?void 0:T();n||u&&setTimeout(()=>{var r,a,t,f,g,m,o;s=!0,(a=(r=e==null?void 0:e.apTableRef)==null?void 0:r.value)==null||a[h](),(o=(m=(g=(f=(t=e==null?void 0:e.apTableRef)==null?void 0:t.value)==null?void 0:f.scrollBar)==null?void 0:g.x)==null?void 0:m.scroll)==null||o.call(m,d.value),Y(v.value,l.value)})}),c.onDeactivated(()=>{var r,a,t,f;s=!1,d.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,v.value=R(l.value)??0;const u=b(l.value);u&&u.removeEventListener("scroll",S)}),{tableScrollX:d,tableScrollY:v}}exports.useTableRefresh=q;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aplus-frontend/ui",
3
- "version": "0.4.20",
3
+ "version": "0.4.21",
4
4
  "main": "./lib/index.js",
5
5
  "type": "module",
6
6
  "files": [