@oneflowui/ui 0.5.7 → 0.5.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.
- package/README.md +11 -0
- package/dist/components/ContextMenu/index.vue.js +2 -2
- package/dist/components/Dashboard/index.vue.d.ts +1 -1
- package/dist/components/Dashboard/index.vue.js +3 -3
- package/dist/components/database/DatabaseView.vue.d.ts +6 -1
- package/dist/components/database/DatabaseView.vue.js +2 -2
- package/dist/components/database/DatabaseView.vue2.js +438 -293
- package/dist/components/overlay/Drawer.vue.d.ts +1 -1
- package/dist/components/overlay/Modal.vue.d.ts +1 -1
- package/dist/components/table/ColumnHeaderMenu.vue.d.ts +2 -2
- package/dist/components/table/DataTable.vue.d.ts +3 -1
- package/dist/components/table/DataTable.vue.js +2 -2
- package/dist/components/table/DataTable.vue2.js +598 -526
- package/dist/components/table/DetailSheet.vue.d.ts +2 -0
- package/dist/components/table/DetailSheet.vue.js +2 -2
- package/dist/components/table/DetailSheet.vue2.js +155 -76
- package/dist/components/table/TableDataRow.vue.d.ts +3 -1
- package/dist/components/table/TableDataRow.vue.js +3 -3
- package/dist/components/table/TableDataRow.vue2.js +95 -68
- package/dist/components/table/TableHeaderRow.vue.d.ts +3 -1
- package/dist/components/table/TableHeaderRow.vue.js +3 -3
- package/dist/components/table/TableHeaderRow.vue2.js +96 -60
- package/dist/composables/useColumnResize.d.ts +4 -1
- package/dist/composables/useColumnResize.js +114 -45
- package/dist/composables/useRowDrag.d.ts +1 -1
- package/dist/composables/useVirtualList.d.ts +1 -0
- package/dist/composables/useVirtualList.js +89 -77
- package/dist/plugin.js +240 -171
- package/dist/style.css +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/utils/icon.js +25 -68
- package/dist/utils/iconRegistry.d.ts +7 -0
- package/dist/utils/iconRegistry.js +60 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "./DetailSheet.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import o from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ o(t, [["__scopeId", "data-v-bac586d2"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,139 +1,218 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { useMarkdown as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as H, ref as N, computed as h, openBlock as o, createBlock as C, Teleport as E, createVNode as j, Transition as z, withCtx as O, createElementBlock as a, normalizeClass as v, createElementVNode as e, Fragment as y, renderList as k, toDisplayString as _, createCommentVNode as m } from "vue";
|
|
2
|
+
import x from "./FieldCell.vue.js";
|
|
3
|
+
import { useMarkdown as R } from "../../composables/useMarkdown.js";
|
|
4
|
+
const q = { class: "of-detail-sheet__properties" }, A = { class: "of-detail-sheet__label" }, G = { class: "of-detail-sheet__cell" }, I = {
|
|
5
5
|
key: 1,
|
|
6
6
|
class: "of-detail-sheet__value"
|
|
7
|
-
},
|
|
7
|
+
}, J = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "of-detail-sheet__content"
|
|
10
|
-
},
|
|
10
|
+
}, Q = { class: "of-detail-sheet__content-label" }, U = ["innerHTML"], W = { class: "of-detail-sheet__footer" }, X = ["disabled"], Y = {
|
|
11
|
+
key: 1,
|
|
12
|
+
class: "of-detail-sheet-shell of-detail-sheet-shell--embedded"
|
|
13
|
+
}, Z = { class: "of-detail-sheet__properties" }, $ = { class: "of-detail-sheet__label" }, K = { class: "of-detail-sheet__cell" }, ee = {
|
|
14
|
+
key: 1,
|
|
15
|
+
class: "of-detail-sheet__value"
|
|
16
|
+
}, te = {
|
|
17
|
+
key: 0,
|
|
18
|
+
class: "of-detail-sheet__content"
|
|
19
|
+
}, le = { class: "of-detail-sheet__content-label" }, se = ["innerHTML"], oe = { class: "of-detail-sheet__footer" }, ae = ["disabled"], fe = /* @__PURE__ */ H({
|
|
11
20
|
__name: "DetailSheet",
|
|
12
21
|
props: {
|
|
13
22
|
row: {},
|
|
14
23
|
columns: {},
|
|
15
24
|
fieldDefs: {},
|
|
16
25
|
visible: { type: Boolean },
|
|
26
|
+
embedded: { type: Boolean },
|
|
17
27
|
contentFields: {},
|
|
18
28
|
fullPage: { type: Boolean },
|
|
19
29
|
readonly: { type: Boolean }
|
|
20
30
|
},
|
|
21
31
|
emits: ["close", "save", "delete", "cell-edit"],
|
|
22
|
-
setup(
|
|
23
|
-
const
|
|
24
|
-
function
|
|
25
|
-
var
|
|
26
|
-
if (
|
|
27
|
-
const
|
|
28
|
-
return (
|
|
32
|
+
setup(n, { emit: L }) {
|
|
33
|
+
const i = n, r = L, { renderMarkdown: S } = R({ showCopyButton: !0 }), d = N({}), g = h(() => Object.keys(d.value).length > 0), p = h(() => i.embedded || i.visible), V = h(() => new Set(i.contentFields ?? []));
|
|
34
|
+
function w(s) {
|
|
35
|
+
var t;
|
|
36
|
+
if (V.value.has(s.key)) return !0;
|
|
37
|
+
const l = (t = i.fieldDefs) == null ? void 0 : t.find((f) => f.id === s.key);
|
|
38
|
+
return (l == null ? void 0 : l.type) === "richtext";
|
|
29
39
|
}
|
|
30
|
-
const
|
|
31
|
-
function
|
|
32
|
-
var
|
|
33
|
-
return ((
|
|
34
|
-
id:
|
|
40
|
+
const D = h(() => i.columns.filter((s) => !w(s))), b = h(() => i.columns.filter((s) => w(s)));
|
|
41
|
+
function B(s) {
|
|
42
|
+
var l;
|
|
43
|
+
return ((l = i.fieldDefs) == null ? void 0 : l.find((t) => t.id === s)) ?? {
|
|
44
|
+
id: s,
|
|
35
45
|
type: "text",
|
|
36
|
-
label:
|
|
46
|
+
label: s
|
|
37
47
|
};
|
|
38
48
|
}
|
|
39
|
-
function
|
|
40
|
-
return
|
|
49
|
+
function u(s) {
|
|
50
|
+
return s.key in d.value ? d.value[s.key] : i.row[s.key];
|
|
41
51
|
}
|
|
42
|
-
function
|
|
43
|
-
const
|
|
44
|
-
return typeof
|
|
52
|
+
function F(s) {
|
|
53
|
+
const l = u(s);
|
|
54
|
+
return typeof l != "string" || !l ? "" : S(l);
|
|
45
55
|
}
|
|
46
|
-
function M(
|
|
47
|
-
|
|
56
|
+
function M(s, l, t) {
|
|
57
|
+
d.value = { ...d.value, [l]: t }, r("cell-edit", { rowId: s, fieldId: l, value: t });
|
|
48
58
|
}
|
|
49
59
|
function P() {
|
|
50
|
-
r("save", { rowId:
|
|
60
|
+
r("save", { rowId: i.row.id, fields: { ...d.value } }), d.value = {}, r("close");
|
|
51
61
|
}
|
|
52
|
-
function
|
|
53
|
-
|
|
62
|
+
function c() {
|
|
63
|
+
d.value = {}, r("close");
|
|
54
64
|
}
|
|
55
65
|
function T() {
|
|
56
|
-
r("delete",
|
|
66
|
+
r("delete", i.row.id), r("close");
|
|
57
67
|
}
|
|
58
|
-
return (
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
68
|
+
return (s, l) => n.embedded ? p.value ? (o(), a("div", Y, [
|
|
69
|
+
e("div", {
|
|
70
|
+
class: v(["of-detail-sheet", { "of-detail-sheet--full-page": n.fullPage }])
|
|
71
|
+
}, [
|
|
72
|
+
e("div", { class: "of-detail-sheet__header" }, [
|
|
73
|
+
e("button", {
|
|
74
|
+
class: "of-detail-sheet__close",
|
|
75
|
+
onClick: c
|
|
76
|
+
}, "✕"),
|
|
77
|
+
l[3] || (l[3] = e("h3", { class: "of-detail-sheet__title" }, "记录详情", -1)),
|
|
78
|
+
l[4] || (l[4] = e("div", { class: "of-detail-sheet__header-spacer" }, null, -1))
|
|
79
|
+
]),
|
|
80
|
+
e("div", {
|
|
81
|
+
class: v(["of-detail-sheet__body", { "of-detail-sheet__body--full-page": n.fullPage }])
|
|
82
|
+
}, [
|
|
83
|
+
e("div", Z, [
|
|
84
|
+
(o(!0), a(y, null, k(D.value, (t) => {
|
|
85
|
+
var f;
|
|
86
|
+
return o(), a("div", {
|
|
87
|
+
key: t.key,
|
|
88
|
+
class: "of-detail-sheet__field"
|
|
89
|
+
}, [
|
|
90
|
+
e("span", $, _(t.label), 1),
|
|
91
|
+
e("div", K, [
|
|
92
|
+
(f = n.fieldDefs) != null && f.length ? (o(), C(x, {
|
|
93
|
+
key: 0,
|
|
94
|
+
"row-id": n.row.id,
|
|
95
|
+
field: B(t.key),
|
|
96
|
+
value: u(t),
|
|
97
|
+
readonly: n.readonly,
|
|
98
|
+
onCommit: M
|
|
99
|
+
}, null, 8, ["row-id", "field", "value", "readonly"])) : (o(), a("span", ee, _(u(t) ?? "—"), 1))
|
|
100
|
+
])
|
|
101
|
+
]);
|
|
102
|
+
}), 128))
|
|
103
|
+
]),
|
|
104
|
+
b.value.length > 0 ? (o(), a("div", te, [
|
|
105
|
+
(o(!0), a(y, null, k(b.value, (t) => (o(), a("div", {
|
|
106
|
+
key: t.key,
|
|
107
|
+
class: "of-detail-sheet__content-block"
|
|
108
|
+
}, [
|
|
109
|
+
e("span", le, _(t.label), 1),
|
|
110
|
+
e("div", {
|
|
111
|
+
class: "of-detail-sheet__markdown of-markdown",
|
|
112
|
+
innerHTML: F(t)
|
|
113
|
+
}, null, 8, se)
|
|
114
|
+
]))), 128))
|
|
115
|
+
])) : m("", !0)
|
|
116
|
+
], 2),
|
|
117
|
+
e("div", oe, [
|
|
118
|
+
e("button", {
|
|
119
|
+
class: "of-detail-sheet__btn of-detail-sheet__btn--delete",
|
|
120
|
+
onClick: T
|
|
121
|
+
}, " 删除 "),
|
|
122
|
+
l[5] || (l[5] = e("div", { class: "of-detail-sheet__footer-spacer" }, null, -1)),
|
|
123
|
+
e("button", {
|
|
124
|
+
class: "of-detail-sheet__btn of-detail-sheet__btn--cancel",
|
|
125
|
+
onClick: c
|
|
126
|
+
}, " 取消 "),
|
|
127
|
+
e("button", {
|
|
128
|
+
class: "of-detail-sheet__btn of-detail-sheet__btn--save",
|
|
129
|
+
disabled: !g.value,
|
|
130
|
+
onClick: P
|
|
131
|
+
}, " 保存 ", 8, ae)
|
|
132
|
+
])
|
|
133
|
+
], 2)
|
|
134
|
+
])) : m("", !0) : (o(), C(E, {
|
|
135
|
+
key: 0,
|
|
136
|
+
to: "body"
|
|
137
|
+
}, [
|
|
138
|
+
j(z, { name: "of-sheet" }, {
|
|
139
|
+
default: O(() => [
|
|
140
|
+
p.value ? (o(), a("div", {
|
|
62
141
|
key: 0,
|
|
63
|
-
class:
|
|
142
|
+
class: v(["of-detail-sheet-overlay", { "of-detail-sheet-overlay--full-page": n.fullPage }])
|
|
64
143
|
}, [
|
|
65
|
-
|
|
144
|
+
e("button", {
|
|
66
145
|
type: "button",
|
|
67
146
|
class: "of-detail-sheet-overlay__hitarea",
|
|
68
147
|
"aria-label": "关闭详情",
|
|
69
|
-
onClick:
|
|
148
|
+
onClick: c
|
|
70
149
|
}),
|
|
71
|
-
|
|
72
|
-
class:
|
|
150
|
+
e("div", {
|
|
151
|
+
class: v(["of-detail-sheet", { "of-detail-sheet--full-page": n.fullPage }])
|
|
73
152
|
}, [
|
|
74
|
-
|
|
75
|
-
|
|
153
|
+
e("div", { class: "of-detail-sheet__header" }, [
|
|
154
|
+
e("button", {
|
|
76
155
|
class: "of-detail-sheet__close",
|
|
77
|
-
onClick:
|
|
156
|
+
onClick: c
|
|
78
157
|
}, "✕"),
|
|
79
|
-
|
|
80
|
-
|
|
158
|
+
l[0] || (l[0] = e("h3", { class: "of-detail-sheet__title" }, "记录详情", -1)),
|
|
159
|
+
l[1] || (l[1] = e("div", { class: "of-detail-sheet__header-spacer" }, null, -1))
|
|
81
160
|
]),
|
|
82
|
-
|
|
83
|
-
class:
|
|
161
|
+
e("div", {
|
|
162
|
+
class: v(["of-detail-sheet__body", { "of-detail-sheet__body--full-page": n.fullPage }])
|
|
84
163
|
}, [
|
|
85
|
-
|
|
86
|
-
(o(!0),
|
|
164
|
+
e("div", q, [
|
|
165
|
+
(o(!0), a(y, null, k(D.value, (t) => {
|
|
87
166
|
var f;
|
|
88
|
-
return o(),
|
|
89
|
-
key:
|
|
167
|
+
return o(), a("div", {
|
|
168
|
+
key: t.key,
|
|
90
169
|
class: "of-detail-sheet__field"
|
|
91
170
|
}, [
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
(f =
|
|
171
|
+
e("span", A, _(t.label), 1),
|
|
172
|
+
e("div", G, [
|
|
173
|
+
(f = n.fieldDefs) != null && f.length ? (o(), C(x, {
|
|
95
174
|
key: 0,
|
|
96
|
-
"row-id":
|
|
97
|
-
field:
|
|
98
|
-
value:
|
|
99
|
-
readonly:
|
|
175
|
+
"row-id": n.row.id,
|
|
176
|
+
field: B(t.key),
|
|
177
|
+
value: u(t),
|
|
178
|
+
readonly: n.readonly,
|
|
100
179
|
onCommit: M
|
|
101
|
-
}, null, 8, ["row-id", "field", "value", "readonly"])) : (o(),
|
|
180
|
+
}, null, 8, ["row-id", "field", "value", "readonly"])) : (o(), a("span", I, _(u(t) ?? "—"), 1))
|
|
102
181
|
])
|
|
103
182
|
]);
|
|
104
183
|
}), 128))
|
|
105
184
|
]),
|
|
106
|
-
|
|
107
|
-
(o(!0),
|
|
108
|
-
key:
|
|
185
|
+
b.value.length > 0 ? (o(), a("div", J, [
|
|
186
|
+
(o(!0), a(y, null, k(b.value, (t) => (o(), a("div", {
|
|
187
|
+
key: t.key,
|
|
109
188
|
class: "of-detail-sheet__content-block"
|
|
110
189
|
}, [
|
|
111
|
-
|
|
112
|
-
|
|
190
|
+
e("span", Q, _(t.label), 1),
|
|
191
|
+
e("div", {
|
|
113
192
|
class: "of-detail-sheet__markdown of-markdown",
|
|
114
|
-
innerHTML:
|
|
115
|
-
}, null, 8,
|
|
193
|
+
innerHTML: F(t)
|
|
194
|
+
}, null, 8, U)
|
|
116
195
|
]))), 128))
|
|
117
|
-
])) :
|
|
196
|
+
])) : m("", !0)
|
|
118
197
|
], 2),
|
|
119
|
-
|
|
120
|
-
|
|
198
|
+
e("div", W, [
|
|
199
|
+
e("button", {
|
|
121
200
|
class: "of-detail-sheet__btn of-detail-sheet__btn--delete",
|
|
122
201
|
onClick: T
|
|
123
202
|
}, " 删除 "),
|
|
124
|
-
|
|
125
|
-
|
|
203
|
+
l[2] || (l[2] = e("div", { class: "of-detail-sheet__footer-spacer" }, null, -1)),
|
|
204
|
+
e("button", {
|
|
126
205
|
class: "of-detail-sheet__btn of-detail-sheet__btn--cancel",
|
|
127
|
-
onClick:
|
|
206
|
+
onClick: c
|
|
128
207
|
}, " 取消 "),
|
|
129
|
-
|
|
208
|
+
e("button", {
|
|
130
209
|
class: "of-detail-sheet__btn of-detail-sheet__btn--save",
|
|
131
|
-
disabled: !
|
|
210
|
+
disabled: !g.value,
|
|
132
211
|
onClick: P
|
|
133
|
-
}, " 保存 ", 8,
|
|
212
|
+
}, " 保存 ", 8, X)
|
|
134
213
|
])
|
|
135
214
|
], 2)
|
|
136
|
-
], 2)) :
|
|
215
|
+
], 2)) : m("", !0)
|
|
137
216
|
]),
|
|
138
217
|
_: 1
|
|
139
218
|
})
|
|
@@ -141,5 +220,5 @@ const R = { class: "of-detail-sheet__properties" }, q = { class: "of-detail-shee
|
|
|
141
220
|
}
|
|
142
221
|
});
|
|
143
222
|
export {
|
|
144
|
-
|
|
223
|
+
fe as default
|
|
145
224
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TableColumn, ColorMap } from '../../types';
|
|
1
|
+
import { TableColumn, ColorMap, Density } from '../../types';
|
|
2
2
|
type TableRow = Record<string, unknown> & {
|
|
3
3
|
id: string;
|
|
4
4
|
};
|
|
@@ -8,6 +8,7 @@ type __VLS_Props = {
|
|
|
8
8
|
selected?: boolean;
|
|
9
9
|
selectable?: boolean;
|
|
10
10
|
columns: TableColumn[];
|
|
11
|
+
density?: Density;
|
|
11
12
|
/**
|
|
12
13
|
* 优先级颜色映射,与内置默认映射合并(传入优先)
|
|
13
14
|
*/
|
|
@@ -36,6 +37,7 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
36
37
|
onSelect?: ((id: string) => any) | undefined;
|
|
37
38
|
onClick?: ((row: TableRow) => any) | undefined;
|
|
38
39
|
}>, {
|
|
40
|
+
density: Density;
|
|
39
41
|
selectable: boolean;
|
|
40
42
|
rowKey: string;
|
|
41
43
|
selected: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from "./TableDataRow.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const m = /* @__PURE__ */ o
|
|
3
|
+
import a from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const m = /* @__PURE__ */ a(o, [["__scopeId", "data-v-4ecab060"]]);
|
|
5
5
|
export {
|
|
6
6
|
m as default
|
|
7
7
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { mergeColorMap as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as B, computed as d, openBlock as o, createElementBlock as n, normalizeStyle as c, normalizeClass as Y, withModifiers as E, createElementVNode as g, createCommentVNode as R, Fragment as b, renderList as W, renderSlot as _, toDisplayString as r } from "vue";
|
|
2
|
+
import { mergeColorMap as v, DEFAULT_PRIORITY_MAP as H, DEFAULT_STATUS_MAP as N, resolveBadge as x } from "../../composables/useBadge.js";
|
|
3
|
+
const I = ["aria-selected"], K = ["for"], L = ["id", "checked"], U = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "of-badge of-badge--role"
|
|
6
|
-
},
|
|
6
|
+
}, V = {
|
|
7
7
|
key: 1,
|
|
8
8
|
class: "of-td-empty"
|
|
9
|
-
},
|
|
9
|
+
}, X = {
|
|
10
10
|
key: 3,
|
|
11
11
|
class: "of-td-text"
|
|
12
|
-
},
|
|
12
|
+
}, F = {
|
|
13
13
|
key: 4,
|
|
14
14
|
class: "of-td-id"
|
|
15
15
|
}, z = {
|
|
16
16
|
key: 5,
|
|
17
17
|
class: "of-td-title"
|
|
18
|
-
},
|
|
18
|
+
}, O = {
|
|
19
19
|
key: 6,
|
|
20
20
|
class: "of-td-text"
|
|
21
|
-
},
|
|
21
|
+
}, q = /* @__PURE__ */ B({
|
|
22
22
|
__name: "TableDataRow",
|
|
23
23
|
props: {
|
|
24
24
|
row: {},
|
|
@@ -26,106 +26,133 @@ const K = ["aria-selected"], N = ["for"], V = ["id", "checked"], F = {
|
|
|
26
26
|
selected: { type: Boolean, default: !1 },
|
|
27
27
|
selectable: { type: Boolean, default: !0 },
|
|
28
28
|
columns: {},
|
|
29
|
+
density: { default: "standard" },
|
|
29
30
|
priorityColorMap: { default: void 0 },
|
|
30
31
|
statusColorMap: { default: void 0 }
|
|
31
32
|
},
|
|
32
33
|
emits: ["select", "click"],
|
|
33
|
-
setup(
|
|
34
|
-
const i =
|
|
35
|
-
|
|
34
|
+
setup(i, { emit: M }) {
|
|
35
|
+
const s = i, y = M, C = {
|
|
36
|
+
compact: {
|
|
37
|
+
rowHeight: 36,
|
|
38
|
+
cellPaddingX: 10,
|
|
39
|
+
cellPaddingY: 6,
|
|
40
|
+
fillMinWidth: 180
|
|
41
|
+
},
|
|
42
|
+
standard: {
|
|
43
|
+
rowHeight: 44,
|
|
44
|
+
cellPaddingX: 12,
|
|
45
|
+
cellPaddingY: 8,
|
|
46
|
+
fillMinWidth: 220
|
|
47
|
+
},
|
|
48
|
+
comfortable: {
|
|
49
|
+
rowHeight: 52,
|
|
50
|
+
cellPaddingX: 14,
|
|
51
|
+
cellPaddingY: 10,
|
|
52
|
+
fillMinWidth: 240
|
|
53
|
+
}
|
|
54
|
+
}, u = d(() => C[s.density]), P = d(() => ({
|
|
55
|
+
minHeight: `${u.value.rowHeight}px`
|
|
56
|
+
})), k = d(() => ({
|
|
57
|
+
padding: `${u.value.cellPaddingY}px ${u.value.cellPaddingX}px`
|
|
58
|
+
}));
|
|
59
|
+
function S(e) {
|
|
60
|
+
const l = k.value;
|
|
36
61
|
if (e.width === "fill") {
|
|
37
|
-
const t = `${e.minWidth ??
|
|
38
|
-
return { flex: `1 1 ${t}`, minWidth: t };
|
|
62
|
+
const t = `${e.minWidth ?? u.value.fillMinWidth}px`;
|
|
63
|
+
return { ...l, flex: `1 1 ${t}`, minWidth: t };
|
|
39
64
|
}
|
|
40
|
-
return { width: `${e.width}px`, flexShrink: "0", flexGrow: "0" };
|
|
65
|
+
return { ...l, width: `${e.width}px`, flexShrink: "0", flexGrow: "0" };
|
|
41
66
|
}
|
|
42
|
-
const
|
|
43
|
-
() =>
|
|
44
|
-
),
|
|
45
|
-
function
|
|
46
|
-
return
|
|
67
|
+
const $ = d(
|
|
68
|
+
() => v(H, s.priorityColorMap)
|
|
69
|
+
), D = d(() => v(N, s.statusColorMap));
|
|
70
|
+
function p(e) {
|
|
71
|
+
return x(e, $.value);
|
|
47
72
|
}
|
|
48
|
-
function
|
|
49
|
-
return
|
|
73
|
+
function m(e) {
|
|
74
|
+
return x(e, D.value);
|
|
50
75
|
}
|
|
51
|
-
function
|
|
76
|
+
function T(e) {
|
|
52
77
|
if (!e) return "-";
|
|
53
|
-
const
|
|
54
|
-
return isNaN(
|
|
78
|
+
const l = new Date(e);
|
|
79
|
+
return isNaN(l.getTime()) ? e : `${l.getMonth() + 1}/${l.getDate()}`;
|
|
55
80
|
}
|
|
56
|
-
function
|
|
57
|
-
return
|
|
81
|
+
function w(e) {
|
|
82
|
+
return s.row[e.key];
|
|
58
83
|
}
|
|
59
|
-
function
|
|
60
|
-
const
|
|
61
|
-
return
|
|
84
|
+
function h(e) {
|
|
85
|
+
const l = w(e);
|
|
86
|
+
return l != null ? String(l) : "-";
|
|
62
87
|
}
|
|
63
|
-
function
|
|
64
|
-
const
|
|
65
|
-
return typeof
|
|
88
|
+
function a(e) {
|
|
89
|
+
const l = w(e);
|
|
90
|
+
return typeof l == "string" ? l : "";
|
|
66
91
|
}
|
|
67
|
-
function
|
|
68
|
-
const e =
|
|
92
|
+
function f() {
|
|
93
|
+
const e = s.row[s.rowKey];
|
|
69
94
|
return e != null ? String(e) : "";
|
|
70
95
|
}
|
|
71
|
-
function
|
|
72
|
-
e.target === e.currentTarget && (e.key !== "Enter" && e.key !== " " || (e.preventDefault(),
|
|
96
|
+
function A(e) {
|
|
97
|
+
e.target === e.currentTarget && (e.key !== "Enter" && e.key !== " " || (e.preventDefault(), y("click", s.row)));
|
|
73
98
|
}
|
|
74
|
-
return (e,
|
|
75
|
-
class:
|
|
99
|
+
return (e, l) => (o(), n("div", {
|
|
100
|
+
class: Y(["of-table-row", { "of-table-row--selected": i.selected }]),
|
|
76
101
|
role: "row",
|
|
77
102
|
tabindex: "0",
|
|
78
|
-
"aria-selected":
|
|
79
|
-
|
|
80
|
-
|
|
103
|
+
"aria-selected": i.selected || void 0,
|
|
104
|
+
style: c(P.value),
|
|
105
|
+
onClick: l[2] || (l[2] = (t) => y("click", i.row)),
|
|
106
|
+
onKeydown: A
|
|
81
107
|
}, [
|
|
82
|
-
|
|
108
|
+
i.selectable ? (o(), n("div", {
|
|
83
109
|
key: 0,
|
|
84
110
|
class: "of-td of-td-checkbox",
|
|
85
111
|
role: "gridcell",
|
|
86
|
-
|
|
112
|
+
style: c(k.value),
|
|
113
|
+
onClick: l[1] || (l[1] = E(() => {
|
|
87
114
|
}, ["stop"]))
|
|
88
115
|
}, [
|
|
89
|
-
|
|
116
|
+
g("label", {
|
|
90
117
|
class: "of-checkbox-label",
|
|
91
|
-
for: `of-table-row-checkbox-${
|
|
118
|
+
for: `of-table-row-checkbox-${f()}`
|
|
92
119
|
}, [
|
|
93
|
-
|
|
94
|
-
id: `of-table-row-checkbox-${
|
|
120
|
+
g("input", {
|
|
121
|
+
id: `of-table-row-checkbox-${f()}`,
|
|
95
122
|
type: "checkbox",
|
|
96
123
|
class: "of-checkbox",
|
|
97
|
-
checked:
|
|
98
|
-
onChange:
|
|
99
|
-
}, null, 40,
|
|
100
|
-
|
|
101
|
-
], 8,
|
|
102
|
-
])) :
|
|
103
|
-
(
|
|
104
|
-
key:
|
|
124
|
+
checked: i.selected,
|
|
125
|
+
onChange: l[0] || (l[0] = (t) => y("select", f()))
|
|
126
|
+
}, null, 40, L),
|
|
127
|
+
l[3] || (l[3] = g("span", { class: "of-sr-only" }, "选择当前行", -1))
|
|
128
|
+
], 8, K)
|
|
129
|
+
], 4)) : R("", !0),
|
|
130
|
+
(o(!0), n(b, null, W(i.columns, (t) => (o(), n("div", {
|
|
131
|
+
key: t.key,
|
|
105
132
|
class: "of-td",
|
|
106
133
|
role: "gridcell",
|
|
107
|
-
style:
|
|
134
|
+
style: c(S(t))
|
|
108
135
|
}, [
|
|
109
|
-
|
|
110
|
-
row:
|
|
111
|
-
col:
|
|
136
|
+
_(e.$slots, "cell", {
|
|
137
|
+
row: i.row,
|
|
138
|
+
col: t
|
|
112
139
|
}, () => [
|
|
113
|
-
|
|
140
|
+
t.key === "status" ? (o(), n("span", {
|
|
114
141
|
key: 0,
|
|
115
142
|
class: "of-badge",
|
|
116
|
-
style:
|
|
117
|
-
},
|
|
143
|
+
style: c(m(a(t)).style)
|
|
144
|
+
}, r(m(a(t)).label), 5)) : t.key === "priority" ? (o(), n("span", {
|
|
118
145
|
key: 1,
|
|
119
146
|
class: "of-badge",
|
|
120
|
-
style:
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
], 64)) :
|
|
147
|
+
style: c(p(a(t)).style)
|
|
148
|
+
}, r(p(a(t)).label), 5)) : t.key === "role" ? (o(), n(b, { key: 2 }, [
|
|
149
|
+
a(t) ? (o(), n("span", U, r(a(t)), 1)) : (o(), n("span", V, "-"))
|
|
150
|
+
], 64)) : t.key === "updatedAt" ? (o(), n("span", X, r(T(a(t))), 1)) : t.key === "id" ? (o(), n("span", F, r(f()), 1)) : t.key === "title" ? (o(), n("span", z, r(h(t)), 1)) : (o(), n("span", O, r(h(t)), 1))
|
|
124
151
|
], !0)
|
|
125
152
|
], 4))), 128))
|
|
126
|
-
],
|
|
153
|
+
], 46, I));
|
|
127
154
|
}
|
|
128
155
|
});
|
|
129
156
|
export {
|
|
130
|
-
|
|
157
|
+
q as default
|
|
131
158
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TableColumn } from '../../types';
|
|
1
|
+
import { Density, TableColumn } from '../../types';
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
columns: TableColumn[];
|
|
4
4
|
selectable?: boolean;
|
|
@@ -9,6 +9,7 @@ type __VLS_Props = {
|
|
|
9
9
|
enableResize?: boolean;
|
|
10
10
|
enableFieldMenu?: boolean;
|
|
11
11
|
enableAddField?: boolean;
|
|
12
|
+
density?: Density;
|
|
12
13
|
};
|
|
13
14
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
14
15
|
sort: (key: string) => any;
|
|
@@ -27,6 +28,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
27
28
|
"onHeader-dblclick"?: ((colKey: string) => any) | undefined;
|
|
28
29
|
"onAdd-field"?: (() => any) | undefined;
|
|
29
30
|
}>, {
|
|
31
|
+
density: Density;
|
|
30
32
|
selectable: boolean;
|
|
31
33
|
sortKey: string;
|
|
32
34
|
sortOrder: "asc" | "desc";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./TableHeaderRow.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import a from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const m = /* @__PURE__ */ a(o, [["__scopeId", "data-v-9b7b027a"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|