geekplus-digital-ui 0.2.3 → 0.2.5

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,13 +1,34 @@
1
1
  import { Fragment as e, h as t, inject as n } from "vue";
2
2
  //#region packages/components/table/src/table-wrapper.vue
3
- var r = (e) => (e?.type?.name || e?.type?.__name) === "ElTableColumn", i = (t) => {
3
+ var r = (e) => (e?.type?.name || e?.type?.__name) === "ElTableColumn", i = (e) => (e?.type?.name || e?.type?.__name) === "ElTable", a = (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(...i(e));
7
+ n.push(...a(e));
8
8
  } else n.push(r);
9
9
  return n;
10
- }, a = (e) => {
10
+ }, o = (t) => {
11
+ for (let n of t) {
12
+ if (i(n)) return n;
13
+ let t = null;
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);
16
+ if (e) return e;
17
+ }
18
+ }
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);
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);
29
+ }
30
+ return n;
31
+ }), c = (e) => {
11
32
  let t = [], n = [];
12
33
  for (let i of e) {
13
34
  if (!r(i)) continue;
@@ -18,45 +39,45 @@ var r = (e) => (e?.type?.name || e?.type?.__name) === "ElTableColumn", i = (t) =
18
39
  controllable: t,
19
40
  always: n
20
41
  };
21
- }, o = (e, t, n) => n.length === 0 ? e : n.filter((e) => t.includes(e)).map((t) => e.find((e) => e.props?.prop === t)).filter(Boolean), s = {
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 = {
22
43
  name: "DTableWrapper",
23
44
  setup(e, { slots: r }) {
24
- let s = n("dTableContext");
45
+ let i = n("dTableContext");
25
46
  return () => {
26
- if (!s) return r.default?.() ?? [];
27
- let e = r.default?.() ?? [], n = i(e), c = n.find((e) => (e?.type?.name || e?.type?.__name) === "ElTable");
28
- if (!c) return e;
29
- let l = c.children?.default, { controllable: u, always: d } = a(i(typeof l == "function" ? l() : [])), f = u.map((e) => ({
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) => ({
30
51
  prop: e.props.prop,
31
52
  label: e.props.label || e.props.type || e.props.prop,
32
53
  fixed: e.props.fixed === "right" ? "right" : e.props.fixed ? "left" : !1
33
54
  }));
34
55
  queueMicrotask(() => {
35
- JSON.stringify(s.columnList.value) !== JSON.stringify(f) && (s.columnList.value = f);
56
+ JSON.stringify(i.columnList.value) !== JSON.stringify(p) && (i.columnList.value = p);
36
57
  });
37
- let p = o(u, s.checkedKeys.value, s.columnOrder.value), m = d.filter((e) => e.props?.type), h = d.filter((e) => !e.props?.type), g = s.columnFixed?.value ?? {}, _ = (e) => {
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) => {
38
59
  let n = e.props?.prop;
39
- if (!n || !Object.prototype.hasOwnProperty.call(g, n)) return e;
40
- let r = g[n], i = { ...e.props };
60
+ if (!n || !Object.prototype.hasOwnProperty.call(_, n)) return e;
61
+ let r = _[n], i = { ...e.props };
41
62
  return r ? i.fixed = r : delete i.fixed, t(e.type, i, e.children);
42
- }, v = [
43
- ...m,
44
- ...p.map(_),
45
- ...h
46
- ], y = Object.entries(g).map(([e, t]) => `${e}:${t}`).join(","), b = [
47
- ...s.checkedKeys.value,
48
- ...s.columnOrder.value,
49
- y
50
- ].join(","), x = t(c.type, {
51
- ...c.props,
52
- key: b
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
53
75
  }, {
54
- ...c.children,
55
- default: () => v
56
- });
57
- return n.map((e) => e === c ? x : e);
76
+ ...n.children,
77
+ default: () => y
78
+ }));
58
79
  };
59
80
  }
60
81
  };
61
82
  //#endregion
62
- export { s as default };
83
+ export { u as default };
@@ -13,7 +13,7 @@ import ie from "../../icons/file-light.vue.js";
13
13
  import ae from "../../icons/plus-light.vue.js";
14
14
  import oe from "../../icons/trash-light.vue.js";
15
15
  import se from "../../icons/image-light.vue.js";
16
- import './upload.vue_vue_type_style_index_1_lang.css';import './upload.vue_vue_type_style_index_0_scoped_aef1e5b2_lang.css';/* empty css */
16
+ import './upload.vue_vue_type_style_index_1_lang.css';import './upload.vue_vue_type_style_index_0_scoped_946130d7_lang.css';/* empty css */
17
17
  /* empty css */
18
18
  import "../../index.js";
19
19
  import { isFunction as ce } from "lodash-es";
@@ -202,8 +202,8 @@ var Ce = { class: "d-upload__preview" }, we = ["src"], Te = {
202
202
  id: e,
203
203
  name: t,
204
204
  docName: t,
205
- url: O.domain + r,
206
- docUrl: O.domain + r,
205
+ url: /^https?:\/\//.test(r) ? r : O.domain + r,
206
+ docUrl: /^https?:\/\//.test(r) ? r : O.domain + r,
207
207
  type: O.docType || a,
208
208
  docType: O.docType || a,
209
209
  status: "success"
@@ -410,6 +410,6 @@ var Ce = { class: "d-upload__preview" }, we = ["src"], Te = {
410
410
  }))])) : l("", !0)
411
411
  ], 2));
412
412
  }
413
- }), [["__scopeId", "data-v-aef1e5b2"]]);
413
+ }), [["__scopeId", "data-v-946130d7"]]);
414
414
  //#endregion
415
415
  export { D as default };
@@ -0,0 +1 @@
1
+ .d-upload[data-v-946130d7]{line-height:normal}.d-upload .d-upload__header[data-v-946130d7]{align-items:center;gap:8px;width:100%;display:flex}.d-upload .d-upload__header .el-button[data-v-946130d7]{margin:0}.d-upload.is-list[data-v-946130d7],.d-upload.is-list .d-upload__list[data-v-946130d7]{flex-direction:column;gap:8px;display:flex}.d-upload.is-list .d-upload__list .d-upload__list-item .d-upload__file-row[data-v-946130d7]{align-items:center;gap:4px;display:flex;position:relative}.d-upload.is-list .d-upload__list .d-upload__list-item .d-upload__file-row[data-v-946130d7] .el-link{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.d-upload.is-list .d-upload__list .d-upload__list-item .d-upload__file-row[data-v-946130d7] .el-link .el-link__inner{display:inline}.d-upload.is-list .d-upload__list .d-upload__list-item .d-upload__file-row .d-upload__remove-icon[data-v-946130d7]{cursor:pointer;color:var(--el-text-color-secondary);display:none}.d-upload.is-list .d-upload__list .d-upload__list-item .d-upload__file-row:hover .d-upload__remove-icon[data-v-946130d7]{display:block}.d-upload.is-card[data-v-946130d7],.d-upload.is-card .d-upload__card[data-v-946130d7]{flex-wrap:wrap;gap:8px;display:flex}.d-upload.is-card .d-upload__card .d-upload__card-item[data-v-946130d7]{box-sizing:border-box;border:1px solid var(--el-border-color);cursor:pointer;border-radius:4px;justify-content:center;align-items:center;font-size:16px;display:flex;position:relative;overflow:hidden}.d-upload.is-card .d-upload__card .d-upload__card-item .d-upload__card-cover[data-v-946130d7]{background:var(--el-overlay-color);opacity:0;justify-content:center;align-items:center;gap:12px;width:100%;height:100%;display:flex;position:absolute;top:0;left:0}.d-upload.is-card .d-upload__card .d-upload__card-item .d-upload__card-cover .d-icon[data-v-946130d7]{color:var(--el-color-white)}.d-upload.is-card .d-upload__card .d-upload__card-item .d-upload__card-cover[data-v-946130d7]:hover{opacity:1}.d-upload.is-card .d-upload__card .el-image[data-v-946130d7]{width:100%;height:100%}.d-upload.is-card .d-upload__card .el-image .el-image__error[data-v-946130d7]{font-size:16px}.d-upload .d-upload__expand-toggle[data-v-946130d7]{width:100%;display:flex}.d-upload .d-upload__expand-toggle[data-v-946130d7] .el-link__inner{gap:4px}.d-upload .d-upload__tip[data-v-946130d7]{width:100%;color:var(--el-text-color-regular);margin:0;font-size:12px}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geekplus-digital-ui",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "homepage": "https://ui.geekplus.cc/static/ui/",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -1 +0,0 @@
1
- .d-upload[data-v-aef1e5b2]{line-height:normal}.d-upload .d-upload__header[data-v-aef1e5b2]{align-items:center;gap:8px;width:100%;display:flex}.d-upload .d-upload__header .el-button[data-v-aef1e5b2]{margin:0}.d-upload.is-list[data-v-aef1e5b2],.d-upload.is-list .d-upload__list[data-v-aef1e5b2]{flex-direction:column;gap:8px;display:flex}.d-upload.is-list .d-upload__list .d-upload__list-item .d-upload__file-row[data-v-aef1e5b2]{align-items:center;gap:4px;display:flex;position:relative}.d-upload.is-list .d-upload__list .d-upload__list-item .d-upload__file-row[data-v-aef1e5b2] .el-link{text-overflow:ellipsis;white-space:nowrap;display:block;overflow:hidden}.d-upload.is-list .d-upload__list .d-upload__list-item .d-upload__file-row[data-v-aef1e5b2] .el-link .el-link__inner{display:inline}.d-upload.is-list .d-upload__list .d-upload__list-item .d-upload__file-row .d-upload__remove-icon[data-v-aef1e5b2]{cursor:pointer;color:var(--el-text-color-secondary);display:none}.d-upload.is-list .d-upload__list .d-upload__list-item .d-upload__file-row:hover .d-upload__remove-icon[data-v-aef1e5b2]{display:block}.d-upload.is-card[data-v-aef1e5b2],.d-upload.is-card .d-upload__card[data-v-aef1e5b2]{flex-wrap:wrap;gap:8px;display:flex}.d-upload.is-card .d-upload__card .d-upload__card-item[data-v-aef1e5b2]{box-sizing:border-box;border:1px solid var(--el-border-color);cursor:pointer;border-radius:4px;justify-content:center;align-items:center;font-size:16px;display:flex;position:relative;overflow:hidden}.d-upload.is-card .d-upload__card .d-upload__card-item .d-upload__card-cover[data-v-aef1e5b2]{background:var(--el-overlay-color);opacity:0;justify-content:center;align-items:center;gap:12px;width:100%;height:100%;display:flex;position:absolute;top:0;left:0}.d-upload.is-card .d-upload__card .d-upload__card-item .d-upload__card-cover .d-icon[data-v-aef1e5b2]{color:var(--el-color-white)}.d-upload.is-card .d-upload__card .d-upload__card-item .d-upload__card-cover[data-v-aef1e5b2]:hover{opacity:1}.d-upload.is-card .d-upload__card .el-image[data-v-aef1e5b2]{width:100%;height:100%}.d-upload.is-card .d-upload__card .el-image .el-image__error[data-v-aef1e5b2]{font-size:16px}.d-upload .d-upload__expand-toggle[data-v-aef1e5b2]{width:100%;display:flex}.d-upload .d-upload__expand-toggle[data-v-aef1e5b2] .el-link__inner{gap:4px}.d-upload .d-upload__tip[data-v-aef1e5b2]{width:100%;color:var(--el-text-color-regular);margin:0;font-size:12px}