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, h as t, inject as n } from "vue";
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 r = (e) => (e?.type?.name || e?.type?.__name) === "ElTableColumn", i = (e) => (e?.type?.name || e?.type?.__name) === "ElTable", a = (t) => {
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(...a(e));
7
+ n.push(...o(e));
8
8
  } else n.push(r);
9
9
  return n;
10
- }, o = (t) => {
10
+ }, s = (t) => {
11
11
  for (let n of t) {
12
- if (i(n)) return n;
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 = o(t);
15
+ let e = s(t);
16
16
  if (e) return e;
17
17
  }
18
18
  }
19
19
  return null;
20
- }, s = (n, r, i) => n.map((n) => {
21
- if (n === r) return i;
22
- if (n.type === e) {
23
- let a = Array.isArray(n.children) ? n.children : [], o = s(a, r, i);
24
- return o === a ? n : t(e, null, o);
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 n.type == "string" && Array.isArray(n.children)) {
27
- let e = s(n.children, r, i);
28
- return e === n.children ? n : t(n.type, n.props, 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 n;
31
- }), c = (e) => {
30
+ return t;
31
+ }), l = (e) => {
32
32
  let t = [], n = [];
33
- for (let i of e) {
34
- if (!r(i)) continue;
35
- let { prop: e } = i.props || {};
36
- e ? t.push(i) : n.push(i);
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
- }, l = (e, t, n) => n.length === 0 ? e : n.filter((e) => t.includes(e)).map((t) => e.find((e) => e.props?.prop === t)).filter(Boolean), u = {
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: r }) {
45
- let i = n("dTableContext");
44
+ setup(e, { slots: i }) {
45
+ let a = r("dTableContext");
46
46
  return () => {
47
- if (!i) return r.default?.() ?? [];
48
- let e = r.default?.() ?? [], n = o(e);
49
- if (!n) return e;
50
- let u = n.children?.default, { controllable: d, always: f } = c(a(typeof u == "function" ? u() : [])), p = d.map((e) => ({
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(i.columnList.value) !== JSON.stringify(p) && (i.columnList.value = p);
56
+ JSON.stringify(a.columnList.value) !== JSON.stringify(m) && (a.columnList.value = m);
57
57
  });
58
- let m = l(d, i.checkedKeys.value, i.columnOrder.value), h = f.filter((e) => e.props?.type), g = f.filter((e) => !e.props?.type), _ = i.columnFixed?.value ?? {}, v = (e) => {
59
- let n = e.props?.prop;
60
- if (!n || !Object.prototype.hasOwnProperty.call(_, n)) return e;
61
- let r = _[n], i = { ...e.props };
62
- return r ? i.fixed = r : delete i.fixed, t(e.type, i, e.children);
63
- }, y = [
64
- ...h,
65
- ...m.map(v),
66
- ...g
67
- ], b = Object.entries(_).map(([e, t]) => `${e}:${t}`).join(","), x = [
68
- ...i.checkedKeys.value,
69
- ...i.columnOrder.value,
70
- b
71
- ].join(",");
72
- return s(e, n, t(n.type, {
73
- ...n.props,
74
- key: x
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 { u as default };
80
+ export { d as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geekplus-digital-ui",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "homepage": "https://ui.geekplus.cc/static/ui/",
5
5
  "type": "module",
6
6
  "main": "index.js",