@oneflowui/ui 0.5.3 → 0.5.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.
- package/README.en.md +3 -1
- package/README.md +3 -1
- 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 +12 -0
- package/dist/components/table/DataTable.vue.js +4 -4
- package/dist/components/table/DataTable.vue2.js +438 -416
- 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/index.d.ts +0 -1
- package/dist/index.js +195 -198
- package/dist/style.css +1 -1
- package/package.json +5 -1
- package/dist/dev/App.vue.d.ts +0 -2
- package/dist/dev/main.d.ts +0 -0
- package/dist/tests/database-view.integration.spec.d.ts +0 -1
- package/dist/tests/drawer.integration.spec.d.ts +0 -1
- package/dist/tests/fielddef.integration.spec.d.ts +0 -1
- package/dist/tests/gantt.integration.spec.d.ts +0 -1
- package/dist/tests/shallowRef.integration.spec.d.ts +0 -1
- package/dist/tests/table-detail.integration.spec.d.ts +0 -1
- package/dist/tests/three-layer-model.integration.spec.d.ts +0 -1
- package/dist/tests/useStream.integration.spec.d.ts +0 -1
- package/dist/tests/useTypewriter.integration.spec.d.ts +0 -1
- package/dist/tests/useVirtualList.integration.spec.d.ts +0 -1
|
@@ -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
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -71,4 +71,3 @@ export { useDatabaseView } from './composables/useDatabaseView';
|
|
|
71
71
|
export type { DatabaseViewMode, DatabaseViewFetchParams, DatabaseViewFetchResult, DatabaseViewProvider, DatabaseSchemaEvent, DatabaseViewActions, UseDatabaseViewOptions, UseDatabaseViewResult, } from './composables/useDatabaseView';
|
|
72
72
|
export { useSearch } from './composables/useSearch';
|
|
73
73
|
export type { UseSearchOptions, SearchHighlight as SearchHighlightSegment, } from './composables/useSearch';
|
|
74
|
-
export { OneflowUI, default } from './plugin';
|