@oneflowui/ui 0.5.4 → 0.5.6
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/dist/components/breadcrumb/Breadcrumb.vue.js +2 -2
- package/dist/components/breadcrumb/BreadcrumbItem.vue.js +2 -2
- package/dist/components/table/DataTable.vue.d.ts +18 -0
- package/dist/components/table/DataTable.vue.js +1 -1
- package/dist/components/table/DataTable.vue2.js +485 -455
- package/dist/components/table/MobileListView.vue.d.ts +23 -1
- package/dist/components/table/MobileListView.vue.js +1 -1
- package/dist/components/table/MobileListView.vue2.js +48 -39
- package/dist/components/table/TableDataRow.vue.js +1 -1
- package/dist/components/table/TableDataRow.vue2.js +45 -41
- package/dist/components/table/TableGroupRow.vue.js +2 -2
- package/dist/components/table/TableGroupRow.vue2.js +37 -31
- package/dist/components/table/TableHeaderRow.vue.js +1 -1
- package/dist/components/table/TableHeaderRow.vue2.js +31 -24
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -10,7 +10,23 @@ type __VLS_Props = {
|
|
|
10
10
|
statusColorMap?: ColorMap;
|
|
11
11
|
readonly?: boolean;
|
|
12
12
|
};
|
|
13
|
-
declare
|
|
13
|
+
declare function __VLS_template(): {
|
|
14
|
+
attrs: Partial<{}>;
|
|
15
|
+
slots: {
|
|
16
|
+
cell?(_: {
|
|
17
|
+
row: TableRow;
|
|
18
|
+
col: TableColumn;
|
|
19
|
+
}): any;
|
|
20
|
+
cell?(_: {
|
|
21
|
+
row: TableRow;
|
|
22
|
+
col: TableColumn;
|
|
23
|
+
}): any;
|
|
24
|
+
};
|
|
25
|
+
refs: {};
|
|
26
|
+
rootEl: HTMLDivElement;
|
|
27
|
+
};
|
|
28
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
29
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
14
30
|
"row-click": (row: any) => any;
|
|
15
31
|
"add-row": () => any;
|
|
16
32
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
@@ -21,4 +37,10 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
21
37
|
addable: boolean;
|
|
22
38
|
readonly: boolean;
|
|
23
39
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
40
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
24
41
|
export default _default;
|
|
42
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
43
|
+
new (): {
|
|
44
|
+
$slots: S;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./MobileListView.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-e312b60f"]]);
|
|
5
5
|
export {
|
|
6
6
|
f as default
|
|
7
7
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { mergeColorMap as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as E, computed as v, ref as k, openBlock as o, createElementBlock as a, Fragment as g, renderList as C, createElementVNode as X, normalizeStyle as M, renderSlot as S, createTextVNode as A, toDisplayString as d, createCommentVNode as i } from "vue";
|
|
2
|
+
import { mergeColorMap as L, DEFAULT_STATUS_MAP as N, resolveBadge as Y } from "../../composables/useBadge.js";
|
|
3
|
+
const D = { class: "of-mobile-list" }, F = ["onClick", "onTouchstart"], U = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "of-mobile-card__title"
|
|
6
|
-
},
|
|
6
|
+
}, z = {
|
|
7
7
|
key: 1,
|
|
8
8
|
class: "of-mobile-card__meta"
|
|
9
|
-
},
|
|
9
|
+
}, I = {
|
|
10
10
|
key: 1,
|
|
11
11
|
class: "of-mobile-card__tag"
|
|
12
|
-
},
|
|
12
|
+
}, O = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "of-mobile-card__action-delete"
|
|
15
|
-
},
|
|
15
|
+
}, j = /* @__PURE__ */ E({
|
|
16
16
|
__name: "MobileListView",
|
|
17
17
|
props: {
|
|
18
18
|
rows: {},
|
|
@@ -23,61 +23,70 @@ const $ = { class: "of-mobile-list" }, D = ["onClick", "onTouchstart"], F = {
|
|
|
23
23
|
readonly: { type: Boolean, default: !1 }
|
|
24
24
|
},
|
|
25
25
|
emits: ["row-click", "add-row"],
|
|
26
|
-
setup(r, { emit:
|
|
27
|
-
const m = r, y =
|
|
28
|
-
function u(
|
|
29
|
-
const e =
|
|
26
|
+
setup(r, { emit: T }) {
|
|
27
|
+
const m = r, y = T, B = v(() => L(N, m.statusColorMap)), f = v(() => m.columns[0]), h = v(() => m.columns.slice(1, 4));
|
|
28
|
+
function u(t, n) {
|
|
29
|
+
const e = t[n.key];
|
|
30
30
|
return e != null ? String(e) : "";
|
|
31
31
|
}
|
|
32
|
-
function p(
|
|
33
|
-
return Y(
|
|
32
|
+
function p(t) {
|
|
33
|
+
return Y(t, B.value);
|
|
34
34
|
}
|
|
35
|
-
let b = 0,
|
|
36
|
-
const c =
|
|
37
|
-
function
|
|
38
|
-
b =
|
|
35
|
+
let b = 0, _ = 0;
|
|
36
|
+
const c = k(null), s = k(0);
|
|
37
|
+
function V(t, n) {
|
|
38
|
+
b = t.touches[0].clientX, _ = t.touches[0].clientY, c.value = n, s.value = 0;
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function $(t) {
|
|
41
41
|
if (!c.value) return;
|
|
42
|
-
const n =
|
|
42
|
+
const n = t.touches[0].clientX - b, e = t.touches[0].clientY - _;
|
|
43
43
|
if (Math.abs(e) > Math.abs(n)) {
|
|
44
44
|
c.value = null;
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
s.value = Math.max(-80, Math.min(0, n));
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function x() {
|
|
50
50
|
s.value < -40 ? s.value = -80 : (s.value = 0, c.value = null);
|
|
51
51
|
}
|
|
52
|
-
return (
|
|
53
|
-
(
|
|
52
|
+
return (t, n) => (o(), a("div", D, [
|
|
53
|
+
(o(!0), a(g, null, C(r.rows, (e) => (o(), a("div", {
|
|
54
54
|
key: e.id,
|
|
55
55
|
class: "of-mobile-card-wrapper"
|
|
56
56
|
}, [
|
|
57
57
|
X("div", {
|
|
58
58
|
class: "of-mobile-card",
|
|
59
59
|
style: M({ transform: c.value === e.id ? `translateX(${s.value}px)` : "" }),
|
|
60
|
-
onClick: (
|
|
61
|
-
onTouchstart: (
|
|
62
|
-
onTouchmove:
|
|
63
|
-
onTouchend:
|
|
60
|
+
onClick: (l) => y("row-click", e),
|
|
61
|
+
onTouchstart: (l) => V(l, e.id),
|
|
62
|
+
onTouchmove: $,
|
|
63
|
+
onTouchend: x
|
|
64
64
|
}, [
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}, [
|
|
70
|
-
|
|
65
|
+
f.value ? (o(), a("div", U, [
|
|
66
|
+
S(t.$slots, "cell", {
|
|
67
|
+
row: e,
|
|
68
|
+
col: f.value
|
|
69
|
+
}, () => [
|
|
70
|
+
A(d(u(e, f.value) || "—"), 1)
|
|
71
|
+
], !0)
|
|
72
|
+
])) : i("", !0),
|
|
73
|
+
h.value.length > 0 ? (o(), a("div", z, [
|
|
74
|
+
(o(!0), a(g, null, C(h.value, (l) => S(t.$slots, "cell", {
|
|
75
|
+
key: l.key,
|
|
76
|
+
row: e,
|
|
77
|
+
col: l
|
|
78
|
+
}, () => [
|
|
79
|
+
l.key === "status" && u(e, l) ? (o(), a("span", {
|
|
71
80
|
key: 0,
|
|
72
81
|
class: "of-mobile-card__badge",
|
|
73
|
-
style: M(p(u(e,
|
|
74
|
-
}, d(p(u(e,
|
|
75
|
-
],
|
|
82
|
+
style: M(p(u(e, l)).style)
|
|
83
|
+
}, d(p(u(e, l)).label), 5)) : u(e, l) ? (o(), a("span", I, d(l.label) + ": " + d(u(e, l)), 1)) : i("", !0)
|
|
84
|
+
], !0)), 128))
|
|
76
85
|
])) : i("", !0)
|
|
77
|
-
], 44,
|
|
78
|
-
c.value === e.id && s.value < -40 ? (
|
|
86
|
+
], 44, F),
|
|
87
|
+
c.value === e.id && s.value < -40 ? (o(), a("div", O, " 删除 ")) : i("", !0)
|
|
79
88
|
]))), 128)),
|
|
80
|
-
r.addable && !r.readonly ? (
|
|
89
|
+
r.addable && !r.readonly ? (o(), a("button", {
|
|
81
90
|
key: 0,
|
|
82
91
|
class: "of-mobile-add-btn",
|
|
83
92
|
onClick: n[0] || (n[0] = (e) => y("add-row"))
|
|
@@ -86,5 +95,5 @@ const $ = { class: "of-mobile-list" }, D = ["onClick", "onTouchstart"], F = {
|
|
|
86
95
|
}
|
|
87
96
|
});
|
|
88
97
|
export {
|
|
89
|
-
|
|
98
|
+
j as default
|
|
90
99
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./TableDataRow.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-
|
|
4
|
+
const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-b5ce5f86"]]);
|
|
5
5
|
export {
|
|
6
6
|
f as default
|
|
7
7
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineComponent as S, computed as
|
|
1
|
+
import { defineComponent as S, computed as m, openBlock as n, createElementBlock as s, normalizeClass as $, withModifiers as B, createElementVNode as D, createCommentVNode as T, Fragment as p, renderList as A, normalizeStyle as d, renderSlot as P, toDisplayString as a } from "vue";
|
|
2
2
|
import { mergeColorMap as w, DEFAULT_PRIORITY_MAP as R, DEFAULT_STATUS_MAP as _, resolveBadge as h } from "../../composables/useBadge.js";
|
|
3
|
-
const E = ["
|
|
3
|
+
const E = ["aria-selected"], N = ["checked"], V = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "of-badge of-badge--role"
|
|
6
|
-
},
|
|
6
|
+
}, F = {
|
|
7
7
|
key: 1,
|
|
8
8
|
class: "of-td-empty"
|
|
9
|
-
},
|
|
9
|
+
}, I = {
|
|
10
10
|
key: 3,
|
|
11
11
|
class: "of-td-text"
|
|
12
|
-
},
|
|
12
|
+
}, L = {
|
|
13
13
|
key: 4,
|
|
14
14
|
class: "of-td-id"
|
|
15
|
-
},
|
|
15
|
+
}, U = {
|
|
16
16
|
key: 5,
|
|
17
17
|
class: "of-td-title"
|
|
18
|
-
},
|
|
18
|
+
}, z = {
|
|
19
19
|
key: 6,
|
|
20
20
|
class: "of-td-text"
|
|
21
|
-
},
|
|
21
|
+
}, G = /* @__PURE__ */ S({
|
|
22
22
|
__name: "TableDataRow",
|
|
23
23
|
props: {
|
|
24
24
|
row: {},
|
|
@@ -30,18 +30,18 @@ const E = ["checked"], N = {
|
|
|
30
30
|
statusColorMap: {}
|
|
31
31
|
},
|
|
32
32
|
emits: ["select", "click"],
|
|
33
|
-
setup(
|
|
34
|
-
const i =
|
|
33
|
+
setup(l, { emit: b }) {
|
|
34
|
+
const i = l, u = b;
|
|
35
35
|
function C(e) {
|
|
36
36
|
if (e.width === "fill") {
|
|
37
|
-
const
|
|
38
|
-
return { flex: `1 1 ${
|
|
37
|
+
const o = `${e.minWidth ?? 220}px`;
|
|
38
|
+
return { flex: `1 1 ${o}`, minWidth: o };
|
|
39
39
|
}
|
|
40
40
|
return { width: `${e.width}px`, flexShrink: "0", flexGrow: "0" };
|
|
41
41
|
}
|
|
42
|
-
const v =
|
|
42
|
+
const v = m(
|
|
43
43
|
() => w(R, i.priorityColorMap)
|
|
44
|
-
), x =
|
|
44
|
+
), x = m(() => w(_, i.statusColorMap));
|
|
45
45
|
function c(e) {
|
|
46
46
|
return h(e, v.value);
|
|
47
47
|
}
|
|
@@ -50,66 +50,70 @@ const E = ["checked"], N = {
|
|
|
50
50
|
}
|
|
51
51
|
function M(e) {
|
|
52
52
|
if (!e) return "-";
|
|
53
|
-
const
|
|
54
|
-
return isNaN(
|
|
53
|
+
const o = new Date(e);
|
|
54
|
+
return isNaN(o.getTime()) ? e : `${o.getMonth() + 1}/${o.getDate()}`;
|
|
55
55
|
}
|
|
56
56
|
function y(e) {
|
|
57
57
|
return i.row[e.key];
|
|
58
58
|
}
|
|
59
59
|
function k(e) {
|
|
60
|
-
const
|
|
61
|
-
return
|
|
60
|
+
const o = y(e);
|
|
61
|
+
return o != null ? String(o) : "-";
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
const
|
|
65
|
-
return typeof
|
|
63
|
+
function r(e) {
|
|
64
|
+
const o = y(e);
|
|
65
|
+
return typeof o == "string" ? o : "";
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function g() {
|
|
68
68
|
const e = i.row[i.rowKey];
|
|
69
69
|
return e != null ? String(e) : "";
|
|
70
70
|
}
|
|
71
|
-
return (e,
|
|
72
|
-
class: $(["of-table-row", { "of-table-row--selected":
|
|
73
|
-
|
|
71
|
+
return (e, o) => (n(), s("div", {
|
|
72
|
+
class: $(["of-table-row", { "of-table-row--selected": l.selected }]),
|
|
73
|
+
role: "row",
|
|
74
|
+
"aria-selected": l.selected || void 0,
|
|
75
|
+
onClick: o[2] || (o[2] = (t) => u("click", l.row))
|
|
74
76
|
}, [
|
|
75
|
-
|
|
77
|
+
l.selectable ? (n(), s("div", {
|
|
76
78
|
key: 0,
|
|
77
79
|
class: "of-td of-td-checkbox",
|
|
78
|
-
|
|
80
|
+
role: "gridcell",
|
|
81
|
+
onClick: o[1] || (o[1] = B(() => {
|
|
79
82
|
}, ["stop"]))
|
|
80
83
|
}, [
|
|
81
84
|
D("input", {
|
|
82
85
|
type: "checkbox",
|
|
83
86
|
class: "of-checkbox",
|
|
84
|
-
checked:
|
|
85
|
-
onChange:
|
|
86
|
-
}, null, 40,
|
|
87
|
+
checked: l.selected,
|
|
88
|
+
onChange: o[0] || (o[0] = (t) => u("select", g()))
|
|
89
|
+
}, null, 40, N)
|
|
87
90
|
])) : T("", !0),
|
|
88
|
-
(
|
|
91
|
+
(n(!0), s(p, null, A(l.columns, (t) => (n(), s("div", {
|
|
89
92
|
key: t.key,
|
|
90
93
|
class: "of-td",
|
|
94
|
+
role: "gridcell",
|
|
91
95
|
style: d(C(t))
|
|
92
96
|
}, [
|
|
93
97
|
P(e.$slots, "cell", {
|
|
94
|
-
row:
|
|
98
|
+
row: l.row,
|
|
95
99
|
col: t
|
|
96
100
|
}, () => [
|
|
97
|
-
t.key === "status" ? (
|
|
101
|
+
t.key === "status" ? (n(), s("span", {
|
|
98
102
|
key: 0,
|
|
99
103
|
class: "of-badge",
|
|
100
|
-
style: d(f(
|
|
101
|
-
}, a(f(
|
|
104
|
+
style: d(f(r(t)).style)
|
|
105
|
+
}, a(f(r(t)).label), 5)) : t.key === "priority" ? (n(), s("span", {
|
|
102
106
|
key: 1,
|
|
103
107
|
class: "of-badge",
|
|
104
|
-
style: d(c(
|
|
105
|
-
}, a(c(
|
|
106
|
-
|
|
107
|
-
], 64)) : t.key === "updatedAt" ? (
|
|
108
|
+
style: d(c(r(t)).style)
|
|
109
|
+
}, a(c(r(t)).label), 5)) : t.key === "role" ? (n(), s(p, { key: 2 }, [
|
|
110
|
+
r(t) ? (n(), s("span", V, a(r(t)), 1)) : (n(), s("span", F, "-"))
|
|
111
|
+
], 64)) : t.key === "updatedAt" ? (n(), s("span", I, a(M(r(t))), 1)) : t.key === "id" ? (n(), s("span", L, a(g()), 1)) : t.key === "title" ? (n(), s("span", U, a(k(t)), 1)) : (n(), s("span", z, a(k(t)), 1))
|
|
108
112
|
], !0)
|
|
109
113
|
], 4))), 128))
|
|
110
|
-
],
|
|
114
|
+
], 10, E));
|
|
111
115
|
}
|
|
112
116
|
});
|
|
113
117
|
export {
|
|
114
|
-
|
|
118
|
+
G as default
|
|
115
119
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./TableGroupRow.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const c = /* @__PURE__ */ r(o, [["__scopeId", "data-v-52c60c99"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
c as default
|
|
7
7
|
};
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { defineComponent as w, computed as
|
|
1
|
+
import { defineComponent as w, computed as c, openBlock as l, createElementBlock as a, normalizeStyle as p, createElementVNode as g, createCommentVNode as d, normalizeClass as k, createTextVNode as x, toDisplayString as s, Fragment as h, renderList as B } from "vue";
|
|
2
2
|
import { resolveBadge as C } from "../../composables/useBadge.js";
|
|
3
3
|
const N = {
|
|
4
|
+
class: "of-table-group-row__cell",
|
|
5
|
+
role: "gridcell"
|
|
6
|
+
}, K = {
|
|
4
7
|
key: 0,
|
|
5
8
|
class: "of-table-group-row__checkbox-spacer"
|
|
6
|
-
},
|
|
9
|
+
}, L = {
|
|
7
10
|
key: 2,
|
|
8
11
|
class: "of-table-group-row__label"
|
|
9
|
-
},
|
|
12
|
+
}, M = { class: "of-table-group-row__count" }, V = /* @__PURE__ */ w({
|
|
10
13
|
name: "TableGroupRow",
|
|
11
14
|
__name: "TableGroupRow",
|
|
12
15
|
props: {
|
|
@@ -19,40 +22,43 @@ const N = {
|
|
|
19
22
|
aggregations: {}
|
|
20
23
|
},
|
|
21
24
|
emits: ["toggle"],
|
|
22
|
-
setup(
|
|
23
|
-
const o =
|
|
24
|
-
const [, e] =
|
|
25
|
-
return { key:
|
|
25
|
+
setup(n, { emit: i }) {
|
|
26
|
+
const o = n, b = i, r = c(() => o.colorMap ? C(o.groupKey, o.colorMap) : null), m = c(() => o.groupKey || "(空)"), f = c(() => o.level * 16), _ = c(() => o.aggregations ? Object.entries(o.aggregations).map(([u, t]) => {
|
|
27
|
+
const [, e] = u.split(":"), y = e === "sum" ? "总计" : e === "avg" ? "平均" : e === "min" ? "最小" : e === "max" ? "最大" : "计数", v = typeof t == "number" && !Number.isInteger(t) ? t.toFixed(2) : String(t);
|
|
28
|
+
return { key: u, label: y, value: v };
|
|
26
29
|
}) : []);
|
|
27
|
-
return (
|
|
30
|
+
return (u, t) => (l(), a("div", {
|
|
28
31
|
class: "of-table-group-row",
|
|
29
|
-
|
|
32
|
+
role: "row",
|
|
33
|
+
onClick: t[0] || (t[0] = (e) => b("toggle")),
|
|
30
34
|
style: p({ paddingLeft: `${12 + f.value}px` })
|
|
31
35
|
}, [
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
36
|
+
g("div", N, [
|
|
37
|
+
n.selectable ? (l(), a("div", K)) : d("", !0),
|
|
38
|
+
g("span", {
|
|
39
|
+
class: k(["of-table-group-row__chevron", { "of-table-group-row__chevron--collapsed": n.collapsed }])
|
|
40
|
+
}, "▼", 2),
|
|
41
|
+
r.value ? (l(), a("span", {
|
|
42
|
+
key: 1,
|
|
43
|
+
class: "of-table-group-row__badge",
|
|
44
|
+
style: p(r.value.style)
|
|
45
|
+
}, [
|
|
46
|
+
r.value.dot ? (l(), a("span", {
|
|
47
|
+
key: 0,
|
|
48
|
+
class: "of-table-group-row__badge-dot",
|
|
49
|
+
style: p({ background: r.value.dot })
|
|
50
|
+
}, null, 4)) : d("", !0),
|
|
51
|
+
x(" " + s(r.value.label), 1)
|
|
52
|
+
], 4)) : (l(), a("span", L, s(m.value), 1)),
|
|
53
|
+
g("span", M, "(" + s(n.count) + ")", 1),
|
|
54
|
+
(l(!0), a(h, null, B(_.value, (e) => (l(), a("span", {
|
|
55
|
+
key: e.key,
|
|
56
|
+
class: "of-table-group-row__agg"
|
|
57
|
+
}, s(e.label) + ": " + s(e.value), 1))), 128))
|
|
58
|
+
])
|
|
53
59
|
], 4));
|
|
54
60
|
}
|
|
55
61
|
});
|
|
56
62
|
export {
|
|
57
|
-
|
|
63
|
+
V as default
|
|
58
64
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./TableHeaderRow.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import a from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const m = /* @__PURE__ */ a(o, [["__scopeId", "data-v-
|
|
4
|
+
const m = /* @__PURE__ */ a(o, [["__scopeId", "data-v-cbab1336"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import { defineComponent as v, openBlock as o, createElementBlock as
|
|
2
|
-
import { ChevronUp as $, ChevronDown as
|
|
3
|
-
const D = {
|
|
1
|
+
import { defineComponent as v, openBlock as o, createElementBlock as s, createElementVNode as c, createCommentVNode as f, Fragment as x, renderList as z, withModifiers as r, normalizeStyle as C, normalizeClass as w, toDisplayString as B, createBlock as u, unref as d, createVNode as S } from "vue";
|
|
2
|
+
import { ChevronUp as $, ChevronDown as h, Plus as g } from "lucide-vue-next";
|
|
3
|
+
const D = {
|
|
4
|
+
class: "of-table-header",
|
|
5
|
+
role: "row"
|
|
6
|
+
}, F = {
|
|
4
7
|
key: 0,
|
|
5
|
-
class: "of-th of-th-checkbox"
|
|
8
|
+
class: "of-th of-th-checkbox",
|
|
9
|
+
role: "columnheader",
|
|
10
|
+
"aria-label": "选择全部行"
|
|
6
11
|
}, M = ["checked", "indeterminate"], K = ["aria-sort", "onClick", "onContextmenu", "onDblclick"], O = { class: "of-th-label" }, R = { class: "of-th-sort-icon" }, N = ["onMousedown", "onDblclick"], E = /* @__PURE__ */ v({
|
|
7
12
|
__name: "TableHeaderRow",
|
|
8
13
|
props: {
|
|
@@ -17,8 +22,8 @@ const D = { class: "of-table-header" }, F = {
|
|
|
17
22
|
enableAddField: { type: Boolean, default: !1 }
|
|
18
23
|
},
|
|
19
24
|
emits: ["sort", "select-all", "resize-start", "resize-dblclick", "header-contextmenu", "header-dblclick", "add-field"],
|
|
20
|
-
setup(e, { emit:
|
|
21
|
-
const
|
|
25
|
+
setup(e, { emit: k }) {
|
|
26
|
+
const a = k;
|
|
22
27
|
function y(n) {
|
|
23
28
|
if (n.width === "fill") {
|
|
24
29
|
const l = `${n.minWidth ?? 220}px`;
|
|
@@ -27,60 +32,62 @@ const D = { class: "of-table-header" }, F = {
|
|
|
27
32
|
return { width: `${n.width}px`, flexShrink: "0", flexGrow: "0" };
|
|
28
33
|
}
|
|
29
34
|
function m(n) {
|
|
30
|
-
|
|
35
|
+
a("sort", n);
|
|
31
36
|
}
|
|
32
37
|
function b(n, l) {
|
|
33
|
-
n.stopPropagation(),
|
|
38
|
+
n.stopPropagation(), a("resize-start", n, l);
|
|
34
39
|
}
|
|
35
|
-
return (n, l) => (o(),
|
|
36
|
-
e.selectable ? (o(),
|
|
40
|
+
return (n, l) => (o(), s("div", D, [
|
|
41
|
+
e.selectable ? (o(), s("div", F, [
|
|
37
42
|
c("input", {
|
|
38
43
|
type: "checkbox",
|
|
39
44
|
class: "of-checkbox",
|
|
40
45
|
checked: e.allSelected,
|
|
41
46
|
indeterminate: e.indeterminate,
|
|
42
|
-
onChange: l[0] || (l[0] = (t) =>
|
|
47
|
+
onChange: l[0] || (l[0] = (t) => a("select-all"))
|
|
43
48
|
}, null, 40, M)
|
|
44
49
|
])) : f("", !0),
|
|
45
|
-
(o(!0),
|
|
50
|
+
(o(!0), s(x, null, z(e.columns, (t) => (o(), s("div", {
|
|
46
51
|
key: t.key,
|
|
47
52
|
role: "columnheader",
|
|
48
53
|
class: w(["of-th", { "of-th--sortable": !0, "of-th--active": e.sortKey === t.key }]),
|
|
49
54
|
style: C(y(t)),
|
|
50
55
|
"aria-sort": e.sortKey === t.key ? e.sortOrder === "asc" ? "ascending" : "descending" : "none",
|
|
51
|
-
onClick: (
|
|
52
|
-
onContextmenu:
|
|
53
|
-
onDblclick:
|
|
56
|
+
onClick: (i) => m(t.key),
|
|
57
|
+
onContextmenu: r((i) => e.enableFieldMenu && a("header-contextmenu", i, t.key), ["prevent"]),
|
|
58
|
+
onDblclick: r((i) => e.enableFieldMenu && a("header-dblclick", t.key), ["stop"])
|
|
54
59
|
}, [
|
|
55
60
|
c("span", O, B(t.label), 1),
|
|
56
61
|
c("span", R, [
|
|
57
|
-
e.sortKey === t.key && e.sortOrder === "asc" ? (o(), u(
|
|
62
|
+
e.sortKey === t.key && e.sortOrder === "asc" ? (o(), u(d($), {
|
|
58
63
|
key: 0,
|
|
59
64
|
size: 12,
|
|
60
65
|
class: "of-sort-icon-active"
|
|
61
|
-
})) : e.sortKey === t.key && e.sortOrder === "desc" ? (o(), u(
|
|
66
|
+
})) : e.sortKey === t.key && e.sortOrder === "desc" ? (o(), u(d(h), {
|
|
62
67
|
key: 1,
|
|
63
68
|
size: 12,
|
|
64
69
|
class: "of-sort-icon-active"
|
|
65
|
-
})) : (o(), u(
|
|
70
|
+
})) : (o(), u(d(h), {
|
|
66
71
|
key: 2,
|
|
67
72
|
size: 12,
|
|
68
73
|
class: "of-sort-icon-idle"
|
|
69
74
|
}))
|
|
70
75
|
]),
|
|
71
|
-
e.enableResize ? (o(),
|
|
76
|
+
e.enableResize ? (o(), s("div", {
|
|
72
77
|
key: 0,
|
|
73
78
|
class: "of-th-resizer",
|
|
74
|
-
onMousedown: (
|
|
75
|
-
onDblclick:
|
|
79
|
+
onMousedown: (i) => b(i, t.key),
|
|
80
|
+
onDblclick: r((i) => a("resize-dblclick", t.key), ["stop"])
|
|
76
81
|
}, null, 40, N)) : f("", !0)
|
|
77
82
|
], 46, K))), 128)),
|
|
78
|
-
e.enableAddField ? (o(),
|
|
83
|
+
e.enableAddField ? (o(), s("div", {
|
|
79
84
|
key: 1,
|
|
80
85
|
class: "of-th of-th-add",
|
|
81
|
-
|
|
86
|
+
role: "columnheader",
|
|
87
|
+
"aria-label": "添加字段",
|
|
88
|
+
onClick: l[1] || (l[1] = r((t) => a("add-field"), ["stop"]))
|
|
82
89
|
}, [
|
|
83
|
-
S(
|
|
90
|
+
S(d(g), { size: 14 })
|
|
84
91
|
])) : f("", !0)
|
|
85
92
|
]));
|
|
86
93
|
}
|