geekplus-digital-ui 0.2.6 → 0.2.7
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,83 +1,80 @@
|
|
|
1
|
-
import { Fragment as e,
|
|
1
|
+
import { Fragment as e, cloneVNode as t, h as n, inject as r } from "vue";
|
|
2
2
|
//#region packages/components/table/src/table-wrapper.vue
|
|
3
|
-
var
|
|
3
|
+
var i = (e) => (e?.type?.name || e?.type?.__name) === "ElTableColumn", a = (e) => (e?.type?.name || e?.type?.__name) === "ElTable", o = (t) => {
|
|
4
4
|
let n = [];
|
|
5
5
|
for (let r of t) if (r.type === e) {
|
|
6
6
|
let e = Array.isArray(r.children) ? r.children : [];
|
|
7
|
-
n.push(...
|
|
7
|
+
n.push(...o(e));
|
|
8
8
|
} else n.push(r);
|
|
9
9
|
return n;
|
|
10
|
-
},
|
|
10
|
+
}, s = (t) => {
|
|
11
11
|
for (let n of t) {
|
|
12
|
-
if (
|
|
12
|
+
if (a(n)) return n;
|
|
13
13
|
let t = null;
|
|
14
14
|
if (n.type === e ? t = Array.isArray(n.children) ? n.children : [] : typeof n.type == "string" && Array.isArray(n.children) && (t = n.children), t) {
|
|
15
|
-
let e =
|
|
15
|
+
let e = s(t);
|
|
16
16
|
if (e) return e;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
return null;
|
|
20
|
-
},
|
|
21
|
-
if (
|
|
22
|
-
if (
|
|
23
|
-
let a = Array.isArray(
|
|
24
|
-
return o === a ?
|
|
20
|
+
}, c = (t, r, i) => t.map((t) => {
|
|
21
|
+
if (t === r) return i;
|
|
22
|
+
if (t.type === e) {
|
|
23
|
+
let a = Array.isArray(t.children) ? t.children : [], o = c(a, r, i);
|
|
24
|
+
return o === a ? t : n(e, null, o);
|
|
25
25
|
}
|
|
26
|
-
if (typeof
|
|
27
|
-
let e =
|
|
28
|
-
return e ===
|
|
26
|
+
if (typeof t.type == "string" && Array.isArray(t.children)) {
|
|
27
|
+
let e = c(t.children, r, i);
|
|
28
|
+
return e === t.children ? t : n(t.type, t.props, e);
|
|
29
29
|
}
|
|
30
|
-
return
|
|
31
|
-
}),
|
|
30
|
+
return t;
|
|
31
|
+
}), l = (e) => {
|
|
32
32
|
let t = [], n = [];
|
|
33
|
-
for (let
|
|
34
|
-
if (!r
|
|
35
|
-
let { prop: e } =
|
|
36
|
-
e ? t.push(
|
|
33
|
+
for (let r of e) {
|
|
34
|
+
if (!i(r)) continue;
|
|
35
|
+
let { prop: e } = r.props || {};
|
|
36
|
+
e ? t.push(r) : n.push(r);
|
|
37
37
|
}
|
|
38
38
|
return {
|
|
39
39
|
controllable: t,
|
|
40
40
|
always: n
|
|
41
41
|
};
|
|
42
|
-
},
|
|
42
|
+
}, u = (e, t, n) => n.length === 0 ? e : n.filter((e) => t.includes(e)).map((t) => e.find((e) => e.props?.prop === t)).filter(Boolean), d = {
|
|
43
43
|
name: "DTableWrapper",
|
|
44
|
-
setup(e, { slots:
|
|
45
|
-
let
|
|
44
|
+
setup(e, { slots: i }) {
|
|
45
|
+
let a = r("dTableContext");
|
|
46
46
|
return () => {
|
|
47
|
-
if (!
|
|
48
|
-
let e =
|
|
49
|
-
if (!
|
|
50
|
-
let
|
|
47
|
+
if (!a) return i.default?.() ?? [];
|
|
48
|
+
let e = i.default?.() ?? [], r = s(e);
|
|
49
|
+
if (!r) return e;
|
|
50
|
+
let d = r.children?.default, { controllable: f, always: p } = l(o(typeof d == "function" ? d() : [])), m = f.map((e) => ({
|
|
51
51
|
prop: e.props.prop,
|
|
52
52
|
label: e.props.label || e.props.type || e.props.prop,
|
|
53
53
|
fixed: e.props.fixed === "right" ? "right" : e.props.fixed ? "left" : !1
|
|
54
54
|
}));
|
|
55
55
|
queueMicrotask(() => {
|
|
56
|
-
JSON.stringify(
|
|
56
|
+
JSON.stringify(a.columnList.value) !== JSON.stringify(m) && (a.columnList.value = m);
|
|
57
57
|
});
|
|
58
|
-
let
|
|
59
|
-
let
|
|
60
|
-
if (!
|
|
61
|
-
let r =
|
|
62
|
-
return r ? i.fixed = r : delete i.fixed,
|
|
63
|
-
},
|
|
64
|
-
...
|
|
65
|
-
...
|
|
66
|
-
...
|
|
67
|
-
],
|
|
68
|
-
...
|
|
69
|
-
...
|
|
70
|
-
|
|
71
|
-
].join(",");
|
|
72
|
-
return
|
|
73
|
-
...
|
|
74
|
-
|
|
75
|
-
},
|
|
76
|
-
...n.children,
|
|
77
|
-
default: () => y
|
|
78
|
-
}));
|
|
58
|
+
let h = u(f, a.checkedKeys.value, a.columnOrder.value), g = p.filter((e) => e.props?.type), _ = p.filter((e) => !e.props?.type), v = a.columnFixed?.value ?? {}, y = (e) => {
|
|
59
|
+
let t = e.props?.prop;
|
|
60
|
+
if (!t || !Object.prototype.hasOwnProperty.call(v, t)) return e;
|
|
61
|
+
let r = v[t], i = { ...e.props };
|
|
62
|
+
return r ? i.fixed = r : delete i.fixed, n(e.type, i, e.children);
|
|
63
|
+
}, b = [
|
|
64
|
+
...g,
|
|
65
|
+
...h.map(y),
|
|
66
|
+
..._
|
|
67
|
+
], x = Object.entries(v).map(([e, t]) => `${e}:${t}`).join(","), S = t(r, { key: [
|
|
68
|
+
...a.checkedKeys.value,
|
|
69
|
+
...a.columnOrder.value,
|
|
70
|
+
x
|
|
71
|
+
].join(",") });
|
|
72
|
+
return S.children = {
|
|
73
|
+
...r.children,
|
|
74
|
+
default: () => b
|
|
75
|
+
}, c(e, r, S);
|
|
79
76
|
};
|
|
80
77
|
}
|
|
81
78
|
};
|
|
82
79
|
//#endregion
|
|
83
|
-
export {
|
|
80
|
+
export { d as default };
|