@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
|
|
2
|
-
import { useElementVisibility as
|
|
3
|
-
function
|
|
4
|
-
const
|
|
5
|
-
const e =
|
|
6
|
-
let
|
|
7
|
-
for (let
|
|
8
|
-
|
|
9
|
-
return
|
|
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
|
-
() =>
|
|
13
|
+
() => t.showCollapseButton,
|
|
14
14
|
() => d.active().value,
|
|
15
15
|
() => {
|
|
16
16
|
var e;
|
|
17
|
-
return (e =
|
|
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
|
|
22
|
+
e && (await f(), i.value = {}, s.value = !1, await c());
|
|
23
23
|
}
|
|
24
24
|
);
|
|
25
25
|
async function c() {
|
|
26
|
-
if (!
|
|
26
|
+
if (!t.showCollapseButton || (await f(), !a.value))
|
|
27
27
|
return;
|
|
28
|
-
const e =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
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
|
|
42
|
+
return k(() => {
|
|
41
43
|
c();
|
|
42
|
-
}), { isCalculated:
|
|
44
|
+
}), { isCalculated: s, keepFormItemIndex: g, wrapperRef: a };
|
|
43
45
|
}
|
|
44
46
|
export {
|
|
45
|
-
|
|
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.
|
|
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/
|
|
71
|
-
"@dazhicheng/
|
|
70
|
+
"@dazhicheng/hooks": "1.4.45",
|
|
71
|
+
"@dazhicheng/utils": "1.3.42"
|
|
72
72
|
},
|
|
73
73
|
"files": [
|
|
74
74
|
"dist"
|