@dazhicheng/ui 1.5.237 → 1.5.239

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,46 +1,48 @@
1
- import { useTemplateRef as b, ref as f, computed as k, watch as x, nextTick as m, onMounted as C } from "vue";
2
- import { useElementVisibility as B, useBreakpoints as I, breakpointsTailwind as S } from "@vueuse/core";
3
- function M(o) {
4
- const n = b("wrapperRef"), w = B(n), i = f({}), r = f(!1), d = I(S), v = k(() => {
5
- const e = o.collapsedRows ?? 1, t = i.value;
6
- let s = 0;
7
- for (let a = 1; a <= e; a++)
8
- s += (t == null ? void 0 : t[a]) ?? 0;
9
- return s - 1 || 1;
1
+ import { useTemplateRef as y, ref as m, computed as b, watch as x, nextTick as f, onMounted as k } from "vue";
2
+ import { useElementVisibility as C, useBreakpoints as B, breakpointsTailwind as I } from "@vueuse/core";
3
+ function H(t) {
4
+ const a = y("wrapperRef"), w = C(a), i = m({}), s = m(!1), d = B(I), g = b(() => {
5
+ const e = t.collapsedRows ?? 1, l = i.value;
6
+ let o = 0;
7
+ for (let n = 1; n <= e; n++)
8
+ o += (l == null ? void 0 : l[n]) ?? 0;
9
+ return Math.max(o - 1, 1);
10
10
  });
11
11
  x(
12
12
  [
13
- () => o.showCollapseButton,
13
+ () => t.showCollapseButton,
14
14
  () => d.active().value,
15
15
  () => {
16
16
  var e;
17
- return (e = o.schema) == null ? void 0 : e.length;
17
+ return (e = t.schema) == null ? void 0 : e.length;
18
18
  },
19
19
  () => w.value
20
20
  ],
21
21
  async ([e]) => {
22
- e && (await m(), i.value = {}, r.value = !1, await c());
22
+ e && (await f(), i.value = {}, s.value = !1, await c());
23
23
  }
24
24
  );
25
25
  async function c() {
26
- if (!o.showCollapseButton || (await m(), !n.value))
26
+ if (!t.showCollapseButton || (await f(), !a.value))
27
27
  return;
28
- const e = Array.from(n.value.children), t = n.value, a = window.getComputedStyle(t).getPropertyValue("grid-template-rows").split(" "), g = t == null ? void 0 : t.getBoundingClientRect();
29
- e.forEach((p) => {
30
- const R = p.getBoundingClientRect().top - g.top;
31
- let l = 0, u = 0;
32
- for (const [h, y] of a.entries())
33
- if (u += Number.parseFloat(y), R < u) {
34
- l = h + 1;
28
+ const e = a.value, o = window.getComputedStyle(e).getPropertyValue("grid-template-rows").split(" "), n = e == null ? void 0 : e.getBoundingClientRect();
29
+ if (o[0] === "none" || n.height === 0)
30
+ return;
31
+ Array.from(e.children).forEach((h) => {
32
+ const p = h.getBoundingClientRect().top - n.top;
33
+ let r = 0, u = 0;
34
+ for (const [v, R] of o.entries())
35
+ if (u += Number.parseFloat(R), p < u) {
36
+ r = v + 1;
35
37
  break;
36
38
  }
37
- l > ((o == null ? void 0 : o.collapsedRows) ?? 1) || (i.value[l] = (i.value[l] ?? 0) + 1, r.value = !0);
39
+ r > ((t == null ? void 0 : t.collapsedRows) ?? 1) || (i.value[r] = (i.value[r] ?? 0) + 1, s.value = !0);
38
40
  });
39
41
  }
40
- return C(() => {
42
+ return k(() => {
41
43
  c();
42
- }), { isCalculated: r, keepFormItemIndex: v, wrapperRef: n };
44
+ }), { isCalculated: s, keepFormItemIndex: g, wrapperRef: a };
43
45
  }
44
46
  export {
45
- M as useExpandable
47
+ H as useExpandable
46
48
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dazhicheng/ui",
3
- "version": "1.5.237",
3
+ "version": "1.5.239",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -67,8 +67,8 @@
67
67
  "vue-router": "^5.0.2",
68
68
  "vxe-pc-ui": "^4.12.36",
69
69
  "vxe-table": "^4.17.48",
70
- "@dazhicheng/utils": "1.3.41",
71
- "@dazhicheng/hooks": "1.4.44"
70
+ "@dazhicheng/hooks": "1.4.45",
71
+ "@dazhicheng/utils": "1.3.42"
72
72
  },
73
73
  "files": [
74
74
  "dist"