geekplus-digital-ui 0.2.1 → 0.2.2
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/icons/grip-dots-vertical-solid.vue.d.ts +2 -0
- package/components/icons/grip-dots-vertical-solid.vue.js +16 -0
- package/components/table/index.d.ts +3 -0
- package/components/table/src/table-filter.vue.js +98 -70
- package/components/table/src/table-filter.vue_vue_type_style_index_0_scoped_9588721e_lang.css +1 -0
- package/components/table/src/table-wrapper.vue.js +18 -9
- package/components/table/src/table.vue.d.ts +1 -0
- package/components/table/src/table.vue.js +33 -28
- package/components/table/src/table.vue_vue_type_style_index_0_scoped_d07e3dbc_lang.css +1 -0
- package/package.json +1 -1
- package/skills/use-geekplus-digital-ui/SKILL.md +2 -2
- package/components/table/src/table-filter.vue_vue_type_style_index_0_scoped_70a03e33_lang.css +0 -1
- package/components/table/src/table.vue_vue_type_style_index_0_scoped_a6c85ac1_lang.css +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, SVGSVGElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
2
|
+
import { createElementBlock as t, createElementVNode as n, openBlock as r } from "vue";
|
|
3
|
+
//#region packages/components/icons/grip-dots-vertical-solid.vue
|
|
4
|
+
var i = {}, a = {
|
|
5
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
viewBox: "0 0 320 512"
|
|
7
|
+
};
|
|
8
|
+
function o(e, i) {
|
|
9
|
+
return r(), t("svg", a, [...i[0] ||= [n("path", {
|
|
10
|
+
fill: "currentColor",
|
|
11
|
+
d: "M128 64A64 64 0 1 0 0 64 64 64 0 1 0 128 64zm0 192a64 64 0 1 0 -128 0 64 64 0 1 0 128 0zM0 448c0 35.3 28.7 64 64 64s64-28.7 64-64-28.7-64-64-64-64 28.7-64 64zM320 64a64 64 0 1 0 -128 0 64 64 0 1 0 128 0zM192 256a64 64 0 1 0 128 0 64 64 0 1 0 -128 0zM320 448c0-35.3-28.7-64-64-64s-64 28.7-64 64 28.7 64 64 64 64-28.7 64-64z"
|
|
12
|
+
}, null, -1)]]);
|
|
13
|
+
}
|
|
14
|
+
var s = /* @__PURE__ */ e(i, [["render", o]]);
|
|
15
|
+
//#endregion
|
|
16
|
+
export { s as default };
|
|
@@ -4,6 +4,7 @@ export const DTable: {
|
|
|
4
4
|
columnList: import('vue').Ref<never[], never[]>;
|
|
5
5
|
checkedKeys: import('vue').Ref<never[], never[]>;
|
|
6
6
|
columnOrder: import('vue').Ref<never[], never[]>;
|
|
7
|
+
columnFixed: import('vue').Ref<{}, {}>;
|
|
7
8
|
saveConfig: () => void;
|
|
8
9
|
readonly storageKey: string;
|
|
9
10
|
};
|
|
@@ -45,6 +46,7 @@ export const DTable: {
|
|
|
45
46
|
columnList: import('vue').Ref<never[], never[]>;
|
|
46
47
|
checkedKeys: import('vue').Ref<never[], never[]>;
|
|
47
48
|
columnOrder: import('vue').Ref<never[], never[]>;
|
|
49
|
+
columnFixed: import('vue').Ref<{}, {}>;
|
|
48
50
|
saveConfig: () => void;
|
|
49
51
|
readonly storageKey: string;
|
|
50
52
|
};
|
|
@@ -81,6 +83,7 @@ export const DTable: {
|
|
|
81
83
|
columnList: import('vue').Ref<never[], never[]>;
|
|
82
84
|
checkedKeys: import('vue').Ref<never[], never[]>;
|
|
83
85
|
columnOrder: import('vue').Ref<never[], never[]>;
|
|
86
|
+
columnFixed: import('vue').Ref<{}, {}>;
|
|
84
87
|
saveConfig: () => void;
|
|
85
88
|
readonly storageKey: string;
|
|
86
89
|
};
|
|
@@ -3,129 +3,157 @@ import "../../../hooks/index.js";
|
|
|
3
3
|
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
|
-
import
|
|
6
|
+
import i from "../../icons/grip-dots-vertical-solid.vue.js";
|
|
7
|
+
import './table-filter.vue_vue_type_style_index_0_scoped_9588721e_lang.css';/* empty css */
|
|
7
8
|
import "../../index.js";
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import { ElButton as
|
|
10
|
-
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, withCtx as y } from "vue";
|
|
10
|
+
import { ElButton as b, ElCheckbox as x, ElPopover as S } from "element-plus";
|
|
11
|
+
import { useSortable as C } from "@vueuse/integrations/useSortable";
|
|
11
12
|
//#region packages/components/table/src/table-filter.vue
|
|
12
|
-
var
|
|
13
|
+
var w = { class: "d-table-filter__header" }, T = { class: "d-table-filter__body" }, E = {
|
|
13
14
|
key: 0,
|
|
14
15
|
class: "d-table-filter__group-label"
|
|
15
|
-
},
|
|
16
|
+
}, D = /* @__PURE__ */ t(/* @__PURE__ */ Object.assign({ name: "DTableFilter" }, {
|
|
16
17
|
__name: "table-filter",
|
|
17
18
|
setup(t) {
|
|
18
|
-
let { t:
|
|
19
|
-
let t =
|
|
19
|
+
let { t: D } = e(), { columnList: O, checkedKeys: k, columnOrder: A, columnFixed: j, saveConfig: M } = p("dTableContext"), N = (e) => Object.prototype.hasOwnProperty.call(j.value, e) ? j.value[e] : O.value.find((t) => t.prop === e)?.fixed ?? !1, P = (e) => {
|
|
20
|
+
let t = A.value.map((t) => {
|
|
21
|
+
let n = O.value.find((e) => e.prop === t);
|
|
22
|
+
return !n || N(t) !== e ? null : n;
|
|
23
|
+
}).filter(Boolean), n = O.value.filter((t) => N(t.prop) === e && !A.value.includes(t.prop));
|
|
20
24
|
return [...t, ...n];
|
|
21
|
-
},
|
|
22
|
-
left:
|
|
23
|
-
middle:
|
|
24
|
-
right:
|
|
25
|
-
})),
|
|
25
|
+
}, F = o(() => ({
|
|
26
|
+
left: P("left"),
|
|
27
|
+
middle: P(!1),
|
|
28
|
+
right: P("right")
|
|
29
|
+
})), I = o(() => [
|
|
26
30
|
{
|
|
27
31
|
key: "left",
|
|
28
32
|
labelKey: "d.table.fixedLeft",
|
|
29
|
-
items:
|
|
30
|
-
hideWhenEmpty: !0,
|
|
33
|
+
items: F.value.left,
|
|
31
34
|
showLabel: !0
|
|
32
35
|
},
|
|
33
36
|
{
|
|
34
37
|
key: "middle",
|
|
35
38
|
labelKey: "d.table.columns",
|
|
36
|
-
items:
|
|
37
|
-
|
|
38
|
-
showLabel: M.value.left.length > 0 || M.value.right.length > 0
|
|
39
|
+
items: F.value.middle,
|
|
40
|
+
showLabel: !0
|
|
39
41
|
},
|
|
40
42
|
{
|
|
41
43
|
key: "right",
|
|
42
44
|
labelKey: "d.table.fixedRight",
|
|
43
|
-
items:
|
|
44
|
-
hideWhenEmpty: !0,
|
|
45
|
+
items: F.value.right,
|
|
45
46
|
showLabel: !0
|
|
46
47
|
}
|
|
47
|
-
]),
|
|
48
|
-
left:
|
|
49
|
-
middle:
|
|
50
|
-
right:
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
...
|
|
60
|
-
...
|
|
61
|
-
...
|
|
62
|
-
|
|
63
|
-
|
|
48
|
+
]), L = {
|
|
49
|
+
left: h(null),
|
|
50
|
+
middle: h(null),
|
|
51
|
+
right: h(null)
|
|
52
|
+
}, R = (e, t) => {
|
|
53
|
+
L[t].value = e;
|
|
54
|
+
}, z = (e) => Object.keys(L).find((t) => L[t].value === e), B = {
|
|
55
|
+
left: "left",
|
|
56
|
+
middle: !1,
|
|
57
|
+
right: "right"
|
|
58
|
+
}, V = (e) => (t) => {
|
|
59
|
+
let { from: n, to: r, oldIndex: i, newIndex: a } = t, o = z(r) ?? e, s = {
|
|
60
|
+
left: [...F.value.left.map((e) => e.prop)],
|
|
61
|
+
middle: [...F.value.middle.map((e) => e.prop)],
|
|
62
|
+
right: [...F.value.right.map((e) => e.prop)]
|
|
63
|
+
};
|
|
64
|
+
if (n === r) {
|
|
65
|
+
if (i === a) return;
|
|
66
|
+
let [t] = s[e].splice(i, 1);
|
|
67
|
+
s[e].splice(a, 0, t);
|
|
68
|
+
} else {
|
|
69
|
+
let t = s[e][i];
|
|
70
|
+
if (!t) return;
|
|
71
|
+
s[e].splice(i, 1), s[o].splice(a, 0, t), j.value = {
|
|
72
|
+
...j.value,
|
|
73
|
+
[t]: B[o]
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
A.value = [
|
|
77
|
+
...s.left,
|
|
78
|
+
...s.middle,
|
|
79
|
+
...s.right
|
|
80
|
+
], M();
|
|
81
|
+
}, H = (e) => ({
|
|
64
82
|
handle: ".d-table-filter__handle",
|
|
65
83
|
animation: 150,
|
|
84
|
+
group: {
|
|
85
|
+
name: "d-table-filter-cols",
|
|
86
|
+
pull: !0,
|
|
87
|
+
put: !0
|
|
88
|
+
},
|
|
66
89
|
onUpdate: () => {},
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
},
|
|
75
|
-
|
|
90
|
+
onAdd: () => {},
|
|
91
|
+
onRemove: () => {},
|
|
92
|
+
onEnd: V(e)
|
|
93
|
+
}), U = {
|
|
94
|
+
left: C(L.left, o(() => F.value.left), H("left")),
|
|
95
|
+
middle: C(L.middle, o(() => F.value.middle), H("middle")),
|
|
96
|
+
right: C(L.right, o(() => F.value.right), H("right"))
|
|
97
|
+
}, W = !1, G = () => {
|
|
98
|
+
W || (W = !0, Object.values(U).forEach((e) => e.start()));
|
|
99
|
+
}, K = (e, t) => {
|
|
100
|
+
if (t) k.value.includes(e) || (k.value = [...k.value, e], M());
|
|
76
101
|
else {
|
|
77
|
-
if (
|
|
78
|
-
|
|
102
|
+
if (k.value.length <= 1) return;
|
|
103
|
+
k.value = k.value.filter((t) => t !== e), M();
|
|
79
104
|
}
|
|
80
|
-
},
|
|
81
|
-
let e =
|
|
82
|
-
|
|
105
|
+
}, q = () => {
|
|
106
|
+
let e = O.value.map((e) => e.prop);
|
|
107
|
+
k.value = e, A.value = e, j.value = {}, M();
|
|
83
108
|
};
|
|
84
|
-
return (e, t) => (
|
|
109
|
+
return (e, t) => (m(), s(v(S), {
|
|
85
110
|
placement: "bottom-end",
|
|
86
111
|
width: "auto",
|
|
87
112
|
trigger: "click",
|
|
88
|
-
onShow:
|
|
113
|
+
onShow: G
|
|
89
114
|
}, {
|
|
90
|
-
reference:
|
|
115
|
+
reference: y(() => [f(v(b), {
|
|
91
116
|
link: "",
|
|
92
117
|
style: { "font-size": "16px" }
|
|
93
118
|
}, {
|
|
94
|
-
default:
|
|
95
|
-
default:
|
|
119
|
+
default: y(() => [f(v(n), null, {
|
|
120
|
+
default: y(() => [f(r)]),
|
|
96
121
|
_: 1
|
|
97
122
|
})]),
|
|
98
123
|
_: 1
|
|
99
124
|
})]),
|
|
100
|
-
default:
|
|
125
|
+
default: y(() => [u("div", w, [f(v(b), {
|
|
101
126
|
link: "",
|
|
102
127
|
type: "primary",
|
|
103
|
-
onClick:
|
|
128
|
+
onClick: q
|
|
104
129
|
}, {
|
|
105
|
-
default:
|
|
130
|
+
default: y(() => [d(_(v(D)("d.table.reset")), 1)]),
|
|
106
131
|
_: 1
|
|
107
|
-
})]),
|
|
132
|
+
})]), u("div", T, [(m(!0), l(a, null, g(I.value, (e) => (m(), l(a, { key: e.key }, [e.showLabel ? (m(), l("div", E, _(v(D)(e.labelKey)), 1)) : c("", !0), u("ul", {
|
|
108
133
|
ref_for: !0,
|
|
109
|
-
ref: (t) =>
|
|
134
|
+
ref: (t) => R(t, e.key),
|
|
110
135
|
class: "d-table-filter__list"
|
|
111
|
-
}, [(
|
|
136
|
+
}, [(m(!0), l(a, null, g(e.items, (e) => (m(), l("li", {
|
|
112
137
|
key: e.prop,
|
|
113
138
|
class: "d-table-filter__item"
|
|
114
|
-
}, [
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
139
|
+
}, [f(v(n), { class: "d-table-filter__handle" }, {
|
|
140
|
+
default: y(() => [f(i)]),
|
|
141
|
+
_: 1
|
|
142
|
+
}), f(v(x), {
|
|
143
|
+
"model-value": v(k).includes(e.prop),
|
|
144
|
+
disabled: v(k).length <= 1 && v(k).includes(e.prop),
|
|
145
|
+
onChange: (t) => K(e.prop, t)
|
|
118
146
|
}, {
|
|
119
|
-
default:
|
|
147
|
+
default: y(() => [d(_(e.label), 1)]),
|
|
120
148
|
_: 2
|
|
121
149
|
}, 1032, [
|
|
122
150
|
"model-value",
|
|
123
151
|
"disabled",
|
|
124
152
|
"onChange"
|
|
125
|
-
])]))), 128))], 512)], 64))
|
|
153
|
+
])]))), 128))], 512)], 64))), 128))])]),
|
|
126
154
|
_: 1
|
|
127
155
|
}));
|
|
128
156
|
}
|
|
129
|
-
}), [["__scopeId", "data-v-
|
|
157
|
+
}), [["__scopeId", "data-v-9588721e"]]);
|
|
130
158
|
//#endregion
|
|
131
|
-
export {
|
|
159
|
+
export { D as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.d-table-filter__body[data-v-9588721e]{max-height:400px;overflow-y:auto}.d-table-filter__list[data-v-9588721e]{margin:0;padding:0;list-style:none}.d-table-filter__item[data-v-9588721e]{align-items:center;gap:6px;display:flex}.d-table-filter__item[data-v-9588721e] .el-checkbox{height:24px}.d-table-filter__header[data-v-9588721e]{justify-content:flex-end;margin-bottom:4px;display:flex}.d-table-filter__group-label[data-v-9588721e]{color:var(--el-text-color-secondary);padding:4px 0 2px;font-size:12px}.d-table-filter__handle[data-v-9588721e]{color:var(--el-text-color-placeholder);cursor:grab;flex-shrink:0}.d-table-filter__handle[data-v-9588721e]:active{cursor:grabbing}
|
|
@@ -11,8 +11,8 @@ var r = (e) => (e?.type?.name || e?.type?.__name) === "ElTableColumn", i = (t) =
|
|
|
11
11
|
let t = [], n = [];
|
|
12
12
|
for (let i of e) {
|
|
13
13
|
if (!r(i)) continue;
|
|
14
|
-
let {
|
|
15
|
-
e ?
|
|
14
|
+
let { prop: e } = i.props || {};
|
|
15
|
+
e ? t.push(i) : n.push(i);
|
|
16
16
|
}
|
|
17
17
|
return {
|
|
18
18
|
controllable: t,
|
|
@@ -28,24 +28,33 @@ var r = (e) => (e?.type?.name || e?.type?.__name) === "ElTableColumn", i = (t) =
|
|
|
28
28
|
if (!c) return e;
|
|
29
29
|
let l = c.children?.default, { controllable: u, always: d } = a(i(typeof l == "function" ? l() : [])), f = u.map((e) => ({
|
|
30
30
|
prop: e.props.prop,
|
|
31
|
-
label: e.props.label,
|
|
31
|
+
label: e.props.label || e.props.type || e.props.prop,
|
|
32
32
|
fixed: e.props.fixed === "right" ? "right" : e.props.fixed ? "left" : !1
|
|
33
33
|
}));
|
|
34
34
|
queueMicrotask(() => {
|
|
35
35
|
JSON.stringify(s.columnList.value) !== JSON.stringify(f) && (s.columnList.value = f);
|
|
36
36
|
});
|
|
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 =
|
|
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) => {
|
|
38
|
+
let n = e.props?.prop;
|
|
39
|
+
if (!n || !Object.prototype.hasOwnProperty.call(g, n)) return e;
|
|
40
|
+
let r = g[n], i = { ...e.props };
|
|
41
|
+
return r ? i.fixed = r : delete i.fixed, t(e.type, i, e.children);
|
|
42
|
+
}, v = [
|
|
38
43
|
...m,
|
|
39
|
-
...p,
|
|
44
|
+
...p.map(_),
|
|
40
45
|
...h
|
|
41
|
-
],
|
|
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, {
|
|
42
51
|
...c.props,
|
|
43
|
-
key:
|
|
52
|
+
key: b
|
|
44
53
|
}, {
|
|
45
54
|
...c.children,
|
|
46
|
-
default: () =>
|
|
55
|
+
default: () => v
|
|
47
56
|
});
|
|
48
|
-
return n.map((e) => e === c ?
|
|
57
|
+
return n.map((e) => e === c ? x : e);
|
|
49
58
|
};
|
|
50
59
|
}
|
|
51
60
|
};
|
|
@@ -8,6 +8,7 @@ declare const __VLS_component: import('vue').DefineComponent<{}, {
|
|
|
8
8
|
columnList: import('vue').Ref<never[], never[]>;
|
|
9
9
|
checkedKeys: import('vue').Ref<never[], never[]>;
|
|
10
10
|
columnOrder: import('vue').Ref<never[], never[]>;
|
|
11
|
+
columnFixed: import('vue').Ref<{}, {}>;
|
|
11
12
|
saveConfig: () => void;
|
|
12
13
|
readonly storageKey: string;
|
|
13
14
|
};
|
|
@@ -3,7 +3,7 @@ import "../../../hooks/index.js";
|
|
|
3
3
|
import t from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
4
|
import n from "./table-wrapper.vue.js";
|
|
5
5
|
import r from "./table-filter.vue.js";
|
|
6
|
-
import './table.
|
|
6
|
+
import './table.vue_vue_type_style_index_0_scoped_d07e3dbc_lang.css';/* empty css */
|
|
7
7
|
import { computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createVNode as l, mergeModels as u, onMounted as d, openBlock as f, provide as p, ref as m, renderSlot as h, toDisplayString as g, unref as _, useModel as v, useSlots as y, useTemplateRef as b, watch as x, withCtx as S } from "vue";
|
|
8
8
|
import { useResizeObserver as C } from "@vueuse/core";
|
|
9
9
|
import { ElPagination as w } from "element-plus";
|
|
@@ -76,68 +76,73 @@ var T = { class: "d-table" }, E = {
|
|
|
76
76
|
}),
|
|
77
77
|
emits: /* @__PURE__ */ u(["page-change"], ["update:currentPage", "update:pageSize"]),
|
|
78
78
|
setup(t, { expose: u, emit: j }) {
|
|
79
|
-
let { t: M } = e(), N = t, P = j, F = v(t, "currentPage"), I = v(t, "pageSize"), L = y(), R = i(() => !!L.toolbar), z = m([]), B = m([]), V = m([]), H = () => `d-table-${N.storageKey}`,
|
|
79
|
+
let { t: M } = e(), N = t, P = j, F = v(t, "currentPage"), I = v(t, "pageSize"), L = y(), R = i(() => !!L.toolbar), z = m([]), B = m([]), V = m([]), H = m({}), U = () => `d-table-${N.storageKey}`, W = () => {
|
|
80
80
|
if (N.storageKey) try {
|
|
81
|
-
let e = localStorage.getItem(
|
|
81
|
+
let e = localStorage.getItem(U());
|
|
82
82
|
if (!e) return;
|
|
83
|
-
let { checkedKeys: t, columnOrder: n } = JSON.parse(e);
|
|
84
|
-
Array.isArray(t) && (B.value = t), Array.isArray(n) && (V.value = n);
|
|
83
|
+
let { checkedKeys: t, columnOrder: n, columnFixed: r } = JSON.parse(e);
|
|
84
|
+
Array.isArray(t) && (B.value = t), Array.isArray(n) && (V.value = n), r && typeof r == "object" && !Array.isArray(r) && (H.value = r);
|
|
85
85
|
} catch {}
|
|
86
|
-
},
|
|
86
|
+
}, G = () => {
|
|
87
87
|
if (N.storageKey) try {
|
|
88
|
-
localStorage.setItem(
|
|
88
|
+
localStorage.setItem(U(), JSON.stringify({
|
|
89
89
|
checkedKeys: B.value,
|
|
90
|
-
columnOrder: V.value
|
|
90
|
+
columnOrder: V.value,
|
|
91
|
+
columnFixed: H.value
|
|
91
92
|
}));
|
|
92
93
|
} catch {}
|
|
93
94
|
};
|
|
94
|
-
|
|
95
|
+
W(), x(z, () => {
|
|
95
96
|
let e = z.value.map((e) => e.prop), t = e.filter((e) => !V.value.includes(e));
|
|
96
97
|
t.length && (V.value = [...V.value, ...t], B.value = [...B.value, ...t]), V.value = V.value.filter((t) => e.includes(t)), B.value = B.value.filter((t) => e.includes(t));
|
|
98
|
+
let n = {};
|
|
99
|
+
for (let [t, r] of Object.entries(H.value)) e.includes(t) && (n[t] = r);
|
|
100
|
+
H.value = n;
|
|
97
101
|
}, { deep: !0 });
|
|
98
|
-
let
|
|
102
|
+
let K = {
|
|
99
103
|
columnList: z,
|
|
100
104
|
checkedKeys: B,
|
|
101
105
|
columnOrder: V,
|
|
102
|
-
|
|
106
|
+
columnFixed: H,
|
|
107
|
+
saveConfig: G,
|
|
103
108
|
get storageKey() {
|
|
104
|
-
return
|
|
109
|
+
return U();
|
|
105
110
|
}
|
|
106
111
|
};
|
|
107
|
-
p("dTableContext",
|
|
108
|
-
let
|
|
109
|
-
if (!N.autoHeight || !N.availableHeight || !
|
|
110
|
-
|
|
112
|
+
p("dTableContext", K);
|
|
113
|
+
let q = b("tableAreaRef"), J = m(void 0), Y = () => {
|
|
114
|
+
if (!N.autoHeight || !N.availableHeight || !q.value) {
|
|
115
|
+
J.value = void 0;
|
|
111
116
|
return;
|
|
112
117
|
}
|
|
113
118
|
if (!N.heightContainer) {
|
|
114
|
-
|
|
119
|
+
J.value = void 0;
|
|
115
120
|
return;
|
|
116
121
|
}
|
|
117
122
|
let e = document.querySelector(N.heightContainer);
|
|
118
123
|
if (!e) return;
|
|
119
|
-
let { height: t } = e.getBoundingClientRect(), { height: n } =
|
|
120
|
-
|
|
124
|
+
let { height: t } = e.getBoundingClientRect(), { height: n } = q.value.getBoundingClientRect(), r = N.availableHeight - (t - n);
|
|
125
|
+
J.value = r > 0 ? r : void 0;
|
|
121
126
|
};
|
|
122
127
|
return d(() => {
|
|
123
|
-
if (!
|
|
124
|
-
let e =
|
|
125
|
-
t && C(t,
|
|
128
|
+
if (!q.value) return;
|
|
129
|
+
let e = q.value.parentElement, t = N.heightContainer ? document.querySelector(N.heightContainer) : null;
|
|
130
|
+
t && C(t, Y), e && C(e, Y), Y();
|
|
126
131
|
}), x(() => [
|
|
127
132
|
N.autoHeight,
|
|
128
133
|
N.availableHeight,
|
|
129
134
|
N.heightContainer
|
|
130
|
-
],
|
|
131
|
-
tableContext:
|
|
132
|
-
saveConfig:
|
|
135
|
+
], Y), u({
|
|
136
|
+
tableContext: K,
|
|
137
|
+
saveConfig: G
|
|
133
138
|
}), (e, i) => (f(), s("div", T, [
|
|
134
139
|
R.value || t.filterable ? (f(), s("div", E, [c("div", D, [h(e.$slots, "toolbar", {}, void 0, !0)]), c("div", O, [t.filterable ? (f(), a(r, { key: 0 })) : o("", !0)])])) : o("", !0),
|
|
135
140
|
c("div", {
|
|
136
141
|
ref_key: "tableAreaRef",
|
|
137
|
-
ref:
|
|
142
|
+
ref: q,
|
|
138
143
|
class: "d-table__body"
|
|
139
144
|
}, [l(n, null, {
|
|
140
|
-
default: S(() => [h(e.$slots, "default", { tableHeight:
|
|
145
|
+
default: S(() => [h(e.$slots, "default", { tableHeight: J.value }, void 0, !0)]),
|
|
141
146
|
_: 3
|
|
142
147
|
})], 512),
|
|
143
148
|
t.showPage ? (f(), s("div", k, [h(e.$slots, "pagination", {}, () => [l(_(w), {
|
|
@@ -161,6 +166,6 @@ var T = { class: "d-table" }, E = {
|
|
|
161
166
|
])], !0), t.showTip ? (f(), s("span", A, g(_(M)("d.table.scrollTip")), 1)) : o("", !0)])) : o("", !0)
|
|
162
167
|
]));
|
|
163
168
|
}
|
|
164
|
-
}), [["__scopeId", "data-v-
|
|
169
|
+
}), [["__scopeId", "data-v-d07e3dbc"]]);
|
|
165
170
|
//#endregion
|
|
166
171
|
export { j as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.d-table[data-v-d07e3dbc]{flex-direction:column;gap:12px;display:flex}.d-table__toolbar[data-v-d07e3dbc]{justify-content:space-between;align-items:center;gap:12px;display:flex}.d-table__toolbar-left[data-v-d07e3dbc]{flex:1;align-items:center;gap:12px;display:flex}.d-table__toolbar-left[data-v-d07e3dbc] .el-button{margin:0}.d-table__toolbar-right[data-v-d07e3dbc]{flex-shrink:0;align-items:center;gap:12px;display:flex}.d-table__pagination[data-v-d07e3dbc]{flex-shrink:0;justify-content:space-between;align-items:center;display:flex}.d-table__scroll-tip[data-v-d07e3dbc]{color:var(--el-text-color-secondary);font-size:12px}
|
package/package.json
CHANGED
|
@@ -46,7 +46,7 @@ Peer dependencies: `vue@^3.5.0`、`element-plus@^2.13.0`
|
|
|
46
46
|
| **InlineEdit** | `<d-inline-edit>` | 展示态/编辑态切换 |
|
|
47
47
|
| **SearchForm** | `<d-search-form>` | 可折叠搜索筛选区域 |
|
|
48
48
|
| **SearchItem** | `<d-search-item>` | 搜索表单的单个搜索项,配合 SearchForm 使用 |
|
|
49
|
-
| **Table** | `<d-table>` |
|
|
49
|
+
| **Table** | `<d-table>` | 表格列筛选/拖排/跨区固定/内置分页/自适应高度 |
|
|
50
50
|
|
|
51
51
|
详细 Props/Events/Slots API 请查阅文档:https://ui.geekplus.cc/static/ui/
|
|
52
52
|
|
|
@@ -60,7 +60,7 @@ Peer dependencies: `vue@^3.5.0`、`element-plus@^2.13.0`
|
|
|
60
60
|
- 图标悬浮提示 → `<d-icon-tip>`
|
|
61
61
|
- 行内编辑切换 → `<d-inline-edit>`
|
|
62
62
|
- 搜索筛选表单 → `<d-search-form>` + `<d-search-item>`
|
|
63
|
-
-
|
|
63
|
+
- 表格列显示/隐藏、列拖动排序、跨区拖拽改变固定状态、分页、表格自适应高度 → `<d-table>`
|
|
64
64
|
|
|
65
65
|
2. **全局配置优先**:通用参数(如 Upload 的 `domain`、`axios`、`url`)应通过全局配置注入,业务页面只关注数据绑定和交互逻辑:
|
|
66
66
|
|
package/components/table/src/table-filter.vue_vue_type_style_index_0_scoped_70a03e33_lang.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.d-table-filter__body[data-v-70a03e33]{max-height:400px;overflow-y:auto}.d-table-filter__list[data-v-70a03e33]{margin:0;padding:0;list-style:none}.d-table-filter__item[data-v-70a03e33]{align-items:center;gap:6px;display:flex}.d-table-filter__item[data-v-70a03e33] .el-checkbox{height:24px}.d-table-filter__header[data-v-70a03e33]{justify-content:flex-end;margin-bottom:4px;display:flex}.d-table-filter__group-label[data-v-70a03e33]{color:var(--el-text-color-secondary);padding:4px 0 2px;font-size:12px}.d-table-filter__handle[data-v-70a03e33]{color:var(--el-text-color-placeholder);cursor:grab;flex-shrink:0;font-size:16px;line-height:1}.d-table-filter__handle[data-v-70a03e33]:active{cursor:grabbing}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.d-table[data-v-a6c85ac1]{flex-direction:column;gap:12px;display:flex}.d-table__toolbar[data-v-a6c85ac1]{justify-content:space-between;align-items:center;gap:12px;display:flex}.d-table__toolbar-left[data-v-a6c85ac1]{flex:1;align-items:center;gap:12px;display:flex}.d-table__toolbar-left[data-v-a6c85ac1] .el-button{margin:0}.d-table__toolbar-right[data-v-a6c85ac1]{flex-shrink:0;align-items:center;gap:12px;display:flex}.d-table__pagination[data-v-a6c85ac1]{flex-shrink:0;justify-content:space-between;align-items:center;display:flex}.d-table__scroll-tip[data-v-a6c85ac1]{color:var(--el-text-color-secondary);font-size:12px}
|