geekplus-digital-ui 0.2.8 → 0.2.9
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.
|
@@ -4,62 +4,62 @@ 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_106f6a04_lang.css';/* empty css */
|
|
8
8
|
import "../../index.js";
|
|
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,
|
|
10
|
-
import { ElButton as
|
|
11
|
-
import { useSortable as
|
|
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, watch as y, withCtx as b } from "vue";
|
|
10
|
+
import { ElButton as x, ElCheckbox as S, ElPopover as C } from "element-plus";
|
|
11
|
+
import { useSortable as w } from "@vueuse/integrations/useSortable";
|
|
12
12
|
//#region packages/components/table/src/table-filter.vue
|
|
13
|
-
var
|
|
13
|
+
var T = { class: "d-table-filter__header" }, E = { class: "d-table-filter__body" }, D = {
|
|
14
14
|
key: 0,
|
|
15
15
|
class: "d-table-filter__group-label"
|
|
16
|
-
},
|
|
16
|
+
}, O = /* @__PURE__ */ t(/* @__PURE__ */ Object.assign({ name: "DTableFilter" }, {
|
|
17
17
|
__name: "table-filter",
|
|
18
18
|
setup(t) {
|
|
19
|
-
let { t:
|
|
20
|
-
let t =
|
|
21
|
-
let n =
|
|
22
|
-
return !n ||
|
|
23
|
-
}).filter(Boolean), n =
|
|
19
|
+
let { t: O } = e(), { columnList: k, checkedKeys: A, columnOrder: j, columnFixed: M, saveConfig: N } = p("dTableContext"), P = h(!1), F = h([]), I = h([]), L = h({}), R = (e) => Object.prototype.hasOwnProperty.call(L.value, e) ? L.value[e] : k.value.find((t) => t.prop === e)?.fixed ?? !1, z = (e) => {
|
|
20
|
+
let t = I.value.map((t) => {
|
|
21
|
+
let n = k.value.find((e) => e.prop === t);
|
|
22
|
+
return !n || R(t) !== e ? null : n;
|
|
23
|
+
}).filter(Boolean), n = k.value.filter((t) => R(t.prop) === e && !I.value.includes(t.prop));
|
|
24
24
|
return [...t, ...n];
|
|
25
|
-
},
|
|
26
|
-
left:
|
|
27
|
-
middle:
|
|
28
|
-
right:
|
|
29
|
-
})),
|
|
25
|
+
}, B = o(() => ({
|
|
26
|
+
left: z("left"),
|
|
27
|
+
middle: z(!1),
|
|
28
|
+
right: z("right")
|
|
29
|
+
})), V = o(() => [
|
|
30
30
|
{
|
|
31
31
|
key: "left",
|
|
32
32
|
labelKey: "d.table.fixedLeft",
|
|
33
|
-
items:
|
|
33
|
+
items: B.value.left,
|
|
34
34
|
showLabel: !0
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
key: "middle",
|
|
38
38
|
labelKey: "d.table.columns",
|
|
39
|
-
items:
|
|
39
|
+
items: B.value.middle,
|
|
40
40
|
showLabel: !0
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
key: "right",
|
|
44
44
|
labelKey: "d.table.fixedRight",
|
|
45
|
-
items:
|
|
45
|
+
items: B.value.right,
|
|
46
46
|
showLabel: !0
|
|
47
47
|
}
|
|
48
|
-
]),
|
|
48
|
+
]), H = {
|
|
49
49
|
left: h(null),
|
|
50
50
|
middle: h(null),
|
|
51
51
|
right: h(null)
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
},
|
|
52
|
+
}, U = (e, t) => {
|
|
53
|
+
H[t].value = e;
|
|
54
|
+
}, W = (e) => Object.keys(H).find((t) => H[t].value === e), G = {
|
|
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
|
+
}, K = (e) => (t) => {
|
|
59
|
+
let { from: n, to: r, oldIndex: i, newIndex: a } = t, o = W(r) ?? e, s = {
|
|
60
|
+
left: [...B.value.left.map((e) => e.prop)],
|
|
61
|
+
middle: [...B.value.middle.map((e) => e.prop)],
|
|
62
|
+
right: [...B.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), L.value = {
|
|
72
|
+
...L.value,
|
|
73
|
+
[t]: G[o]
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
|
-
|
|
76
|
+
I.value = [
|
|
77
77
|
...s.left,
|
|
78
78
|
...s.middle,
|
|
79
79
|
...s.right
|
|
80
80
|
];
|
|
81
|
-
},
|
|
81
|
+
}, q = (e) => ({
|
|
82
82
|
handle: ".d-table-filter__handle",
|
|
83
83
|
animation: 150,
|
|
84
84
|
group: {
|
|
@@ -89,89 +89,91 @@ 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:
|
|
95
|
-
middle:
|
|
96
|
-
right:
|
|
97
|
-
},
|
|
98
|
-
Object.values(
|
|
92
|
+
onEnd: K(e)
|
|
93
|
+
}), J = {
|
|
94
|
+
left: w(H.left, o(() => B.value.left), q("left")),
|
|
95
|
+
middle: w(H.middle, o(() => B.value.middle), q("middle")),
|
|
96
|
+
right: w(H.right, o(() => B.value.right), q("right"))
|
|
97
|
+
}, Y = () => {
|
|
98
|
+
Object.values(J).forEach((e) => {
|
|
99
99
|
e.stop(), e.start();
|
|
100
100
|
});
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
};
|
|
102
|
+
y(P, (e) => {
|
|
103
|
+
e && (F.value = [...A.value], I.value = [...j.value], L.value = { ...M.value });
|
|
104
|
+
}, { flush: "sync" });
|
|
105
|
+
let X = (e, t) => {
|
|
106
|
+
if (t) F.value.includes(e) || (F.value = [...F.value, e]);
|
|
105
107
|
else {
|
|
106
|
-
if (
|
|
107
|
-
|
|
108
|
+
if (F.value.length <= 1) return;
|
|
109
|
+
F.value = F.value.filter((t) => t !== e);
|
|
108
110
|
}
|
|
109
111
|
}, Z = () => {
|
|
110
|
-
let e =
|
|
111
|
-
|
|
112
|
+
let e = k.value.map((e) => e.prop);
|
|
113
|
+
F.value = e, I.value = e, L.value = {};
|
|
112
114
|
}, Q = () => {
|
|
113
|
-
|
|
115
|
+
A.value = [...F.value], j.value = [...I.value], M.value = { ...L.value }, N(), P.value = !1;
|
|
114
116
|
}, $ = () => {
|
|
115
|
-
|
|
117
|
+
P.value = !1;
|
|
116
118
|
};
|
|
117
|
-
return (e, t) => (m(), s(v(
|
|
118
|
-
visible:
|
|
119
|
-
"onUpdate:visible": t[0] ||= (e) =>
|
|
119
|
+
return (e, t) => (m(), s(v(C), {
|
|
120
|
+
visible: P.value,
|
|
121
|
+
"onUpdate:visible": t[0] ||= (e) => P.value = e,
|
|
120
122
|
placement: "bottom-end",
|
|
121
123
|
width: "auto",
|
|
122
124
|
trigger: "click",
|
|
123
125
|
onShow: Y
|
|
124
126
|
}, {
|
|
125
|
-
reference:
|
|
127
|
+
reference: b(() => [f(v(x), {
|
|
126
128
|
link: "",
|
|
127
129
|
style: { "font-size": "16px" }
|
|
128
130
|
}, {
|
|
129
|
-
default:
|
|
130
|
-
default:
|
|
131
|
+
default: b(() => [f(v(n), null, {
|
|
132
|
+
default: b(() => [f(r)]),
|
|
131
133
|
_: 1
|
|
132
134
|
})]),
|
|
133
135
|
_: 1
|
|
134
136
|
})]),
|
|
135
|
-
default:
|
|
136
|
-
f(v(
|
|
137
|
+
default: b(() => [u("div", T, [
|
|
138
|
+
f(v(x), {
|
|
137
139
|
link: "",
|
|
138
140
|
onClick: $
|
|
139
141
|
}, {
|
|
140
|
-
default:
|
|
142
|
+
default: b(() => [d(_(v(O)("d.table.cancel")), 1)]),
|
|
141
143
|
_: 1
|
|
142
144
|
}),
|
|
143
|
-
f(v(
|
|
145
|
+
f(v(x), {
|
|
144
146
|
link: "",
|
|
145
147
|
type: "primary",
|
|
146
148
|
onClick: Z
|
|
147
149
|
}, {
|
|
148
|
-
default:
|
|
150
|
+
default: b(() => [d(_(v(O)("d.table.reset")), 1)]),
|
|
149
151
|
_: 1
|
|
150
152
|
}),
|
|
151
|
-
f(v(
|
|
153
|
+
f(v(x), {
|
|
152
154
|
link: "",
|
|
153
155
|
type: "primary",
|
|
154
156
|
onClick: Q
|
|
155
157
|
}, {
|
|
156
|
-
default:
|
|
158
|
+
default: b(() => [d(_(v(O)("d.table.confirm")), 1)]),
|
|
157
159
|
_: 1
|
|
158
160
|
})
|
|
159
|
-
]), u("div",
|
|
161
|
+
]), u("div", E, [(m(!0), l(a, null, g(V.value, (e) => (m(), l(a, { key: e.key }, [e.showLabel ? (m(), l("div", D, _(v(O)(e.labelKey)), 1)) : c("", !0), u("ul", {
|
|
160
162
|
ref_for: !0,
|
|
161
|
-
ref: (t) =>
|
|
163
|
+
ref: (t) => U(t, e.key),
|
|
162
164
|
class: "d-table-filter__list"
|
|
163
165
|
}, [(m(!0), l(a, null, g(e.items, (e) => (m(), l("li", {
|
|
164
166
|
key: e.prop,
|
|
165
167
|
class: "d-table-filter__item"
|
|
166
168
|
}, [f(v(n), { class: "d-table-filter__handle" }, {
|
|
167
|
-
default:
|
|
169
|
+
default: b(() => [f(i)]),
|
|
168
170
|
_: 1
|
|
169
|
-
}), f(v(
|
|
170
|
-
"model-value":
|
|
171
|
-
disabled:
|
|
171
|
+
}), f(v(S), {
|
|
172
|
+
"model-value": F.value.includes(e.prop),
|
|
173
|
+
disabled: F.value.length <= 1 && F.value.includes(e.prop),
|
|
172
174
|
onChange: (t) => X(e.prop, t)
|
|
173
175
|
}, {
|
|
174
|
-
default:
|
|
176
|
+
default: b(() => [d(_(e.label), 1)]),
|
|
175
177
|
_: 2
|
|
176
178
|
}, 1032, [
|
|
177
179
|
"model-value",
|
|
@@ -181,6 +183,6 @@ var w = { class: "d-table-filter__header" }, T = { class: "d-table-filter__body"
|
|
|
181
183
|
_: 1
|
|
182
184
|
}, 8, ["visible"]));
|
|
183
185
|
}
|
|
184
|
-
}), [["__scopeId", "data-v-
|
|
186
|
+
}), [["__scopeId", "data-v-106f6a04"]]);
|
|
185
187
|
//#endregion
|
|
186
|
-
export {
|
|
188
|
+
export { O as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.d-table-filter__body[data-v-106f6a04]{max-height:400px;overflow-y:auto}.d-table-filter__list[data-v-106f6a04]{margin:0;padding:0;list-style:none}.d-table-filter__item[data-v-106f6a04]{align-items:center;gap:6px;display:flex}.d-table-filter__item[data-v-106f6a04] .el-checkbox{height:24px}.d-table-filter__header[data-v-106f6a04]{justify-content:flex-end;align-items:center;gap:8px;margin-bottom:4px;display:flex}.d-table-filter__header[data-v-106f6a04] .el-button{margin:0}.d-table-filter__group-label[data-v-106f6a04]{color:var(--el-text-color-secondary);padding:4px 0 2px;font-size:12px}.d-table-filter__handle[data-v-106f6a04]{color:var(--el-text-color-placeholder);cursor:grab;flex-shrink:0}.d-table-filter__handle[data-v-106f6a04]:active{cursor:grabbing}
|
package/package.json
CHANGED
package/components/table/src/table-filter.vue_vue_type_style_index_0_scoped_023a2c22_lang.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
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}
|