geekplus-digital-ui 0.2.6 → 0.2.8
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.
- package/components/table/src/table-filter.vue.js +81 -56
- package/components/table/src/table-filter.vue_vue_type_style_index_0_scoped_023a2c22_lang.css +1 -0
- package/components/table/src/table-wrapper.vue.js +47 -50
- package/locale/lang/en.d.ts +2 -0
- package/locale/lang/en.js +3 -1
- package/locale/lang/ja.d.ts +2 -0
- package/locale/lang/ja.js +3 -1
- package/locale/lang/ko.d.ts +2 -0
- package/locale/lang/ko.js +3 -1
- package/locale/lang/zh-cn.d.ts +2 -0
- package/locale/lang/zh-cn.js +3 -1
- package/locale/lang/zh-tw.d.ts +2 -0
- package/locale/lang/zh-tw.js +3 -1
- package/package.json +1 -1
- package/components/table/src/table-filter.vue_vue_type_style_index_0_scoped_93138aaa_lang.css +0 -1
|
@@ -4,7 +4,7 @@ import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
|
4
4
|
import n from "../../icon/index.js";
|
|
5
5
|
import r from "../../icons/filter-list-light.vue.js";
|
|
6
6
|
import i from "../../icons/grip-dots-vertical-solid.vue.js";
|
|
7
|
-
import './table-filter.
|
|
7
|
+
import './table-filter.vue_vue_type_style_index_0_scoped_023a2c22_lang.css';/* empty css */
|
|
8
8
|
import "../../index.js";
|
|
9
9
|
import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, inject as p, openBlock as m, ref as h, renderList as g, toDisplayString as _, unref as v, withCtx as y } from "vue";
|
|
10
10
|
import { ElButton as b, ElCheckbox as x, ElPopover as S } from "element-plus";
|
|
@@ -16,50 +16,50 @@ var w = { class: "d-table-filter__header" }, T = { class: "d-table-filter__body"
|
|
|
16
16
|
}, D = /* @__PURE__ */ t(/* @__PURE__ */ Object.assign({ name: "DTableFilter" }, {
|
|
17
17
|
__name: "table-filter",
|
|
18
18
|
setup(t) {
|
|
19
|
-
let { t: D } = e(), { columnList: O, checkedKeys: k, columnOrder: A, columnFixed: j, saveConfig: M } = p("dTableContext"), N = (e) => Object.prototype.hasOwnProperty.call(
|
|
20
|
-
let t =
|
|
19
|
+
let { t: D } = e(), { columnList: O, checkedKeys: k, columnOrder: A, columnFixed: j, saveConfig: M } = p("dTableContext"), N = h(!1), P = h([]), F = h([]), I = h({}), L = (e) => Object.prototype.hasOwnProperty.call(I.value, e) ? I.value[e] : O.value.find((t) => t.prop === e)?.fixed ?? !1, R = (e) => {
|
|
20
|
+
let t = F.value.map((t) => {
|
|
21
21
|
let n = O.value.find((e) => e.prop === t);
|
|
22
|
-
return !n ||
|
|
23
|
-
}).filter(Boolean), n = O.value.filter((t) =>
|
|
22
|
+
return !n || L(t) !== e ? null : n;
|
|
23
|
+
}).filter(Boolean), n = O.value.filter((t) => L(t.prop) === e && !F.value.includes(t.prop));
|
|
24
24
|
return [...t, ...n];
|
|
25
|
-
},
|
|
26
|
-
left:
|
|
27
|
-
middle:
|
|
28
|
-
right:
|
|
29
|
-
})),
|
|
25
|
+
}, z = o(() => ({
|
|
26
|
+
left: R("left"),
|
|
27
|
+
middle: R(!1),
|
|
28
|
+
right: R("right")
|
|
29
|
+
})), B = o(() => [
|
|
30
30
|
{
|
|
31
31
|
key: "left",
|
|
32
32
|
labelKey: "d.table.fixedLeft",
|
|
33
|
-
items:
|
|
33
|
+
items: z.value.left,
|
|
34
34
|
showLabel: !0
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
key: "middle",
|
|
38
38
|
labelKey: "d.table.columns",
|
|
39
|
-
items:
|
|
39
|
+
items: z.value.middle,
|
|
40
40
|
showLabel: !0
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
key: "right",
|
|
44
44
|
labelKey: "d.table.fixedRight",
|
|
45
|
-
items:
|
|
45
|
+
items: z.value.right,
|
|
46
46
|
showLabel: !0
|
|
47
47
|
}
|
|
48
|
-
]),
|
|
48
|
+
]), V = {
|
|
49
49
|
left: h(null),
|
|
50
50
|
middle: h(null),
|
|
51
51
|
right: h(null)
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
},
|
|
52
|
+
}, H = (e, t) => {
|
|
53
|
+
V[t].value = e;
|
|
54
|
+
}, U = (e) => Object.keys(V).find((t) => V[t].value === e), W = {
|
|
55
55
|
left: "left",
|
|
56
56
|
middle: !1,
|
|
57
57
|
right: "right"
|
|
58
|
-
},
|
|
59
|
-
let { from: n, to: r, oldIndex: i, newIndex: a } = t, o =
|
|
60
|
-
left: [...
|
|
61
|
-
middle: [...
|
|
62
|
-
right: [...
|
|
58
|
+
}, G = (e) => (t) => {
|
|
59
|
+
let { from: n, to: r, oldIndex: i, newIndex: a } = t, o = U(r) ?? e, s = {
|
|
60
|
+
left: [...z.value.left.map((e) => e.prop)],
|
|
61
|
+
middle: [...z.value.middle.map((e) => e.prop)],
|
|
62
|
+
right: [...z.value.right.map((e) => e.prop)]
|
|
63
63
|
};
|
|
64
64
|
if (n === r) {
|
|
65
65
|
if (i === a) return;
|
|
@@ -68,17 +68,17 @@ var w = { class: "d-table-filter__header" }, T = { class: "d-table-filter__body"
|
|
|
68
68
|
} else {
|
|
69
69
|
let t = s[e][i];
|
|
70
70
|
if (!t) return;
|
|
71
|
-
s[e].splice(i, 1), s[o].splice(a, 0, t),
|
|
72
|
-
...
|
|
73
|
-
[t]:
|
|
71
|
+
s[e].splice(i, 1), s[o].splice(a, 0, t), I.value = {
|
|
72
|
+
...I.value,
|
|
73
|
+
[t]: W[o]
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
|
-
|
|
76
|
+
F.value = [
|
|
77
77
|
...s.left,
|
|
78
78
|
...s.middle,
|
|
79
79
|
...s.right
|
|
80
|
-
]
|
|
81
|
-
},
|
|
80
|
+
];
|
|
81
|
+
}, K = (e) => ({
|
|
82
82
|
handle: ".d-table-filter__handle",
|
|
83
83
|
animation: 150,
|
|
84
84
|
group: {
|
|
@@ -89,30 +89,38 @@ var w = { class: "d-table-filter__header" }, T = { class: "d-table-filter__body"
|
|
|
89
89
|
onUpdate: () => {},
|
|
90
90
|
onAdd: () => {},
|
|
91
91
|
onRemove: () => {},
|
|
92
|
-
onEnd:
|
|
93
|
-
}),
|
|
94
|
-
left: C(
|
|
95
|
-
middle: C(
|
|
96
|
-
right: C(
|
|
97
|
-
},
|
|
98
|
-
Object.values(
|
|
92
|
+
onEnd: G(e)
|
|
93
|
+
}), q = {
|
|
94
|
+
left: C(V.left, o(() => z.value.left), K("left")),
|
|
95
|
+
middle: C(V.middle, o(() => z.value.middle), K("middle")),
|
|
96
|
+
right: C(V.right, o(() => z.value.right), K("right"))
|
|
97
|
+
}, J = () => {
|
|
98
|
+
Object.values(q).forEach((e) => {
|
|
99
99
|
e.stop(), e.start();
|
|
100
100
|
});
|
|
101
|
-
},
|
|
102
|
-
|
|
101
|
+
}, Y = () => {
|
|
102
|
+
P.value = [...k.value], F.value = [...A.value], I.value = { ...j.value }, J();
|
|
103
|
+
}, X = (e, t) => {
|
|
104
|
+
if (t) P.value.includes(e) || (P.value = [...P.value, e]);
|
|
103
105
|
else {
|
|
104
|
-
if (
|
|
105
|
-
|
|
106
|
+
if (P.value.length <= 1) return;
|
|
107
|
+
P.value = P.value.filter((t) => t !== e);
|
|
106
108
|
}
|
|
107
|
-
},
|
|
109
|
+
}, Z = () => {
|
|
108
110
|
let e = O.value.map((e) => e.prop);
|
|
109
|
-
|
|
111
|
+
P.value = e, F.value = e, I.value = {};
|
|
112
|
+
}, Q = () => {
|
|
113
|
+
k.value = [...P.value], A.value = [...F.value], j.value = { ...I.value }, M(), N.value = !1;
|
|
114
|
+
}, $ = () => {
|
|
115
|
+
N.value = !1;
|
|
110
116
|
};
|
|
111
117
|
return (e, t) => (m(), s(v(S), {
|
|
118
|
+
visible: N.value,
|
|
119
|
+
"onUpdate:visible": t[0] ||= (e) => N.value = e,
|
|
112
120
|
placement: "bottom-end",
|
|
113
121
|
width: "auto",
|
|
114
122
|
trigger: "click",
|
|
115
|
-
onShow:
|
|
123
|
+
onShow: Y
|
|
116
124
|
}, {
|
|
117
125
|
reference: y(() => [f(v(b), {
|
|
118
126
|
link: "",
|
|
@@ -124,16 +132,33 @@ var w = { class: "d-table-filter__header" }, T = { class: "d-table-filter__body"
|
|
|
124
132
|
})]),
|
|
125
133
|
_: 1
|
|
126
134
|
})]),
|
|
127
|
-
default: y(() => [u("div", w, [
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
+
default: y(() => [u("div", w, [
|
|
136
|
+
f(v(b), {
|
|
137
|
+
link: "",
|
|
138
|
+
onClick: $
|
|
139
|
+
}, {
|
|
140
|
+
default: y(() => [d(_(v(D)("d.table.cancel")), 1)]),
|
|
141
|
+
_: 1
|
|
142
|
+
}),
|
|
143
|
+
f(v(b), {
|
|
144
|
+
link: "",
|
|
145
|
+
type: "primary",
|
|
146
|
+
onClick: Z
|
|
147
|
+
}, {
|
|
148
|
+
default: y(() => [d(_(v(D)("d.table.reset")), 1)]),
|
|
149
|
+
_: 1
|
|
150
|
+
}),
|
|
151
|
+
f(v(b), {
|
|
152
|
+
link: "",
|
|
153
|
+
type: "primary",
|
|
154
|
+
onClick: Q
|
|
155
|
+
}, {
|
|
156
|
+
default: y(() => [d(_(v(D)("d.table.confirm")), 1)]),
|
|
157
|
+
_: 1
|
|
158
|
+
})
|
|
159
|
+
]), u("div", T, [(m(!0), l(a, null, g(B.value, (e) => (m(), l(a, { key: e.key }, [e.showLabel ? (m(), l("div", E, _(v(D)(e.labelKey)), 1)) : c("", !0), u("ul", {
|
|
135
160
|
ref_for: !0,
|
|
136
|
-
ref: (t) =>
|
|
161
|
+
ref: (t) => H(t, e.key),
|
|
137
162
|
class: "d-table-filter__list"
|
|
138
163
|
}, [(m(!0), l(a, null, g(e.items, (e) => (m(), l("li", {
|
|
139
164
|
key: e.prop,
|
|
@@ -142,9 +167,9 @@ var w = { class: "d-table-filter__header" }, T = { class: "d-table-filter__body"
|
|
|
142
167
|
default: y(() => [f(i)]),
|
|
143
168
|
_: 1
|
|
144
169
|
}), f(v(x), {
|
|
145
|
-
"model-value":
|
|
146
|
-
disabled:
|
|
147
|
-
onChange: (t) =>
|
|
170
|
+
"model-value": P.value.includes(e.prop),
|
|
171
|
+
disabled: P.value.length <= 1 && P.value.includes(e.prop),
|
|
172
|
+
onChange: (t) => X(e.prop, t)
|
|
148
173
|
}, {
|
|
149
174
|
default: y(() => [d(_(e.label), 1)]),
|
|
150
175
|
_: 2
|
|
@@ -154,8 +179,8 @@ var w = { class: "d-table-filter__header" }, T = { class: "d-table-filter__body"
|
|
|
154
179
|
"onChange"
|
|
155
180
|
])]))), 128))], 512)], 64))), 128))])]),
|
|
156
181
|
_: 1
|
|
157
|
-
}));
|
|
182
|
+
}, 8, ["visible"]));
|
|
158
183
|
}
|
|
159
|
-
}), [["__scopeId", "data-v-
|
|
184
|
+
}), [["__scopeId", "data-v-023a2c22"]]);
|
|
160
185
|
//#endregion
|
|
161
186
|
export { D as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.d-table-filter__body[data-v-023a2c22]{max-height:400px;overflow-y:auto}.d-table-filter__list[data-v-023a2c22]{margin:0;padding:0;list-style:none}.d-table-filter__item[data-v-023a2c22]{align-items:center;gap:6px;display:flex}.d-table-filter__item[data-v-023a2c22] .el-checkbox{height:24px}.d-table-filter__header[data-v-023a2c22]{justify-content:flex-end;align-items:center;gap:8px;margin-bottom:4px;display:flex}.d-table-filter__header[data-v-023a2c22] .el-button{margin:0}.d-table-filter__group-label[data-v-023a2c22]{color:var(--el-text-color-secondary);padding:4px 0 2px;font-size:12px}.d-table-filter__handle[data-v-023a2c22]{color:var(--el-text-color-placeholder);cursor:grab;flex-shrink:0}.d-table-filter__handle[data-v-023a2c22]:active{cursor:grabbing}
|
|
@@ -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 };
|
package/locale/lang/en.d.ts
CHANGED
package/locale/lang/en.js
CHANGED
|
@@ -24,7 +24,9 @@ var e = {
|
|
|
24
24
|
fixedLeft: "Fixed Left",
|
|
25
25
|
fixedRight: "Fixed Right",
|
|
26
26
|
columns: "Columns",
|
|
27
|
-
scrollTip: "Horizontal scroll: Shift + scroll wheel"
|
|
27
|
+
scrollTip: "Horizontal scroll: Shift + scroll wheel",
|
|
28
|
+
confirm: "Confirm",
|
|
29
|
+
cancel: "Cancel"
|
|
28
30
|
},
|
|
29
31
|
upload: {
|
|
30
32
|
lessThan: "Less than {size}MB",
|
package/locale/lang/ja.d.ts
CHANGED
package/locale/lang/ja.js
CHANGED
package/locale/lang/ko.d.ts
CHANGED
package/locale/lang/ko.js
CHANGED
package/locale/lang/zh-cn.d.ts
CHANGED
package/locale/lang/zh-cn.js
CHANGED
package/locale/lang/zh-tw.d.ts
CHANGED
package/locale/lang/zh-tw.js
CHANGED
package/package.json
CHANGED
package/components/table/src/table-filter.vue_vue_type_style_index_0_scoped_93138aaa_lang.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.d-table-filter__body[data-v-93138aaa]{max-height:400px;overflow-y:auto}.d-table-filter__list[data-v-93138aaa]{margin:0;padding:0;list-style:none}.d-table-filter__item[data-v-93138aaa]{align-items:center;gap:6px;display:flex}.d-table-filter__item[data-v-93138aaa] .el-checkbox{height:24px}.d-table-filter__header[data-v-93138aaa]{justify-content:flex-end;margin-bottom:4px;display:flex}.d-table-filter__group-label[data-v-93138aaa]{color:var(--el-text-color-secondary);padding:4px 0 2px;font-size:12px}.d-table-filter__handle[data-v-93138aaa]{color:var(--el-text-color-placeholder);cursor:grab;flex-shrink:0}.d-table-filter__handle[data-v-93138aaa]:active{cursor:grabbing}
|