@dazhicheng/ui 1.5.234 → 1.5.236

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