@dazhicheng/ui 1.5.233 → 1.5.235
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,11 +1,11 @@
|
|
|
1
|
-
import { useTemplateRef as b, ref as
|
|
1
|
+
import { useTemplateRef as b, ref as m, computed as k, watch as x, nextTick as w, 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
|
|
4
|
+
const a = b("wrapperRef"), c = B(a), i = m({}), r = m(!1), d = I(S), v = k(() => {
|
|
5
5
|
const e = o.collapsedRows ?? 1, t = i.value;
|
|
6
6
|
let s = 0;
|
|
7
|
-
for (let
|
|
8
|
-
s += (t == null ? void 0 : t[
|
|
7
|
+
for (let n = 1; n <= e; n++)
|
|
8
|
+
s += (t == null ? void 0 : t[n]) ?? 0;
|
|
9
9
|
return s - 1 || 1;
|
|
10
10
|
});
|
|
11
11
|
x(
|
|
@@ -16,21 +16,21 @@ function M(o) {
|
|
|
16
16
|
var e;
|
|
17
17
|
return (e = o.schema) == null ? void 0 : e.length;
|
|
18
18
|
},
|
|
19
|
-
() =>
|
|
19
|
+
() => c.value
|
|
20
20
|
],
|
|
21
21
|
async ([e]) => {
|
|
22
|
-
e && (await
|
|
22
|
+
e && (await w(), i.value = {}, r.value = !1, await u());
|
|
23
23
|
}
|
|
24
24
|
);
|
|
25
|
-
async function
|
|
26
|
-
if (!o.showCollapseButton || (await
|
|
25
|
+
async function u() {
|
|
26
|
+
if (!o.showCollapseButton || !c.value || (await w(), !a.value))
|
|
27
27
|
return;
|
|
28
|
-
const e = Array.from(
|
|
28
|
+
const e = Array.from(a.value.children), t = a.value, n = window.getComputedStyle(t).getPropertyValue("grid-template-rows").split(" "), g = t == null ? void 0 : t.getBoundingClientRect();
|
|
29
29
|
e.forEach((p) => {
|
|
30
30
|
const R = p.getBoundingClientRect().top - g.top;
|
|
31
|
-
let l = 0,
|
|
32
|
-
for (const [h, y] of
|
|
33
|
-
if (
|
|
31
|
+
let l = 0, f = 0;
|
|
32
|
+
for (const [h, y] of n.entries())
|
|
33
|
+
if (f += Number.parseFloat(y), R < f) {
|
|
34
34
|
l = h + 1;
|
|
35
35
|
break;
|
|
36
36
|
}
|
|
@@ -38,8 +38,8 @@ function M(o) {
|
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
return C(() => {
|
|
41
|
-
|
|
42
|
-
}), { isCalculated: r, keepFormItemIndex: v, wrapperRef:
|
|
41
|
+
u();
|
|
42
|
+
}), { isCalculated: r, keepFormItemIndex: v, wrapperRef: a };
|
|
43
43
|
}
|
|
44
44
|
export {
|
|
45
45
|
M as useExpandable
|
|
@@ -41,7 +41,7 @@ const Ie = { key: 1 }, Be = ["onClick"], Ue = /* @__PURE__ */ oe({
|
|
|
41
41
|
/** 是否清除冒泡 */
|
|
42
42
|
stopButtonPropagation: y.bool.def(!1),
|
|
43
43
|
/** 显示buttton的个数 默认是2 */
|
|
44
|
-
showBtnNums: y.number.def(
|
|
44
|
+
showBtnNums: y.number.def(100),
|
|
45
45
|
/** 弹出框的宽度 */
|
|
46
46
|
popoverWidth: y.number.def(27),
|
|
47
47
|
/** 是否自动换行 */
|